Skip to content

Commit edc1b7d

Browse files
committed
Add an option in companies list to filter by delete ones
1 parent 19fc7fe commit edc1b7d

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

language/en-GB/en-GB.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,7 @@ COBALT_REVENUE_THIS_MONTH = "Revenue this month"
672672
COBALT_LOG0 = "Logo"
673673
COBALT_ALL_COMPANIES = "all companies"
674674
COBALT_CONTACT_DETAILS = "contact details"
675+
COBALT_COMPANIES_UNPUBLISHED="Unpublished"
675676
COBALT_COMPANIES_TASKS_TODAY = "companies with tasks due today"
676677
COBALT_COMPANIES_TASKS_TOMORROW = "companies with tasks due tomorrow"
677678
COBALT_COMPANIES_UPDATED_LAST_MONTH = "companies updated in the last month"

src/Cobalt/Helper/CompanyHelper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public static function getTypes()
4141
{
4242
return array( 'all'=>TextHelper::_('COBALT_ALL_COMPANIES'),
4343
'today'=>TextHelper::_('COBALT_COMPANIES_TASKS_TODAY'),
44+
'unpublished'=>TextHelper::_('COBALT_COMPANIES_UNPUBLISHED'),
4445
'tomorrow'=>TextHelper::_('COBALT_COMPANIES_TASKS_TOMORROW'),
4546
'updated_thirty'=>TextHelper::_('COBALT_COMPANIES_UPDATED_LAST_MONTH'),
4647
'recent'=>TextHelper::_('COBALT_RECENTLY_ADDED'),

src/Cobalt/Model/Company.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ public function _buildQuery()
194194

195195
//filter for type
196196
if ($type != null && $type != "all") {
197+
// Filter for get companies with published status of -1
198+
if($type == 'unpublished')
199+
{
200+
$query->where("c.published='-1'");
201+
}
197202

198203
//filter for companies with tasks due today
199204
if ($type == 'today') {
@@ -233,6 +238,10 @@ public function _buildQuery()
233238
$query->group("c.id");
234239

235240
}
241+
else
242+
{
243+
$query->where("c.published=1");
244+
}
236245

237246
/** company name filter **/
238247
$company_name = $this->getState()->get('Company.'.$view.'_name');
@@ -269,8 +278,7 @@ public function _buildQuery()
269278

270279
//set user state requests
271280
$query
272-
->order($this->getState()->get('Company.filter_order').' '.$this->getState()->get('Company.filter_order_Dir'))
273-
->where("c.published=".$this->published);
281+
->order($this->getState()->get('Company.filter_order').' '.$this->getState()->get('Company.filter_order_Dir'));
274282

275283
return $query;
276284
}

src/Cobalt/Model/Deal.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ public function _buildQuery()
772772
}
773773
else
774774
{
775-
$query->group('d.id, c.name, stat.name, source.name, stage.name, stage.percent, event_cf.association_id, event_cf.event_id, event_cf.association_type, event.id, users.first_name, users.last_name, p.first_name, p.last_name, p.email, p.phone');
775+
$query->group('d.id, c.name, stat.name, source.name, stage.name, stage.percent, event_cf.association_id, event_cf.event_id, event_cf.association_type, event.id, users.first_name, users.last_name, p.first_name, p.last_name, p.email, p.phone, c.created');
776776
}
777777

778778
/**

0 commit comments

Comments
 (0)