/** * @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_frontpage($handler_id, array $args, array &$data) { $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => 'salesproject/new/', MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('create salesproject'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_people.png', MIDCOM_TOOLBAR_ENABLED => midcom::get('auth')->can_user_do('midgard:create', null, 'org_openpsa_sales_salesproject_dba'))); org_openpsa_widgets_ui::enable_ui_tab(); $sales_url = org_openpsa_core_siteconfig::get_instance()->get_node_relative_url('org.openpsa.sales'); $data['tabs'] = array(array('url' => $sales_url . "list/active/", 'title' => $this->_l10n->get('active')), array('url' => $sales_url . "list/won/", 'title' => $this->_l10n->get('won')), array('url' => $sales_url . "list/delivered/", 'title' => $this->_l10n->get('delivered')), array('url' => $sales_url . "list/invoiced/", 'title' => $this->_l10n->get('invoiced')), array('url' => $sales_url . "list/canceled/", 'title' => $this->_l10n->get('canceled')), array('url' => $sales_url . "list/lost/", 'title' => $this->_l10n->get('lost'))); }
/** * 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}"); }
/** * Looks up a contact 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->_contact = new org_openpsa_contacts_person_dba($args[0]); $this->_load_datamanager(); $data['person_rss_url'] = $this->_contact->get_parameter('net.nemein.rss', 'url'); if ($data['person_rss_url']) { // We've autoprobed that this contact has a RSS feed available, link it midcom::get('head')->add_link_head(array('rel' => 'alternate', 'type' => 'application/rss+xml', 'title' => sprintf($this->_l10n->get('rss feed of person %s'), $this->_contact->name), 'href' => $data['person_rss_url'])); } $this->_prepare_request_data(); //enable ui_tab org_openpsa_widgets_ui::enable_ui_tab(); $this->_populate_toolbar($handler_id); $this->bind_view_to_object($this->_contact, $this->_datamanager->schema_name); $this->add_breadcrumb("person/{$this->_contact->guid}/", $this->_contact->name); midcom::get('head')->set_pagetitle($this->_contact->name); }
/** * Handler method for listing group members * * @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_view($handler_id, array $args, array &$data) { midcom::get('auth')->require_valid_user(); // Get the requested group object $this->_group = new org_openpsa_contacts_group_dba($args[0]); $data['group'] = $this->_group; if ($this->_group->orgOpenpsaObtype < org_openpsa_contacts_group_dba::MYCONTACTS) { $this->_type = 'group'; $data['group_tree'] = $this->_master->get_group_tree(); $data['members_grid'] = new org_openpsa_widgets_grid('members_grid', 'json'); org_openpsa_widgets_tree::add_head_elements(); } else { $this->_type = 'organization'; $root_group = org_openpsa_contacts_interface::find_root_group(); if ($this->_group->owner != $root_group->id) { $data['parent_group'] = $this->_group->get_parent(); } else { $data['parent_group'] = false; } //pass billing-data if invoices is installed if (midcom::get('componentloader')->is_installed('org.openpsa.invoices')) { $qb_billing_data = org_openpsa_invoices_billing_data_dba::new_query_builder(); $qb_billing_data->add_constraint('linkGuid', '=', $this->_group->guid); $billing_data = $qb_billing_data->execute(); if (count($billing_data) > 0) { $this->_request_data['billing_data'] = $billing_data[0]; } } // This handler uses Ajax, include the handler javascripts midcom::get('head')->add_jsfile(MIDCOM_STATIC_URL . "/org.openpsa.helpers/ajaxutils.js"); org_openpsa_widgets_ui::enable_ui_tab(); } $data['view'] = midcom_helper_datamanager2_handler::get_view($this, $this->_group); // Add toolbar items $this->_populate_toolbar(); $this->bind_view_to_object($this->_group); midcom::get('head')->set_pagetitle($this->_group->official); org_openpsa_contacts_viewer::add_breadcrumb_path_for_group($this->_group, $this); }
/** * @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) { // Get the requested document object $this->_document = $this->_load_document($args[0]); //If the user hasn't looked at the document since its last update, save the current time as last visit $person = midcom::get('auth')->user->get_storage(); if ((int) $person->get_parameter('org.openpsa.documents_visited', $this->_document->guid) < (int) $this->_document->metadata->revised) { $person->set_parameter('org.openpsa.documents_visited', $this->_document->guid, time()); } // Get number of older versions $this->_request_data['document_versions'] = 0; $qb = org_openpsa_documents_document_dba::new_query_builder(); $qb->add_constraint('topic', '=', $this->_request_data['directory']->id); if ($this->_document->nextVersion == 0) { $qb->add_constraint('nextVersion', '=', $this->_document->id); } else { $qb->add_constraint('nextVersion', '=', $this->_document->nextVersion); $qb->add_constraint('metadata.created', '<', gmstrftime('%Y-%m-%d %T', $this->_document->metadata->created)); } $qb->add_constraint('orgOpenpsaObtype', '=', ORG_OPENPSA_OBTYPE_DOCUMENT); $this->_request_data['document_versions'] = $qb->count(); $this->set_active_leaf($this->_document->id); org_openpsa_widgets_ui::enable_ui_tab(); org_openpsa_widgets_contact::add_head_elements(); $this->_request_data['document_dm'] =& $this->_datamanager; $this->_request_data['document'] =& $this->_document; midcom::get('head')->set_pagetitle($this->_document->title); if ($this->_document->nextVersion == 0) { $this->_populate_toolbar(); } $this->_add_version_navigation(); $this->bind_view_to_object($this->_document, $this->_datamanager->schema->name); }