/** * Set the footer of the browse table. * * Overrule this function to set the header differently, without * having to recode the core table building code. * * @param \MUtil_Model_Bridge_VerticalTableBridge $bridge * @param \MUtil_Model_ModelAbstract $model * @return void */ protected function setShowTableFooter(\MUtil_Model_Bridge_VerticalTableBridge $bridge, \MUtil_Model_ModelAbstract $model) { $row = $bridge->getRow(); parent::setShowTableFooter($bridge, $model); if (isset($row['gla_respondent_id'], $row['gla_organization']) && $this->menuList instanceof \Gems_Menu_MenuList) { $patientNr = $this->util->getDbLookup()->getPatientNr($row['gla_respondent_id'], $row['gla_organization']); $this->menuList->addParameterSources(array('gr2o_patient_nr' => $patientNr, 'gr2o_id_organization' => $row['gla_organization'])); $this->menuList->addByController('respondent', 'show', $this->_('Show respondent')); } }
/** * Adds rows 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_VerticalTableBridge $bridge * @param \MUtil_Model_ModelAbstract $model * @return void */ protected function addShowTableRows(\MUtil_Model_Bridge_VerticalTableBridge $bridge, \MUtil_Model_ModelAbstract $model) { $this->_roundData = $bridge->getRow(); if ($this->trackEngine instanceof \Gems_Tracker_Engine_StepEngineAbstract) { $this->trackEngine->updateRoundModelToItem($model, $this->_roundData, $this->locale->getLanguage()); } $bridge->addItem('gro_id_track'); $bridge->addItem('gro_id_survey'); $bridge->addItem('gro_round_description'); $bridge->addItem('gro_id_order'); $bridge->addItem('gro_icon_file'); if ($model->has('ggp_name')) { $bridge->addItem('ggp_name'); } elseif ($model->has('gro_id_relationfield')) { $bridge->addItem('gro_id_relationfield'); } $bridge->addItem($model->get('valid_after', 'value')); $this->_addIf(array('gro_valid_after_source', 'gro_valid_after_id', 'gro_valid_after_field'), $bridge, $model); if ($model->has('gro_valid_after_length', 'label')) { $bridge->addItem(array($bridge->gro_valid_after_length, ' ', $bridge->gro_valid_after_unit), $model->get('gro_valid_after_length', 'label')); } $bridge->addItem($model->get('valid_for', 'value')); $this->_addIf(array('gro_valid_for_source', 'gro_valid_for_id', 'gro_valid_for_field'), $bridge, $model); if ($model->has('gro_valid_for_length', 'label')) { $bridge->addItem(array($bridge->gro_valid_for_length, ' ', $bridge->gro_valid_for_unit), $model->get('gro_valid_after_length', 'label')); } $bridge->addItem('gro_active'); // Preven empty row when no changed events exist if ($label = $model->get('gro_changed_event', 'label')) { $bridge->addItem('gro_changed_event'); } $bridge->addItem('gro_code'); $bridge->addItem('org_specific_round'); if ($this->_roundData['org_specific_round']) { $bridge->addItem('organizations'); } $menuItem = $this->menu->find(array($this->request->getControllerKey() => $this->request->getControllerName(), $this->request->getActionKey() => 'edit')); if ($menuItem) { $bridge->tbody()->onclick = array('location.href=\'', $menuItem->toHRefAttribute($this->request), '\';'); } }
/** * Set the footer of the browse table. * * Overrule this function to set the header differently, without * having to recode the core table building code. * * @param \MUtil_Model_Bridge_VerticalTableBridge $bridge * @param \MUtil_Model_ModelAbstract $model * @return void */ protected function setShowTableFooter(\MUtil_Model_Bridge_VerticalTableBridge $bridge, \MUtil_Model_ModelAbstract $model) { $fparams = array('class' => 'centerAlign'); $row = $bridge->getRow(); if (isset($row[$this->filterWhen]) && $row[$this->filterWhen]) { $count = $this->db->fetchOne("SELECT COUNT(*) FROM gems__appointments WHERE " . $this->getWhere()); if ($count) { $footer = $bridge->tfrow($fparams); $footer[] = sprintf($this->plural('This will delete %d appointment. Are you sure?', 'This will delete %d appointments. Are you sure?', $count), $count); $footer[] = ' '; $footer->actionLink(array($this->confirmParameter => 1), $this->_('Yes')); $footer[] = ' '; $footer->actionLink(array($this->request->getActionKey() => $this->abortAction), $this->_('No')); } else { $this->addMessage($this->_('Clean up not needed!')); $bridge->tfrow($this->_('No clean up needed, no appointments exist.'), $fparams); } } else { $this->addMessage($this->_('Clean up filter disabled!')); $bridge->tfrow($this->_('No clean up possible.'), array('class' => 'centerAlign')); } if ($this->displayMenu) { if (!$this->menuList) { $this->menuList = $this->menu->getCurrentMenuList($this->request, $this->_('Cancel')); $this->menuList->addCurrentSiblings(); } if ($this->menuList instanceof \Gems_Menu_MenuList) { $this->menuList->addParameterSources($bridge); } $bridge->tfrow($this->menuList, $fparams); } }