To proponuję zmiany kodu. Wyłączymy poszczególne fragmenty kodu wyświetlania ticketów i zobaczymy, co wtedy.
Więc idź do pliku modules/Premium/Projects/Tickets/Tickets_0.php, funkcja body zaraz na początku.
Na początek zostawiamy tylko najważniejsze, czyli będzie:
public function body() {
$this->rb = $this->init_module('Utils/RecordBrowser','premium_tickets','premium_tickets');
$this->display_module($this->rb);
}
Sprawdzasz w przeglądarce, czy zaczęło działać... dodajemy ustawienia domyślnych danych i wyświetlania:
public function body() {
$this->rb = $this->init_module('Utils/RecordBrowser','premium_tickets','premium_tickets');
$me = CRM_ContactsCommon::get_my_record();
$this->rb->set_defaults(array('ticket_owner'=>$me['id'], 'assigned_to'=>$me['id'], 'date'=>date('Y-m-d'), 'status'=>0, 'permission'=>0));
$this->rb->set_default_order(array('status'=>'ASC', 'priority'=>'ASC'));
$this->rb->set_header_properties(array(
'ticket_id'=>array('width'=>5),
'priority'=>array('width'=>5,'wrapmode'=>'nowrap'),
'title'=>array('width'=>15,'wrapmode'=>'nowrap'),
'project_name'=>array('name'=>'Project','width'=>5,'wrapmode'=>'nowrap'),
'ticket_owner'=>array('width'=>5,'wrapmode'=>'nowrap'),
'assigned_to'=>array('width'=>5, 'wrapmode'=>'nowrap'),
'status'=>array('width'=>5, 'wrapmode'=>'nowrap'),
'type'=>array('width'=>5, 'wrapmode'=>'nowrap'),
'resolution'=>array('width'=>5, 'wrapmode'=>'nowrap'),
'required_tickets'=>array('name'=>__('Required'),'width'=>5, 'wrapmode'=>'nowrap')
));
$this->display_module($this->rb);
}
Teraz custom filters:
public function body() {
$this->rb = $this->init_module('Utils/RecordBrowser','premium_tickets','premium_tickets');
$me = CRM_ContactsCommon::get_my_record();
$this->rb->set_defaults(array('ticket_owner'=>$me['id'], 'assigned_to'=>$me['id'], 'date'=>date('Y-m-d'), 'status'=>0, 'permission'=>0));
$sts = Utils_CommonDataCommon::get_translated_array('Premium_Ticket_Status',true);
$trans = array('__NULL__'=>array(), '__NO_CLOSED__'=>array('!status'=>6), '__ALLACTIVE__'=>Premium_Projects_TicketsCommon::active_tickets_crits());
foreach ($sts as $k=>$v)
$trans[$k] = array('status'=>$k);
$this->rb->set_custom_filter('status',array('type'=>'select','label'=>__('Ticket status'),'args'=>array('__NULL__'=>'['.__('All').']','__ALLACTIVE__'=>'['.__('All active').']','__NO_CLOSED__'=>'['.__('Not closed').']')+$sts,'trans'=>$trans));
$recs = Utils_RecordBrowserCommon::get_records('premium_projects', array('!status'=>array(2,4)));
$vals = array('__NULL__'=>'---');
$trans = array('__NULL__'=>array());
foreach ($recs as $k=>$v) {
$vals[$v['id']] = $v['project_name'];
$trans[$v['id']] = array('project_name'=>$v['id']);
}
$this->rb->set_custom_filter('project_name',array('type'=>'select','label'=>__('Project Name'),'args'=>$vals,'trans'=>$trans));
$this->rb->set_filters_defaults(array('assigned_to'=>$this->rb->crm_perspective_default(), 'status'=>'__NO_CLOSED__'));
$this->rb->set_default_order(array('status'=>'ASC', 'priority'=>'ASC'));
$this->rb->set_header_properties(array(
'ticket_id'=>array('width'=>5),
'priority'=>array('width'=>5,'wrapmode'=>'nowrap'),
'title'=>array('width'=>15,'wrapmode'=>'nowrap'),
'project_name'=>array('name'=>'Project','width'=>5,'wrapmode'=>'nowrap'),
'ticket_owner'=>array('width'=>5,'wrapmode'=>'nowrap'),
'assigned_to'=>array('width'=>5, 'wrapmode'=>'nowrap'),
'status'=>array('width'=>5, 'wrapmode'=>'nowrap'),
'type'=>array('width'=>5, 'wrapmode'=>'nowrap'),
'resolution'=>array('width'=>5, 'wrapmode'=>'nowrap'),
'required_tickets'=>array('name'=>__('Required'),'width'=>5, 'wrapmode'=>'nowrap')
));
$this->display_module($this->rb);
}
Powyższy kod różni się od oryginalnego tylko brakiem modułu Utils/Tray. Jeśli zaczęło działać i działa z powyższym kodem, to znaczy, że to wina Utils/Tray.
Daj znać co i jak.
Pozdrawiam,
Adam