Page 1 of 1

Activity Filter & Export csv not working

Posted: 15 May 2014, 18:15
by mustafaengg
Hi There,
This might be a bug I am using 0.9.1a tried it on WAMP & LAMP
In Activity tab, activity Filter is not working on
Date
First name
Last name
regarding
Notes
for all above (is equal to, contains) its not even throwing any error!

Entered by and Activity is working fine.

When Action is clicked there is no option in pop out box, unable to export csv.

Re: Activity Filter & Export csv not working

Posted: 25 May 2014, 08:56
by mustafaengg
"RUSS I was expecting a response from you"
Alright i got it figured out you have to make changes in
CATSROOT/module/activiry/datagrid.php make changes as follows:

$this->_classColumns = array(
'Date' => array('pagerRender' => 'return $rsData[\'dateCreated\'];',
'sortableColumn' => 'dateCreatedSort',
'pagerWidth' => 110,
'pagerOptional' => true,
'alphaNavigation'=> true,
'filter' => 'activity.date_created'),

'First Name' => array('pagerRender' => 'if ($rsData[\'dataItemType\']=='.DATA_ITEM_CANDIDATE.') {$ret = \'<img src="images/mru/candidate.gif" height="12" alt="" />\';} else if ($rsData[\'dataItemType\']=='.DATA_ITEM_CONTACT.') {$ret = \'<img src="images/mru/contact.gif" height="12">\';} else {$ret = \'<img src="images/mru/blank.gif">\';} if ($rsData[\'isHot\'] == 1) $className = \'jobLinkHot\'; else $className = \'jobLinkCold\'; if ($rsData[\'dataItemType\']=='.DATA_ITEM_CANDIDATE.') {return $ret.\'&nbsp;<a href="'.CATSUtility::getIndexName().'?m=candidates&a=show&candidateID=\'.$rsData[\'dataItemID\'].\'" class="\'.$className.\'" title="\'.htmlspecialchars(InfoString::make($rsData[\'dataItemType\'],$rsData[\'dataItemID\'],$rsData[\'siteID\'])).\'">\'.htmlspecialchars($rsData[\'firstName\']).\'</a>\';} else {return $ret.\'&nbsp;<a href="'.CATSUtility::getIndexName().'?m=contacts&a=show&contactID=\'.$rsData[\'dataItemID\'].\'" class="\'.$className.\'" title="\'.htmlspecialchars(InfoString::make($rsData[\'dataItemType\'],$rsData[\'dataItemID\'],$rsData[\'siteID\'])).\'">\'.htmlspecialchars($rsData[\'firstName\']).\'</a>\';}',
'sortableColumn' => 'firstName',
'pagerWidth' => 85,
'pagerOptional' => false,
'alphaNavigation' => true,
'filterable' => false,
'filterHaving' => 'firstName'),

'Last Name' => array('pagerRender' => 'if ($rsData[\'isHot\'] == 1) $className = \'jobLinkHot\'; else $className = \'jobLinkCold\'; if ($rsData[\'dataItemType\']=='.DATA_ITEM_CANDIDATE.') {return \'<a href="'.CATSUtility::getIndexName().'?m=candidates&a=show&candidateID=\'.$rsData[\'dataItemID\'].\'" class="\'.$className.\'" title="\'.htmlspecialchars(InfoString::make($rsData[\'dataItemType\'],$rsData[\'dataItemID\'],$rsData[\'siteID\'])).\'"> \'.htmlspecialchars($rsData[\'lastName\']).\'</a>\';} else {return \'<a href="'.CATSUtility::getIndexName().'?m=contacts&a=show&contactID=\'.$rsData[\'dataItemID\'].\'" class="\'.$className.\'" title="\'.htmlspecialchars(InfoString::make($rsData[\'dataItemType\'],$rsData[\'dataItemID\'],$rsData[\'siteID\'])).\'"> \'.htmlspecialchars($rsData[\'lastName\']).\'</a>\';}',
'sortableColumn' => 'lastName',
'pagerWidth' => 75,
'pagerOptional' => false,
'alphaNavigation' => true,
'filterable' => false,
'filterHaving' => 'lastName'),

'Regarding' => array('pagerRender' => 'if ($rsData[\'jobIsHot\'] == 1) $className = \'jobLinkHot\'; else $className = \'jobLinkCold\'; if ($rsData[\'companyIsHot\'] == 1) $companyClassName = \'jobLinkHot\'; else $companyClassName = \'jobLinkCold\'; if ($rsData[\'regardingJobTitle\'] == \'\') {$ret = \'General\'; } else {$ret = \'<a href="'.CATSUtility::getIndexName().'?m=joborders&a=show&jobOrderID=\'.$rsData[\'jobOrderID\'].\'" class="\'.$className.\'">\'.htmlspecialchars($rsData[\'regardingJobTitle\']).\'</a>\'; if($rsData[\'regardingCompanyName\'] != \'\') {$ret .= \' <a href="'.CATSUtility::getIndexName().'?m=companies&a=show&companyID=\'.$rsData[\'companyID\'].\'" class="\'.$companyClassName.\'">(\'.htmlspecialchars($rsData[\'regardingCompanyName\']).\')\';}} return $ret;',
'sortableColumn' => 'regarding',
'pagerWidth' => 125,
'pagerOptional' => true,
'alphaNavigation' => true,
'filter' => 'CONCAT(joborder.title, company.name)'),

'Activity' => array('pagerRender' => '$ret = $rsData[\'typeDescription\']; return $ret;',
'sortableColumn' => 'typeDescription',
'pagerWidth' => 65,
'pagerOptional' => true,
'alphaNavigation' => true,
'filter' => 'activity_type.short_description'),

'Notes' => array('pagerRender' => 'return $rsData[\'notes\'];',
'sortableColumn' => 'notes',
'pagerWidth' => 240,
'pagerOptional' => true,
'alphaNavigation' => true,
'filter' => 'activity.notes'),

'Entered By' => array(
'pagerRender' => 'return StringUtility::makeInitialName($rsData[\'enteredByFirstName\'], $rsData[\'enteredByLastName\'], false, LAST_NAME_MAXLEN);',
'exportRender' => 'return $rsData[\'enteredByFirstName\'] . " " .$rsData[\'enteredByLastName\'];',
'sortableColumn' => 'enteredBySort',
'pagerWidth' => 60,
'alphaNavigation' => true,
'filter' => 'CONCAT(entered_by_user.last_name, entered_by_user.first_name)'),
);

Note the new words in "filter".

As for exporting add the following line:
/**
* Adds more options to the action area on the pager. Overloads
* DataGrid Inner Action Area function.
*
* @return html innerActionArea commands.
*/
public function getInnerActionArea()
{
$html = '';
$html .= $this->getInnerActionAreaItem('Export', CATSUtility::getIndexName().'?m=export&a=exportByDataGrid');

$html .= parent::getInnerActionArea();

return $html;
this will enable export option.

Re: Activity Filter & Export csv not working

Posted: 27 May 2014, 09:20
by RussH
This may double post, on the train!
Thanks for this update, will check a plain install of 0.9.1a and 0.9.2 and see if it's there, will add your fix to the repo.

Thanks again

Re: Activity Filter & Export csv not working

Posted: 10 Jan 2015, 08:22
by waleedi
It's not difficult to do.
I've only changed the colors, added my logo en made round borders. The round borders are just a few extra lines in the CSS file and works in the most recent browser.

I "eliminated" the reset button because it's of no use.

Re: Activity Filter & Export csv not working

Posted: 09 Feb 2015, 13:37
by RussH
mustafaengg wrote:"RUSS I was expecting a response from you"
Alright i got it figured out you have to make changes in
CATSROOT/module/activiry/datagrid.php make changes as follows:
<snip>

Thanks Mustafaengg, i've added this to the github repo for 0.9.2, pending testing.