Пример #1
0
 function isVisible()
 {
     // check login
     $visit = FegApplication::getVisit();
     if (empty($visit)) {
         return false;
     } else {
         return true;
     }
 }
Пример #2
0
 function render()
 {
     $active_worker = FegApplication::getActiveWorker();
     $visit = FegApplication::getVisit();
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('path', $this->_TPL_PATH);
     $response = DevblocksPlatform::getHttpResponse();
     $tpl->assign('request_path', implode('/', $response->path));
     // ====== Who's Online
     $whos_online = DAO_Worker::getAllOnline();
     if (!empty($whos_online)) {
         $tpl->assign('whos_online', $whos_online);
         $tpl->assign('whos_online_count', count($whos_online));
     }
     $tpl->display('file:' . $this->_TPL_PATH . 'stats/index.tpl');
 }
Пример #3
0
 function render()
 {
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('path', $this->_TPL_PATH);
     $active_worker = FegApplication::getActiveWorker();
     $visit = FegApplication::getVisit();
     $response = DevblocksPlatform::getHttpResponse();
     $translate = DevblocksPlatform::getTranslationService();
     $url = DevblocksPlatform::getUrlService();
     $stack = $response->path;
     @array_shift($stack);
     // customer
     @($customer_id = array_shift($stack));
     @($customer = DAO_CustomerAccount::get($customer_id));
     if (empty($customer)) {
         echo "<H1>" . $translate->_('customer.display.invalid_customer') . "</H1>";
         return;
     }
     $tpl->assign('customer_id', $customer_id);
     // Tabs
     $tab_manifests = DevblocksPlatform::getExtensions('feg.customer.tab', false);
     $tpl->assign('tab_manifests', $tab_manifests);
     @($tab_selected = array_shift($stack));
     if (empty($tab_selected)) {
         $tab_selected = 'property';
     }
     $tpl->assign('tab_selected', $tab_selected);
     switch ($tab_selected) {
         case 'property':
             @($tab_parm = array_shift($stack));
             break;
     }
     // ====== Who's Online
     $whos_online = DAO_Worker::getAllOnline();
     if (!empty($whos_online)) {
         $tpl->assign('whos_online', $whos_online);
         $tpl->assign('whos_online_count', count($whos_online));
     }
     $tpl->display('file:' . $this->_TPL_PATH . 'customer/index.tpl');
 }
Пример #4
0
 private static function _save()
 {
     // persist
     $visit = FegApplication::getVisit();
     $visit->set(self::VISIT_ABSTRACTVIEWS, self::$views);
 }
Пример #5
0
 function showTab()
 {
     $visit = FegApplication::getVisit();
     /* @var $visit CerberusVisit */
     $translate = DevblocksPlatform::getTranslationService();
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('path', $this->tpl_path);
     @($customer_id = DevblocksPlatform::importGPC($_REQUEST['customer_id'], 'integer', 0));
     $tpl->assign('customer_id', $customer_id);
     $defaults = new Feg_AbstractViewModel();
     $defaults->class_name = 'View_MessageAuditLog';
     $defaults->id = 'customer_audit_log';
     $defaults->renderLimit = 15;
     $defaults->view_columns = array(SearchFields_MessageAuditLog::CHANGE_DATE, SearchFields_MessageAuditLog::RECIPIENT_ID, SearchFields_MessageAuditLog::MESSAGE_ID, SearchFields_MessageAuditLog::MESSAGE_RECIPIENT_ID, SearchFields_MessageAuditLog::WORKER_ID, SearchFields_MessageAuditLog::CHANGE_FIELD, SearchFields_MessageAuditLog::CHANGE_VALUE);
     $defaults->renderSortBy = SearchFields_MessageAuditLog::CHANGE_DATE;
     $defaults->renderSortAsc = false;
     $defaults->params = array();
     $defaults->renderPage = 0;
     $view = Feg_AbstractViewLoader::getView($defaults->id, $defaults);
     $view->name = 'Customer Audit Log';
     $view->renderTemplate = 'default';
     $view->params = array(SearchFields_MessageAuditLog::ACCOUNT_ID => new DevblocksSearchCriteria(SearchFields_MessageAuditLog::ACCOUNT_ID, DevblocksSearchCriteria::OPER_EQ, $customer_id));
     $view->renderPage = 0;
     Feg_AbstractViewLoader::setView($view->id, $view);
     $tpl->assign('view', $view);
     $tpl->display('file:' . $this->tpl_path . '/display/log/index.tpl');
 }
Пример #6
0
 function showTabNotificationsAction()
 {
     $visit = FegApplication::getVisit();
     $translate = DevblocksPlatform::getTranslationService();
     $active_worker = FegApplication::getActiveWorker();
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->assign('path', $this->_TPL_PATH);
     // Select tab
     $visit->set(FegVisit::KEY_PREFERENCES_SELECTED_TAB, 'notifications');
     // My Notifications
     $myNotificationsView = Feg_AbstractViewLoader::getView(self::VIEW_MY_NOTIFICATIONS);
     $title = vsprintf($translate->_('preferences.my_notifications.view.title'), $active_worker->getName());
     if (null == $myNotificationsView) {
         $myNotificationsView = new View_WorkerEvent();
         $myNotificationsView->id = self::VIEW_MY_NOTIFICATIONS;
         $myNotificationsView->name = $title;
         $myNotificationsView->renderLimit = 25;
         $myNotificationsView->renderPage = 0;
         $myNotificationsView->renderSortBy = SearchFields_WorkerEvent::CREATED_DATE;
         $myNotificationsView->renderSortAsc = 0;
     }
     // Overload criteria
     $myNotificationsView->name = $title;
     $myNotificationsView->params = array(SearchFields_WorkerEvent::WORKER_ID => new DevblocksSearchCriteria(SearchFields_WorkerEvent::WORKER_ID, '=', $active_worker->id), SearchFields_WorkerEvent::IS_READ => new DevblocksSearchCriteria(SearchFields_WorkerEvent::IS_READ, '=', 0));
     /*
      * [TODO] This doesn't need to save every display, but it was possible to 
      * lose the params in the saved version of the view in the DB w/o recovery.
      * This should be moved back into the if(null==...) check in a later build.
      */
     Feg_AbstractViewLoader::setView($myNotificationsView->id, $myNotificationsView);
     $tpl->assign('view', $myNotificationsView);
     $tpl->display('file:' . $this->_TPL_PATH . 'preferences/tabs/my_notifications/index.tpl');
 }