/**
  * 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)
 {
     $items = $model->getItemsOrdered();
     foreach ($items as $name) {
         if ($model->get($name, 'type') === \MUtil_Model::TYPE_CHILD_MODEL) {
             $this->submodel = $model->get($name, 'model');
             $subitems = $this->submodel->getItemsOrdered();
         }
     }
     if (isset($subitems) && is_array($subitems)) {
         $items = array_diff($items, $subitems);
     }
     foreach ($items as $name) {
         if ($label = $model->get($name, 'label')) {
             $bridge->addItem($name, $label);
         }
     }
     /*if ($subitems) {
           $bridge->addItem('gctt', 'moo');
       }*/
     if ($model->has('row_class')) {
         // Make sure deactivated rounds are show as deleted
         foreach ($bridge->getTable()->tbody() as $tr) {
             foreach ($tr as $td) {
                 if ('td' === $td->tagName) {
                     $td->appendAttrib('class', $bridge->row_class);
                 }
             }
         }
     }
 }
 /**
  * Place to set the data to display
  *
  * @param \MUtil_Model_Bridge_VerticalTableBridge $bridge
  * @return void
  */
 protected function addTableCells(\MUtil_Model_Bridge_VerticalTableBridge $bridge)
 {
     $HTML = \MUtil_Html::create();
     $bridge->caption($this->getCaption());
     $br = $HTML->br();
     $address[] = $bridge->grs_address_1;
     $address[] = $br;
     if ($this->model->has('grs_address_2')) {
         $address[] = $bridge->grs_address_2;
         $address[] = $bridge->itemIf('grs_address_2', $br);
     }
     $address[] = $bridge->grs_zipcode;
     $address[] = $bridge->itemIf('grs_zipcode', new \MUtil_Html_Raw('  '));
     $address[] = $bridge->grs_city;
     // ROW 0
     $label = $this->model->get('gr2o_patient_nr', 'label');
     // Try to read label from model...
     if (empty($label)) {
         $label = $this->_('Respondent nr: ');
         // ...but have a fall-back
     }
     $bridge->addItem($bridge->gr2o_patient_nr, $label);
     $bridge->addItem($HTML->spaced($bridge->itemIf('grs_last_name', array($bridge->grs_last_name, ',')), $bridge->grs_gender, $bridge->grs_first_name, $bridge->grs_surname_prefix), $this->_('Respondent'));
     // ROW 1
     $bridge->addItem('grs_birthday');
     $bridge->addItem('grs_phone_1');
     // ROW 2
     $bridge->addItem('grs_email');
     $bridge->addItem($address, $this->_('Address'));
 }
 /**
  * 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), '\';');
     }
 }
 /**
  * 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)
 {
     foreach ($model->getItemsOrdered() as $name) {
         if ($label = $model->get($name, 'label')) {
             $bridge->addItem($name, $label);
         }
     }
     if ($model->has('row_class')) {
         // Make sure deactivated rounds are show as deleted
         foreach ($bridge->getTable()->tbody() as $tr) {
             foreach ($tr as $td) {
                 if ('td' === $td->tagName) {
                     $td->appendAttrib('class', $bridge->row_class);
                 }
             }
         }
     }
 }