/** * Return default handler objects for supported tasks. * @param string $handler_type Specific functionality required. * @param object $options * @return object * @access private */ protected function _default_handler_for($handler_type, $options = null) { switch ($handler_type) { case Handler_navigator: include_once 'projects/gui/job_navigator.php'; return new JOB_NAVIGATOR($this); case Handler_print_renderer: case Handler_html_renderer: case Handler_text_renderer: include_once 'projects/gui/job_renderer.php'; return new JOB_RENDERER($this->app, $options); case Handler_commands: include_once 'projects/cmd/job_commands.php'; return new JOB_COMMANDS($this); case Handler_history_item: include_once 'projects/obj/project_history_items.php'; return new JOB_HISTORY_ITEM($this->app); case Handler_associated_data: include_once 'projects/gui/job_renderer.php'; return new JOB_ASSOCIATED_DATA_RENDERER($this->app, $options); default: return parent::_default_handler_for($handler_type, $options); } }
/** * @param PROJECT_ENTRY $entry * @return string */ public function comp_name_for($entry) { if (!$entry->component_id) { return '(no component)'; } if (!isset($this->_components)) { /** @var PROJECT $folder */ $folder = $entry->parent_folder(); $component_query = $folder->component_query(); $this->_components = $component_query->indexed_objects(); } $component = $this->_components[$entry->component_id]; return $this->context->get_icon_with_text($component->icon_url, Thirty_two_px, $component->title_as_link()); }
/** * Show search details for an object. * @param PROJECT_ENTRY $obj * @access private */ protected function _echo_details($obj) { ?> <tr> <th>Kind</th> <td> <?php $props = $obj->kind_properties(); echo $this->context->get_icon_with_text($props->icon, Sixteen_px, $obj->kind_as_text()); ?> </td> </tr> <?php $comp = $obj->component(); if (isset($comp)) { ?> <tr> <th>Component</th> <td> <?php echo $this->app->get_icon_with_text($comp->icon_url, Sixteen_px, $comp->title_as_link()); ?> </td> </tr> <?php } parent::_echo_details($obj); }
/** * Return default handler objects for supported tasks. * @param string $handler_type Specific functionality required. * @param object $options * @return object * @access private */ protected function _default_handler_for($handler_type, $options = null) { switch ($handler_type) { case Handler_navigator: include_once 'projects/gui/change_navigator.php'; return new CHANGE_NAVIGATOR($this); case Handler_print_renderer: case Handler_html_renderer: case Handler_text_renderer: include_once 'projects/gui/change_renderer.php'; return new CHANGE_RENDERER($this->app, $options); case Handler_commands: include_once 'projects/cmd/change_commands.php'; return new CHANGE_COMMANDS($this); case Handler_history_item: include_once 'projects/obj/project_history_items.php'; return new CHANGE_HISTORY_ITEM($this->app); default: return parent::_default_handler_for($handler_type, $options); } }
/** * Store the form's values for this job. * @param PROJECT_ENTRY $obj * @access private */ protected function _store_to_object($obj) { $main_branch_id = $this->value_for('main_branch_id'); $obj->kind = $this->value_for('kind'); $obj->component_id = $this->value_for('component_id'); $obj->extra_description = $this->value_for('extra_description'); foreach ($this->branches as $branch) { if ($this->value_for("branch_{$branch->id}_enabled")) { $branch_info = $obj->new_branch_info($branch); $this->_store_to_branch_info($branch_info); $obj->add_branch_info($branch_info); if ($main_branch_id == $branch->id) { $obj->set_main_branch_info($branch_info); } } } parent::_store_to_object($obj); }