/** * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_versions($handler_id, array &$data) { if ($this->_provider->count_rows() == 0) { return; } $data['grid'] = $this->_provider->get_grid('documents_grid'); midcom_show_style('show-document-grid'); }
/** * Handler method for listing users * * @param string $handler_id Name of the used handler * @param mixed $args Array containing the variable arguments passed to the handler * @param mixed &$data Data passed to the show method */ public function _handler_list($handler_id, array $args, array &$data) { $auth = midcom::get('auth'); if (!$auth->can_user_do('org.openpsa.user:access', null, 'org_openpsa_user_interface')) { $person = $auth->user->get_storage(); return new midcom_response_relocate('view/' . $person->guid . '/'); } $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX); $data['provider_url'] = $prefix . 'json/'; $grid_id = 'org_openpsa_user_grid'; if (sizeof($args) == 1) { $grid_id = 'org_openpsa_members_grid'; $this->_group = new org_openpsa_contacts_group_dba($args[0]); $data['group'] = $this->_group; $data['provider_url'] .= 'members/' . $this->_group->guid . '/'; } $data['grid'] = $this->_provider->get_grid($grid_id); org_openpsa_widgets_tree::add_head_elements(); $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "create/", MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('create person'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_person-new.png', MIDCOM_TOOLBAR_ENABLED => midcom::get('auth')->can_user_do('midgard:create', null, 'midcom_db_person'))); $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "group/create/", MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('create group'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_people-new.png', MIDCOM_TOOLBAR_ENABLED => midcom::get('auth')->can_user_do('midgard:create', null, 'midcom_db_group'))); }
/** * @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_list($handler_id, array $args, array &$data) { midcom::get('auth')->require_valid_user(); $siteconfig = org_openpsa_core_siteconfig::get_instance(); $this->_sales_url = $siteconfig->get_node_full_url('org.openpsa.sales'); $provider = new org_openpsa_widgets_grid_provider($this, 'local'); $provider->add_order('start'); $data['grid'] = $provider->get_grid('scheduled'); midcom::get('head')->set_pagetitle($this->_l10n->get('scheduled invoices')); $this->add_breadcrumb('', $this->_l10n->get('scheduled invoices')); $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => '', MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('dashboard'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_left.png')); $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => 'invoice/new/', MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('create invoice'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/printer.png', MIDCOM_TOOLBAR_ENABLED => midcom::get('auth')->can_user_do('midgard:create', null, 'org_openpsa_invoices_invoice_dba'))); $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => 'projects/', MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('project invoicing'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/printer.png', MIDCOM_TOOLBAR_ENABLED => midcom::get('auth')->can_user_do('midgard:create', null, 'org_openpsa_invoices_invoice_dba'))); }
private function _show_invoice_list($type = 'all') { $this->_list_type = $type; $provider = new org_openpsa_widgets_grid_provider($this, 'local'); if ($provider->count_rows() == 0) { return; } switch ($this->_list_type) { case 'paid': $provider->add_order('paid', 'DESC'); break; case 'unsent': $provider->add_order('index_number'); break; case 'overdue': case 'open': $provider->add_order('due'); break; } $grid_id = $type . '_invoices_grid'; if ($this->_deliverable) { $grid_id = 'd_' . $this->_deliverable->id . $grid_id; $this->_request_data['totals']['deliverable'] = 0; } $this->_request_data['grid'] = $provider->get_grid($grid_id); $this->_request_data['list_type'] = $this->_list_type; $label = $type == 'all' ? 'invoices' : $type . ' invoices'; $this->_request_data['list_label'] = $this->_l10n->get($label); midcom_show_style('show-grid'); }