/** * Simple helper which references all important members to the request data listing * for usage within the style listing. */ private function _prepare_request_data($handler_id) { $this->_request_data['deliverable'] =& $this->_deliverable; $this->_request_data['datamanager'] =& $this->_datamanager; $this->_request_data['controller'] =& $this->_controller; $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "deliverable/edit/{$this->_deliverable->guid}/", MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('edit'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/edit.png', MIDCOM_TOOLBAR_ENABLED => $this->_deliverable->can_do('midgard:update'), MIDCOM_TOOLBAR_ACCESSKEY => 'e')); /*$this->_view_toolbar->add_item ( array ( MIDCOM_TOOLBAR_URL => "deliverable/delete/{$this->_deliverable->guid}/", MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('delete'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/trash.png', MIDCOM_TOOLBAR_ENABLED => $this->_deliverable->can_do('midgard:delete'), MIDCOM_TOOLBAR_ACCESSKEY => 'd', ) );*/ switch ($handler_id) { case 'deliverable_edit': $this->_view_toolbar->disable_item("deliverable/edit/{$this->_deliverable->guid}/"); break; case 'deliverable_delete': $this->_view_toolbar->disable_item("deliverable/delete/{$this->_deliverable->guid}/"); break; } }
/** * Simple helper which references all important members to the request data listing * for usage within the style listing. */ private function _prepare_request_data() { $this->_request_data['deliverable'] =& $this->_deliverable; $this->_request_data['salesproject'] =& $this->_salesproject; // Populate the toolbar $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "deliverable/edit/{$this->_deliverable->guid}/", MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('edit'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/edit.png', MIDCOM_TOOLBAR_ENABLED => $this->_deliverable->can_do('midgard:update'), MIDCOM_TOOLBAR_ACCESSKEY => 'e')); $siteconfig = org_openpsa_core_siteconfig::get_instance(); $this->_request_data['projects_url'] = $siteconfig->get_node_relative_url('org.openpsa.projects'); $this->_request_data['invoices_url'] = $siteconfig->get_node_relative_url('org.openpsa.invoices'); /*if ($this->_salesproject->can_do('midgard:delete')) { $this->_view_toolbar->add_item(Array( MIDCOM_TOOLBAR_URL => "salesproject/delete/{$this->_salesproject->guid}/", MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('delete'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/trash.png', )); }*/ }