Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option in companies list to filter by delete ones #152

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions language/en-GB/en-GB.ini
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ COBALT_REVENUE_THIS_MONTH = "Revenue this month"
COBALT_LOG0 = "Logo"
COBALT_ALL_COMPANIES = "all companies"
COBALT_CONTACT_DETAILS = "contact details"
COBALT_COMPANIES_UNPUBLISHED="Unpublished"
COBALT_COMPANIES_TASKS_TODAY = "companies with tasks due today"
COBALT_COMPANIES_TASKS_TOMORROW = "companies with tasks due tomorrow"
COBALT_COMPANIES_UPDATED_LAST_MONTH = "companies updated in the last month"
Expand Down
1 change: 1 addition & 0 deletions src/Cobalt/Helper/CompanyHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public static function getTypes()
{
return array( 'all'=>TextHelper::_('COBALT_ALL_COMPANIES'),
'today'=>TextHelper::_('COBALT_COMPANIES_TASKS_TODAY'),
'unpublished'=>TextHelper::_('COBALT_COMPANIES_UNPUBLISHED'),
'tomorrow'=>TextHelper::_('COBALT_COMPANIES_TASKS_TOMORROW'),
'updated_thirty'=>TextHelper::_('COBALT_COMPANIES_UPDATED_LAST_MONTH'),
'recent'=>TextHelper::_('COBALT_RECENTLY_ADDED'),
Expand Down
12 changes: 10 additions & 2 deletions src/Cobalt/Model/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ public function _buildQuery()

//filter for type
if ($type != null && $type != "all") {
// Filter for get companies with published status of -1
if($type == 'unpublished')
{
$query->where("c.published='-1'");
}

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

}
else
{
$query->where("c.published=1");
}

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

//set user state requests
$query
->order($this->getState()->get('Company.filter_order').' '.$this->getState()->get('Company.filter_order_Dir'))
->where("c.published=".$this->published);
->order($this->getState()->get('Company.filter_order').' '.$this->getState()->get('Company.filter_order_Dir'));

return $query;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Cobalt/Model/Deal.php
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ public function _buildQuery()
}
else
{
$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');
$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');
}

/**
Expand Down