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


PHP DateTimeField::convertToDBTimeZone方法代码示例

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


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

示例1: 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

示例2: beforeSave

 public function beforeSave(&$values)
 {
     global $adb, $vtiger_current_version;
     if (version_compare($vtiger_current_version, '5.3.0', '>=')) {
         foreach ($values["setter"] as $key => $field) {
             // I have to respect Users timezone
             if (strpos($field["value"], "\$") === false && ($field["field"] == "time_start" || $field["field"] == "time_end")) {
                 $date = DateTimeField::convertToDBTimeZone(date("Y-m-d") . " " . $field["value"]);
                 $values["setter"][$key]["value"] = date("H:i", $date->format('U'));
             }
         }
     }
 }
开发者ID:cin-system,项目名称:vtigercrm-cin,代码行数:13,代码来源:WfTaskTaskCreator.php

示例3: updateEvent

 public function updateEvent(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $recordId = $request->get('id');
     $actionname = 'EditView';
     if (isPermitted($moduleName, $actionname, $recordId) === 'no') {
         $succes = false;
     } else {
         $delta = $request->get('delta');
         $start = DateTimeField::convertToDBTimeZone($request->get('start'));
         $date_start = $start->format('Y-m-d');
         $time_start = $start->format('H:i:s');
         $succes = false;
         if (!empty($recordId)) {
             try {
                 $recordModel = Vtiger_Record_Model::getInstanceById($recordId, $moduleName);
                 $recordData = $recordModel->entity->column_fields;
                 $end = self::changeDateTime($recordData['due_date'] . ' ' . $recordData['time_end'], $delta);
                 $due_date = $end['date'];
                 $time_end = $end['time'];
                 $recordModel->set('id', $recordId);
                 $recordModel->set('mode', 'edit');
                 $recordModel->set('date_start', $date_start);
                 $recordModel->set('due_date', $due_date);
                 if ($request->get('allDay') == 'true') {
                     $recordModel->set('allday', 1);
                     $start = self::changeDateTime($recordData['date_start'] . ' ' . $recordData['time_start'], $delta);
                     $recordModel->set('date_start', $start['date']);
                 } else {
                     $recordModel->set('time_start', $time_start);
                     $recordModel->set('time_end', $time_end);
                     $recordModel->set('allday', 0);
                 }
                 $recordModel->save();
                 $succes = true;
             } catch (Exception $e) {
                 $succes = false;
             }
         }
     }
     $response = new Vtiger_Response();
     $response->setResult($succes);
     $response->emit();
 }
开发者ID:noclav,项目名称:UpdatePackages,代码行数:44,代码来源:Calendar.php

示例4: process

 public function process(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $record = $request->get('record');
     if (!empty($record) && $request->get('isDuplicate') == true) {
         $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName);
         $viewer->assign('MODE', '');
         $recordModel->set('id', '');
         //While Duplicating record, If the related record is deleted then we are removing related record info in record model
         $mandatoryFieldModels = $recordModel->getModule()->getMandatoryFieldModels();
         foreach ($mandatoryFieldModels as $fieldModel) {
             if ($fieldModel->isReferenceField()) {
                 $fieldName = $fieldModel->get('name');
                 if (Vtiger_Util_Helper::checkRecordExistance($recordModel->get($fieldName))) {
                     $recordModel->set($fieldName, '');
                 }
             }
         }
     } else {
         if (!empty($record)) {
             $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName);
             $viewer->assign('RECORD_ID', $record);
             $viewer->assign('MODE', 'edit');
         } else {
             $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
             $referenceId = $request->get('reference_id');
             if ($referenceId) {
                 $parentRecordModel = Vtiger_Record_Model::getInstanceById($referenceId);
                 $recordModel->setRecordFieldValues($parentRecordModel);
             }
             $viewer->assign('MODE', '');
         }
     }
     if (!$this->record) {
         $this->record = $recordModel;
     }
     $moduleModel = $recordModel->getModule();
     $fieldList = $moduleModel->getFields();
     $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
     foreach ($requestFieldList as $fieldName => $fieldValue) {
         $fieldModel = $fieldList[$fieldName];
         $specialField = false;
         // We collate date and time part together in the EditView UI handling
         // so a bit of special treatment is required if we come from QuickCreate
         if ($moduleName == 'Calendar' && empty($record) && $fieldName == 'time_start' && !empty($fieldValue)) {
             $specialField = true;
             // Convert the incoming user-picked time to GMT time
             // which will get re-translated based on user-time zone on EditForm
             $fieldValue = DateTimeField::convertToDBTimeZone($fieldValue)->format("H:i");
         }
         if ($moduleName == 'Calendar' && empty($record) && $fieldName == 'date_start' && !empty($fieldValue)) {
             $startTime = Vtiger_Time_UIType::getTimeValueWithSeconds($requestFieldList['time_start']);
             $startDateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($fieldValue . " " . $startTime);
             list($startDate, $startTime) = explode(' ', $startDateTime);
             $fieldValue = Vtiger_Date_UIType::getDisplayDateValue($startDate);
         }
         if ($fieldModel->isEditable() || $specialField) {
             $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
         }
     }
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT);
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $mappingRelatedField = $moduleModel->getMappingRelatedField($moduleName);
     $viewer->assign('MAPPING_RELATED_FIELD', Zend_Json::encode($mappingRelatedField));
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('MODULE_TYPE', $moduleModel->getModuleType());
     $viewer->assign('RECORD', $recordModel);
     $viewer->assign('BLOCK_LIST', $moduleModel->getBlocks());
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('APIADDRESS', Settings_ApiAddress_Module_Model::getInstance('Settings:ApiAddress')->getConfig());
     $viewer->assign('APIADDRESS_ACTIVE', Settings_ApiAddress_Module_Model::isActive());
     $isRelationOperation = $request->get('relationOperation');
     //if it is relation edit
     $viewer->assign('IS_RELATION_OPERATION', $isRelationOperation);
     if ($isRelationOperation) {
         $viewer->assign('SOURCE_MODULE', $request->get('sourceModule'));
         $viewer->assign('SOURCE_RECORD', $request->get('sourceRecord'));
     }
     $viewer->assign('MAX_UPLOAD_LIMIT_MB', Vtiger_Util_Helper::getMaxUploadSize());
     $viewer->assign('MAX_UPLOAD_LIMIT', vglobal('upload_maxsize'));
     $viewer->view('EditView.tpl', $moduleName);
 }
开发者ID:nikdejan,项目名称:YetiForceCRM,代码行数:87,代码来源:Edit.php

示例5: 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')) {
         $dbStartDateOject = DateTimeField::convertToDBTimeZone($this->get('start'), $currentUser, false);
         $dbStartDateTime = $dbStartDateOject->format('Y-m-d H:i:s');
         $dbStartDate = $dbStartDateOject->format('Y-m-d');
         $dbEndDateObject = DateTimeField::convertToDBTimeZone($this->get('end'), $currentUser, false);
         $dbEndDateTime = $dbEndDateObject->format('Y-m-d H:i:s');
         $dbEndDate = $dbEndDateObject->format('Y-m-d');
         $query .= " AND ((concat(vtiger_reservations.date_start, ' ', vtiger_reservations.time_start) >= ? AND concat(vtiger_reservations.date_start, ' ', vtiger_reservations.time_start) <= ?) OR (concat(vtiger_reservations.due_date, ' ', vtiger_reservations.time_end) >= ? AND concat(vtiger_reservations.due_date, ' ', vtiger_reservations.time_end) <= ?) OR (vtiger_reservations.date_start < ? AND vtiger_reservations.due_date > ?) )";
         $params[] = $dbStartDateTime;
         $params[] = $dbEndDateTime;
         $params[] = $dbStartDateTime;
         $params[] = $dbEndDateTime;
         $params[] = $dbStartDate;
         $params[] = $dbEndDate;
     }
     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 .= $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'] = $record['title'];
         $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:yozhi,项目名称:YetiForceCRM,代码行数:66,代码来源:Calendar.php

示例6: fromUserRequest

 public static function fromUserRequest($requestArray)
 {
     // All the information from the user is received in User Time zone
     // Convert Start date and Time to DB Time zone
     $startDateObj = DateTimeField::convertToDBTimeZone($requestArray["startdate"] . ' ' . $requestArray['starttime']);
     $requestArray['startdate'] = $startDate = $startDateObj->format('Y-m-d');
     $requestArray['starttime'] = $startTime = $startDateObj->format('H:i');
     $endDateObj = DateTimeField::convertToDBTimeZone($requestArray["enddate"] . ' ' . $requestArray['endtime']);
     $requestArray['enddate'] = $endDate = $endDateObj->format('Y-m-d');
     $requestArray['endtime'] = $endTime = $endDateObj->format('H:i');
     if (!empty($requestArray["recurringenddate"])) {
         $reccurringDateObj = DateTimeField::convertToDBTimeZone($requestArray["recurringenddate"] . ' ' . $requestArray['endtime']);
         $requestArray['recurringenddate'] = $reccurringDateObj->format('Y-m-d');
     }
     if ($requestArray['sun_flag']) {
         $requestArray['dayofweek_to_repeat'][] = 0;
     }
     if ($requestArray['mon_flag']) {
         $requestArray['dayofweek_to_repeat'][] = 1;
     }
     if ($requestArray['tue_flag']) {
         $requestArray['dayofweek_to_repeat'][] = 2;
     }
     if ($requestArray['wed_flag']) {
         $requestArray['dayofweek_to_repeat'][] = 3;
     }
     if ($requestArray['thu_flag']) {
         $requestArray['dayofweek_to_repeat'][] = 4;
     }
     if ($requestArray['fri_flag']) {
         $requestArray['dayofweek_to_repeat'][] = 5;
     }
     if ($requestArray['sat_flag']) {
         $requestArray['dayofweek_to_repeat'][] = 6;
     }
     if ($requestArray['type'] == 'Weekly') {
         if ($requestArray['dayofweek_to_repeat'] != null) {
             $userStartDateTime = DateTimeField::convertToUserTimeZone($startDate . ' ' . $startTime);
             $dayOfWeek = $requestArray['dayofweek_to_repeat'];
             $dbDaysOfWeek = array();
             for ($i = 0; $i < count($dayOfWeek); ++$i) {
                 $selectedDayOfWeek = $dayOfWeek[$i];
                 $currentDayOfWeek = $userStartDateTime->format('w');
                 $newDate = $userStartDateTime->format('d') + ($selectedDayOfWeek - $currentDayOfWeek);
                 $userStartDateTime->setDate($userStartDateTime->format('Y'), $userStartDateTime->format('m'), $newDate);
                 $dbDaysOfWeek[] = $userStartDateTime->format('w');
             }
             $requestArray['dayofweek_to_repeat'] = $dbDaysOfWeek;
         }
     } elseif ($requestArray['type'] == 'Monthly') {
         $userStartDateTime = DateTimeField::convertToUserTimeZone($startDate . ' ' . $startTime);
         if ($requestArray['repeatmonth_type'] == 'date') {
             $dayOfMonth = $requestArray['repeatmonth_date'];
             $userStartDateTime->setDate($userStartDateTime->format('Y'), $userStartDateTime->format('m'), $dayOfMonth);
             $userStartDateTime->setTimezone(new DateTimeZone(DateTimeField::getDBTimeZone()));
             $requestArray['repeatmonth_date'] = $userStartDateTime->format('d');
         } else {
             $dayOfWeek = $requestArray['dayofweek_to_repeat'][0];
             if ($requestArray['repeatmonth_daytype'] == 'first') {
                 $userStartDateTime->setDate($userStartDateTime->format('Y'), $userStartDateTime->format('m'), 1);
                 $dayOfWeekForFirstDay = $userStartDateTime->format('N');
                 if ($dayOfWeekForFirstDay < $dayOfWeek) {
                     $date = $dayOfWeek - $dayOfWeekForFirstDay + 1;
                 } else {
                     $date = 7 - $dayOfWeekForFirstDay + $dayOfWeek + 1;
                 }
             } elseif ($requestArray['repeatmonth_daytype'] == 'last') {
                 $daysInMonth = $userStartDateTime->format('t');
                 $userStartDateTime->setDate($userStartDateTime->format('Y'), $userStartDateTime->format('m'), $daysInMonth);
                 $dayOfWeekForLastDay = $userStartDateTime->format('N');
                 if ($dayOfWeekForLastDay < $dayOfWeek) {
                     $date = $daysInMonth - 7 + ($dayOfWeek - $dayOfWeekForLastDay);
                 } else {
                     $date = $daysInMonth - ($dayOfWeekForLastDay - $dayOfWeek);
                 }
             }
             $userStartDateTime->setDate($userStartDateTime->format('Y'), $userStartDateTime->format('m'), $date);
             $userStartDateTime->setTimezone(new DateTimeZone(DateTimeField::getDBTimeZone()));
             $requestArray['dayofweek_to_repeat'][0] = (int) $userStartDateTime->format('N') % 7;
         }
     }
     return new RecurringType($requestArray);
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:83,代码来源:RecurringType.php

示例7: getDBTimeFromUserValue

 public function getDBTimeFromUserValue($value)
 {
     $time = DateTimeField::convertToDBTimeZone(date(DateTimeField::getPHPDateFormat()) . ' ' . $value);
     $value = $time->format('H:i:s');
     return $value;
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:6,代码来源:Time.php

示例8: getEntityCount

 public function getEntityCount()
 {
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $db = PearDatabase::getInstance();
     $startDate = DateTimeField::convertToDBTimeZone($this->get('start'));
     $startDate = strtotime($startDate->format('Y-m-d H:i:s'));
     $endDate = DateTimeField::convertToDBTimeZone($this->get('end'));
     $endDate = strtotime($endDate->format('Y-m-d H:i:s'));
     $data = $this->getQuery();
     $result = $db->pquery($data['query'], $data['params']);
     $return = [];
     while ($record = $db->fetch_array($result)) {
         $crmid = $record['activityid'];
         $activitytype = $record['activitytype'];
         $dateTimeFieldInstance = new DateTimeField($record['date_start'] . ' ' . $record['time_start']);
         $userDateTimeString = $dateTimeFieldInstance->getDisplayDateTimeValue($currentUser);
         $dateTimeComponents = explode(' ', $userDateTimeString);
         $dateComponent = $dateTimeComponents[0];
         $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];
         $endDateFormated = DateTimeField::__convertToDBFormat($dateComponent, $currentUser->get('date_format'));
         $begin = new DateTime($startDateFormated);
         $end = new DateTime($endDateFormated);
         $end->modify('+1 day');
         $interval = DateInterval::createFromDateString('1 day');
         foreach (new DatePeriod($begin, $interval, $end) as $dt) {
             $date = strtotime($dt->format('Y-m-d'));
             if ($date >= $startDate && $date <= $endDate) {
                 $date = date('Y-m-d', $date);
                 $return[$date]['start'] = $date;
                 $return[$date]['date'] = $date;
                 $return[$date]['event'][$activitytype]['count'] += 1;
                 $return[$date]['event'][$activitytype]['className'] = '  fc-draggable calCol_' . $activitytype;
                 $return[$date]['event'][$activitytype]['label'] = vtranslate($activitytype, $this->getModuleName());
                 $return[$date]['type'] = 'widget';
             }
         }
     }
     return array_values($return);
 }
开发者ID:noclav,项目名称:UpdatePackages,代码行数:43,代码来源:Calendar.php

示例9: AddMessageToContact

function AddMessageToContact($username, $session, $contactid, $msgdtls)
{
    if (!validateSession($username, $session)) {
        return null;
    }
    global $current_user, $adb;
    require_once 'modules/Users/Users.php';
    require_once 'modules/Emails/Emails.php';
    $current_user = new Users();
    $user_id = $current_user->retrieve_user_id($username);
    $query = "select email1 from vtiger_users where id = ?";
    $result = $adb->pquery($query, array($user_id));
    $user_emailid = $adb->query_result($result, 0, "email1");
    $current_user = $current_user->retrieveCurrentUserInfoFromFile($user_id);
    foreach ($msgdtls as $msgdtl) {
        if (isset($msgdtl)) {
            $email = new Emails();
            //$log->debug($msgdtls['contactid']);
            $email_body = str_replace("'", "''", $msgdtl['body']);
            $email_body = str_replace('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">', " ", $email_body);
            $email_subject = str_replace("'", "''", $msgdtl['subject']);
            $date_sent = DateTimeField::convertToDBTimeZone($msgdtl['datesent']);
            $date_sent = $sent_date->format("Y-m-d");
            $email->column_fields['subject'] = $email_subject;
            $email->column_fields['assigned_user_id'] = $user_id;
            $email->column_fields['date_start'] = $date_sent;
            $email->column_fields['description'] = $email_body;
            $email->column_fields['activitytype'] = 'Emails';
            $email->column_fields['email_flag'] = 'SENT';
            $email->plugin_save = true;
            $email->save("Emails");
            $query = "select fieldid from vtiger_field where fieldname = 'email' and tabid = 4 and vtiger_field.presence in (0,2)";
            $result = $adb->pquery($query, array());
            $field_id = $adb->query_result($result, 0, "fieldid");
            $email->set_emails_se_invitee_relationship($email->id, $contactid);
            // crm-now, doesn't seem to be needed for this case at all
            // $email->set_emails_contact_invitee_relationship($email->id,$contactid);
            // $email->set_emails_user_invitee_relationship($email->id,$user_id);
            return $email->id;
        } else {
            return "";
        }
    }
}
开发者ID:kduqi,项目名称:corebos,代码行数:44,代码来源:vtigerolservice.php

示例10: array

} else {
    $timeFields = array('time_start', 'time_end');
    $tabId = getTabid($tab_type);
    foreach ($focus->column_fields as $fieldname => $val) {
        $fieldInfo = getFieldRelatedInfo($tabId, $fieldname);
        $uitype = $fieldInfo['uitype'];
        $typeofdata = $fieldInfo['typeofdata'];
        if (isset($_REQUEST[$fieldname])) {
            if (is_array($_REQUEST[$fieldname])) {
                $value = $_REQUEST[$fieldname];
            } else {
                $value = trim($_REQUEST[$fieldname]);
            }
            if (($typeofdata == 'T~M' || $typeofdata == 'T~O') && ($uitype == 2 || $uitype == 70)) {
                if (!in_array($fieldname, $timeFields)) {
                    $date = DateTimeField::convertToDBTimeZone($value);
                    $value = $date->format('H:i');
                }
                $focus->column_fields[$fieldname] = $value;
            } else {
                $focus->column_fields[$fieldname] = $value;
            }
            if ($fieldname == 'notime' && $focus->column_fields[$fieldname]) {
                $focus->column_fields['time_start'] = '';
                $focus->column_fields['duration_hours'] = '';
                $focus->column_fields['duration_minutes'] = '';
            }
            if ($fieldname == 'recurringtype' && !isset($_REQUEST['recurringcheck'])) {
                $focus->column_fields['recurringtype'] = '--None--';
            }
        }
开发者ID:mslokhat,项目名称:corebos,代码行数:31,代码来源:Save.php

示例11: pullEvents

 protected function pullEvents($start, $end, &$result, $userid = false, $color = null, $textColor = 'white')
 {
     $dbStartDateOject = DateTimeField::convertToDBTimeZone($start);
     $dbStartDateTime = $dbStartDateOject->format('Y-m-d H:i:s');
     $dbStartDateTimeComponents = explode(' ', $dbStartDateTime);
     $dbStartDate = $dbStartDateTimeComponents[0];
     $dbEndDateObject = DateTimeField::convertToDBTimeZone($end);
     $dbEndDateTime = $dbEndDateObject->format('Y-m-d H:i:s');
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $db = PearDatabase::getInstance();
     $moduleModel = Vtiger_Module_Model::getInstance('Events');
     if ($userid) {
         $focus = new Users();
         $focus->id = $userid;
         $focus->retrieve_entity_info($userid, 'Users');
         $user = Users_Record_Model::getInstanceFromUserObject($focus);
         $userName = $user->getName();
         $queryGenerator = new QueryGenerator($moduleModel->get('name'), $user);
     } else {
         $queryGenerator = new QueryGenerator($moduleModel->get('name'), $currentUser);
     }
     $queryGenerator->setFields(array('subject', 'eventstatus', 'visibility', 'date_start', 'time_start', 'due_date', 'time_end', 'assigned_user_id', 'id', 'activitytype'));
     $query = $queryGenerator->getQuery();
     $query .= " AND vtiger_activity.activitytype NOT IN ('Emails','Task') AND ";
     $hideCompleted = $currentUser->get('hidecompletedevents');
     if ($hideCompleted) {
         $query .= "vtiger_activity.eventstatus != 'HELD' AND ";
     }
     $query .= " ((concat(date_start, '', time_start)  >= '{$dbStartDateTime}' AND concat(due_date, '', time_end) < '{$dbEndDateTime}') OR ( due_date >= '{$dbStartDate}'))";
     $params = array();
     if (empty($userid)) {
         $eventUserId = $currentUser->getId();
     } else {
         $eventUserId = $userid;
     }
     $params = array_merge(array($eventUserId), $this->getGroupsIdsForUsers($eventUserId));
     $query .= " AND vtiger_crmentity.smownerid IN (" . generateQuestionMarks($params) . ")";
     $queryResult = $db->pquery($query, $params);
     while ($record = $db->fetchByAssoc($queryResult)) {
         $item = array();
         $crmid = $record['activityid'];
         $visibility = $record['visibility'];
         $activitytype = $record['activitytype'];
         $status = $record['eventstatus'];
         $item['id'] = $crmid;
         $item['visibility'] = $visibility;
         $item['activitytype'] = $activitytype;
         $item['status'] = $status;
         if (!$currentUser->isAdminUser() && $visibility == 'Private' && $userid && $userid != $currentUser->getId()) {
             $item['title'] = decode_html($userName) . ' - ' . decode_html(vtranslate('Busy', 'Events')) . '*';
             $item['url'] = '';
         } else {
             $item['title'] = decode_html($record['subject']) . ' - (' . decode_html(vtranslate($record['eventstatus'], 'Calendar')) . ')';
             $item['url'] = sprintf('index.php?module=Calendar&view=Detail&record=%s', $crmid);
         }
         $dateTimeFieldInstance = new DateTimeField($record['date_start'] . ' ' . $record['time_start']);
         $userDateTimeString = $dateTimeFieldInstance->getFullcalenderDateTimevalue($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->getFullcalenderDateTimevalue($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'] = $cssClass;
         $item['allDay'] = false;
         $item['color'] = $color;
         $item['textColor'] = $textColor;
         $item['module'] = $moduleModel->getName();
         $result[] = $item;
     }
 }
开发者ID:lsmonki,项目名称:vtigercrm,代码行数:77,代码来源:Feed.php

示例12: process

 public function process(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $record = $request->get('record');
     if (!empty($record) && $request->get('isDuplicate') == true) {
         $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName);
         $viewer->assign('MODE', '');
         //While Duplicating record, If the related record is deleted then we are removing related record info in record model
         $mandatoryFieldModels = $recordModel->getModule()->getMandatoryFieldModels();
         foreach ($mandatoryFieldModels as $fieldModel) {
             if ($fieldModel->isReferenceField()) {
                 $fieldName = $fieldModel->get('name');
                 if (Vtiger_Util_Helper::checkRecordExistance($recordModel->get($fieldName))) {
                     $recordModel->set($fieldName, '');
                 }
             }
         }
     } else {
         if (!empty($record)) {
             $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName);
             $viewer->assign('RECORD_ID', $record);
             $viewer->assign('MODE', 'edit');
         } else {
             $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
             $viewer->assign('MODE', '');
         }
     }
     if (!$this->record) {
         $this->record = $recordModel;
     }
     $moduleModel = $recordModel->getModule();
     $fieldList = $moduleModel->getFields();
     $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
     foreach ($requestFieldList as $fieldName => $fieldValue) {
         $fieldModel = $fieldList[$fieldName];
         $specialField = false;
         // We collate date and time part together in the EditView UI handling
         // so a bit of special treatment is required if we come from QuickCreate
         if ($moduleName == 'Calendar' && empty($record) && $fieldName == 'time_start' && !empty($fieldValue)) {
             $specialField = true;
             // Convert the incoming user-picked time to GMT time
             // which will get re-translated based on user-time zone on EditForm
             $fieldValue = DateTimeField::convertToDBTimeZone($fieldValue)->format("H:i");
         }
         if ($moduleName == 'Calendar' && empty($record) && $fieldName == 'date_start' && !empty($fieldValue)) {
             $startTime = Vtiger_Time_UIType::getTimeValueWithSeconds($requestFieldList['time_start']);
             $startDateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($fieldValue . " " . $startTime);
             list($startDate, $startTime) = explode(' ', $startDateTime);
             $fieldValue = Vtiger_Date_UIType::getDisplayDateValue($startDate);
         }
         if ($fieldModel->isEditable() || $specialField) {
             $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
         }
     }
     // SalesPlatform.ru begin Unifying method for EditView preparing
     $recordModel = prepareEditView($recordModel, $_REQUEST, $viewer);
     // SalesPlatform.ru end
     // SalesPlatform.ru begin Set company
     if ($request->get('relationOperation')) {
         $sourceRecordModel = Vtiger_Record_Model::getInstanceById($request->get('sourceRecord'));
         if ($sourceRecordModel->get('spcompany') != null && $sourceRecordModel->get('spcompany') != '') {
             if ($recordModel->getField('spcompany')) {
                 $recordModel->set('spcompany', $sourceRecordModel->get('spcompany'));
             }
         }
     }
     // SalesPlatform.ru end
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT);
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     // SalesPlatform.ru begin Field Validation Information
     $tabid = getTabid($moduleName);
     $validationData = getDBValidationData($recordModel->get('tab_name'), $tabid);
     $validationArray = split_validationdataArray($validationData);
     $viewer->assign("VALIDATION_DATA_FIELDNAME", $validationArray['fieldname']);
     $viewer->assign("VALIDATION_DATA_FIELDDATATYPE", $validationArray['datatype']);
     $viewer->assign("VALIDATION_DATA_FIELDLABEL", $validationArray['fieldlabel']);
     $viewer->assign('ID', $record);
     // SalesPlatform.ru end
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $isRelationOperation = $request->get('relationOperation');
     //if it is relation edit
     $viewer->assign('IS_RELATION_OPERATION', $isRelationOperation);
     if ($isRelationOperation) {
         $viewer->assign('SOURCE_MODULE', $request->get('sourceModule'));
         $viewer->assign('SOURCE_RECORD', $request->get('sourceRecord'));
     }
     $viewer->assign('MAX_UPLOAD_LIMIT_MB', Vtiger_Util_Helper::getMaxUploadSize());
     $viewer->assign('MAX_UPLOAD_LIMIT', vglobal('upload_maxsize'));
     // SalesPlatform.ru begin enable/disable button Import
     $instance = Vtiger_Module::getInstance('SPSocialConnector');
     $fl_import_button = true;
     if (empty($record) || $instance->presence == 1) {
         $fl_import_button = false;
     }
//.........这里部分代码省略.........
开发者ID:gitter-badger,项目名称:openshift-salesplatform,代码行数:101,代码来源:Edit.php

示例13: process

 public function process(Vtiger_Request $request)
 {
     $adb = PearDatabase::getInstance();
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $record = $request->get('record');
     if (!empty($record) && $request->get('isDuplicate') == true) {
         $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName);
         $viewer->assign('MODE', '');
     } else {
         if (!empty($record)) {
             $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName);
             $viewer->assign('RECORD_ID', $record);
             $viewer->assign('MODE', 'edit');
         } else {
             $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
             $viewer->assign('MODE', '');
         }
     }
     if (!$this->record) {
         $this->record = $recordModel;
     }
     $moduleModel = $recordModel->getModule();
     $fieldList = $moduleModel->getFields();
     $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
     foreach ($requestFieldList as $fieldName => $fieldValue) {
         $fieldModel = $fieldList[$fieldName];
         $specialField = false;
         // We collate date and time part together in the EditView UI handling
         // so a bit of special treatment is required if we come from QuickCreate
         if ($moduleName == 'Calendar' && empty($record) && $fieldName == 'time_start' && !empty($fieldValue)) {
             $specialField = true;
             // Convert the incoming user-picked time to GMT time
             // which will get re-translated based on user-time zone on EditForm
             $fieldValue = DateTimeField::convertToDBTimeZone($fieldValue)->format("H:i");
         }
         if ($moduleName == 'Calendar' && empty($record) && $fieldName == 'date_start' && !empty($fieldValue)) {
             $startTime = Vtiger_Time_UIType::getTimeValueWithSeconds($requestFieldList['time_start']);
             $startDateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($fieldValue . " " . $startTime);
             list($startDate, $startTime) = explode(' ', $startDateTime);
             $fieldValue = Vtiger_Date_UIType::getDisplayDateValue($startDate);
         }
         if ($fieldModel->isEditable() || $specialField) {
             $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
         }
     }
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT);
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $mappingRelatedField = $moduleModel->getMappingRelatedField($moduleName);
     $viewer->assign('MAPPING_RELATED_FIELD', Zend_Json::encode($mappingRelatedField));
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('BLOCK_LIST', $moduleModel->getBlocks());
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('RECORD_MODEL', $recordModel);
     $isRelationOperation = $request->get('relationOperation');
     //if it is relation edit
     $viewer->assign('IS_RELATION_OPERATION', $isRelationOperation);
     if ($isRelationOperation) {
         $viewer->assign('SOURCE_MODULE', $request->get('sourceModule'));
         $viewer->assign('SOURCE_RECORD', $request->get('sourceRecord'));
     }
     $viewer->assign('MAX_UPLOAD_LIMIT_MB', vglobal('upload_maxsize') / 1000000);
     $viewer->assign('MAX_UPLOAD_LIMIT', vglobal('upload_maxsize'));
     // check if passwords are encrypted
     if (file_exists('modules/OSSPasswords/config.ini')) {
         // encryption key exists so passwords are encrypted
         $config = parse_ini_file('modules/OSSPasswords/config.ini');
         // let smarty know that passwords are encrypted
         $viewer->assign('ENCRYPTED', true);
         $viewer->assign('ENC_KEY', $config['key']);
         $viewer->assign('RECORD', $_GET['record']);
         $viewer->assign('VIEW', $_GET['view']);
     } else {
         $viewer->assign('ENCRYPTED', false);
         $viewer->assign('ENC_KEY', '');
         $viewer->assign('RECORD', $_GET['record']);
         $viewer->assign('VIEW', $_GET['view']);
     }
     // widget button
     // get min, max, allow_chars from vtiger_passwords_config
     $result = $adb->query("SELECT * FROM vtiger_passwords_config WHERE 1 LIMIT 1", true);
     $min = $adb->query_result($result, 0, 'pass_length_min');
     $max = $adb->query_result($result, 0, 'pass_length_max');
     $allow_chars = $adb->query_result($result, 0, 'pass_allow_chars');
     $GenerateButton = 'Generate Password';
     $ConfigureButton = 'LBL_ConfigurePass';
     $viewer = $this->getViewer($request);
     $viewer->assign('GENERATEPASS', $GenerateButton);
     $viewer->assign('GENERATEONCLICK', 'generate_password(' . $min . ',' . $max . ',\'' . $allow_chars . '\');');
     $viewer->view('EditView.tpl', $moduleName);
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:95,代码来源:Edit.php

示例14: getEntity

 public function getEntity()
 {
     $db = PearDatabase::getInstance();
     $module = 'Calendar';
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $query = "SELECT vtiger_activity.activityid as act_id,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.setype,\n\t\tvtiger_activity.*, relcrm.setype AS linkmod, relcrm.label AS linklabel, procrm.label AS processlabel, procrm.setype AS processmod\n\t\tFROM vtiger_activity\n\t\tLEFT JOIN vtiger_activitycf\n\t\t\tON vtiger_activitycf.activityid = vtiger_activity.activityid\n\t\tLEFT JOIN vtiger_crmentity\n\t\t\tON vtiger_crmentity.crmid = vtiger_activity.activityid\n\t\tLEFT JOIN vtiger_crmentity relcrm\n\t\t\tON relcrm.crmid = vtiger_activity.link\n\t\tLEFT JOIN vtiger_crmentity procrm\n\t\t\tON procrm.crmid = vtiger_activity.process\n\t\tWHERE vtiger_crmentity.deleted = 0 AND activitytype != 'Emails' ";
     $instance = CRMEntity::getInstance($module);
     $securityParameter = $instance->getUserAccessConditionsQuerySR($module, $currentUser);
     if ($securityParameter != '') {
         $query .= $securityParameter;
     }
     $params = array();
     if ($this->get('start') && $this->get('end')) {
         $dbStartDateOject = DateTimeField::convertToDBTimeZone($this->get('start'));
         $dbStartDateTime = $dbStartDateOject->format('Y-m-d H:i:s');
         $dbStartDate = $dbStartDateOject->format('Y-m-d');
         $dbEndDateObject = DateTimeField::convertToDBTimeZone($this->get('end'));
         $dbEndDateTime = $dbEndDateObject->format('Y-m-d H:i:s');
         $dbEndDate = $dbEndDateObject->format('Y-m-d');
         $query .= " AND ( (concat(date_start, ' ', time_start)  >= ? AND concat(date_start, ' ', time_start) <= ?) OR (concat(due_date, ' ', time_end)  >= ? AND concat(due_date, ' ', time_end) <= ?) OR (date_start < ? AND due_date > ?) ) ";
         $params[] = $dbStartDateTime;
         $params[] = $dbEndDateTime;
         $params[] = $dbStartDateTime;
         $params[] = $dbEndDateTime;
         $params[] = $dbStartDate;
         $params[] = $dbEndDate;
     }
     if ($this->get('types')) {
         $query .= " AND vtiger_activity.activitytype IN ('" . implode("','", $this->get('types')) . "')";
     }
     if ($this->get('time') == 'current') {
         $query .= " AND ((vtiger_activity.activitytype='Task' and vtiger_activity.status not in ('Completed','Deferred'))\n\t\t\tOR (vtiger_activity.activitytype not in ('Emails','Task') and vtiger_activity.eventstatus not in ('','Held')))";
     }
     if ($this->get('time') == 'history') {
         $query .= " AND ((vtiger_activity.activitytype='Task' and vtiger_activity.status in ('Completed','Deferred'))\n\t\t\tOR (vtiger_activity.activitytype not in ('Emails','Task') and  vtiger_activity.eventstatus in ('','Held')))";
     }
     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;
         $item['set'] = $record['activitytype'] == 'Task' ? 'Task' : 'Event';
         $item['lok'] = $record['location'];
         $item['pri'] = $record['priority'];
         $item['sta'] = $record['status'] == '' ? $record['eventstatus'] : $record['status'];
         $item['vis'] = $record['visibility'];
         $item['state'] = $record['state'];
         //Relation
         $item['link'] = $record['link'];
         $item['linkl'] = $record['linklabel'];
         $item['linkm'] = $record['linkmod'];
         //Process
         $item['process'] = $record['process'];
         $item['procl'] = $record['processlabel'];
         $item['procm'] = $record['processmod'];
         if ($record['linkmod'] != 'Accounts' && (!empty($record['link']) || !empty($record['process']))) {
             $findId = 0;
             $findMod = '';
             if (!empty($record['link'])) {
                 $findId = $record['link'];
                 $findMod = $record['linkmod'];
             }
             if (!empty($record['process'])) {
                 $findId = $record['process'];
                 $findMod = $record['processmod'];
             }
             $tabInfo = $this->relationAcounts[$findMod];
             if ($tabInfo) {
                 $findResult = $db->pquery('SELECT accountid, accountname FROM vtiger_account ' . 'INNER JOIN ' . $tabInfo[0] . ' ON vtiger_account.accountid = ' . $tabInfo[0] . '.' . $tabInfo[2] . ' WHERE ' . $tabInfo[1] . ' = ?;', [$findId]);
                 if ($db->num_rows($findResult) > 0) {
                     $item['accid'] = $db->query_result_raw($findResult, 0, 'accountid');
                     $item['accname'] = $db->query_result_raw($findResult, 0, 'accountname');
                 }
             }
         }
         $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];
//.........这里部分代码省略.........
开发者ID:rcrrich,项目名称:YetiForceCRM,代码行数:101,代码来源:Calendar.php

示例15: matchHandler

 protected function matchHandler($match)
 {
     ${"GLOBALS"}["xkaopqxzm"] = "match";
     if (count(${${"GLOBALS"}["fzudcyrhgcof"]}) == 2) {
         if (${${"GLOBALS"}["fzudcyrhgcof"]}[0] == "\$current_user_id") {
             ${"GLOBALS"}["pcmwmi"] = "sql";
             ${"GLOBALS"}["ikafodlyvv"] = "result";
             global $current_user, $adb;
             ${${"GLOBALS"}["pcmwmi"]} = "SELECT id FROM vtiger_ws_entity WHERE name = 'Users'";
             $qphgzkamlp = "wsTabId";
             ${${"GLOBALS"}["ikafodlyvv"]} = $adb->query(${${"GLOBALS"}["tmrwyiij"]});
             ${"GLOBALS"}["qtfuoyyj"] = "wsTabId";
             ${$qphgzkamlp} = $adb->query_result(${${"GLOBALS"}["lpwetnmjxv"]}, 0, "id");
             return ${${"GLOBALS"}["qtfuoyyj"]} . "x" . $current_user->id;
         }
         ${${"GLOBALS"}["tjyojamrs"]} = ${${"GLOBALS"}["fzudcyrhgcof"]}[1];
         ${${"GLOBALS"}["mduamvfjsqip"]} = $this->_context->get(${${"GLOBALS"}["tjyojamrs"]});
         if (${${"GLOBALS"}["mduamvfjsqip"]} === false) {
             $fhtdikgbwslw = "fieldname";
             return "\$" . ${$fhtdikgbwslw};
         }
         if (!empty(${${"GLOBALS"}["mduamvfjsqip"]})) {
             return ${${"GLOBALS"}["mduamvfjsqip"]};
         }
     } elseif (substr(${${"GLOBALS"}["xkaopqxzm"]}[0], 0, 2) == "\$[") {
         $dijnlqw = "date";
         $mqgzejwr = "parameter";
         ${"GLOBALS"}["nmvdtxgwlrfi"] = "parameter";
         ${"GLOBALS"}["ttjnpwjeoog"] = "function";
         ${${"GLOBALS"}["nnvfnxph"]} = strtolower(${${"GLOBALS"}["fzudcyrhgcof"]}[3]);
         ${"GLOBALS"}["pwzsndhjqsu"] = "format";
         ${"GLOBALS"}["smpvjojh"] = "time";
         if (count(${${"GLOBALS"}["fzudcyrhgcof"]}) > 4 && ${${"GLOBALS"}["fzudcyrhgcof"]}[4] != "") {
             ${"GLOBALS"}["dpyjijot"] = "i";
             $sotxthjssww = "parameter";
             $cwegxum = "i";
             ${"GLOBALS"}["abvuifgun"] = "i";
             ${$sotxthjssww} = explode(",", ${${"GLOBALS"}["fzudcyrhgcof"]}[6]);
             for (${${"GLOBALS"}["abvuifgun"]} = 0; ${$cwegxum} < count(${${"GLOBALS"}["hcmotgp"]}); ${${"GLOBALS"}["dpyjijot"]}++) {
                 ${"GLOBALS"}["grxhbqfel"] = "parameter";
                 $ligygcuopl = "i";
                 ${"GLOBALS"}["ndjfnng"] = "parameter";
                 ${${"GLOBALS"}["grxhbqfel"]}[${$ligygcuopl}] = trim(${${"GLOBALS"}["ndjfnng"]}[${${"GLOBALS"}["kmptlmxqx"]}], "'\" ");
             }
         } else {
             ${${"GLOBALS"}["hcmotgp"]} = false;
         }
         $jgqwmporwhlx = "parameter";
         ${"GLOBALS"}["vrsthbowou"] = "time";
         $rqvrwfirvnlx = "time";
         ${"GLOBALS"}["bpcyoqq"] = "time";
         ${"GLOBALS"}["ihnsia"] = "parameter";
         ${"GLOBALS"}["fnrwpimqo"] = "parameter";
         $jcrssxzdfxv = "parameter";
         switch (${${"GLOBALS"}["ttjnpwjeoog"]}) {
             case "url":
                 if (${$jcrssxzdfxv} != false && count(${${"GLOBALS"}["ihnsia"]}) > 0) {
                     $mrpmif = "parameter";
                     $dqjrkbsn = "parameter";
                     $jzqqvbm = "parameter";
                     ${$dqjrkbsn}[0] = intval(${${"GLOBALS"}["hcmotgp"]}[0]);
                     ${${"GLOBALS"}["xbpvinrmg"]} = VTEntity::getForId(${$mrpmif}[0]);
                     global $site_URL;
                     return ${${"GLOBALS"}["pvutchkhwqsg"]} . "/index.php?action=DetailView&module=" . $objTMP->getModuleName() . "&record=" . ${$jzqqvbm}[0];
                 }
                 break;
             case "round":
                 ${$jgqwmporwhlx}[0] = VTTemplate::parse(${${"GLOBALS"}["hcmotgp"]}[0], $this->_context);
                 if (count(${${"GLOBALS"}["hcmotgp"]}) == 3 && ${${"GLOBALS"}["hcmotgp"]}[2] == "1") {
                     ${"GLOBALS"}["alckvik"] = "return";
                     ${${"GLOBALS"}["alckvik"]} = \CurrencyField::convertToUserFormat(${${"GLOBALS"}["hcmotgp"]}[0]);
                 } else {
                     ${"GLOBALS"}["vlvxrxrbd"] = "return";
                     ${${"GLOBALS"}["vlvxrxrbd"]} = round(${${"GLOBALS"}["hcmotgp"]}[0], ${${"GLOBALS"}["hcmotgp"]}[1]);
                 }
                 return ${${"GLOBALS"}["eklrhak"]};
                 break;
             case "utctz":
                 ${${"GLOBALS"}["nmvdtxgwlrfi"]}[0] = VTTemplate::parse(${${"GLOBALS"}["hcmotgp"]}[0], $this->_context);
                 ${${"GLOBALS"}["eklrhak"]} = \DateTimeField::convertToDBTimeZone(${${"GLOBALS"}["hcmotgp"]}[0]);
                 return $return->format("H:i:s");
                 break;
             case "dateformat":
                 ${${"GLOBALS"}["hcmotgp"]}[0] = VTTemplate::parse(${${"GLOBALS"}["hcmotgp"]}[0], $this->_context);
                 ${$rqvrwfirvnlx} = strtotime(${${"GLOBALS"}["hcmotgp"]}[0]);
                 ${${"GLOBALS"}["gatkidfjf"]} = ${${"GLOBALS"}["hcmotgp"]}[1];
                 return date(${${"GLOBALS"}["gatkidfjf"]}, ${${"GLOBALS"}["bpcyoqq"]});
                 break;
             case "now":
                 ${${"GLOBALS"}["pwzsndhjqsu"]} = "Y-m-d";
                 ${$dijnlqw} = \DateTimeField::convertToUserTimeZone(date("Y-m-d H:i:s"));
                 ${${"GLOBALS"}["vrsthbowou"]} = strtotime($date->format("Y-m-d H:i:s"));
                 if (${${"GLOBALS"}["fnrwpimqo"]} != false) {
                     if (!empty(${${"GLOBALS"}["hcmotgp"]}[0])) {
                         ${${"GLOBALS"}["okbxsjn"]} += intval(${${"GLOBALS"}["hcmotgp"]}[0]) * 86400;
                     }
                     if (!empty(${${"GLOBALS"}["hcmotgp"]}[1])) {
                         ${"GLOBALS"}["ftrqsw"] = "parameter";
                         $mrgqelzfbcf = "format";
                         ${$mrgqelzfbcf} = ${${"GLOBALS"}["ftrqsw"]}[1];
//.........这里部分代码省略.........
开发者ID:cin-system,项目名称:vtigercrm-cin,代码行数:101,代码来源:VTTemplate.php


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