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


PHP DAO_Worker::logActivity方法代码示例

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


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

示例1: writeResponse

 public function writeResponse(DevblocksHttpResponse $response)
 {
     $path = $response->path;
     // [JAS]: Ajax? // [TODO] Explore outputting whitespace here for Safari
     //	    if(empty($path))
     //			return;
     $tpl = DevblocksPlatform::getTemplateService();
     $session = DevblocksPlatform::getSessionService();
     $settings = CerberusSettings::getInstance();
     $translate = DevblocksPlatform::getTranslationService();
     $active_worker = CerberusApplication::getActiveWorker();
     $visit = $session->getVisit();
     $page_manifests = $this->_getAllowedPages();
     $controller = array_shift($path);
     // Default page [TODO] This is supposed to come from framework.config.php
     if (empty($controller)) {
         $controller = 'home';
     }
     // [JAS]: Require us to always be logged in for Cerberus pages
     if (empty($visit) && 0 != strcasecmp($controller, 'login')) {
         $query = array();
         if (!empty($response->path)) {
             $query = array('url' => urlencode(implode('/', $response->path)));
         }
         DevblocksPlatform::redirect(new DevblocksHttpRequest(array('login'), $query));
     }
     $page_id = $this->_getPageIdByUri($controller);
     @($page = DevblocksPlatform::getExtension($page_id, true));
     /* @var $page CerberusPageExtension */
     if (empty($page)) {
         header("Status: 404");
         return;
         // [TODO] 404
     }
     // [JAS]: Listeners (Step-by-step guided tour, etc.)
     $listenerManifests = DevblocksPlatform::getExtensions('devblocks.listener.http');
     foreach ($listenerManifests as $listenerManifest) {
         /* @var $listenerManifest DevblocksExtensionManifest */
         $inst = $listenerManifest->createInstance();
         /* @var $inst DevblocksHttpRequestListenerExtension */
         $inst->run($response, $tpl);
     }
     $tpl->assign('active_worker', $active_worker);
     $tour_enabled = false;
     if (!empty($visit) && !is_null($active_worker)) {
         $tour_enabled = intval(DAO_WorkerPref::get($active_worker->id, 'assist_mode', 1));
         if (DEMO_MODE) {
             $tour_enabled = 1;
         }
         // override for DEMO
         $keyboard_shortcuts = intval(DAO_WorkerPref::get($active_worker->id, 'keyboard_shortcuts', 1));
         $tpl->assign('pref_keyboard_shortcuts', $keyboard_shortcuts);
         $active_worker_memberships = $active_worker->getMemberships();
         $tpl->assign('active_worker_memberships', $active_worker_memberships);
         $unread_notifications = DAO_WorkerEvent::getUnreadCountByWorker($active_worker->id);
         $tpl->assign('active_worker_notify_count', $unread_notifications);
         DAO_Worker::logActivity($active_worker->id, $page->getActivity());
     }
     $tpl->assign('tour_enabled', $tour_enabled);
     // [JAS]: Variables provided to all page templates
     $tpl->assign('settings', $settings);
     $tpl->assign('session', $_SESSION);
     $tpl->assign('translate', $translate);
     $tpl->assign('visit', $visit);
     $tpl->assign('license', CerberusLicense::getInstance());
     $tpl->assign('page_manifests', $page_manifests);
     $tpl->assign('page', $page);
     $tpl->assign('response_uri', implode('/', $response->path));
     $core_tpl = DEVBLOCKS_PLUGIN_PATH . 'cerberusweb.core/templates/';
     $tpl->assign('core_tpl', $core_tpl);
     // Prebody Renderers
     $preBodyRenderers = DevblocksPlatform::getExtensions('cerberusweb.renderer.prebody', true);
     if (!empty($preBodyRenderers)) {
         $tpl->assign('prebody_renderers', $preBodyRenderers);
     }
     // Postbody Renderers
     $postBodyRenderers = DevblocksPlatform::getExtensions('cerberusweb.renderer.postbody', true);
     if (!empty($postBodyRenderers)) {
         $tpl->assign('postbody_renderers', $postBodyRenderers);
     }
     // Timings
     $tpl->assign('render_time', microtime(true) - DevblocksPlatform::getStartTime());
     if (function_exists('memory_get_usage') && function_exists('memory_get_peak_usage')) {
         $tpl->assign('render_memory', memory_get_usage() - DevblocksPlatform::getStartMemory());
         $tpl->assign('render_peak_memory', memory_get_peak_usage() - DevblocksPlatform::getStartPeakMemory());
     }
     $tpl->display($core_tpl . 'border.tpl');
     //		$cache = DevblocksPlatform::getCacheService();
     //		$cache->printStatistics();
 }
开发者ID:rmiddle,项目名称:cerb4,代码行数:90,代码来源:plugin.classes.php

示例2: showWorkspaceTabAction

 function showWorkspaceTabAction()
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('path', $this->_TPL_PATH);
     $visit = PortSensorApplication::getVisit();
     $db = DevblocksPlatform::getDatabaseService();
     $active_worker = PortSensorApplication::getActiveWorker();
     $current_workspace = DevblocksPlatform::importGPC($_REQUEST['workspace'], 'string', '');
     $workspaces = DAO_Worklist::getWorkspaces($active_worker->id);
     // Fix a bad/old cache
     if (!empty($current_workspace) && false === array_search($current_workspace, $workspaces)) {
         $current_workspace = '';
     }
     $views = array();
     if (empty($current_workspace) && !empty($workspaces)) {
         // custom dashboards
         $current_workspace = reset($workspaces);
     }
     if (!empty($current_workspace)) {
         // Remember the tab
         $visit->set(PortSensorVisit::KEY_HOME_SELECTED_TAB, 'w_' . $current_workspace);
         $lists = DAO_Worklist::getWhere(sprintf("%s = %d AND %s = %s", DAO_Worklist::WORKER_ID, $active_worker->id, DAO_Worklist::WORKSPACE, $db->qstr($current_workspace)));
         // Load the workspace sources to map to view renderer
         $source_manifests = DevblocksPlatform::getExtensions(Extension_WorklistSource::EXTENSION_POINT, false);
         // Loop through list schemas
         if (is_array($lists) && !empty($lists)) {
             foreach ($lists as $list) {
                 /* @var $list Model_Worklist */
                 $view_id = 'cust_' . $list->id;
                 if (null == ($view = Ps_AbstractViewLoader::getView($view_id))) {
                     $list_view = $list->view;
                     // Make sure we can find the workspace source (plugin not disabled)
                     if (!isset($source_manifests[$list->source_extension]) || null == ($workspace_source = $source_manifests[$list->source_extension]) || !isset($workspace_source->params['view_class'])) {
                         continue;
                     }
                     // Make sure our workspace source has a valid renderer class
                     $view_class = $workspace_source->params['view_class'];
                     if (!class_exists($view_class)) {
                         continue;
                     }
                     $view = new $view_class();
                     $view->id = $view_id;
                     $view->name = $list_view->title;
                     $view->renderLimit = $list_view->num_rows;
                     $view->renderPage = 0;
                     $view->view_columns = $list_view->columns;
                     $view->params = $list_view->params;
                     $view->renderSortBy = $list_view->sort_by;
                     $view->renderSortAsc = $list_view->sort_asc;
                     Ps_AbstractViewLoader::setView($view_id, $view);
                 }
                 if (!empty($view)) {
                     $views[] = $view;
                 }
             }
         }
         $tpl->assign('current_workspace', $current_workspace);
         $tpl->assign('views', $views);
     }
     // Log activity
     DAO_Worker::logActivity($active_worker->id, new Model_Activity('activity.mail.workspaces', array('<i>' . $current_workspace . '</i>')));
     $tpl->display('file:' . $this->_TPL_PATH . 'home/workspaces/index.tpl');
 }
开发者ID:jstanden,项目名称:portsensor,代码行数:63,代码来源:home.php

示例3: signoutAction

 function signoutAction()
 {
     $session = DevblocksPlatform::getSessionService();
     $visit = $session->getVisit();
     if (null != ($worker = CerberusApplication::getActiveWorker())) {
         DAO_Worker::logActivity($worker->id, new Model_Activity(null));
     }
     $session->clear();
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('login')));
 }
开发者ID:rmiddle,项目名称:cerb4,代码行数:10,代码来源:login.php

示例4: render


//.........这里部分代码省略.........
     $translate = DevblocksPlatform::getTranslationService();
     $url = DevblocksPlatform::getUrlService();
     $stack = $response->path;
     @array_shift($stack);
     // display
     @($id = array_shift($stack));
     // Tabs
     $tab_manifests = DevblocksPlatform::getExtensions('cerberusweb.ticket.tab', false);
     $tpl->assign('tab_manifests', $tab_manifests);
     @($tab_selected = array_shift($stack));
     if (empty($tab_selected)) {
         $tab_selected = 'conversation';
     }
     $tpl->assign('tab_selected', $tab_selected);
     switch ($tab_selected) {
         case 'conversation':
             @($mail_always_show_all = DAO_WorkerPref::get($active_worker->id, 'mail_always_show_all', 0));
             @($tab_option = array_shift($stack));
             if ($mail_always_show_all || 0 == strcasecmp("read_all", $tab_option)) {
                 $tpl->assign('expand_all', true);
             }
             break;
     }
     // [JAS]: Translate Masks
     if (!is_numeric($id)) {
         $id = DAO_Ticket::getTicketIdByMask($id);
     }
     $ticket = DAO_Ticket::getTicket($id);
     if (empty($ticket)) {
         echo "<H1>" . $translate->_('display.invalid_ticket') . "</H1>";
         return;
     }
     // Permissions
     $active_worker_memberships = $active_worker->getMemberships();
     // Check group membership ACL
     if (!isset($active_worker_memberships[$ticket->team_id])) {
         echo "<H1>" . $translate->_('common.access_denied') . "</H1>";
         return;
     }
     $tpl->assign('ticket', $ticket);
     // TicketToolbarItem Extensions
     $ticketToolbarItems = DevblocksPlatform::getExtensions('cerberusweb.ticket.toolbaritem', true);
     if (!empty($ticketToolbarItems)) {
         $tpl->assign('ticket_toolbaritems', $ticketToolbarItems);
     }
     // Next+Prev: Does a series exist?
     if (null != ($series_info = $visit->get('ch_display_series', null))) {
         @($series = $series_info['series']);
         $cur = 1;
         $found = false;
         // Is this ID part of the series?  If not, invalidate
         if (is_array($series)) {
             while ($mask = current($series)) {
                 // Stop if we find it.
                 if ($mask == $ticket->mask) {
                     $found = true;
                     break;
                 }
                 next($series);
                 $cur++;
             }
         }
         if (!$found) {
             // not found
             $visit->set('ch_display_series', null);
         } else {
             // found
             $series_stats = array('title' => $series_info['title'], 'total' => $series_info['total'], 'count' => count($series));
             $series_stats['cur'] = $cur;
             if (false !== prev($series)) {
                 @($series_stats['prev'] = current($series));
                 next($series);
                 // skip to current
             } else {
                 reset($series);
             }
             next($series);
             // next
             @($series_stats['next'] = current($series));
             $tpl->assign('series_stats', $series_stats);
         }
     }
     $quick_search_type = $visit->get('quick_search_type');
     $tpl->assign('quick_search_type', $quick_search_type);
     // Comments [TODO] Eventually this can be cached on ticket.num_comments
     $comments_total = DAO_TicketComment::getCountByTicketId($id);
     $tpl->assign('comments_total', $comments_total);
     // Tasks Total [TODO] Eventually this can be ticket.num_tasks
     $tasks_total = DAO_Task::getCountBySourceObjectId('cerberusweb.tasks.ticket', $id);
     $tpl->assign('tasks_total', $tasks_total);
     $workers = DAO_Worker::getAll();
     $tpl->assign('workers', $workers);
     $teams = DAO_Group::getAll();
     $tpl->assign('teams', $teams);
     $team_categories = DAO_Bucket::getTeams();
     $tpl->assign('team_categories', $team_categories);
     // Log Activity
     DAO_Worker::logActivity($active_worker->id, new Model_Activity('activity.display_ticket', array(sprintf("<a href='%s' title='[%s] %s'>#%s</a>", $url->write("c=display&id=" . $ticket->mask), htmlspecialchars(@$teams[$ticket->team_id]->name, ENT_QUOTES, LANG_CHARSET_CODE), htmlspecialchars($ticket->subject, ENT_QUOTES, LANG_CHARSET_CODE), $ticket->mask))));
     $tpl->display('file:' . $this->_TPL_PATH . 'display/index.tpl');
 }
开发者ID:jsjohnst,项目名称:cerb4,代码行数:101,代码来源:display.php

示例5: writeResponse

 public function writeResponse(DevblocksHttpResponse $response)
 {
     /* @var $response DevblocksHttpResponse */
     $path = $response->path;
     $uri_prefix = array_shift($path);
     // should be mobile
     // [JAS]: Ajax? // [TODO] Explore outputting whitespace here for Safari
     //	    if(empty($path))
     //			return;
     $tpl = DevblocksPlatform::getTemplateService();
     $session = DevblocksPlatform::getSessionService();
     $settings = CerberusSettings::getInstance();
     $translate = DevblocksPlatform::getTranslationService();
     $visit = $session->getVisit();
     $controller = array_shift($path);
     $pages = DevblocksPlatform::getExtensions('cerberusweb.mobile.page', true);
     // Default page [TODO] This is supposed to come from framework.config.php
     if (empty($controller)) {
         $controller = 'tickets';
     }
     // [JAS]: Require us to always be logged in for Cerberus pages
     // [TODO] This should probably consult with the page itself for ::authenticated()
     if (empty($visit)) {
         $controller = 'login';
     }
     $page_id = $this->_getPageIdByUri($controller);
     /* @var $page CerberusPageExtension */
     @($page = $pages[$page_id]);
     if (empty($page)) {
         return;
     }
     // 404
     // [TODO] Reimplement
     if (!empty($visit) && !is_null($visit->getWorker())) {
         DAO_Worker::logActivity($visit->getWorker()->id, $page->getActivity());
     }
     // [JAS]: Listeners (Step-by-step guided tour, etc.)
     $listenerManifests = DevblocksPlatform::getExtensions('devblocks.listener.http');
     foreach ($listenerManifests as $listenerManifest) {
         /* @var $listenerManifest DevblocksExtensionManifest */
         $inst = $listenerManifest->createInstance();
         /* @var $inst DevblocksHttpRequestListenerExtension */
         $inst->run($response, $tpl);
     }
     // [JAS]: Pre-translate any dynamic strings
     $common_translated = array();
     if (!empty($visit) && !is_null($visit->getWorker())) {
         $common_translated['header_signed_in'] = vsprintf($translate->_('header.signed_in'), array('<b>' . $visit->getWorker()->getName() . '</b>'));
     }
     $tpl->assign('common_translated', $common_translated);
     //        $tour_enabled = false;
     //		if(!empty($visit) && !is_null($visit->getWorker())) {
     //        	$worker = $visit->getWorker();
     //			$tour_enabled = DAO_WorkerPref::get($worker->id, 'assist_mode');
     //			$tour_enabled = ($tour_enabled===false) ? 1 : $tour_enabled;
     //			if(DEMO_MODE) $tour_enabled = 1; // override for DEMO
     //		}
     //		$tpl->assign('tour_enabled', $tour_enabled);
     // [JAS]: Variables provided to all page templates
     $tpl->assign('settings', $settings);
     $tpl->assign('session', $_SESSION);
     $tpl->assign('translate', $translate);
     $tpl->assign('visit', $visit);
     $tpl->assign('license', CerberusLicense::getInstance());
     $active_worker = CerberusApplication::getActiveWorker();
     $tpl->assign('active_worker', $active_worker);
     if (!empty($active_worker)) {
         $active_worker_memberships = $active_worker->getMemberships();
         $tpl->assign('active_worker_memberships', $active_worker_memberships);
     }
     $tpl->assign('pages', $pages);
     $tpl->assign('page', $page);
     $tpl->assign('response_uri', implode('/', $response->path));
     $tpl_path = DEVBLOCKS_PLUGIN_PATH . 'cerberusweb.mobile/templates/';
     $tpl->assign('core_tpl', DEVBLOCKS_PLUGIN_PATH . 'cerberusweb.core/templates/');
     // Timings
     $tpl->assign('render_time', microtime(true) - DevblocksPlatform::getStartTime());
     if (function_exists('memory_get_usage') && function_exists('memory_get_peak_usage')) {
         $tpl->assign('render_memory', memory_get_usage() - DevblocksPlatform::getStartMemory());
         $tpl->assign('render_peak_memory', memory_get_peak_usage() - DevblocksPlatform::getStartPeakMemory());
     }
     $tpl->display($tpl_path . 'border.tpl');
 }
开发者ID:jsjohnst,项目名称:cerb4,代码行数:83,代码来源:classes.php

示例6: showSearchTabAction

 function showSearchTabAction()
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('path', $this->_TPL_PATH);
     //		$db = DevblocksPlatform::getDatabaseService();
     $visit = CerberusApplication::getVisit();
     $active_worker = CerberusApplication::getActiveWorker();
     // Log activity
     DAO_Worker::logActivity($active_worker->id, new Model_Activity('activity.mail.search'));
     // Remember the tab
     $visit->set(CerberusVisit::KEY_MAIL_MODE, 'search');
     // Request path
     //		@$request = DevblocksPlatform::importGPC($_REQUEST['request'],'string','');
     //		$response_path = explode('/', $request);
     //		@array_shift($response_path); // tickets
     //		@array_shift($response_path); // overview
     $tpl->assign('response_uri', 'tickets/search');
     $view = C4_AbstractViewLoader::getView(CerberusApplication::VIEW_SEARCH);
     if (null == $view) {
         $view = C4_TicketView::createSearchView();
         C4_AbstractViewLoader::setView($view->id, $view);
     }
     $tpl->assign('view', $view);
     $tpl->assign('params', $view->params);
     $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->assign('view_fields', C4_TicketView::getFields());
     $tpl->assign('view_searchable_fields', C4_TicketView::getSearchFields());
     $tpl->display('file:' . $this->_TPL_PATH . 'tickets/search/index.tpl');
 }
开发者ID:Hildy,项目名称:cerb5,代码行数:34,代码来源:tickets.php

示例7: signoffAction

 public function signoffAction()
 {
     $session = DevblocksPlatform::getSessionService();
     $visit = $session->getVisit();
     DAO_Worker::logActivity(new Model_Activity(null));
     $session->clear();
     //		DevblocksHttpResponse::
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('iphone', 'login')));
 }
开发者ID:sluther,项目名称:cerb5-iphone,代码行数:9,代码来源:App.php


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