当前位置: 首页>>代码示例>>PHP>>正文


PHP SidebarController::addCurrentBox方法代码示例

本文整理汇总了PHP中SidebarController::addCurrentBox方法的典型用法代码示例。如果您正苦于以下问题:PHP SidebarController::addCurrentBox方法的具体用法?PHP SidebarController::addCurrentBox怎么用?PHP SidebarController::addCurrentBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SidebarController的用法示例。


在下文中一共展示了SidebarController::addCurrentBox方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: view

 public function view()
 {
     $newsletter = $this->_uses['Newsletter'];
     $newsletter->load($this->_data['id']) or sendBack();
     $sidebar = new SidebarController($this->view);
     $sidebar->addCurrentBox('currently_viewing', $newsletter->name, array('module' => 'crm', 'controller' => 'newsletters', 'action' => 'edit', 'id' => $newsletter->id));
     $sidebar->addList('related_items', array('views' => array('tag' => 'Views', 'link' => array('module' => 'crm', 'controller' => 'newsletters', 'action' => 'showviews', 'newsletter_id' => $newsletter->id)), 'clicks' => array('tag' => 'Clicks', 'link' => array('module' => 'crm', 'controller' => 'newsletters', 'action' => 'showclicks', 'newsletter_id' => $newsletter->id))));
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:10,代码来源:NewslettersController.php

示例2: view

 public function view()
 {
     $flash = Flash::Instance();
     $event = $this->_uses['CalendarEvent'];
     $event->load($this->_data['id']);
     if ($event->private == 't' && $event->owner != EGS_USERNAME) {
         $flash->addError("Cannot view a private event");
         sendBack();
     }
     $sidebar = new SidebarController($this->view);
     $sidebar->addList('Actions', array('new_event' => array('link' => array('module' => 'calendar', 'controller' => 'calendarevents', 'action' => 'new'), 'tag' => 'new_event')));
     if ($event->owner == EGS_USERNAME) {
         $sidebar->addCurrentBox('currently_viewing', $event->summary, array('module' => 'calendar', 'controller' => 'calendarevents', 'action' => 'edit', 'id' => $event->id));
     }
     $sidebar->addList('calendar_views', array('new_event' => array('link' => array('module' => 'calendar'), 'tag' => 'View Calendar')));
     $sidebar->addList('related_items', array('attachments' => array('tag' => 'Attachments', 'link' => array('module' => 'calendar', 'controller' => 'calendareventattachments', 'action' => 'index', 'entity_id' => $event->id), 'new' => array('module' => 'calendar', 'controller' => 'calendareventattachments', 'action' => 'new', 'entity_id' => $event->id))));
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:19,代码来源:CalendareventsController.php

示例3: view

 public function view()
 {
     if (!$this->loadData()) {
         $this->dataError();
         sendBack();
     }
     $person = $this->_uses[$this->modeltype];
     $person_id = $person->{$person->idField};
     $party_id = $person->party_id;
     $company = DataObjectFactory::Factory('Company');
     $slcustomer = DataObjectFactory::Factory('SLCustomer');
     if ($person->isLoaded()) {
         $company->load($person->company_id);
         $slcustomer->loadBy('company_id', $person->company_id);
     }
     if (!$person->isLoaded()) {
         $flash = Flash::instance();
         $flash->addError('You do not have permission to view this person.');
         sendTo($this->name, 'index', $this->_modules);
         return;
     }
     $sidebar = new SidebarController($this->view);
     // Need loose coupling method - use person categories?
     $employee = DataObjectFactory::Factory('Employee');
     $employee->loadBy('person_id', $person_id);
     if ($employee->isLoaded()) {
         $sidebar->addList('currently_viewing', array('view' => array('tag' => 'view ' . $person->fullname, 'link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'view', 'id' => $person_id))));
     } else {
         $sidebar->addCurrentBox('currently_viewing', $person->fullname, array('module' => 'contacts', 'controller' => 'persons', 'id' => $person->id));
     }
     $items = array();
     $ao = AccessObject::Instance();
     if ($ao->hasPermission('crm')) {
         $items += array('opportunities' => array('tag' => 'Opportunities', 'link' => array('module' => 'crm', 'controller' => 'opportunitys', 'action' => 'viewperson', 'person_id' => $person_id), 'new' => array('module' => 'crm', 'controller' => 'opportunitys', 'action' => 'new', 'person_id' => $person_id)), 'activities' => array('tag' => 'Activities', 'link' => array('module' => 'crm', 'controller' => 'activitys', 'action' => 'viewperson', 'person_id' => $person_id), 'new' => array('module' => 'crm', 'controller' => 'activitys', 'action' => 'new', 'person_id' => $person_id)));
     }
     if ($ao->hasPermission('ticketing')) {
         $items += array('tickets' => array('tag' => 'Tickets', 'link' => array('module' => 'ticketing', 'controller' => 'tickets', 'action' => 'viewcompany', 'originator_person_id' => $person_id), 'new' => array('module' => 'ticketing', 'controller' => 'tickets', 'action' => 'new', 'originator_person_id' => $person_id)));
     }
     if (isModuleAdmin('projects')) {
         $items += array('resource_template' => array('tag' => 'Resource Template', 'link' => array('module' => 'projects', 'controller' => 'resourcetemplate', 'action' => 'viewperson', 'person_id' => $person_id), 'new' => array('module' => 'projects', 'controller' => 'resourcetemplate', 'action' => 'new', 'person_id' => $person_id)));
     }
     $items += array('spacer', 'notes' => array('tag' => 'Notes', 'link' => array('module' => 'contacts', 'controller' => 'partynotes', 'action' => 'viewperson', 'party_id' => $party_id), 'new' => array('module' => 'contacts', 'controller' => 'partynotes', 'action' => 'new', 'party_id' => $party_id)), 'spacer', 'attachments' => array('tag' => 'Attachments', 'link' => array('module' => 'contacts', 'controller' => 'personattachments', 'action' => 'index', 'person_id' => $person_id), 'new' => array('module' => 'contacts', 'controller' => 'personattachments', 'action' => 'new', 'data_model' => 'person', 'entity_id' => $person_id)), 'spacer', 'addresses' => array('tag' => 'Addresses', 'link' => array('module' => 'contacts', 'controller' => 'partyaddresss', 'action' => 'viewperson', 'party_id' => $party_id), 'new' => array('module' => 'contacts', 'controller' => 'partyaddresss', 'action' => 'new', 'party_id' => $party_id)), 'spacer', 'phone' => array('tag' => 'Phone', 'link' => array('module' => 'contacts', 'controller' => 'partycontactmethods', 'action' => 'viewperson', 'party_id' => $party_id, 'type' => 'T'), 'new' => array('module' => 'contacts', 'controller' => 'partycontactmethods', 'action' => 'new', 'party_id' => $party_id, 'type' => 'T')), 'mobile' => array('tag' => 'Mobile', 'link' => array('module' => 'contacts', 'controller' => 'partycontactmethods', 'action' => 'viewperson', 'party_id' => $party_id, 'type' => 'M'), 'new' => array('module' => 'contacts', 'controller' => 'partycontactmethods', 'action' => 'new', 'party_id' => $party_id, 'type' => 'M')), 'fax' => array('tag' => 'Fax', 'link' => array('module' => 'contacts', 'controller' => 'partycontactmethods', 'action' => 'viewperson', 'party_id' => $party_id, 'type' => 'F'), 'new' => array('module' => 'contacts', 'controller' => 'partycontactmethods', 'action' => 'new', 'party_id' => $party_id, 'type' => 'F')), 'email' => array('tag' => 'Email', 'link' => array('module' => 'contacts', 'controller' => 'partycontactmethods', 'action' => 'viewperson', 'party_id' => $party_id, 'type' => 'E'), 'new' => array('module' => 'contacts', 'controller' => 'partycontactmethods', 'action' => 'new', 'party_id' => $party_id, 'type' => 'E')), 'spacer', 'meetings' => array('tag' => 'Meetings', 'link' => array('module' => 'calendar', 'controller' => 'calendarevents', 'action' => 'viewperson', 'person_id' => $person_id), 'new' => array('module' => 'calendar', 'controller' => 'calendarevents', 'action' => 'new', 'person_id' => $person_id)), 'calls' => array('tag' => 'Calls', 'link' => array('module' => 'contacts', 'controller' => 'loggedcalls', 'action' => 'viewperson', 'person_id' => $person_id), 'new' => array('module' => 'contacts', 'controller' => 'loggedcalls', 'action' => 'new', 'person_id' => $person_id)));
     if ($slcustomer->isLoaded()) {
         $items += array('sorders' => array('tag' => 'Sales Orders/Quotes', 'link' => array('module' => 'sales_order', 'controller' => 'sorders', 'action' => 'viewperson', 'person_id' => $person_id), 'new' => array('module' => 'sales_order', 'controller' => 'sorders', 'action' => 'new', 'person_id' => $person_id, 'slmaster_id' => $slcustomer->id)));
     }
     $sidebar->addList('related_items', $items);
     $category = DataObjectFactory::Factory('peopleInCategories');
     $this->view->set('categories', implode(',', $category->getCategorynames($person_id)));
     $current_categories = $category->getCategoryID($person_id);
     $ledger_category = DataObjectFactory::Factory('LedgerCategory');
     foreach ($ledger_category->getPersonTypes($current_categories) as $model_name => $model_detail) {
         $do = DataObjectFactory::Factory($model_name);
         $do->loadBy('person_id', $person_id);
         if ($do->isLoaded()) {
             $sidebar->addList('related_items', array($model_name => array('tag' => $do->getTitle(), 'link' => array('module' => $model_detail['module'], 'controller' => $model_detail['controller'], 'action' => 'view', $do->idField => $do->{$do->idField}))));
         } else {
             $sidebar->addList('related_items', array($model_name => array('tag' => $do->getTitle(), 'new' => array('module' => $model_detail['module'], 'controller' => $model_detail['controller'], 'action' => 'new', 'person_id' => $person->{$person->idField}))));
         }
     }
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
     $category = DataObjectFactory::Factory('PeopleInCategories');
     $this->view->set('categories', implode(',', $category->getCategorynames($person_id)));
     if ($person instanceof Person) {
         $pl = new PreferencePageList('recently_viewed_people' . EGS_COMPANY_ID);
         $pl->addPage(new Page(array('module' => 'contacts', 'controller' => 'persons', 'action' => 'view', 'id' => $person_id), 'person', $person->firstname . ' ' . $person->surname));
         $pl->save();
     }
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:69,代码来源:PersonsController.php


注:本文中的SidebarController::addCurrentBox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。