/** * Generic request startup work: * * - Load the Schema Database * - Add the LINK HTML HEAD elements */ public function _on_handle($handler, $args) { org_openpsa_widgets_contact::add_head_elements(); $this->add_stylesheet(MIDCOM_STATIC_URL . "/org.openpsa.projects/projects.css"); $this->add_stylesheet(MIDCOM_STATIC_URL . "/org.openpsa.invoices/invoices.css"); $this->add_stylesheet(MIDCOM_STATIC_URL . "/org.openpsa.sales/sales.css"); midcom::get('auth')->require_valid_user(); }
/** * The handle callback populates the toolbars. */ public function _on_handle($handler, $args) { // Always run in uncached mode midcom::get('cache')->content->no_cache(); if ($handler != 'mycontacts_xml') { midcom::get('auth')->require_valid_user(); } org_openpsa_widgets_contact::add_head_elements(); }
/** * Looks up an campaign to display. */ public function _handler_view($handler_id, array $args, array &$data) { $this->_campaign = $this->_master->load_campaign($args[0]); $this->_load_datamanager(); $this->_datamanager->autoset_storage($this->_campaign); $this->set_active_leaf('campaign_' . $this->_campaign->id); $this->_request_data['campaign'] =& $this->_campaign; $this->_request_data['datamanager'] =& $this->_datamanager; org_openpsa_widgets_contact::add_head_elements(); $this->_populate_toolbar(); $schemadb_message = midcom_helper_datamanager2_schema::load_database($this->_config->get('schemadb_message')); foreach ($schemadb_message as $name => $schema) { $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "message/create/{$this->_campaign->guid}/{$name}/", MIDCOM_TOOLBAR_LABEL => sprintf($this->_l10n->get('new %s'), $this->_l10n->get($schema->description)), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/' . org_openpsa_directmarketing_viewer::get_messagetype_icon($schema->customdata['org_openpsa_directmarketing_messagetype']), MIDCOM_TOOLBAR_ENABLED => $this->_campaign->can_do('midgard:create'))); } // Populate calendar events for the campaign $this->bind_view_to_object($this->_campaign, $this->_datamanager->schema->name); midcom::get('metadata')->set_request_metadata($this->_campaign->metadata->revised, $this->_campaign->guid); midcom::get('head')->set_pagetitle($this->_campaign->title); }
/** * The handler for the list view * * @param mixed $handler_id the array key from the request array * @param array $args the arguments given to the handler * @param Array &$data The local request data. */ public function _handler_list($handler_id, array $args, array &$data) { midcom::get('auth')->require_valid_user(); // List hours $qb = org_openpsa_projects_hour_report_dba::new_query_builder(); $mode = 'full'; //url for batch_handler $this->_request_data['action_target_url'] = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX) . "hours/task/batch/"; switch ($handler_id) { case 'list_hours': $this->_master->add_list_filter($qb); $data['view_title'] = $data['l10n']->get('hour reports'); $data['breadcrumb_title'] = $data['view_title']; break; case 'list_hours_task': $this->_master->add_list_filter($qb); // Fallthrough // Fallthrough case 'list_hours_task_all': $task = new org_openpsa_projects_task_dba($args[0]); $qb->add_constraint('task', '=', $task->id); $mode = 'simple'; $data['view_title'] = sprintf($data['l10n']->get($handler_id . " %s"), $task->title); $data['breadcrumb_title'] = $task->get_label(); $siteconfig = org_openpsa_core_siteconfig::get_instance(); $projects_url = $siteconfig->get_node_full_url('org.openpsa.projects'); if ($projects_url) { $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => $projects_url . "task/{$task->guid}/", MIDCOM_TOOLBAR_LABEL => sprintf($this->_l10n->get('show task %s'), $task->title), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/jump-to.png', MIDCOM_TOOLBAR_ACCESSKEY => 'g')); } break; } $qb->add_order('date', 'DESC'); $data['hours'] = $qb->execute(); $this->_load_hour_data($data['hours']); $data['mode'] = $mode; $data['tasks'] = $this->tasks; $data['qb'] = $qb; org_openpsa_widgets_grid::add_head_elements(); midcom_helper_datamanager2_widget_autocomplete::add_head_elements(); org_openpsa_widgets_contact::add_head_elements(); midcom::get('head')->set_pagetitle($data['view_title']); $this->add_breadcrumb('', $data['breadcrumb_title']); }
/** * Add CSS * * @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_callback($handler_id, array $args, array &$data) { $this->add_stylesheet(MIDCOM_STATIC_URL . "/midcom.helper.datamanager2/legacy.css"); //need js for chooser-widgets for list of hour - because of dynamic load loading is needed here midcom::get('head')->add_jsfile(MIDCOM_STATIC_URL . "/midcom.helper.datamanager2/chooser/jquery.chooser_widget.js"); $this->add_stylesheet(MIDCOM_STATIC_URL . "/midcom.helper.datamanager2/chooser/jquery.chooser_widget.css"); if ($handler_id == 'task_view') { org_openpsa_widgets_contact::add_head_elements(); $data['calendar_node'] = midcom_helper_misc::find_node_by_component('org.openpsa.calendar'); } }
/** * @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_latest($handler_id, array $args, array &$data) { $this->_request_data['latest_pages'] = array(); $this->_max_pages = $this->_config->get('latest_count'); // Start by looking for items within last two weeks $from = mktime(0, 0, 0, date('m'), date('d') - 14, date('Y')); $this->_seek_updated($from); $i = 0; while ($this->_updated_pages < $this->_max_pages && $i < 20) { // Expand seek by another two weeks $to = $from; $from = mktime(0, 0, 0, date('m', $to), date('d', $to) - 14, date('Y', $to)); $this->_seek_updated($from, $to); $i++; } $data['view_title'] = sprintf($this->_request_data['l10n']->get('latest updates in %s'), $this->_topic->extra); midcom::get('head')->set_pagetitle($data['view_title']); $this->add_breadcrumb('latest/', $data['view_title']); org_openpsa_widgets_contact::add_head_elements(); }
/** * Add toolbar items * * @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_callback($handler_id, array $args, array &$data) { $this->add_stylesheet(MIDCOM_STATIC_URL . "/midcom.helper.datamanager2/legacy.css"); if ($handler_id == 'project') { org_openpsa_widgets_grid::add_head_elements(); org_openpsa_widgets_contact::add_head_elements(); midcom::get('head')->add_jsfile(MIDCOM_STATIC_URL . '/org.openpsa.core/filter.js'); midcom::get('head')->add_stylesheet(MIDCOM_STATIC_URL . '/org.openpsa.core/filter.css'); } }
/** * function to add css & toolbar-items */ private function _prepare_output() { $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => $this->_relocate_url, MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('back'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/stock_left.png')); $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => $this->_request_data['url_prefix'] . "create/" . $this->_current_object->guid . "/", MIDCOM_TOOLBAR_LABEL => midcom::get('i18n')->get_string('add journal entry', 'org.openpsa.relatedto'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/new-text.png')); org_openpsa_widgets_contact::add_head_elements(); }
public function _on_handle($handler, $args) { org_openpsa_widgets_contact::add_head_elements(); $this->add_stylesheet(MIDCOM_STATIC_URL . "/org.openpsa.invoices/invoices.css"); }
/** * Maps the content topic from the request data to local member variables. */ public function _on_initialize() { org_openpsa_widgets_calendar::add_head_elements(); org_openpsa_widgets_contact::add_head_elements(); midcom::get('head')->add_jsfile(MIDCOM_STATIC_URL . "/org.openpsa.projects/projectbroker.js"); }
public function _on_initialize() { org_openpsa_widgets_contact::add_head_elements(); }
/** * @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); }
public function _on_initialize() { org_openpsa_widgets_contact::add_head_elements(); $this->module = 'invoices'; $this->_initialize_datamanager(); }
/** * Helper function to add needed css & js files */ private function _prepare_output() { $this->_request_data['prefix'] = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX); //load js/css for jqgrid org_openpsa_widgets_grid::add_head_elements(); $this->add_stylesheet(MIDCOM_STATIC_URL . "/org.openpsa.documents/layout.css"); org_openpsa_widgets_contact::add_head_elements(); $this->_populate_toolbar(); }
public function _on_handle($handler, $args) { // Always run in uncached mode midcom::get('cache')->content->no_cache(); org_openpsa_widgets_contact::add_head_elements(); }