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


PHP DateTimeField::convertToUserTimeZone方法代码示例

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


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

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

示例2: beforeGetTaskform

 public function beforeGetTaskform($viewer)
 {
     global $adb, $vtiger_current_version;
     if (version_compare($vtiger_current_version, '5.3.0', '>=')) {
         // I have to respect Users timezone
         $setter = $this->get("setter");
         if (!empty($setter) && is_array($setter)) {
             foreach ($setter as $key => $field) {
                 if (strpos($field["value"], "\$") === false && ($field["field"] == "time_start" || $field["field"] == "time_end")) {
                     $date = DateTimeField::convertToUserTimeZone(date("Y-m-d") . " " . $field["value"]);
                     $setter[$key]["value"] = $date->format("H:i");
                 }
             }
         }
         $this->set("setter", $setter);
     }
     parent::beforeGetTaskform($viewer);
 }
开发者ID:cin-system,项目名称:vtigercrm-cin,代码行数:18,代码来源:WfTaskEventCreator.php

示例3: retrieve_entity_info

 function retrieve_entity_info($record, $module)
 {
     parent::retrieve_entity_info($record, $module);
     $start = DateTimeField::convertToUserTimeZone($this->column_fields['date_start'] . ' ' . $this->column_fields['time_start']);
     $this->column_fields['date_start'] = $start->format('Y-m-d');
     $end = DateTimeField::convertToUserTimeZone($this->column_fields['due_date'] . ' ' . $this->column_fields['time_end']);
     $this->column_fields['due_date'] = $end->format('Y-m-d');
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:8,代码来源:OSSTimeControl.php

示例4: x10

 private function x10($x92, $x93, $x94 = false, $x95 = false)
 {
     global $x15d, $x15e, $x15f, $x160, $x161, $x162, $x163, $x164, $x165, $x166, $x167, $x168, $x169, $x16a, $x16b, $x16c, $x16d, $x16e, $x16f, $x170, $x171, $x172, $x173, $x174, $x175, $x176, $x177, $x178;
     $x96 = Users_Record_Model::getCurrentUserModel();
     $x97 = array("related_to", "relatedto", "parent_id", "parentid", "product_id", "productid", "service_id", "serviceid", "vendor_id", "product", "account", "invoiceid", "linktoaccountscontacts", "projectid", "sc_related_to");
     if ($x95 !== false) {
         $x98 = array();
     }
     $x51 = getTabid($x92);
     $x99 = $x92;
     if ($x94 === false) {
         $x9a = "";
     } else {
         $x9a = "R_";
         if ($x94 !== true) {
             $x99 = $x94;
         }
     }
     $x9b = array();
     $x9c = array();
     $x9d = array();
     $x9e = array();
     $x9f = array();
     $xa0 = array();
     $xa1 = array();
     if ($x51 == '9') {
         $x3d = "SELECT fieldname, uitype FROM vtiger_field WHERE tabid IN (9,16)";
     } else {
         $x3d = "SELECT fieldname, uitype FROM vtiger_field WHERE tabid = '" . $x51 . "'";
     }
     $x3e = self::$x0f->query($x3d);
     while ($x42 = self::$x0f->fetchByAssoc($x3e)) {
         switch ($x42['uitype']) {
             case '19':
             case '20':
             case '21':
             case '24':
                 $x9d[] = $x42['fieldname'];
                 break;
             case '5':
             case '6':
             case '23':
             case '70':
                 $x9e[] = $x42['fieldname'];
                 break;
             case '15':
                 $x9c[] = $x42['fieldname'];
                 break;
             case '56':
                 $x9b[] = $x42['fieldname'];
                 break;
             case '33':
                 $x9f[] = $x42['fieldname'];
                 break;
             case '71':
                 $xa0[] = $x42['fieldname'];
                 break;
             case '9':
                 $xa1[] = $x42['fieldname'];
                 break;
         }
         if ($x42["fieldname"] == "salutationtype") {
             $x9c[] = $x42["fieldname"];
         }
     }
     foreach ($x93->column_fields as $xa2 => $x83) {
         if ($xa2 == "assigned_user_id") {
             $x83 = $this->x1e($x83);
         } elseif ($xa2 == "account_id") {
             $x83 = getAccountName($x83);
         } elseif ($xa2 == "potential_id") {
             $x83 = getPotentialName($x83);
         } elseif ($xa2 == "contact_id") {
             $x83 = getContactName($x83);
         } elseif ($xa2 == "quote_id") {
             $x83 = getQuoteName($x83);
         } elseif ($xa2 == "salesorder_id") {
             $x83 = getSoName($x83);
         } elseif ($xa2 == "campaignid") {
             $x83 = getCampaignName($x83);
         } elseif ($xa2 == "terms_conditions") {
             $x83 = $this->x25($x83);
         } elseif ($xa2 == "comments") {
             $x83 = $this->x26($x93);
         } elseif ($xa2 == "folderid") {
             $x83 = $this->x27($x83);
         } elseif ($xa2 == "time_start" || $xa2 == "time_end") {
             $xa3 = DateTimeField::convertToUserTimeZone($x83);
             $x83 = $xa3->format('H:i');
         } elseif ($x168($xa2, $x97)) {
             if ($x83 != "") {
                 $xa4 = getSalesEntityType($x83);
                 $xa5 = getEntityName($xa4, $x83);
                 if (!empty($xa5)) {
                     foreach ($xa5 as $xa6) {
                         $x83 = $xa6;
                     }
                 }
                 if ($xa2 == "invoiceid" && $x83 == "0") {
                     $x83 = "";
//.........这里部分代码省略.........
开发者ID:jmangarret,项目名称:vtigercrm,代码行数:101,代码来源:PDFContent.php

示例5: getTranslatedString

                    $Actions[] = "<a target='_new' href='index.php?action=EventDetailView&module=Calendar4You&record=" . $record . "&activity_mode={$activity_mode}&parenttab=Tools'>" . $mod['LBL_DETAIL'] . "</a>";
                }
                if ($Calendar4You->CheckPermissions("EDIT", $record)) {
                    $Actions[] = "<a target='_new' href='index.php?action=EventEditView&module=Calendar4You&record=" . $record . "&activity_mode={$activity_mode}&parenttab=Tools'>" . $app['LNK_EDIT'] . "</a>";
                }
                if (vtlib_isModuleActive('Timecontrol')) {
                    $Actions[] = "<a target='_newtc' href='index.php?action=EditView&module=Timecontrol&calendarrecord={$record}&activity_mode={$activity_mode}'>" . getTranslatedString('LBL_TIME_TAKEN') . '</a>';
                }
                if ($Calendar4You->CheckPermissions("DELETE", $record)) {
                    $Actions[] = "<a href='javascript:void(0)' onclick='EditView.record.value=" . $record . ";EditView.return_module.value=" . '"Calendar4You"; EditView.return_action.value="index";  var confirmMsg = "' . getTranslatedString('NTC_DELETE_CONFIRMATION') . '"; submitFormForActionWithConfirmation("EditView", "Delete", confirmMsg);\'>' . $app['LNK_DELETE'] . '</a>';
                }
                $actions = implode(" | ", $Actions);
                $into_title = $app['LBL_ACTION'] . ": " . $actions . "<hr>" . nl2br($into_title);
            }
            $title = "<font style='font-size:12px'>" . $into_title . "</font>";
            if ($add_more_info) {
                if (count($Event_Info[$event]) > 0) {
                    foreach ($Event_Info[$event] as $CD) {
                        $title .= transferForAddIntoTitle(2, $row, $CD);
                    }
                }
            }
            $convert_date_start = DateTimeField::convertToUserTimeZone($row["date_start"] . " " . $row["time_start"]);
            $user_date_start = $convert_date_start->format('Y-m-d H:i');
            $convert_due_date = DateTimeField::convertToUserTimeZone($row["due_date"] . " " . $row["time_end"]);
            $user_due_date = $convert_due_date->format('Y-m-d H:i');
            $Activities[] = array('id' => $row["crmid"], 'typeid' => $activitytypeid, 'userid' => $userid, 'visibility' => $visibility, 'editable' => $editable, 'activity_mode' => $activity_mode, 'title' => $title, 'start' => $user_date_start, 'end' => $user_due_date, 'allDay' => $allDay, 'url' => "");
        }
    }
}
echo json_encode($Activities);
开发者ID:mslokhat,项目名称:corebos,代码行数:31,代码来源:Events.php

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

示例7: getUserRecurringInfo

 function getUserRecurringInfo()
 {
     $recurringType = $this->getRecurringType();
     $recurringInfo = array();
     if ($recurringType == 'Weekly') {
         if ($this->dayofweek_to_rpt != null) {
             $recurringInfo['dayofweek_to_repeat'] = $this->dayofweek_to_rpt;
         }
     } elseif ($recurringType == 'Monthly') {
         $dbStartDateTime = new DateTime($this->startdate->get_DB_formatted_date() . ' ' . $this->startdate->get_formatted_time());
         $recurringInfo['repeatmonth_type'] = $this->repeat_monthby;
         if ($this->repeat_monthby == 'date') {
             $dayOfMonth = $this->rptmonth_datevalue;
             $dbStartDateTime->setDate($dbStartDateTime->format('Y'), $dbStartDateTime->format('m'), $dayOfMonth);
             $userStartDateTime = DateTimeField::convertToUserTimeZone($dbStartDateTime->format('Y-m-d') . ' ' . $dbStartDateTime->format('H:i'));
             $recurringInfo['repeatmonth_date'] = $userStartDateTime->format('d');
         } else {
             $dayOfWeek = $this->dayofweek_to_rpt[0];
             $recurringInfo['repeatmonth_daytype'] = $this->rptmonth_daytype;
             if ($this->rptmonth_daytype == 'first') {
                 $dbStartDateTime->setDate($dbStartDateTime->format('Y'), $dbStartDateTime->format('m'), 1);
                 $dayOfWeekForFirstDay = $dbStartDateTime->format('N');
                 if ($dayOfWeekForFirstDay < $dayOfWeek) {
                     $date = $dayOfWeek - $dayOfWeekForFirstDay + 1;
                 } else {
                     $date = 7 - $dayOfWeekForFirstDay + $dayOfWeek + 1;
                 }
             } elseif ($this->rptmonth_daytype == 'last') {
                 $daysInMonth = $dbStartDateTime->format('t');
                 $dbStartDateTime->setDate($dbStartDateTime->format('Y'), $dbStartDateTime->format('m'), $daysInMonth);
                 $dayOfWeekForLastDay = $dbStartDateTime->format('N');
                 if ($dayOfWeekForLastDay < $dayOfWeek) {
                     $date = $daysInMonth - 7 + ($dayOfWeek - $dayOfWeekForLastDay);
                 } else {
                     $date = $daysInMonth - ($dayOfWeekForLastDay - $dayOfWeek);
                 }
             }
             $dbStartDateTime->setDate($dbStartDateTime->format('Y'), $dbStartDateTime->format('m'), $date);
             $userStartDateTime = DateTimeField::convertToUserTimeZone($dbStartDateTime->format('Y-m-d') . ' ' . $dbStartDateTime->format('H:i'));
             $recurringInfo['dayofweek_to_repeat'][0] = (int) $userStartDateTime->format('N') % 7;
         }
     }
     return $recurringInfo;
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:44,代码来源:RecurringType.php

示例8: getOutputHtml

/** This function returns the vtiger_field details for a given vtiger_fieldname.
 * Param $uitype - UI type of the vtiger_field
 * Param $fieldname - Form vtiger_field name
 * Param $fieldlabel - Form vtiger_field label name
 * Param $maxlength - maximum length of the vtiger_field
 * Param $col_fields - array contains the vtiger_fieldname and values
 * Param $generatedtype - Field generated type (default is 1)
 * Param $module_name - module name
 * Return type is an array
 */
function getOutputHtml($uitype, $fieldname, $fieldlabel, $maxlength, $col_fields, $generatedtype, $module_name, $mode = '', $typeofdata = null)
{
    global $log, $app_strings, $adb, $default_charset, $theme, $mod_strings, $current_user;
    $log->debug("Entering getOutputHtml(" . $uitype . "," . $fieldname . "," . $fieldlabel . "," . $maxlength . "," . print_r($col_fields, true) . "," . $generatedtype . "," . $module_name . ") method ...");
    require 'user_privileges/sharing_privileges_' . $current_user->id . '.php';
    require 'user_privileges/user_privileges_' . $current_user->id . '.php';
    $theme_path = "themes/" . $theme . "/";
    $image_path = $theme_path . "images/";
    $fieldlabel = from_html($fieldlabel);
    $fieldvalue = array();
    $final_arr = array();
    $value = $col_fields[$fieldname];
    $custfld = '';
    $ui_type[] = $uitype;
    $editview_fldname[] = $fieldname;
    // vtlib customization: Related type field
    if ($uitype == '10') {
        global $adb;
        $fldmod_result = $adb->pquery('SELECT relmodule, status FROM vtiger_fieldmodulerel WHERE fieldid=
			(SELECT fieldid FROM vtiger_field, vtiger_tab WHERE vtiger_field.tabid=vtiger_tab.tabid AND fieldname=? AND name=? and vtiger_field.presence in (0,2)) order by sequence', array($fieldname, $module_name));
        $entityTypes = array();
        $parent_id = $value;
        for ($index = 0; $index < $adb->num_rows($fldmod_result); ++$index) {
            $entityTypes[] = $adb->query_result($fldmod_result, $index, 'relmodule');
        }
        if (!empty($value)) {
            if ($adb->num_rows($fldmod_result) == 1) {
                $valueType = $adb->query_result($fldmod_result, 0, 0);
            } else {
                $valueType = getSalesEntityType($value);
            }
            $displayValueArray = getEntityName($valueType, $value);
            if (!empty($displayValueArray)) {
                foreach ($displayValueArray as $key => $value) {
                    $displayValue = $value;
                }
            }
        } else {
            $displayValue = '';
            $valueType = '';
            $value = '';
        }
        $editview_label[] = array('options' => $entityTypes, 'selected' => $valueType, 'displaylabel' => getTranslatedString($fieldlabel, $module_name));
        $fieldvalue[] = array('displayvalue' => $displayValue, 'entityid' => $parent_id);
    } else {
        if ($uitype == 5 || $uitype == 6 || $uitype == 23) {
            $log->info("uitype is " . $uitype);
            if ($value == '') {
                //modified to fix the issue in trac(http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/1469)
                if ($fieldname != 'birthday' && $generatedtype != 2 && getTabid($module_name) != 14) {
                    $disp_value = getNewDisplayDate();
                }
                if (($module_name == 'Events' || $module_name == 'Calendar') && $uitype == 6) {
                    $curr_time = date('H:i', strtotime('+5 minutes'));
                }
                if (($module_name == 'Events' || $module_name == 'Calendar') && $uitype == 23) {
                    $curr_time = date('H:i', strtotime('+10 minutes'));
                }
                //Added to display the Contact - Support End Date as one year future instead of
                //today's date -- 30-11-2005
                if ($fieldname == 'support_end_date' && $_REQUEST['module'] == 'Contacts') {
                    $addyear = strtotime("+1 year");
                    $disp_value = DateTimeField::convertToUserFormat(date('Y-m-d', $addyear));
                } elseif ($fieldname == 'validtill' && $_REQUEST['module'] == 'Quotes') {
                    $disp_value = '';
                }
            } else {
                if ($uitype == 6) {
                    if ($col_fields['time_start'] != '' && ($module_name == 'Events' || $module_name == 'Calendar')) {
                        $curr_time = $col_fields['time_start'];
                        $value = $value . ' ' . $curr_time;
                    } else {
                        $curr_time = date('H:i', strtotime('+5 minutes'));
                    }
                }
                if (($module_name == 'Events' || $module_name == 'Calendar') && $uitype == 23) {
                    if ($col_fields['time_end'] != '') {
                        $curr_time = $col_fields['time_end'];
                        $value = $value . ' ' . $curr_time;
                    } else {
                        $curr_time = date('H:i', strtotime('+10 minutes'));
                    }
                }
                $disp_value = getValidDisplayDate($value);
            }
            $editview_label[] = getTranslatedString($fieldlabel, $module_name);
            $date_format = parse_calendardate($app_strings['NTC_DATE_FORMAT']);
            if (!empty($curr_time)) {
                if (($module_name == 'Events' || $module_name == 'Calendar') && ($uitype == 23 || $uitype == 6)) {
                    $curr_time = DateTimeField::convertToUserTimeZone($curr_time);
//.........这里部分代码省略.........
开发者ID:kduqi,项目名称:corebos,代码行数:101,代码来源:EditViewUtils.php

示例9: getEditViewDisplayValue

 /**
  * Function to get the display value in edit view
  * @param $value
  * @return converted value
  */
 public function getEditViewDisplayValue($value, $record = false)
 {
     $value = DateTimeField::convertToUserTimeZone(date('Y-m-d') . ' ' . $value);
     $value = $value->format('H:i:s');
     return self::getTimeValueInAMorPM($value);
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:11,代码来源:Time.php

示例10: getUserRecurringInfo

 function getUserRecurringInfo()
 {
     $recurringType = $this->getRecurringType();
     $recurringInfo = array();
     if ($recurringType == 'Weekly') {
         if ($this->dayofweek_to_rpt != null) {
             $dbStartDateTime = new DateTime($this->startdate->get_DB_formatted_date() . ' ' . $this->startdate->get_formatted_time());
             $dayOfWeek = $this->dayofweek_to_rpt;
             $userDaysOfWeek = array();
             for ($i = 0; $i < count($dayOfWeek); ++$i) {
                 $selectedDayOfWeek = $dayOfWeek[$i];
                 $currentDayOfWeek = $dbStartDateTime->format('w');
                 $newDate = $dbStartDateTime->format('d') + ($selectedDayOfWeek - $currentDayOfWeek);
                 $dbStartDateTime->setDate($dbStartDateTime->format('Y'), $dbStartDateTime->format('m'), $newDate);
                 $userStartDateTime = DateTimeField::convertToUserTimeZone($dbStartDateTime->format('Y-m-d') . ' ' . $dbStartDateTime->format('H:i'));
                 $userDaysOfWeek[] = $userStartDateTime->format('w');
             }
             $recurringInfo['dayofweek_to_repeat'] = $userDaysOfWeek;
         }
     } elseif ($recurringType == 'Monthly') {
         $dbStartDateTime = new DateTime($this->startdate->get_DB_formatted_date() . ' ' . $this->startdate->get_formatted_time());
         $recurringInfo['repeatmonth_type'] = $this->repeat_monthby;
         if ($this->repeat_monthby == 'date') {
             $dayOfMonth = $this->rptmonth_datevalue;
             $dbStartDateTime->setDate($dbStartDateTime->format('Y'), $dbStartDateTime->format('m'), $dayOfMonth);
             $userStartDateTime = DateTimeField::convertToUserTimeZone($dbStartDateTime->format('Y-m-d') . ' ' . $dbStartDateTime->format('H:i'));
             $recurringInfo['repeatmonth_date'] = $userStartDateTime->format('d');
         } else {
             $dayOfWeek = $this->dayofweek_to_rpt[0];
             $recurringInfo['repeatmonth_daytype'] = $this->rptmonth_daytype;
             if ($this->rptmonth_daytype == 'first' or $this->rptmonth_daytype == 'second' or $this->rptmonth_daytype == 'third') {
                 $dbStartDateTime->setDate($dbStartDateTime->format('Y'), $dbStartDateTime->format('m'), 1);
                 $dayOfWeekForFirstDay = $dbStartDateTime->format('N');
                 if ($dayOfWeekForFirstDay < $dayOfWeek) {
                     $date = $dayOfWeek - $dayOfWeekForFirstDay + 1;
                 } else {
                     $date = 7 - $dayOfWeekForFirstDay + $dayOfWeek + 1;
                 }
                 if ($this->rptmonth_daytype == 'second') {
                     $date += 7;
                 }
                 if ($this->rptmonth_daytype == 'third') {
                     $date += 14;
                 }
             } elseif ($this->rptmonth_daytype == 'last') {
                 $daysInMonth = $dbStartDateTime->format('t');
                 $dbStartDateTime->setDate($dbStartDateTime->format('Y'), $dbStartDateTime->format('m'), $daysInMonth);
                 $dayOfWeekForLastDay = $dbStartDateTime->format('N');
                 if ($dayOfWeekForLastDay < $dayOfWeek) {
                     $date = $daysInMonth - 7 + ($dayOfWeek - $dayOfWeekForLastDay);
                 } else {
                     $date = $daysInMonth - ($dayOfWeekForLastDay - $dayOfWeek);
                 }
             }
             $dbStartDateTime->setDate($dbStartDateTime->format('Y'), $dbStartDateTime->format('m'), $date);
             $userStartDateTime = DateTimeField::convertToUserTimeZone($dbStartDateTime->format('Y-m-d') . ' ' . $dbStartDateTime->format('H:i'));
             $recurringInfo['dayofweek_to_repeat'][0] = $userStartDateTime->format('N');
         }
     }
     return $recurringInfo;
 }
开发者ID:kduqi,项目名称:corebos,代码行数:61,代码来源:RecurringType.php

示例11: get_userTimezone_formatted_date

 /**
  * Function to get formatted date in users time zone
  * @return <Date>
  */
 function get_userTimezone_formatted_date()
 {
     $dateTimeInUserFormat = DateTimeField::convertToUserTimeZone($this->get_DB_formatted_date() . ' ' . $this->get_formatted_time());
     return $dateTimeInUserFormat->format('Y-m-d');
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:9,代码来源:Date.php

示例12: convertToUserTZ

 public static function convertToUserTZ($date)
 {
     if (class_exists("DateTimeField")) {
         $fslfitv = "date";
         ${${"GLOBALS"}["rfzzycoqwhw"]} = DateTimeField::convertToUserTimeZone(${$fslfitv});
         return $return->format("Y-m-d H:i:s");
     } else {
         $nbgifml = "date";
         return ${$nbgifml};
     }
 }
开发者ID:Wasage,项目名称:werpa,代码行数:11,代码来源:VtUtils.php

示例13: convertToUserTZ

 public static function convertToUserTZ($date)
 {
     if (class_exists("DateTimeField")) {
         $return = \DateTimeField::convertToUserTimeZone($date);
         return $return->format("Y-m-d H:i:s");
     } else {
         return $date;
     }
 }
开发者ID:Neodracir,项目名称:VtigerCRM-Tools,代码行数:9,代码来源:VtUtils.php

示例14: convertToUserTZ

 public static function convertToUserTZ($date)
 {
     if (class_exists("DateTimeField")) {
         ${"GLOBALS"}["zmihcgdsngi"] = "date";
         ${${"GLOBALS"}["ruafhkaxlbyo"]} = \DateTimeField::convertToUserTimeZone(${${"GLOBALS"}["zmihcgdsngi"]});
         return $return->format("Y-m-d H:i:s");
     } else {
         return ${${"GLOBALS"}["thoumpsfcdy"]};
     }
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:10,代码来源:VtUtils.php


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