public function info($pa_parameters) { parent::info($pa_parameters); $t_tour = $this->view->getVar('t_item'); if ($t_tour->getPrimaryKey()) { $va_labels = $t_tour->getDisplayLabels(); $this->view->setVar('labels', $t_tour->getPrimaryKey() ? $va_labels : array()); $this->view->setVar('idno', $t_tour->get('idno')); } $t_stop = new ca_tour_stops(); $t_stop->load(array('tour_id' => $t_tour->getPrimaryKey(), 'parent_id' => null)); $this->view->setVar('t_stop', $t_stop); if ($vn_stop_id = $t_stop->getPrimaryKey()) { $va_children = caExtractValuesByUserLocaleFromHierarchyChildList($t_stop->getHierarchyChildren(null, array('additionalTableToJoin' => 'ca_tour_stop_labels', 'additionalTableJoinType' => 'LEFT', 'additionalTableSelectFields' => array('name', 'locale_id'))), 'stop_id', 'name', 'idno'); $this->view->setVar('children', $va_children); } return $this->render('widget_tour_info_html.php', true); }
/** * */ public function removeStop($pn_stop_id) { if (!($vn_tour_id = $this->getPrimaryKey())) { return false; } $t_stop = new ca_tour_stops(); if ($this->inTransaction()) { $t_stop->setTransaction($this->getTransaction()); } if (!$t_stop->load(array('tour_id' => $vn_tour_id, 'stop_id' => $pn_stop_id))) { return false; } $t_stop->setMode(ACCESS_WRITE); return $t_stop->delete(true); }
/** * Fetch stop_id for stop with specified idno in tour * * @param string $ps_tour_code Tour code * @param string $ps_idno idno of stop to return stop_id for * @return int item_id of list item or null if no matching item was found */ function caGetTourStopID($ps_tour_code, $ps_idno) { $vn_tour_id = caGetTourID($ps_tour_code); $t_stop = new ca_tour_stops(); return $t_stop->load(array('tour_id' => $vn_tour_id, 'idno' => $ps_idno)); }