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


PHP DateTimeField类代码示例

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


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

示例1: DoBeforeCreate

 protected function DoBeforeCreate()
 {
     $this->dataset = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."ods_lectura"');
     $field = new IntegerField('id_lectura', null, null, true);
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new IntegerField('id_persona');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, false);
     $field = new IntegerField('id_lugar');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, false);
     $field = new IntegerField('id_origen_lectura');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, false);
     $field = new DateTimeField('fe_fecha_lectura');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, false);
     $field = new StringField('no_usuario');
     $this->dataset->AddField($field, false);
     $field = new StringField('ds_usuario');
     $this->dataset->AddField($field, false);
     $field = new IntegerField('co_lector');
     $this->dataset->AddField($field, false);
     $field = new StringField('ds_observaciones');
     $this->dataset->AddField($field, false);
     $field = new IntegerField('id_carga');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, false);
     $this->dataset->AddLookupField('id_persona', 'public.ods_persona', new IntegerField('id_persona', null, null, true), new IntegerField('id_tipo_persona', 'id_persona_id_tipo_persona', 'id_persona_id_tipo_persona_public_ods_persona'), 'id_persona_id_tipo_persona_public_ods_persona');
     $this->dataset->AddLookupField('id_lugar', 'public.ods_lugar', new IntegerField('id_lugar', null, null, true), new StringField('co_lugar', 'id_lugar_co_lugar', 'id_lugar_co_lugar_public_ods_lugar'), 'id_lugar_co_lugar_public_ods_lugar');
     $this->dataset->AddLookupField('id_origen_lectura', 'public.ods_origen_lectura', new IntegerField('id_origen_lectura'), new StringField('co_origen_lectura', 'id_origen_lectura_co_origen_lectura', 'id_origen_lectura_co_origen_lectura_public_ods_origen_lectura'), 'id_origen_lectura_co_origen_lectura_public_ods_origen_lectura');
 }
开发者ID:jsrxar,项目名称:dto,代码行数:33,代码来源:lectura.php

示例2: getDBDateTimeValue

 /**
  * Function to get Date and Time value for Display
  * @param <type> $date
  * @return <String>
  */
 public static function getDBDateTimeValue($date)
 {
     global $log;
     $log->debug("Entering ./uitypes/Datetime.php::staticgetDBDateTimeValue");
     $date = new DateTimeField($date);
     return $date->getDBInsertDateTimeValue();
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:12,代码来源:Datetime.php

示例3: getRequestedToData

function getRequestedToData()
{
    $mail_data = array();
    $mail_data['user_id'] = $_REQUEST["task_assigned_user_id"];
    $mail_data['subject'] = $_REQUEST['task_subject'];
    $mail_data['status'] = $_REQUEST['activity_mode'] == 'Task' ? $_REQUEST['taskstatus'] : $_REQUEST['eventstatus'];
    $mail_data['activity_mode'] = $_REQUEST['activity_mode'];
    $mail_data['taskpriority'] = $_REQUEST['taskpriority'];
    $mail_data['relatedto'] = $_REQUEST['task_parent_name'];
    $mail_data['contact_name'] = $_REQUEST['task_contact_name'];
    $mail_data['description'] = $_REQUEST['task_description'];
    $mail_data['assign_type'] = $_REQUEST['task_assigntype'];
    $mail_data['group_name'] = getGroupName($_REQUEST['task_assigned_group_id']);
    $mail_data['mode'] = $_REQUEST['task_mode'];
    $startTime = $_REQUEST['task_time_start'];
    $date = new DateTimeField($_REQUEST['task_date_start'] . " " . $startTime);
    $endTime = $_REQUEST['task_time_end'];
    $endDate = new DateTimeField($_REQUEST['task_due_date'] . " " . $startTime);
    $startTime = $date->getDisplayTime();
    $endTime = $endDate->getDisplayTime();
    $value = getaddEventPopupTime($startTime, $endTime, '24');
    $start_hour = $value['starthour'] . ':' . $value['startmin'] . '' . $value['startfmt'];
    $mail_data['st_date_time'] = $date->getDisplayDateTimeValue();
    $mail_data['end_date_time'] = $endDate->getDisplayDate();
    return $mail_data;
}
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:26,代码来源:SaveTodo.php

示例4: getDisplayTimeValue

 /**
  * Function to get display value for time
  * @param <String> time
  * @return <String> time
  */
 public static function getDisplayTimeValue($time)
 {
     global $log;
     $log->debug("Entering ./uitypes/Time.php::staticgetDisplayTimeValue");
     $date = new DateTimeField($time);
     return $date->getDisplayTime();
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:12,代码来源:Time.php

示例5: getAuditTrailEntries

 /**
   * Function to get the Audit Trail Information values of the actions performed by a particular User.
   * @param integer $userid - User's ID
   * @param $navigation_array - Array values to navigate through the number of entries.
   * @param $sortorder - DESC
   * @param $orderby - actiondate
   * Returns the audit trail entries in an array format.
 **/
 function getAuditTrailEntries($userid, $navigation_array, $sorder = '', $orderby = '')
 {
     global $log;
     $log->debug("Entering getAuditTrailEntries(" . $userid . ") method ...");
     global $adb, $current_user;
     if ($sorder != '' && $order_by != '') {
         $list_query = "Select * from vtiger_audit_trial where userid =? order by " . $order_by . " " . $sorder;
     } else {
         $list_query = "Select * from vtiger_audit_trial where userid =? order by " . $this->default_order_by . " " . $this->default_sort_order;
     }
     $result = $adb->pquery($list_query, array($userid));
     $entries_list = array();
     if ($navigation_array['end_val'] != 0) {
         for ($i = $navigation_array['start']; $i <= $navigation_array['end_val']; $i++) {
             $entries = array();
             $userid = $adb->query_result($result, $i - 1, 'userid');
             $entries[] = getTranslatedString($adb->query_result($result, $i - 1, 'module'));
             $entries[] = $adb->query_result($result, $i - 1, 'action');
             $entries[] = $adb->query_result($result, $i - 1, 'recordid');
             $date = new DateTimeField($adb->query_result($result, $i - 1, 'actiondate'));
             $entries[] = $date->getDBInsertDateValue();
             $entries_list[] = $entries;
         }
         $log->debug("Exiting getAuditTrailEntries() method ...");
         return $entries_list;
     }
 }
开发者ID:sacredwebsite,项目名称:vtigercrm,代码行数:35,代码来源:AuditTrail.php

示例6: getEntity

 public function getEntity()
 {
     $db = PearDatabase::getInstance();
     $module = 'Calendar';
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $query = getListQuery($module);
     $params = array();
     if ($this->get('start') && $this->get('end')) {
         $dbStartDateOject = DateTimeField::convertToDBTimeZone($this->get('start'));
         $dbStartDateTime = $dbStartDateOject->format('Y-m-d H:i:s');
         $dbEndDateObject = DateTimeField::convertToDBTimeZone($this->get('end'));
         $dbEndDateTime = $dbEndDateObject->format('Y-m-d H:i:s');
         $query .= " AND (concat(date_start, ' ', time_start)  >= ? AND concat(due_date, ' ', time_end) <= ?) ";
         $params[] = $dbStartDateTime;
         $params[] = $dbEndDateTime;
     }
     if ($this->get('types')) {
         $query .= " AND vtiger_activity.activitytype IN ('" . implode("','", $this->get('types')) . "')";
     }
     if ($this->get('user')) {
         if (is_array($this->get('user'))) {
             $query .= ' AND vtiger_crmentity.smownerid IN (' . implode(",", $this->get('user')) . ')';
         } else {
             $query .= ' AND vtiger_crmentity.smownerid IN (' . $this->get('user') . ')';
         }
     }
     $query .= ' ORDER BY date_start,time_start ASC';
     $queryResult = $db->pquery($query, $params);
     $result = array();
     for ($i = 0; $i < $db->num_rows($queryResult); $i++) {
         $record = $db->raw_query_result_rowdata($queryResult, $i);
         $item = array();
         $crmid = $record['activityid'];
         $activitytype = $record['activitytype'];
         $item['id'] = $crmid;
         $item['title'] = $record['subject'];
         $item['url'] = 'index.php?module=' . $module . '&view=Detail&record=' . $crmid;
         $dateTimeFieldInstance = new DateTimeField($record['date_start'] . ' ' . $record['time_start']);
         $userDateTimeString = $dateTimeFieldInstance->getDisplayDateTimeValue($currentUser);
         $dateTimeComponents = explode(' ', $userDateTimeString);
         $dateComponent = $dateTimeComponents[0];
         $startTimeFormated = $dateTimeComponents[1];
         //Conveting the date format in to Y-m-d . since full calendar expects in the same format
         $startDateFormated = DateTimeField::__convertToDBFormat($dateComponent, $currentUser->get('date_format'));
         $dateTimeFieldInstance = new DateTimeField($record['due_date'] . ' ' . $record['time_end']);
         $userDateTimeString = $dateTimeFieldInstance->getDisplayDateTimeValue($currentUser);
         $dateTimeComponents = explode(' ', $userDateTimeString);
         $dateComponent = $dateTimeComponents[0];
         $endTimeFormated = $dateTimeComponents[1];
         //Conveting the date format in to Y-m-d . since full calendar expects in the same format
         $endDateFormated = DateTimeField::__convertToDBFormat($dateComponent, $currentUser->get('date_format'));
         $item['start'] = $startDateFormated . ' ' . $startTimeFormated;
         $item['end'] = $endDateFormated . ' ' . $endTimeFormated;
         $item['allDay'] = $record['allday'] == 1 ? true : false;
         $item['className'] = ' userCol_' . $record['smownerid'] . ' calCol_' . $activitytype;
         $result[] = $item;
     }
     return $result;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:59,代码来源:Calendar.php

示例7: DoBeforeCreate

 protected function DoBeforeCreate()
 {
     $this->dataset = new TableDataset(new SqlSrvConnectionFactory(), GetConnectionOptions(), '[dbo].[procesosbd]');
     $field = new IntegerField('Process ID');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new StringField('HostName');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new StringField('User');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new StringField('Database');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new StringField('Query');
     $this->dataset->AddField($field, true);
     $field = new StringField('Status');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new IntegerField('Open Transactions');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new StringField('Command');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new StringField('ApplicatiON');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new IntegerField('Wait Time');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new StringField('Wait Type');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new IntegerField('CPU');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new IntegerField('Physical IO');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new IntegerField('Memory Usage');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new DateTimeField('Login Time');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new DateTimeField('Last Batch');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new IntegerField('Blocked By');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new StringField('Blocked By Query');
     $this->dataset->AddField($field, true);
     $field = new IntegerField('Blocking');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
 }
开发者ID:jorgedison,项目名称:Audit-Database,代码行数:59,代码来源:Sesiones.php

示例8: DoBeforeCreate

 protected function DoBeforeCreate()
 {
     $selectQuery = 'SELECT task.task_name,
                       project.project_name,
                       timesheet.name,
                       timesheet.date,
                       timesheet.hours,
                       timesheet.staff_id,
                       pay_period.start_date,
                       pay_period.end_date,
                       pay_period.pay_period_number,
                       pay_period.YEAR,
                       staff.position,
                       staff.emp_number
         FROM timesheet
           LEFT JOIN task ON timesheet.task_id = task.task_id
           LEFT JOIN project ON task.project_id = project.project_id
           LEFT JOIN staff ON timesheet.staff_id = staff.staff_id
           LEFT JOIN pay_period ON timesheet.date BETWEEN pay_period.start_date AND pay_period.end_date';
     $insertQuery = array();
     $updateQuery = array();
     $deleteQuery = array();
     $this->dataset = new QueryDataset(new MyConnectionFactory(), GetConnectionOptions(), $selectQuery, $insertQuery, $updateQuery, $deleteQuery, 'View Pay Period');
     $field = new StringField('task_name');
     $this->dataset->AddField($field, false);
     $field = new StringField('project_name');
     $this->dataset->AddField($field, false);
     $field = new StringField('name');
     $this->dataset->AddField($field, false);
     $field = new DateField('date');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new StringField('hours');
     $this->dataset->AddField($field, true);
     $field = new IntegerField('staff_id');
     if (!$this->GetSecurityInfo()->AdminGrant()) {
         $field->SetReadOnly(true, GetApplication()->GetCurrentUserId());
     }
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new DateTimeField('start_date');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new DateTimeField('end_date');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new IntegerField('pay_period_number');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new IntegerField('YEAR');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new StringField('position');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
     $field = new StringField('emp_number');
     $field->SetIsNotNull(true);
     $this->dataset->AddField($field, true);
 }
开发者ID:BCDevExchange,项目名称:WORKPLAN,代码行数:59,代码来源:View_Pay_Period.php

示例9: getEntity

 public function getEntity()
 {
     $db = PearDatabase::getInstance();
     $module = 'Reservations';
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $query = getListQuery($module);
     $params = array();
     if ($this->get('start') && $this->get('end')) {
         $query .= ' AND vtiger_reservations.date_start >= ? AND vtiger_reservations.due_date <= ?';
         $params[] = $this->get('start');
         $params[] = $this->get('end');
     }
     if ($this->get('types')) {
         $query .= " AND vtiger_reservations.type IN ('" . implode("','", $this->get('types')) . "')";
     }
     if ($this->get('user')) {
         if (is_array($this->get('user'))) {
             $query .= ' AND vtiger_crmentity.smownerid IN (' . implode(",", $this->get('user')) . ')';
         } else {
             $query .= ' AND vtiger_crmentity.smownerid IN (' . $this->get('user') . ')';
         }
     }
     $instance = CRMEntity::getInstance($module);
     $securityParameter = $instance->getUserAccessConditionsQuerySR($module, $currentUser);
     if ($securityParameter != '') {
         $query .= ' AND ' . $securityParameter;
     }
     $query .= ' ORDER BY date_start,time_start ASC';
     $queryResult = $db->pquery($query, $params);
     $result = array();
     for ($i = 0; $i < $db->num_rows($queryResult); $i++) {
         $record = $db->raw_query_result_rowdata($queryResult, $i);
         $item = array();
         $crmid = $record['reservationsid'];
         $item['id'] = $crmid;
         $item['title'] = vtranslate($record['name'], $module);
         $item['url'] = 'index.php?module=Reservations&view=Detail&record=' . $crmid;
         $dateTimeFieldInstance = new DateTimeField($record['date_start'] . ' ' . $record['time_start']);
         $userDateTimeString = $dateTimeFieldInstance->getDisplayDateTimeValue($currentUser);
         $dateTimeComponents = explode(' ', $userDateTimeString);
         $dateComponent = $dateTimeComponents[0];
         //Conveting the date format in to Y-m-d . since full calendar expects in the same format
         $dataBaseDateFormatedString = DateTimeField::__convertToDBFormat($dateComponent, $currentUser->get('date_format'));
         $item['start'] = $dataBaseDateFormatedString . ' ' . $dateTimeComponents[1];
         $dateTimeFieldInstance = new DateTimeField($record['due_date'] . ' ' . $record['time_end']);
         $userDateTimeString = $dateTimeFieldInstance->getDisplayDateTimeValue($currentUser);
         $dateTimeComponents = explode(' ', $userDateTimeString);
         $dateComponent = $dateTimeComponents[0];
         //Conveting the date format in to Y-m-d . since full calendar expects in the same format
         $dataBaseDateFormatedString = DateTimeField::__convertToDBFormat($dateComponent, $currentUser->get('date_format'));
         $item['end'] = $dataBaseDateFormatedString . ' ' . $dateTimeComponents[1];
         $item['className'] = ' userCol_' . $record['smownerid'] . ' calCol_' . $record['type'];
         $result[] = $item;
     }
     return $result;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:56,代码来源:Calendar.php

示例10: getWidgetTimeControl

 public function getWidgetTimeControl($user, $time)
 {
     if (!$time) {
         return array();
     }
     $db = PearDatabase::getInstance();
     $param = array('OSSTimeControl', $user, $time['start'], $time['end']);
     $sql = "SELECT SUM(sum_time) AS daytime, due_date FROM vtiger_osstimecontrol\n\t\t\t\t\tINNER JOIN vtiger_crmentity ON vtiger_osstimecontrol.osstimecontrolid = vtiger_crmentity.crmid\n\t\t\t\t\tWHERE vtiger_crmentity.setype = ? AND vtiger_crmentity.smownerid = ? ";
     $sql .= "AND (vtiger_osstimecontrol.date_start >= ? AND vtiger_osstimecontrol.due_date <= ?) GROUP BY due_date";
     $result = $db->pquery($sql, $param);
     $data = array();
     $countDays = 0;
     $average = 0;
     for ($i = 0; $i < $db->num_rows($result); $i++) {
         $due_date = $db->query_result_raw($result, $i, 'due_date');
         $daytime = $db->query_result_raw($result, $i, 'daytime');
         $due_date = DateTimeField::convertToUserFormat($due_date);
         $data[] = array($daytime, $due_date);
         $countDays++;
         $average = $average + $daytime;
     }
     if ($average > 0) {
         $average = $average / $countDays;
     }
     return array('data' => $data, 'countDays' => $countDays, 'average' => number_format($average, 2, '.', ' '));
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:26,代码来源:Module.php

示例11: assignMessages

 public static function assignMessages($crmid, $viewer)
 {
     $chwmfkvuq = "current_user";
     $dpddjpchus = "row";
     ${"GLOBALS"}["pvcpgoobkx"] = "sql";
     ${"GLOBALS"}["dbjyloqr"] = "cu_model";
     ${$chwmfkvuq} = ${${"GLOBALS"}["dbjyloqr"]} = \Users_Record_Model::getCurrentUserModel();
     ${${"GLOBALS"}["gmbukkbbs"]} = \PearDatabase::getInstance();
     $twasrbuxi = "result";
     ${${"GLOBALS"}["uxfpyp"]} = "SELECT * FROM vtiger_wf_messages WHERE\n        (\n                (crmid = " . ${${"GLOBALS"}["podklxc"]} . " AND target = \"record\") OR\n                (crmid = " . $current_user->id . " AND target = \"user\")\n            )\n        AND (show_until =  \"0000-00-00 00:00:00\" OR show_until >= NOW())";
     ${${"GLOBALS"}["ciokylfx"]} = $adb->query(${${"GLOBALS"}["pvcpgoobkx"]});
     ${"GLOBALS"}["esusgmf"] = "sql";
     ${${"GLOBALS"}["hbelbc"]} = array();
     while (${$dpddjpchus} = $adb->fetchByAssoc(${$twasrbuxi})) {
         $wyoevilr = "row";
         ${"GLOBALS"}["wtiuxgl"] = "messages";
         ${"GLOBALS"}["txeedjxevu"] = "row";
         if (${$wyoevilr}["show_until"] != "0000-00-00 00:00:00") {
             $ticepvccqsn = "row";
             ${"GLOBALS"}["kemkeniiqmz"] = "row";
             ${${"GLOBALS"}["kemkeniiqmz"]}["show_until"] = getTranslatedString("LBL_VISIBLE_UNTIL", "Workflow2") . ": " . \DateTimeField::convertToUserFormat(${$ticepvccqsn}["show_until"]);
         } else {
             ${${"GLOBALS"}["wiurqquqjut"]}["show_until"] = "";
         }
         ${${"GLOBALS"}["wtiuxgl"]}[] = ${${"GLOBALS"}["txeedjxevu"]};
     }
     $viewer->assign("messages", ${${"GLOBALS"}["hbelbc"]});
     ${${"GLOBALS"}["esusgmf"]} = "DELETE FROM vtiger_wf_messages WHERE\n            (\n                (crmid = " . intval($_REQUEST["record"]) . " AND target = 'record') OR\n                (crmid = " . intval($current_user->id) . " AND target = 'user')\n            ) AND\n            (show_once = '1' OR (show_until != '0000-00-00 00:00:00' AND show_until < NOW()))";
     $adb->query(${${"GLOBALS"}["uxfpyp"]});
 }
开发者ID:cin-system,项目名称:vtigercrm-cin,代码行数:30,代码来源:Sidebar.php

示例12: save

 /**
  * Save date
  * @param <Object> $request
  * @return true if saved, false otherwise
  */
 public function save(Vtiger_Request $request)
 {
     $response = new Vtiger_Response();
     $moduleName = 'Settings:' . $request->getModule();
     try {
         $id = $request->get('holidayId');
         $date = DateTimeField::convertToDBFormat($request->get('holidayDate'));
         $name = $request->get('holidayName');
         $type = $request->get('holidayType');
         if (empty($name) || empty($date)) {
             $response->setResult(array('success' => false, 'message' => vtranslate('LBL_FILL_FORM_ERROR', $moduleName)));
         } else {
             if (!empty($id)) {
                 if (Settings_PublicHoliday_Module_Model::edit($id, $date, $name, $type)) {
                     $response->setResult(array('success' => true, 'message' => vtranslate('LBL_EDIT_DATE_OK', $moduleName)));
                 } else {
                     $response->setResult(array('success' => false, 'message' => vtranslate('LBL_EDIT_DATE_ERROR', $moduleName)));
                 }
             } else {
                 if (Settings_PublicHoliday_Module_Model::save($date, $name, $type)) {
                     $response->setResult(array('success' => true, 'message' => vtranslate('LBL_NEW_DATE_OK', $moduleName)));
                 } else {
                     $response->setResult(array('success' => false, 'message' => vtranslate('LBL_NEW_DATE_ERROR', $moduleName)));
                 }
             }
         }
     } catch (Exception $e) {
         $response->setError($e->getCode(), $e->getMessage());
     }
     $response->emit();
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:36,代码来源:Holiday.php

示例13: preProcess

 function preProcess(Vtiger_Request $request)
 {
     parent::preProcess($request);
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $recordId = $request->get('record');
     $page = $request->get('page');
     $detailViewModel = Reports_DetailView_Model::getInstance($moduleName, $recordId);
     $reportModel = $detailViewModel->getRecord();
     $reportModel->setModule('Reports');
     $pagingModel = new Vtiger_Paging_Model();
     $pagingModel->set('page', $page);
     $pagingModel->set('limit', self::REPORT_LIMIT);
     $this->reportData = $reportModel->getReportData($pagingModel);
     $this->calculationFields = $reportModel->getReportCalulationData();
     $primaryModule = $reportModel->getPrimaryModule();
     $secondaryModules = $reportModel->getSecondaryModules();
     $primaryModuleModel = Vtiger_Module_Model::getInstance($primaryModule);
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $userPrivilegesModel = Users_Privileges_Model::getInstanceById($currentUser->getId());
     $permission = $userPrivilegesModel->hasModulePermission($primaryModuleModel->getId());
     if (!$permission) {
         $viewer->assign('MODULE', $primaryModule);
         $viewer->assign('MESSAGE', 'LBL_PERMISSION_DENIED');
         $viewer->view('OperationNotPermitted.tpl', $primaryModule);
         exit;
     }
     $detailViewLinks = $detailViewModel->getDetailViewLinks();
     // Advanced filter conditions
     $viewer->assign('SELECTED_ADVANCED_FILTER_FIELDS', $reportModel->transformToNewAdvancedFilter());
     $viewer->assign('PRIMARY_MODULE', $primaryModule);
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($reportModel);
     $primaryModuleRecordStructure = $recordStructureInstance->getPrimaryModuleRecordStructure();
     $secondaryModuleRecordStructures = $recordStructureInstance->getSecondaryModuleRecordStructure();
     $viewer->assign('PRIMARY_MODULE_RECORD_STRUCTURE', $primaryModuleRecordStructure);
     $viewer->assign('SECONDARY_MODULE_RECORD_STRUCTURES', $secondaryModuleRecordStructures);
     $secondaryModuleIsCalendar = strpos($secondaryModules, 'Calendar');
     if ($primaryModule == 'Calendar' || $secondaryModuleIsCalendar !== FALSE) {
         $advanceFilterOpsByFieldType = Calendar_Field_Model::getAdvancedFilterOpsByFieldType();
     } else {
         $advanceFilterOpsByFieldType = Vtiger_Field_Model::getAdvancedFilterOpsByFieldType();
     }
     $viewer->assign('ADVANCED_FILTER_OPTIONS', Vtiger_Field_Model::getAdvancedFilterOptions());
     $viewer->assign('ADVANCED_FILTER_OPTIONS_BY_TYPE', $advanceFilterOpsByFieldType);
     $dateFilters = Vtiger_Field_Model::getDateFilterTypes();
     foreach ($dateFilters as $comparatorKey => $comparatorInfo) {
         $comparatorInfo['startdate'] = DateTimeField::convertToUserFormat($comparatorInfo['startdate']);
         $comparatorInfo['enddate'] = DateTimeField::convertToUserFormat($comparatorInfo['enddate']);
         $comparatorInfo['label'] = vtranslate($comparatorInfo['label'], $module);
         $dateFilters[$comparatorKey] = $comparatorInfo;
     }
     $viewer->assign('DATE_FILTERS', $dateFilters);
     $viewer->assign('LINEITEM_FIELD_IN_CALCULATION', $reportModel->showLineItemFieldsInFilter(false));
     $viewer->assign('DETAILVIEW_LINKS', $detailViewLinks);
     $viewer->assign('REPORT_MODEL', $reportModel);
     $viewer->assign('RECORD_ID', $recordId);
     $viewer->assign('COUNT', count($this->reportData));
     $viewer->assign('MODULE', $moduleName);
     $viewer->view('ReportHeader.tpl', $moduleName);
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:60,代码来源:Detail.php

示例14: process

 function process(Mobile_API_Request $request)
 {
     $response = new Mobile_API_Response();
     $username = $request->get('username');
     $password = $request->get('password');
     $current_user = CRMEntity::getInstance('Users');
     $current_user->column_fields['user_name'] = $username;
     if (vtlib_isModuleActive('Mobile') === false) {
         $response->setError(1501, 'Service not available');
         return $response;
     }
     if (!$current_user->doLogin($password)) {
         $response->setError(1210, 'Authentication Failed');
     } else {
         // Start session now
         $sessionid = Mobile_API_Session::init();
         if ($sessionid === false) {
             echo "Session init failed {$sessionid}\n";
         }
         $current_user->id = $current_user->retrieve_user_id($username);
         $current_user->retrieveCurrentUserInfoFromFile($current_user->id);
         $this->setActiveUser($current_user);
         $result = array();
         $result['login'] = array('userid' => $current_user->id, 'crm_tz' => DateTimeField::getDBTimeZone(), 'user_tz' => $current_user->time_zone, 'user_currency' => $current_user->currency_code, 'session' => $sessionid, 'vtiger_version' => Mobile_WS_Utils::getVtigerVersion(), 'date_format' => $current_user->date_format, 'mobile_module_version' => Mobile_WS_Utils::getVersion());
         $response->setResult($result);
         $this->postProcess($response);
     }
     return $response;
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:29,代码来源:Login.php

示例15: content_56962c9ceece3

    function content_56962c9ceece3($_smarty_tpl)
    {
        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getName() == 'date_start') {
            $_smarty_tpl->tpl_vars['DATE_FIELD'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value, null, 0);
            $_smarty_tpl->tpl_vars['MODULE_MODEL'] = new Smarty_variable($_smarty_tpl->tpl_vars['RECORD_STRUCTURE_MODEL']->value->getModule(), null, 0);
            $_smarty_tpl->tpl_vars['TIME_FIELD'] = new Smarty_variable($_smarty_tpl->tpl_vars['MODULE_MODEL']->value->getField('time_start'), null, 0);
        } elseif ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getName() == 'due_date') {
            $_smarty_tpl->tpl_vars['DATE_FIELD'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value, null, 0);
            $_smarty_tpl->tpl_vars['MODULE_MODEL'] = new Smarty_variable($_smarty_tpl->tpl_vars['RECORD_STRUCTURE_MODEL']->value->getModule(), null, 0);
            $_smarty_tpl->tpl_vars['TIME_FIELD'] = new Smarty_variable($_smarty_tpl->tpl_vars['MODULE_MODEL']->value->getField('time_end'), null, 0);
        }
        $_smarty_tpl->tpl_vars['DATE_TIME_VALUE'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue'), null, 0);
        $_smarty_tpl->tpl_vars['DATE_TIME_COMPONENTS'] = new Smarty_variable(explode(' ', $_smarty_tpl->tpl_vars['DATE_TIME_VALUE']->value), null, 0);
        $_smarty_tpl->tpl_vars['TIME_FIELD'] = new Smarty_variable($_smarty_tpl->tpl_vars['TIME_FIELD']->value->set('fieldvalue', $_smarty_tpl->tpl_vars['DATE_TIME_COMPONENTS']->value[1]), null, 0);
        $_smarty_tpl->tpl_vars['DATE_TIME_CONVERTED_VALUE'] = new Smarty_variable(DateTimeField::convertToUserTimeZone($_smarty_tpl->tpl_vars['DATE_TIME_VALUE']->value)->format('Y-m-d H:i:s'), null, 0);
        $_smarty_tpl->tpl_vars['DATE_TIME_COMPONENTS'] = new Smarty_variable(explode(' ', $_smarty_tpl->tpl_vars['DATE_TIME_CONVERTED_VALUE']->value), null, 0);
        $_smarty_tpl->tpl_vars['DATE_FIELD'] = new Smarty_variable($_smarty_tpl->tpl_vars['DATE_FIELD']->value->set('fieldvalue', $_smarty_tpl->tpl_vars['DATE_TIME_COMPONENTS']->value[0]), null, 0);
        ?>
<div><?php 
        echo $_smarty_tpl->getSubTemplate(vtemplate_path('uitypes/Date.tpl', $_smarty_tpl->tpl_vars['MODULE']->value), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array('BLOCK_FIELDS' => $_smarty_tpl->tpl_vars['BLOCK_FIELDS']->value, 'FIELD_MODEL' => $_smarty_tpl->tpl_vars['DATE_FIELD']->value), 0);
        ?>
</div><div><?php 
        echo $_smarty_tpl->getSubTemplate(vtemplate_path('uitypes/Time.tpl', $_smarty_tpl->tpl_vars['MODULE']->value), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array('BLOCK_FIELDS' => $_smarty_tpl->tpl_vars['BLOCK_FIELDS']->value, 'FIELD_MODEL' => $_smarty_tpl->tpl_vars['TIME_FIELD']->value), 0);
        ?>
</div><?php 
    }
开发者ID:cin-system,项目名称:vtigercrm-cin,代码行数:26,代码来源:723bb5c35df37d328bdfe6f87398c0fd610faee4.file.DateTime.tpl.php


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