/** * Adds columns from the model to the bridge that creates the browse table. * * Overrule this function to add different columns to the browse table, without * having to recode the core table building code. * * @param \MUtil_Model_Bridge_TableBridge $bridge * @param \MUtil_Model_ModelAbstract $model * @return void */ public function addBrowseTableColumns(\MUtil_Model_Bridge_TableBridge $bridge, \MUtil_Model_ModelAbstract $model) { $model->set('gr2o_patient_nr', 'label', $this->_('Respondent')); $model->set('gto_round_description', 'label', $this->_('Round / Details')); $model->set('gto_valid_from', 'label', $this->_('Valid from')); $model->set('gto_valid_until', 'label', $this->_('Valid until')); $model->set('gto_mail_sent_date', 'label', $this->_('Contact date')); $model->set('respondent_name', 'label', $this->_('Name')); $HTML = \MUtil_Html::create(); $bridge->setDefaultRowClass(\MUtil_Html_TableElement::createAlternateRowClass('even', 'even', 'odd', 'odd')); $bridge->addColumn($this->getTokenLinks($bridge), ' ')->rowspan = 2; // Space needed because TableElement does not look at rowspans $bridge->addSortable('gto_valid_from'); $bridge->addSortable('gto_valid_until'); $bridge->addMultiSort('gr2o_patient_nr', $HTML->raw('; '), 'respondent_name'); $bridge->addMultiSort('ggp_name', array($this->getActionLinks($bridge))); $bridge->tr(); $bridge->addSortable('gto_mail_sent_date'); $bridge->addSortable('gto_completion_time'); if ($this->escort instanceof \Gems_Project_Tracks_SingleTrackInterface) { $bridge->addMultiSort('gto_round_description', $HTML->raw('; '), 'gsu_survey_name'); } else { $model->set('gr2t_track_info', 'tableDisplay', 'smallData'); $model->set('gto_round_description', 'tableDisplay', 'smallData'); $bridge->addMultiSort('gtr_track_name', 'gr2t_track_info', $bridge->gtr_track_name->if($HTML->raw(' » ')), 'gsu_survey_name', 'gto_round_description'); } $bridge->addSortable('assigned_by'); }
/** * Adds columns from the model to the bridge that creates the browse table. * * Overrule this function to add different columns to the browse table, without * having to recode the core table building code. * * @param \MUtil_Model_Bridge_TableBridge $bridge * @param \MUtil_Model_ModelAbstract $model * @return void */ protected function addBrowseTableColumns(\MUtil_Model_Bridge_TableBridge $bridge, \MUtil_Model_ModelAbstract $model) { $model->set('gto_id_token', 'formatFunction', 'strtoupper'); $bridge->setDefaultRowClass(\MUtil_Html_TableElement::createAlternateRowClass('even', 'even', 'odd', 'odd')); $tr1 = $bridge->tr(); $tr1->appendAttrib('class', $bridge->row_class); $tr1->appendAttrib('title', $bridge->gto_comment); $bridge->addColumn($this->createShowTokenButton($bridge), ' ')->rowspan = 2; // Space needed because TableElement does not look at rowspans $bridge->addSortable('gto_valid_from'); $bridge->addSortable('gto_valid_until'); $bridge->addSortable('gto_id_token'); // $bridge->addSortable('gto_mail_sent_num', $this->_('Contact moments'))->rowspan = 2; $this->addRespondentCell($bridge, $model); $bridge->addMultiSort('ggp_name', array($this->createActionButtons($bridge))); $tr2 = $bridge->tr(); $tr2->appendAttrib('class', $bridge->row_class); $tr2->appendAttrib('title', $bridge->gto_comment); $bridge->addSortable('gto_mail_sent_date'); $bridge->addSortable('gto_completion_time'); $bridge->addSortable('gto_mail_sent_num', $this->_('Contact moments')); if ($this->multiTracks) { $model->set('gr2t_track_info', 'tableDisplay', 'smallData'); $model->set('gto_round_description', 'tableDisplay', 'smallData'); $bridge->addMultiSort('gtr_track_name', 'gr2t_track_info', array($bridge->gtr_track_name->if(\MUtil_Html::raw(' » ')), ' '), 'gsu_survey_name', 'gto_round_description'); } else { $bridge->addMultiSort('gto_round_description', \MUtil_Html::raw('; '), 'gsu_survey_name'); } $bridge->addSortable('assigned_by'); }