/** * Looks up a deliverable to display. * * @param mixed $handler_id The ID of the handler. * @param Array $args The argument list. * @param Array &$data The local request data. */ public function _handler_view($handler_id, array $args, array &$data) { $this->_deliverable = new org_openpsa_sales_salesproject_deliverable_dba($args[0]); $this->_salesproject = new org_openpsa_sales_salesproject_dba($this->_deliverable->salesproject); $this->_load_schema(); $this->_request_data['controller'] = midcom_helper_datamanager2_controller::create('ajax'); $this->_request_data['controller']->schemadb =& $this->_request_data['schemadb_salesproject_deliverable']; $this->_request_data['controller']->set_storage($this->_deliverable); $this->_request_data['controller']->process_ajax(); org_openpsa_sales_viewer::add_breadcrumb_path($this->_deliverable, $this); $this->_prepare_request_data(); $this->bind_view_to_object($this->_deliverable); $this->add_stylesheet(MIDCOM_STATIC_URL . "/org.openpsa.core/list.css"); org_openpsa_widgets_ui::enable_ui_tab(); midcom::get('metadata')->set_request_metadata($this->_deliverable->metadata->revised, $this->_deliverable->guid); midcom::get('head')->set_pagetitle("{$this->_salesproject->title}: {$this->_deliverable->title}"); }
/** * Helper, updates the context so that we get a complete breadcrumb line towards the current * location. * * @param string $handler_id */ private function _update_breadcrumb_line($handler_id) { org_openpsa_sales_viewer::add_breadcrumb_path($this->_request_data['deliverable'], $this); switch ($handler_id) { case 'deliverable_edit': $this->add_breadcrumb("deliverable/edit/{$this->_deliverable->guid}/", $this->_l10n_midcom->get('edit')); break; case 'deliverable_delete': $this->add_breadcrumb("deliverable/delete/{$this->_deliverable->guid}/", $this->_l10n_midcom->get('delete')); break; } }
/** * @param mixed $handler_id The ID of the handler. * @param Array $args The argument list. * @param Array &$data The local request data. */ public function _handler_edit($handler_id, array $args, array &$data) { midcom::get('auth')->require_valid_user(); $this->_request_data['salesproject'] = $this->_load_salesproject($args[0]); $this->_salesproject->require_do('midgard:update'); $this->_load_edit_controller(); switch ($this->_controller->process_form()) { case 'save': // Fall-through intentional // Fall-through intentional case 'cancel': return new midcom_response_relocate(midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX) . "salesproject/" . $this->_salesproject->guid); } $this->_request_data['controller'] =& $this->_controller; // Add toolbar items org_openpsa_helpers::dm2_savecancel($this); $this->_view_toolbar->bind_to($this->_salesproject); $customer = $this->_salesproject->get_customer(); if ($customer) { $this->add_breadcrumb("list/customer/{$customer->guid}/", $customer->get_label()); } org_openpsa_sales_viewer::add_breadcrumb_path($data['salesproject'], $this); $this->add_breadcrumb("", sprintf($this->_l10n_midcom->get('edit %s'), $this->_l10n->get('salesproject'))); midcom::get('head')->set_pagetitle(sprintf($this->_l10n_midcom->get('edit %s'), $this->_salesproject->title)); }