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


PHP CerberusApplication::getVisit方法代码示例

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


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

示例1: showTab

 function showTab()
 {
     $visit = CerberusApplication::getVisit();
     $translate = DevblocksPlatform::getTranslationService();
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->cache_lifetime = "0";
     $tpl_path = dirname(dirname(__FILE__)) . '/templates/';
     $tpl->assign('path', $tpl_path);
     @($request_path = DevblocksPlatform::importGPC($_REQUEST['request'], 'string', ''));
     $tpl->assign('request_path', $request_path);
     @($stack = explode('/', $request_path));
     @array_shift($stack);
     // research
     @array_shift($stack);
     // fnr
     @($action = array_shift($stack));
     switch ($action) {
         default:
             //				if(null == ($view = C4_AbstractViewLoader::getView(null, self::VIEW_RESEARCH_FNR_SEARCH))) {
             //					$view = new C4_KbArticleView();
             //					$view->id = self::VIEW_RESEARCH_FNR_SEARCH;
             //					$view->name = $translate->_('common.search_results');
             //					C4_AbstractViewLoader::setView($view->id, $view);
             //				}
             //
             //				$tpl->assign('view', $view);
             //				$tpl->assign('view_fields', C4_KbArticleView::getFields());
             //				$tpl->assign('view_searchable_fields', C4_KbArticleView::getSearchFields());
             //				$tpl->assign('response_uri', 'research/fnr/search');
             $fnr_topics = DAO_FnrTopic::getWhere();
             $tpl->assign('fnr_topics', $fnr_topics);
             $tpl->display($tpl_path . 'research_tab/index.tpl');
             break;
     }
 }
开发者ID:jsjohnst,项目名称:cerb4,代码行数:35,代码来源:App.php

示例2: showTab

 function showTab()
 {
     @($ticket_id = DevblocksPlatform::importGPC($_REQUEST['ticket_id'], 'integer', 0));
     $visit = CerberusApplication::getVisit();
     /* @var $visit CerberusVisit */
     $translate = DevblocksPlatform::getTranslationService();
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('path', $this->tpl_path);
     $tpl->cache_lifetime = "0";
     $view = C4_AbstractViewLoader::getView('', 'audit_log');
     if (null == $view) {
         $view = new C4_TicketAuditLogView();
         $view->id = 'audit_log';
         $view->name = $translate->_('auditlog.audit_log');
         $view->view_columns = array(SearchFields_TicketAuditLog::CHANGE_DATE, SearchFields_TicketAuditLog::WORKER_ID, SearchFields_TicketAuditLog::CHANGE_FIELD, SearchFields_TicketAuditLog::CHANGE_VALUE);
         $view->params = array();
         $view->renderLimit = 15;
         $view->renderPage = 0;
         $view->renderSortBy = SearchFields_TicketAuditLog::CHANGE_DATE;
         $view->renderSortAsc = false;
     }
     $view->params = array(SearchFields_TicketAuditLog::TICKET_ID => new DevblocksSearchCriteria(SearchFields_TicketAuditLog::TICKET_ID, DevblocksSearchCriteria::OPER_EQ, $ticket_id));
     $view->renderPage = 0;
     C4_AbstractViewLoader::setView($view->id, $view);
     $tpl->assign('view', $view);
     $tpl->display('file:' . $this->tpl_path . '/display/log/index.tpl');
 }
开发者ID:jsjohnst,项目名称:cerb4,代码行数:27,代码来源:App.php

示例3: isVisible

 function isVisible()
 {
     // check login
     $visit = CerberusApplication::getVisit();
     if (empty($visit)) {
         return false;
     } else {
         return true;
     }
 }
开发者ID:jsjohnst,项目名称:cerb4,代码行数:10,代码来源:activity.php

示例4: render

 function render()
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('path', $this->_TPL_PATH);
     $visit = CerberusApplication::getVisit();
     $translate = DevblocksPlatform::getTranslationService();
     $response = DevblocksPlatform::getHttpResponse();
     $tpl->assign('request_path', implode('/', $response->path));
     $stack = $response->path;
     array_shift($stack);
     // research
     $tab_manifests = DevblocksPlatform::getExtensions('cerberusweb.research.tab', false);
     uasort($tab_manifests, create_function('$a, $b', "return strcasecmp(\$a->name,\$b->name);\n"));
     $tpl->assign('tab_manifests', $tab_manifests);
     @($tab_selected = array_shift($stack));
     if (empty($tab_selected)) {
         $tab_selected = '';
     }
     $tpl->assign('tab_selected', $tab_selected);
     $tpl->display('file:' . $this->_TPL_PATH . 'research/index.tpl');
 }
开发者ID:Hildy,项目名称:cerb5,代码行数:21,代码来源:research.php

示例5: showContactHistoryAction

 function showContactHistoryAction()
 {
     $translate = DevblocksPlatform::getTranslationService();
     @($ticket_id = DevblocksPlatform::importGPC($_REQUEST['ticket_id'], 'integer'));
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('path', $this->_TPL_PATH);
     $ticket = DAO_Ticket::getTicket($ticket_id);
     $requesters = $ticket->getRequesters();
     $contact = DAO_Address::get($ticket->first_wrote_address_id);
     $tpl->assign('contact', $contact);
     $visit = CerberusApplication::getVisit();
     /* @var $visit CerberusVisit */
     $view = C4_AbstractViewLoader::getView('', 'contact_history');
     if (null == $view) {
         $view = new C4_TicketView();
         $view->id = 'contact_history';
         $view->name = $translate->_('addy_book.history.view.title');
         $view->view_columns = array(SearchFields_Ticket::TICKET_LAST_ACTION_CODE, SearchFields_Ticket::TICKET_CREATED_DATE, SearchFields_Ticket::TICKET_TEAM_ID, SearchFields_Ticket::TICKET_CATEGORY_ID);
         $view->params = array();
         $view->renderLimit = 10;
         $view->renderSortBy = SearchFields_Ticket::TICKET_CREATED_DATE;
         $view->renderSortAsc = false;
     }
     $view->name = vsprintf($translate->_('addy_book.history.view.requester'), intval(count($requesters)));
     $view->params = array(SearchFields_Ticket::REQUESTER_ID => new DevblocksSearchCriteria(SearchFields_Ticket::REQUESTER_ID, 'in', array_keys($requesters)), SearchFields_Ticket::TICKET_DELETED => new DevblocksSearchCriteria(SearchFields_Ticket::TICKET_DELETED, DevblocksSearchCriteria::OPER_EQ, 0));
     $view->renderPage = 0;
     $tpl->assign('view', $view);
     C4_AbstractViewLoader::setView($view->id, $view);
     $workers = DAO_Worker::getAll();
     $tpl->assign('workers', $workers);
     $teams = DAO_Group::getAll();
     $tpl->assign('teams', $teams);
     $buckets = DAO_Bucket::getAll();
     $tpl->assign('buckets', $buckets);
     $team_categories = DAO_Bucket::getTeams();
     $tpl->assign('team_categories', $team_categories);
     $tpl->display('file:' . $this->_TPL_PATH . 'display/modules/history/index.tpl');
 }
开发者ID:jsjohnst,项目名称:cerb4,代码行数:38,代码来源:display.php

示例6: viewDoCopyAction

 function viewDoCopyAction()
 {
     $translate = DevblocksPlatform::getTranslationService();
     $active_worker = CerberusApplication::getActiveWorker();
     $visit = CerberusApplication::getVisit();
     @($view_id = DevblocksPlatform::importGPC($_POST['view_id'], 'string'));
     $view = C4_AbstractViewLoader::getView($view_id);
     @($list_title = DevblocksPlatform::importGPC($_POST['list_title'], 'string', ''));
     @($workspace = DevblocksPlatform::importGPC($_POST['workspace'], 'string', ''));
     @($new_workspace = DevblocksPlatform::importGPC($_POST['new_workspace'], 'string', ''));
     if (empty($workspace) && empty($new_workspace)) {
         $new_workspace = $translate->_('mail.workspaces.new');
     }
     if (empty($list_title)) {
         $list_title = $translate->_('mail.workspaces.new_list');
     }
     $workspace_name = !empty($new_workspace) ? $new_workspace : $workspace;
     // Find the proper workspace source based on the class of the view
     $source_manifests = DevblocksPlatform::getExtensions(Extension_WorkspaceSource::EXTENSION_POINT, false);
     $source_manifest = null;
     if (is_array($source_manifests)) {
         foreach ($source_manifests as $mft) {
             if (is_a($view, $mft->params['view_class'])) {
                 $source_manifest = $mft;
                 break;
             }
         }
     }
     if (!is_null($source_manifest)) {
         // View params inside the list for quick render overload
         $list_view = new Model_WorkerWorkspaceListView();
         $list_view->title = $list_title;
         $list_view->num_rows = $view->renderLimit;
         $list_view->columns = $view->view_columns;
         $list_view->params = $view->params;
         $list_view->sort_by = $view->renderSortBy;
         $list_view->sort_asc = $view->renderSortAsc;
         // Save the new worklist
         $fields = array(DAO_WorkerWorkspaceList::WORKER_ID => $active_worker->id, DAO_WorkerWorkspaceList::WORKSPACE => $workspace_name, DAO_WorkerWorkspaceList::SOURCE_EXTENSION => $source_manifest->id, DAO_WorkerWorkspaceList::LIST_VIEW => serialize($list_view), DAO_WorkerWorkspaceList::LIST_POS => 99);
         $list_id = DAO_WorkerWorkspaceList::create($fields);
     }
     // Select the workspace tab
     $visit->set(CerberusVisit::KEY_HOME_SELECTED_TAB, 'w_' . $workspace_name);
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('home')));
 }
开发者ID:rmiddle,项目名称:cerb4,代码行数:45,代码来源:internal.php

示例7: browseOppsAction

 function browseOppsAction()
 {
     $visit = CerberusApplication::getVisit();
     /* @var $visit CerberusVisit */
     $request = DevblocksPlatform::getHttpRequest();
     $stack = $request->path;
     array_shift($stack);
     // crm
     array_shift($stack);
     // browseOpps
     @($id = array_shift($stack));
     $opp = DAO_CrmOpportunity::get($id);
     if (empty($opp)) {
         echo "<H1>Invalid Opportunity ID.</H1>";
         return;
     }
     // Display series support (inherited paging from Display)
     @($view_id = array_shift($stack));
     if (!empty($view_id)) {
         $view = C4_AbstractViewLoader::getView('', $view_id);
         // Restrict to the active worker's groups
         $active_worker = CerberusApplication::getActiveWorker();
         //			$memberships = $active_worker->getMemberships();
         //			$view->params['tmp'] = new DevblocksSearchCriteria(SearchFields_CrmOpportunity::TEAM_ID, 'in', array_keys($memberships));
         $range = 100;
         $pos = $view->renderLimit * $view->renderPage;
         $page = floor($pos / $range);
         list($series, $series_count) = DAO_CrmOpportunity::search($view->view_columns, $view->params, $range, $page, $view->renderSortBy, $view->renderSortAsc, false);
         $series_info = array('title' => $view->name, 'total' => count($series), 'series' => $series);
         $visit->set('ch_opp_series', $series_info);
     }
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('crm', 'opps', $opp->id)));
     exit;
 }
开发者ID:joegeck,项目名称:cerb4,代码行数:34,代码来源:App.php

示例8: render

 function render()
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('id', $this->id);
     $view_path = DEVBLOCKS_PLUGIN_PATH . 'cerberusweb.mobile/templates/tickets/';
     $tpl->assign('view_path_mobile', $view_path_mobile);
     $tpl->assign('view', $this);
     $visit = CerberusApplication::getVisit();
     $results = self::getData();
     $tpl->assign('results', $results);
     @($ids = array_keys($results[0]));
     $workers = DAO_Worker::getAll();
     $tpl->assign('workers', $workers);
     $teams = DAO_Group::getAll();
     $tpl->assign('teams', $teams);
     $buckets = DAO_Bucket::getAll();
     $tpl->assign('buckets', $buckets);
     $team_categories = DAO_Bucket::getTeams();
     $tpl->assign('team_categories', $team_categories);
     // [TODO] Is this even used here or did mfogg copy it blindly?
     $ticket_fields = DAO_CustomField::getBySource(ChCustomFieldSource_Ticket::ID);
     $tpl->assign('ticket_fields', $ticket_fields);
     // Undo?
     // [TODO] Is this even used here or did mfogg copy it blindly?
     $last_action = C4_TicketView::getLastAction($this->id);
     $tpl->assign('last_action', $last_action);
     if (!empty($last_action) && !is_null($last_action->ticket_ids)) {
         $tpl->assign('last_action_count', count($last_action->ticket_ids));
     }
     $tpl->cache_lifetime = "0";
     $tpl->assign('view_fields', $this->getColumns());
     $tpl->display('file:' . $view_path . 'ticket_view.tpl');
 }
开发者ID:jsjohnst,项目名称:cerb4,代码行数:33,代码来源:classes.php

示例9: doImportAction

 function doImportAction()
 {
     $active_worker = CerberusApplication::getActiveWorker();
     if (!$active_worker->hasPriv('crm.opp.actions.import')) {
         return;
     }
     @($pos = DevblocksPlatform::importGPC($_REQUEST['pos'], 'array', array()));
     @($field = DevblocksPlatform::importGPC($_REQUEST['field'], 'array', array()));
     @($sync_dupes = DevblocksPlatform::importGPC($_REQUEST['sync_dupes'], 'array', array()));
     @($include_first = DevblocksPlatform::importGPC($_REQUEST['include_first'], 'integer', 0));
     @($is_blank_unset = DevblocksPlatform::importGPC($_REQUEST['is_blank_unset'], 'integer', 0));
     @($opt_assign = DevblocksPlatform::importGPC($_REQUEST['opt_assign'], 'integer', 0));
     @($opt_assign_worker_id = DevblocksPlatform::importGPC($_REQUEST['opt_assign_worker_id'], 'integer', 0));
     $visit = CerberusApplication::getVisit();
     $db = DevblocksPlatform::getDatabaseService();
     $workers = DAO_Worker::getAllActive();
     $csv_file = $visit->get('crm.import.last.csv', '');
     $fp = fopen($csv_file, "rt");
     if (!$fp) {
         return;
     }
     // [JAS]: Do we need to consume a first row of headings?
     if (!$include_first) {
         @fgetcsv($fp, 8192, ',', '"');
     }
     while (!feof($fp)) {
         $parts = fgetcsv($fp, 8192, ',', '"');
         if (empty($parts) || 1 == count($parts) && is_null($parts[0])) {
             continue;
         }
         $fields = array();
         $custom_fields = array();
         $sync_fields = array();
         foreach ($pos as $idx => $p) {
             $key = $field[$idx];
             $val = $parts[$idx];
             // Special handling
             if (!empty($key)) {
                 switch ($key) {
                     case 'amount':
                         if (0 != strlen($val) && is_numeric($val)) {
                             @($val = floatval($val));
                         } else {
                             unset($key);
                         }
                         break;
                         // Translate e-mail address to ID
                     // Translate e-mail address to ID
                     case 'email':
                         if (null != ($addy = CerberusApplication::hashLookupAddress($val, true))) {
                             $key = 'primary_email_id';
                             $val = $addy->id;
                         } else {
                             unset($key);
                         }
                         break;
                         // Bools
                     // Bools
                     case 'is_won':
                     case 'is_closed':
                         if (0 != strlen($val)) {
                             @($val = !empty($val) ? 1 : 0);
                         } else {
                             unset($key);
                         }
                         break;
                         // Dates
                     // Dates
                     case 'created_date':
                     case 'updated_date':
                     case 'closed_date':
                         if (0 != strlen($val)) {
                             @($val = !is_numeric($val) ? strtotime($val) : $val);
                         } else {
                             unset($key);
                         }
                         break;
                         // Worker by name
                     // Worker by name
                     case 'worker':
                         unset($key);
                         if (is_array($workers)) {
                             foreach ($workers as $worker_id => $worker) {
                                 if (0 == strcasecmp($val, $worker->getName())) {
                                     $key = 'worker_id';
                                     $val = $worker_id;
                                 }
                             }
                         }
                         break;
                 }
                 if (!isset($key)) {
                     continue;
                 }
                 // Custom fields
                 if ('cf_' == substr($key, 0, 3)) {
                     $custom_fields[substr($key, 3)] = $val;
                 } elseif (!empty($key)) {
                     $fields[$key] = $val;
                 }
//.........这里部分代码省略.........
开发者ID:rmiddle,项目名称:cerb4,代码行数:101,代码来源:App.php

示例10: doArticleQuickSearchAction

 function doArticleQuickSearchAction()
 {
     @($type = DevblocksPlatform::importGPC($_POST['type'], 'string'));
     @($query = DevblocksPlatform::importGPC($_POST['query'], 'string'));
     $query = trim($query);
     $visit = CerberusApplication::getVisit();
     /* @var $visit CerberusVisit */
     $translate = DevblocksPlatform::getTranslationService();
     if (null == ($searchView = C4_AbstractViewLoader::getView(ChKbResearchTab::VIEW_RESEARCH_KB_SEARCH))) {
         $searchView = new C4_KbArticleView();
         $searchView->id = ChKbResearchTab::VIEW_RESEARCH_KB_SEARCH;
         $searchView->name = $translate->_('common.search_results');
         C4_AbstractViewLoader::setView($searchView->id, $searchView);
     }
     $params = array();
     switch ($type) {
         case "content":
             $params[SearchFields_KbArticle::CONTENT] = new DevblocksSearchCriteria(SearchFields_KbArticle::CONTENT, DevblocksSearchCriteria::OPER_FULLTEXT, $query);
             break;
     }
     $searchView->params = $params;
     $searchView->renderPage = 0;
     $searchView->renderSortBy = null;
     C4_AbstractViewLoader::setView($searchView->id, $searchView);
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('research', 'kb', 'search')));
 }
开发者ID:rmiddle,项目名称:cerb4,代码行数:26,代码来源:App.php

示例11: clearLastActions

 public static function clearLastActions()
 {
     $visit = CerberusApplication::getVisit();
     /* @var $visit CerberusVisit */
     $visit->set(CerberusVisit::KEY_VIEW_LAST_ACTION, array());
 }
开发者ID:rmiddle,项目名称:cerb4,代码行数:6,代码来源:Model.class.php

示例12: _renderExplorerNavigation

 private function _renderExplorerNavigation($stack)
 {
     $visit = CerberusApplication::getVisit();
     if (null == ($posts = $visit->get('forums_explorer_results', null))) {
         return;
     }
     $pos = $visit->get('forums_explorer_results_pos', -1);
     // Advance our pointer
     if (!empty($pos) && isset($posts[$pos])) {
         while (key($posts) != $pos) {
             next($posts);
         }
     }
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->cache_lifetime = "0";
     $tpl->assign('path', $this->tpl_path);
     $translate = DevblocksPlatform::getTranslationService();
     $tpl->assign('translate', $translate);
     $workers = DAO_Worker::getAll();
     $tpl->assign('workers', $workers);
     switch (array_shift($stack)) {
         case 'next':
             next($posts);
             $key = key($posts);
             $visit->set('forums_explorer_results_pos', $key);
             break;
         case 'prev':
             prev($posts);
             $key = key($posts);
             $visit->set('forums_explorer_results_pos', $key);
             break;
     }
     if (null != ($post = DAO_ForumsThread::get(key($posts)))) {
         $tpl->assign('current_post', $post);
     }
     // Check for previous position
     if (prev($posts)) {
         $current = current($posts);
         $tpl->assign('prev_post', $current);
         next($posts);
         //re-advance
     } else {
         reset($posts);
     }
     // Check for next position
     if (next($posts)) {
         $current = current($posts);
         $tpl->assign('next_post', $current);
     } else {
         end($posts);
     }
     $tpl->assign('active_worker', $visit->getWorker());
     $tpl->display('file:' . $this->tpl_path . '/explorer/navigation.tpl');
 }
开发者ID:rmiddle,项目名称:cerb4,代码行数:54,代码来源:App.php

示例13: searchviewAction

 function searchviewAction()
 {
     $visit = CerberusApplication::getVisit();
     $response = DevblocksPlatform::getHttpRequest();
     $path = $response->path;
     array_shift($path);
     // tickets
     array_shift($path);
     // searchview
     $id = array_shift($path);
     $view = C4_AbstractViewLoader::getView($id);
     if (!empty($view->params)) {
         $params = array();
         // Index by field name for search system
         if (is_array($view->params)) {
             foreach ($view->params as $key => $criteria) {
                 /* @var $criteria DevblocksSearchCriteria */
                 $params[$key] = $criteria;
             }
         }
     }
     if (null == ($search_view = C4_AbstractViewLoader::getView(CerberusApplication::VIEW_SEARCH))) {
         $search_view = C4_TicketView::createSearchView();
     }
     $search_view->params = $params;
     $search_view->renderPage = 0;
     C4_AbstractViewLoader::setView($search_view->id, $search_view);
     DevblocksPlatform::setHttpResponse(new DevblocksHttpResponse(array('tickets', 'search')));
 }
开发者ID:Hildy,项目名称:cerb5,代码行数:29,代码来源:tickets.php

示例14: showTaskNotesTabAction

 function showTaskNotesTabAction()
 {
     @($task_id = DevblocksPlatform::importGPC($_REQUEST['id'], 'integer'));
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl_path = dirname(dirname(dirname(__FILE__))) . '/templates/';
     $tpl->assign('path', $tpl_path);
     $visit = CerberusApplication::getVisit();
     //		$visit->set(self::SESSION_OPP_TAB, 'notes');
     $task = DAO_Task::get($task_id);
     $tpl->assign('task', $task);
     list($notes, $null) = DAO_Note::search(array(new DevblocksSearchCriteria(SearchFields_Note::SOURCE_EXT_ID, '=', ChNotesSource_Task::ID), new DevblocksSearchCriteria(SearchFields_Note::SOURCE_ID, '=', $task->id)), 25, 0, SearchFields_Note::CREATED, false, false);
     $tpl->assign('notes', $notes);
     $active_workers = DAO_Worker::getAllActive();
     $tpl->assign('active_workers', $active_workers);
     $workers = DAO_Worker::getAllWithDisabled();
     $tpl->assign('workers', $workers);
     $tpl->display('file:' . $tpl_path . 'tasks/display/tabs/notes.tpl');
 }
开发者ID:Hildy,项目名称:cerb5,代码行数:18,代码来源:tasks.php

示例15: showContactHistoryAction

 function showContactHistoryAction()
 {
     $visit = CerberusApplication::getVisit();
     /* @var $visit CerberusVisit */
     $translate = DevblocksPlatform::getTranslationService();
     @($ticket_id = DevblocksPlatform::importGPC($_REQUEST['ticket_id'], 'integer'));
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('path', $this->_TPL_PATH);
     // Ticket
     $ticket = DAO_Ticket::getTicket($ticket_id);
     $tpl->assign('ticket', $ticket);
     $requesters = $ticket->getRequesters();
     // Addy
     $contact = DAO_Address::get($ticket->first_wrote_address_id);
     $tpl->assign('contact', $contact);
     // Scope
     $scope = $visit->get('display.history.scope', '');
     // [TODO] Sanitize scope preference
     // Defaults
     $defaults = new C4_AbstractViewModel();
     $defaults->class_name = 'C4_TicketView';
     $defaults->id = 'contact_history';
     $defaults->name = $translate->_('addy_book.history.view.title');
     $defaults->view_columns = array(SearchFields_Ticket::TICKET_LAST_ACTION_CODE, SearchFields_Ticket::TICKET_CREATED_DATE, SearchFields_Ticket::TICKET_TEAM_ID, SearchFields_Ticket::TICKET_CATEGORY_ID);
     $defaults->params = array();
     $defaults->renderLimit = 10;
     $defaults->renderSortBy = SearchFields_Ticket::TICKET_CREATED_DATE;
     $defaults->renderSortAsc = false;
     // View
     $view = C4_AbstractViewLoader::getView('contact_history', $defaults);
     // Sanitize scope options
     if ('org' == $scope) {
         if (empty($contact->contact_org_id)) {
             $scope = '';
         }
         if (null == ($contact_org = DAO_ContactOrg::get($contact->contact_org_id))) {
             $scope = '';
         }
     }
     if ('domain' == $scope) {
         $email_parts = explode('@', $contact->email);
         if (!is_array($email_parts) || 2 != count($email_parts)) {
             $scope = '';
         }
     }
     switch ($scope) {
         case 'org':
             $view->params = array(SearchFields_Ticket::TICKET_FIRST_CONTACT_ORG_ID => new DevblocksSearchCriteria(SearchFields_Ticket::TICKET_FIRST_CONTACT_ORG_ID, '=', $contact->contact_org_id), SearchFields_Ticket::TICKET_DELETED => new DevblocksSearchCriteria(SearchFields_Ticket::TICKET_DELETED, '=', 0));
             $view->name = ucwords($translate->_('contact_org.name')) . ": " . $contact_org->name;
             break;
         case 'domain':
             $view->params = array(SearchFields_Ticket::REQUESTER_ADDRESS => new DevblocksSearchCriteria(SearchFields_Ticket::REQUESTER_ADDRESS, 'like', '*@' . $email_parts[1]), SearchFields_Ticket::TICKET_DELETED => new DevblocksSearchCriteria(SearchFields_Ticket::TICKET_DELETED, '=', 0));
             $view->name = ucwords($translate->_('common.email')) . ": *@" . $email_parts[1];
             break;
         default:
         case 'email':
             $scope = 'email';
             $view->params = array(SearchFields_Ticket::REQUESTER_ID => new DevblocksSearchCriteria(SearchFields_Ticket::REQUESTER_ID, 'in', array_keys($requesters)), SearchFields_Ticket::TICKET_DELETED => new DevblocksSearchCriteria(SearchFields_Ticket::TICKET_DELETED, '=', 0));
             $view->name = ucwords($translate->_('common.email')) . ": " . $contact->email;
             break;
     }
     $tpl->assign('scope', $scope);
     $view->renderPage = 0;
     $tpl->assign('view', $view);
     C4_AbstractViewLoader::setView($view->id, $view);
     $workers = DAO_Worker::getAll();
     $tpl->assign('workers', $workers);
     $teams = DAO_Group::getAll();
     $tpl->assign('teams', $teams);
     $buckets = DAO_Bucket::getAll();
     $tpl->assign('buckets', $buckets);
     $team_categories = DAO_Bucket::getTeams();
     $tpl->assign('team_categories', $team_categories);
     $tpl->display('file:' . $this->_TPL_PATH . 'display/modules/history/index.tpl');
 }
开发者ID:rmiddle,项目名称:cerb4,代码行数:75,代码来源:display.php


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