/** * @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'))); }
public function _on_handle($handler, $args) { // Pass topic to handlers $this->_request_data['directory'] = new org_openpsa_documents_directory($this->_topic->id); $this->_request_data['enable_versioning'] = $this->_config->get('enable_versioning'); // Always run in uncached mode midcom::get('cache')->content->no_cache(); org_openpsa_widgets_grid::add_head_elements(); org_openpsa_widgets_ui::enable_dynatree(); }
/** * 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); }
/** * 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}"); }
<td class="numeric"><?php echo org_openpsa_helpers::format_number($view['cost']); ?> </td> <?php } ?> </tr> </tbody> </table> </td> </tr> <tbody> </table> </div> <div class="wide"> <?php $tabs = array(); if ($data['invoices_url'] && $data['deliverable']->invoiced > 0) { $tabs[] = array('url' => $data['invoices_url'] . "list/deliverable/{$data['deliverable']->guid}/", 'title' => midcom::get('i18n')->get_string('invoices', 'org.openpsa.invoices')); } if ($data['projects_url'] && $data['deliverable']->state >= org_openpsa_sales_salesproject_deliverable_dba::STATUS_ORDERED) { if ($product && $product->orgOpenpsaObtype == org_openpsa_products_product_dba::TYPE_SERVICE) { $tabs[] = array('url' => $data['projects_url'] . "task/list/all/agreement/{$data['deliverable']->id}/", 'title' => midcom::get('i18n')->get_string('tasks', 'org.openpsa.projects')); } } org_openpsa_widgets_ui::render_tabs($data['deliverable']->guid, $tabs); ?> </div> </div>
/** * 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); }
echo $fielddata . "</div>"; break; } } if (array_key_exists('billing_data', $data)) { echo "<h2>" . $data['l10n']->get('invoice defaults') . "</h2>\n"; echo "<div><strong>" . midcom::get('i18n')->get_string('vat', 'org.openpsa.invoices') . ": </strong>"; echo $data['billing_data']->vat . " %</div>\n"; echo "<div><strong>" . midcom::get('i18n')->get_string('payment target', 'org.openpsa.invoices') . ": </strong>"; echo $data['billing_data']->due . "</div>\n"; $data['billing_data']->render_address(); } org_openpsa_widgets_contact::show_address_card($data['group'], array('visiting', 'postal')); echo '<br style="clear:left" />'; $siteconfig = org_openpsa_core_siteconfig::get_instance(); $tabs = array(); if (strpos($data['view']['categories'], $data['l10n']->get('client')) !== false) { //TODO: Check for privileges somehow $invoices_url = $siteconfig->get_node_relative_url('org.openpsa.invoices'); if ($invoices_url) { $tabs[] = array('url' => $invoices_url . "list/customer/all/{$data['group']->guid}/", 'title' => midcom::get('i18n')->get_string('invoices', 'org.openpsa.invoices')); } $sales_url = $siteconfig->get_node_relative_url('org.openpsa.sales'); if ($sales_url) { $tabs[] = array('url' => $sales_url . "list/customer/{$data['group']->guid}/", 'title' => midcom::get('i18n')->get_string('salesprojects', 'org.openpsa.sales')); } } org_openpsa_widgets_ui::render_tabs($data['group']->guid, $tabs); ?> </div>
<link type="image/x-icon" href="<?php echo MIDCOM_STATIC_URL; ?> /org.openpsa.core/openpsa-16x16.png" rel="shortcut icon"/> <?php $head->add_stylesheet(MIDCOM_STATIC_URL . '/OpenPsa2/style.css', 'screen,projection'); $head->add_stylesheet(MIDCOM_STATIC_URL . '/OpenPsa2/content.css', 'all'); $head->add_stylesheet(MIDCOM_STATIC_URL . '/OpenPsa2/print.css', 'print'); $head->add_stylesheet(MIDCOM_STATIC_URL . '/OpenPsa2/ui-elements.css', 'all'); $head->enable_jquery(); $head->add_jsfile(MIDCOM_JQUERY_UI_URL . '/ui/jquery.ui.core.min.js'); $head->add_jsfile(MIDCOM_JQUERY_UI_URL . '/ui/jquery.ui.widget.min.js'); $head->add_jsfile(MIDCOM_JQUERY_UI_URL . '/ui/jquery.ui.mouse.min.js'); $head->add_jsfile(MIDCOM_JQUERY_UI_URL . '/ui/jquery.ui.draggable.min.js'); org_openpsa_widgets_ui::add_head_elements(); org_openpsa_widgets_ui::initialize_search(); $head->add_jscript("var MIDGARD_ROOT = '" . midcom_connection::get_url('self') . "';"); $head->add_jscript("var TOOLBAR_MORE_LABEL = '" . midcom::get('i18n')->get_l10n('org.openpsa.widgets')->get('more') . "';"); $head->print_head_elements(); if ($pref_found) { ?> <style type="text/css"> #container #leftframe { width: &(navigation_width);px; } #container #content { margin-left: &(content_offset);px; }
/** * @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); }
/** * function that loads the necessary javascript & css files for jqgrid */ public static function add_head_elements() { if (self::$_head_elements_added) { return; } $version = midcom_baseclasses_components_configuration::get('org.openpsa.widgets', 'config')->get('jqgrid_version'); $jqgrid_path = '/org.openpsa.widgets/jquery.jqGrid-' . $version . '/'; $head = midcom::get('head'); //first enable jquery - just in case it isn't loaded $head->enable_jquery(); $head->add_jsfile(MIDCOM_JQUERY_UI_URL . '/ui/jquery.ui.core.min.js'); //needed js/css-files for jqgrid $lang = "en"; $language = midcom::get('i18n')->get_current_language(); if (file_exists(MIDCOM_STATIC_ROOT . $jqgrid_path . 'js/i18n/grid.locale-' . $language . '.js')) { $lang = $language; } $head->add_jsfile(MIDCOM_STATIC_URL . $jqgrid_path . 'js/i18n/grid.locale-' . $lang . '.js'); $head->add_jsfile(MIDCOM_STATIC_URL . $jqgrid_path . 'js/jquery.jqGrid.min.js'); org_openpsa_widgets_ui::add_head_elements(); $head->add_jsfile(MIDCOM_STATIC_URL . '/org.openpsa.widgets/jqGrid.custom.js'); $head->add_jsfile(MIDCOM_JQUERY_UI_URL . '/ui/jquery.ui.widget.min.js'); $head->add_jsfile(MIDCOM_JQUERY_UI_URL . '/ui/jquery.ui.mouse.min.js'); $head->add_jsfile(MIDCOM_JQUERY_UI_URL . '/ui/jquery.ui.resizable.min.js'); $head->add_stylesheet(MIDCOM_STATIC_URL . $jqgrid_path . 'css/ui.jqgrid.css'); $head->add_stylesheet(MIDCOM_STATIC_URL . '/org.openpsa.widgets/jqGrid.custom.css'); $head->add_jquery_ui_theme(); self::$_head_elements_added = true; }
<?php $view =& $data['document_dm']; ?> <div class="sidebar"> <?php midcom_show_style("show-directory-navigation"); ?> </div> <div class="main"> <?php $view->display_view(true); $tabs = array(); if ($data['document_versions'] > 0) { $nap = new midcom_helper_nav(); $node = $nap->get_node($nap->get_current_node()); $tabs[] = array('url' => "{$node[MIDCOM_NAV_RELATIVEURL]}document/versions/{$data['document']->guid}/", 'title' => $data['l10n']->get('older versions')); } org_openpsa_widgets_ui::render_tabs($data['document']->guid, $tabs); ?> </div>
<?php org_openpsa_widgets_ui::render_tabs(null, $data['tabs']);
</div> <div class="main"> <?php $data['datamanager']->display_view(true); //add tabs $tabs = array(); $siteconfig = org_openpsa_core_siteconfig::get_instance(); $invoices_url = $siteconfig->get_node_relative_url('org.openpsa.invoices'); $sales_url = $siteconfig->get_node_relative_url('org.openpsa.sales'); //TODO: Check for privileges somehow $invoices_url = $siteconfig->get_node_relative_url('org.openpsa.invoices'); if ($invoices_url) { $qb = org_openpsa_invoices_invoice_dba::new_query_builder(); $qb->add_constraint('customerContact', '=', $data['person']->id); $qb->set_limit(1); if ($qb->count() > 0) { $tabs[] = array('url' => $invoices_url . "list/customer/all/{$data['person']->guid}/", 'title' => midcom::get('i18n')->get_string('invoices', 'org.openpsa.invoices')); } } if ($sales_url) { $qb = org_openpsa_sales_salesproject_dba::new_query_builder(); $qb->add_constraint('customerContact', '=', $data['person']->id); $qb->set_limit(1); if ($qb->count() > 0) { $tabs[] = array('url' => $sales_url . "list/customer/{$data['person']->guid}/", 'title' => midcom::get('i18n')->get_string('salesprojects', 'org.openpsa.sales')); } } org_openpsa_widgets_ui::render_tabs($data['person']->guid, $tabs); ?> </div>