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


PHP Vtiger_Functions::currentUserDisplayDate方法代码示例

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


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

示例1: process

 public function process(Vtiger_Request $request)
 {
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $loggedUserId = $currentUser->get('id');
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $linkId = $request->get('linkid');
     $user = $request->get('user');
     $time = $request->get('time');
     if ($time == NULL) {
         $time['start'] = date('Y-m-d', strtotime("-1 week"));
         $time['end'] = date("Y-m-d");
     } else {
         // date parameters passed, convert them to YYYY-mm-dd
         $time['start'] = Vtiger_Functions::currentUserDisplayDate($time['start']);
         $time['end'] = Vtiger_Functions::currentUserDisplayDate($time['end']);
     }
     if ($user == NULL) {
         $user = $loggedUserId;
     }
     $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
     $widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
     $selectedTimeTypes = $request->get('timeTypes');
     if ('' == $selectedTimeTypes) {
         $selectedTimeTypes = 'all';
     }
     $data = $moduleModel->getWidgetTimeControl($user, $time, $selectedTimeTypes);
     $listViewUrl = 'index.php?module=OSSTimeControl&view=List';
     for ($i = 0; $i < count($data['data']['days']); $i++) {
         $data['data'][$i]['links'] = $listViewUrl . $this->getSearchParams($user, $data['data']['days'][$i]);
     }
     $timeTypesPossibility = array('PLL_HOLIDAY_TIME' => 'holidayTime', 'PLL_BREAK_TIME' => 'breakTime', 'PLL_WORKING_TIME' => 'workTime');
     $viewer->assign('SELECTEDTIMETYPES', $selectedTimeTypes);
     $viewer->assign('TIMETYPEPOSSIBILITY', $timeTypesPossibility);
     $viewer->assign('CHARTEXIST', $data['chartExist']);
     $viewer->assign('TIMETYPESCOLORS', $data['colors']);
     $viewer->assign('WORKDAYS', $workDays);
     $viewer->assign('USERID', $user);
     $viewer->assign('DTIME', $time);
     $viewer->assign('DATA', $data['data']);
     $viewer->assign('WIDGET', $widget);
     $viewer->assign('MODULE_NAME', $moduleName);
     $viewer->assign('CURRENTUSER', $currentUser);
     $viewer->assign('LOGGEDUSERID', $loggedUserId);
     $content = $request->get('content');
     if (!empty($content)) {
         $viewer->view('dashboards/TimeControlContents.tpl', $moduleName);
     } else {
         $viewer->view('dashboards/TimeControl.tpl', $moduleName);
     }
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:51,代码来源:TimeControl.php

示例2: process

 public function process(Vtiger_Request $request)
 {
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $loggedUserId = $currentUser->get('id');
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $linkId = $request->get('linkid');
     $user = $request->get('user');
     $time = $request->get('time');
     if ($time == NULL) {
         $time['start'] = date('Y-m-d', strtotime("-1 week"));
         $time['end'] = date("Y-m-d");
     } else {
         // date parameters passed, convert them to YYYY-mm-dd
         $time['start'] = Vtiger_Functions::currentUserDisplayDate($time['start']);
         $time['end'] = Vtiger_Functions::currentUserDisplayDate($time['end']);
     }
     if ($user == NULL) {
         $user = $loggedUserId;
     }
     $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
     $widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
     $data = $this->getWidgetTimeControl($user, $time);
     $daysAmount = count($data['ticks']);
     $listViewUrl = 'index.php?module=OSSTimeControl&view=List';
     for ($i = 0; $i < $daysAmount; $i++) {
         $data['links'][$i][0] = $i;
         $data['links'][$i][1] = $listViewUrl . $this->getSearchParams($user, $data['days'][$i]);
     }
     $publicHolidays = Settings_PublicHoliday_Module_Model::getHolidayGroupType([$time['start'], $time['end']]);
     if ($publicHolidays) {
         foreach ($publicHolidays as $key => $value) {
             $upperCase = strtoupper($key);
             $viewer->assign($upperCase, $value);
         }
     }
     $TCPModuleModel = Settings_TimeControlProcesses_Module_Model::getCleanInstance();
     $viewer->assign('TCPMODULE_MODEL', $TCPModuleModel->getConfigInstance());
     $viewer->assign('USERID', $user);
     $viewer->assign('DTIME', $time);
     $viewer->assign('WORKDAYS', $data['workDays']);
     $viewer->assign('WORKEDDAYS', $data['daysWorked']);
     $viewer->assign('HOLIDAYDAYS', $data['holiayDays']);
     $viewer->assign('AVERAGEBREAKTIME', $data['sumBreakTime']);
     $viewer->assign('WORKINGDAYS', $data['workingDays']);
     $viewer->assign('WEEKENDDAYS', $data['weekends']);
     $viewer->assign('AVERAGEWORKTIME', $data['averageWorkingTime']);
     $viewer->assign('ALLDAYS', $data['allDays']);
     $viewer->assign('DATA', $data);
     $viewer->assign('WIDGET', $widget);
     $viewer->assign('MODULE_NAME', $moduleName);
     $viewer->assign('CURRENTUSER', $currentUser);
     $viewer->assign('LOGGEDUSERID', $loggedUserId);
     $content = $request->get('content');
     if (!empty($content)) {
         $viewer->view('dashboards/TimeControlContents.tpl', $moduleName);
     } else {
         $viewer->view('dashboards/TimeControl.tpl', $moduleName);
     }
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:60,代码来源:TimeControl.php

示例3: getValidDisplayDate

function getValidDisplayDate($cur_date_val)
{
    return Vtiger_Functions::currentUserDisplayDate($cur_date_val);
}
开发者ID:jmangarret,项目名称:vtigercrm,代码行数:4,代码来源:CommonUtils.php


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