コード例 #1
0
 /**
  * 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)
 {
     // \MUtil_Model::$verbose = true;
     //
     // Initiate data retrieval for stuff needed by links
     $bridge->gr2o_patient_nr;
     $bridge->gr2o_id_organization;
     $bridge->gr2t_id_respondent_track;
     $HTML = \MUtil_Html::create();
     $roundIcon[] = \MUtil_Lazy::iif($bridge->gto_icon_file, \MUtil_Html::create('img', array('src' => $bridge->gto_icon_file, 'class' => 'icon')), \MUtil_Lazy::iif($bridge->gro_icon_file, \MUtil_Html::create('img', array('src' => $bridge->gro_icon_file, 'class' => 'icon'))));
     $bridge->addMultiSort('gsu_survey_name', $roundIcon);
     $bridge->addSortable('ggp_name');
     $bridge->addSortable('calc_used_date', null, $HTML->if($bridge->is_completed, 'disabled date', 'enabled date'));
     $bridge->addSortable('gto_changed');
     $bridge->addSortable('assigned_by', $this->_('Assigned by'));
     // If we are allowed to see the result of the survey, show them
     $user = $this->loader->getCurrentUser();
     if ($user->hasPrivilege('pr.respondent.result')) {
         $bridge->addSortable('gto_result', $this->_('Score'), 'date');
     }
     $bridge->useRowHref = false;
     $actionLinks[] = $this->createMenuLink($bridge, 'track', 'answer');
     $actionLinks[] = array($bridge->ggp_staff_members->if($this->createMenuLink($bridge, 'ask', 'take'), $bridge->calc_id_token->strtoupper()), 'class' => $bridge->ggp_staff_members->if(null, $bridge->calc_id_token->if('token')));
     // calc_id_token is empty when the survey has been completed
     // Remove nulls
     $actionLinks = array_filter($actionLinks);
     if ($actionLinks) {
         $bridge->addItemLink($actionLinks);
     }
     $this->addTokenLinks($bridge);
 }
コード例 #2
0
 /**
  * Add first columns (group) from the model to the bridge that creates the browse table.
  *
  * You can actually add more than one column in this function, but just call all four functions
  * with the default columns in each
  *
  * 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 addBrowseColumn4(\MUtil_Model_Bridge_TableBridge $bridge, \MUtil_Model_ModelAbstract $model)
 {
     $br = \MUtil_Html::create('br');
     // Display separator and phone sign only if phone exist.
     $phonesep = \MUtil_Html::raw('☏ ');
     // $bridge->itemIf($bridge->grs_phone_1, \MUtil_Html::raw('☏ '));
     $bridge->addMultiSort('grs_birthday', $br, $phonesep, 'grs_phone_1');
 }
コード例 #3
0
 /**
  * As this is a common cell setting, this function allows you to overrule it.
  *
  * @param \MUtil_Model_Bridge_TableBridge $bridge
  * @param \MUtil_Model_ModelAbstract $model
  */
 protected function addRespondentCell(\MUtil_Model_Bridge_TableBridge $bridge, \MUtil_Model_ModelAbstract $model)
 {
     $bridge->addMultiSort('gr2o_patient_nr', \MUtil_Html::raw('; '), 'respondent_name');
 }