本文整理汇总了PHP中DateTimeField::getDisplayTime方法的典型用法代码示例。如果您正苦于以下问题:PHP DateTimeField::getDisplayTime方法的具体用法?PHP DateTimeField::getDisplayTime怎么用?PHP DateTimeField::getDisplayTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateTimeField
的用法示例。
在下文中一共展示了DateTimeField::getDisplayTime方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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();
}
示例3: getDisplayTimeDifferenceValue
/**
* Function to get the calendar event call duration value in hour format
* @param type $fieldName
* @param type $value
* @return <Vtiger_Time_UIType> - getTimeValue
*/
public function getDisplayTimeDifferenceValue($fieldName, $value)
{
$userModel = Users_Privileges_Model::getCurrentUserModel();
$date = new DateTime($value);
//No need to set the time zone as DateTimeField::getDisplayTime API is already doing this
/*if(empty($value)) {
$timeZone = $userModel->get('time_zone');
$targetTimeZone = new DateTimeZone($timeZone);
$date->setTimezone($targetTimeZone);
}*/
if ($fieldName == 'time_end' && empty($value)) {
$date->modify("+15 minutes");
}
$dateTimeField = new DateTimeField($date->format('Y-m-d H:i:s'));
$value = $dateTimeField->getDisplayTime();
return $value;
}
示例4: getDisplayTimeDifferenceValue
/**
* Function to get the calendar event call duration value in hour format
* @param type $fieldName
* @param type $value
* @return <Vtiger_Time_UIType> - getTimeValue
*/
public function getDisplayTimeDifferenceValue($fieldName, $value)
{
$userModel = Users_Privileges_Model::getCurrentUserModel();
$date = new DateTime($value);
//No need to set the time zone as DateTimeField::getDisplayTime API is already doing this
/*if(empty($value)) {
$timeZone = $userModel->get('time_zone');
$targetTimeZone = new DateTimeZone($timeZone);
$date->setTimezone($targetTimeZone);
}*/
if ($fieldName == 'time_end' && empty($value)) {
$defaultCallDuration = $userModel->get('callduration');
$date->modify("+{$defaultCallDuration} minutes");
}
$dateTimeField = new DateTimeField($date->format('Y-m-d H:i:s'));
$value = $dateTimeField->getDisplayTime();
if ($userModel->get('hour_format') == '12') {
return Vtiger_Time_UIType::getTimeValueInAMorPM($value);
}
return $value;
}
示例5: getAdvFilterByCvid
/** to get the Advanced filter for the given customview Id
* @param $cvid :: Type Integer
* @returns $advfilterlist Array
*/
function getAdvFilterByCvid($cvid)
{
global $adb, $log, $default_charset, $current_user, $currentModule, $mod_strings;
$advft_criteria = array();
$sql = 'SELECT * FROM vtiger_cvadvfilter_grouping WHERE cvid = ? ORDER BY groupid';
$groupsresult = $adb->pquery($sql, array($cvid));
$i = 1;
$j = 0;
while ($relcriteriagroup = $adb->fetch_array($groupsresult)) {
$groupId = $relcriteriagroup["groupid"];
$groupCondition = $relcriteriagroup["group_condition"];
$ssql = 'select vtiger_cvadvfilter.* from vtiger_customview
inner join vtiger_cvadvfilter on vtiger_cvadvfilter.cvid = vtiger_customview.cvid
left join vtiger_cvadvfilter_grouping on vtiger_cvadvfilter.cvid = vtiger_cvadvfilter_grouping.cvid
and vtiger_cvadvfilter.groupid = vtiger_cvadvfilter_grouping.groupid';
$ssql .= " where vtiger_customview.cvid = ? AND vtiger_cvadvfilter.groupid = ? order by vtiger_cvadvfilter.columnindex";
$result = $adb->pquery($ssql, array($cvid, $groupId));
$noOfColumns = $adb->num_rows($result);
if ($noOfColumns <= 0) {
continue;
}
while ($relcriteriarow = $adb->fetch_array($result)) {
$columnIndex = $relcriteriarow["columnindex"];
$criteria = array();
$criteria['columnname'] = html_entity_decode($relcriteriarow["columnname"], ENT_QUOTES, $default_charset);
$criteria['comparator'] = $relcriteriarow["comparator"];
$advfilterval = html_entity_decode($relcriteriarow["value"], ENT_QUOTES, $default_charset);
$col = explode(":", $relcriteriarow["columnname"]);
$uitype_value = getUItypeByFieldName($this->customviewmodule, $col[2]);
if ($uitype_value == '15' || $uitype_value == '16' || $uitype_value == '33') {
if (!isValueInPicklist($advfilterval, $col[2])) {
$advfilterval = getTranslationKeyFromTranslatedValue($this->customviewmodule, $advfilterval);
}
}
$temp_val = explode(",", $relcriteriarow["value"]);
if ($col[4] == 'D' || $col[4] == 'T' && $col[1] != 'time_start' && $col[1] != 'time_end' || $col[4] == 'DT') {
$val = array();
for ($x = 0; $x < count($temp_val); $x++) {
if ($col[4] == 'D') {
$date = new DateTimeField(trim($temp_val[$x]));
$val[$x] = $date->getDisplayDate();
} elseif ($col[4] == 'DT') {
$date = new DateTimeField(trim($temp_val[$x]));
$val[$x] = $date->getDisplayDateTimeValue();
} else {
$date = new DateTimeField(trim($temp_val[$x]));
$val[$x] = $date->getDisplayTime();
}
}
$advfilterval = implode(",", $val);
}
if (($col[1] == 'smownerid' || $col[1] == 'smcreatorid' || $col[1] == 'modifiedby') && $advfilterval == 'current_user' && $_REQUEST['action'] != 'CustomView' && empty($_REQUEST['record'])) {
$advfilterval = trim($current_user->first_name . ' ' . $current_user->last_name);
}
$criteria['value'] = $advfilterval;
$criteria['column_condition'] = $relcriteriarow["column_condition"];
$advft_criteria[$i]['columns'][$j] = $criteria;
$advft_criteria[$i]['condition'] = $groupCondition;
$j++;
}
if (!empty($advft_criteria[$i]['columns'][$j - 1]['column_condition'])) {
$advft_criteria[$i]['columns'][$j - 1]['column_condition'] = '';
}
$i++;
}
// Clear the condition (and/or) for last group, if any.
if (!empty($advft_criteria[$i - 1]['condition'])) {
$advft_criteria[$i - 1]['condition'] = '';
}
return $advft_criteria;
}
示例6: getReportFieldValue
/**
*
* @global Users $current_user
* @param ReportRun $report
* @param Array $picklistArray
* @param ADOFieldObject $dbField
* @param Array $valueArray
* @param String $fieldName
* @return String
*/
function getReportFieldValue($report, $picklistArray, $dbField, $valueArray, $fieldName)
{
global $current_user, $default_charset;
$db = PearDatabase::getInstance();
$value = $valueArray[$fieldName];
$fld_type = $dbField->type;
list($module, $fieldLabel) = explode('__', $dbField->name, 2);
$fieldInfo = getFieldByReportLabel($module, $fieldLabel);
$fieldType = null;
$fieldvalue = $value;
if (!empty($fieldInfo)) {
$field = WebserviceField::fromArray($db, $fieldInfo);
$fieldType = $field->getFieldDataType();
}
if ($fieldType == 'currency' && $value != '') {
// Some of the currency fields like Unit Price, Total, Sub-total etc of Inventory modules, do not need currency conversion
if ($field->getUIType() == '72') {
$curid_value = explode("::", $value);
$currency_id = $curid_value[0];
$currency_value = $curid_value[1];
$cur_sym_rate = getCurrencySymbolandCRate($currency_id);
if ($value != '') {
if ($dbField->name == 'Products_Unit_Price') {
// need to do this only for Products Unit Price
if ($currency_id != 1) {
$currency_value = (double) $cur_sym_rate['rate'] * (double) $currency_value;
}
}
$formattedCurrencyValue = CurrencyField::convertToUserFormat($currency_value, null, true);
$fieldvalue = CurrencyField::appendCurrencySymbol($formattedCurrencyValue, $cur_sym_rate['symbol']);
}
} else {
$currencyField = new CurrencyField($value);
$fieldvalue = $currencyField->getDisplayValue();
}
} elseif ($dbField->name == "PriceBooks_Currency") {
if ($value != '') {
$fieldvalue = getTranslatedCurrencyString($value);
}
} elseif (in_array($dbField->name, $report->ui101_fields) && !empty($value)) {
$entityNames = getEntityName('Users', $value);
$fieldvalue = $entityNames[$value];
} elseif ($fieldType == 'date' && !empty($value)) {
if ($module == 'Calendar' && $field->getFieldName() == 'due_date') {
$endTime = $valueArray['calendar_end_time'];
if (empty($endTime)) {
$recordId = $valueArray['calendar_id'];
$endTime = getSingleFieldValue('vtiger_activity', 'time_end', 'activityid', $recordId);
}
$date = new DateTimeField($value . ' ' . $endTime);
$fieldvalue = $date->getDisplayDate();
} else {
if (!($field->getUIType() == '5')) {
$date = new DateTimeField($fieldvalue);
$fieldvalue = $date->getDisplayDateTimeValue();
}
}
} elseif ($fieldType == "datetime" && !empty($value)) {
$date = new DateTimeField($value);
$fieldvalue = $date->getDisplayDateTimeValue();
} elseif ($fieldType == 'time' && !empty($value) && $field->getFieldName() != 'duration_hours') {
if ($field->getFieldName() == "time_start" || $field->getFieldName() == "time_end") {
$date = new DateTimeField($value);
$fieldvalue = $date->getDisplayTime();
} else {
$userModel = Users_Privileges_Model::getCurrentUserModel();
if ($userModel->get('hour_format') == '12') {
$value = Vtiger_Time_UIType::getTimeValueInAMorPM($value);
}
$fieldvalue = $value;
}
} elseif ($fieldType == "picklist" && !empty($value)) {
if (is_array($picklistArray)) {
if (is_array($picklistArray[$dbField->name]) && $field->getFieldName() != 'activitytype' && !in_array($value, $picklistArray[$dbField->name])) {
$fieldvalue = $app_strings['LBL_NOT_ACCESSIBLE'];
} else {
$fieldvalue = getTranslatedString($value, $module);
}
} else {
$fieldvalue = getTranslatedString($value, $module);
}
} elseif ($fieldType == "multipicklist" && !empty($value)) {
if (is_array($picklistArray[1])) {
$valueList = explode(' |##| ', $value);
$translatedValueList = array();
foreach ($valueList as $value) {
if (is_array($picklistArray[1][$dbField->name]) && !in_array($value, $picklistArray[1][$dbField->name])) {
$translatedValueList[] = $app_strings['LBL_NOT_ACCESSIBLE'];
} else {
$translatedValueList[] = getTranslatedString($value, $module);
//.........这里部分代码省略.........
示例7: DateTimeField
$selectedcolumns[] = $sort_by3;
}*/
}
//<<<<<<<reportmodules>>>>>>>>>
// vtlib_getModuleNameById()
$pmodule = vtlib_purify($_REQUEST["primarymodule"]);
$smodule = vtlib_purify(trim($_REQUEST["secondarymodule"], ":"));
//<<<<<<<reportmodules>>>>>>>>>
//<<<<<<<standarfilters>>>>>>>>>
$stdDateFilterField = vtlib_purify($_REQUEST["stdDateFilterField"]);
$stdDateFilter = vtlib_purify($_REQUEST["stdDateFilter"]);
$startdate = vtlib_purify($_REQUEST["startdate"]);
$enddate = vtlib_purify($_REQUEST["enddate"]);
$dbCurrentDateTime = new DateTimeField(date('Y-m-d H:i:s'));
if (!empty($startdate)) {
$startDateTime = new DateTimeField($startdate . ' ' . $dbCurrentDateTime->getDisplayTime());
$startdate = $startDateTime->getDBInsertDateValue();
}
if (!empty($enddate)) {
$endDateTime = new DateTimeField($enddate . ' ' . $dbCurrentDateTime->getDisplayTime());
$enddate = $endDateTime->getDBInsertDateValue();
}
//<<<<<<<standardfilters>>>>>>>>>
//<<<<<<<shared entities>>>>>>>>>
$sharetype = vtlib_purify($_REQUEST["sharing"]);
$shared_entities = vtlib_purify($_REQUEST["sharingSelectedColumnsString"]);
//<<<<<<<shared entities>>>>>>>>>
//<<<<<<<columnstototal>>>>>>>>>>
if (isset($_REQUEST["curl_to_go"]) && $_REQUEST["curl_to_go"] != "") {
$columnstototal = explode('$_@_$', $_REQUEST["curl_to_go"]);
/*$allKeys = array_keys($_REQUEST);
示例8: getAdvancedFilterList
function getAdvancedFilterList($reportid)
{
global $adb;
global $modules;
global $log;
global $current_user;
$advft_criteria = array();
$sql = 'SELECT * FROM vtiger_relcriteria_grouping WHERE queryid = ? ORDER BY groupid';
$groupsresult = $adb->pquery($sql, array($reportid));
$i = 1;
$j = 0;
while ($relcriteriagroup = $adb->fetch_array($groupsresult)) {
$groupId = $relcriteriagroup["groupid"];
$groupCondition = $relcriteriagroup["group_condition"];
$ssql = 'select vtiger_relcriteria.* from vtiger_report
inner join vtiger_relcriteria on vtiger_relcriteria.queryid = vtiger_report.queryid
left join vtiger_relcriteria_grouping on vtiger_relcriteria.queryid = vtiger_relcriteria_grouping.queryid
and vtiger_relcriteria.groupid = vtiger_relcriteria_grouping.groupid';
$ssql .= " where vtiger_report.reportid = ? AND vtiger_relcriteria.groupid = ? order by vtiger_relcriteria.columnindex";
$result = $adb->pquery($ssql, array($reportid, $groupId));
$noOfColumns = $adb->num_rows($result);
if ($noOfColumns <= 0) {
continue;
}
while ($relcriteriarow = $adb->fetch_array($result)) {
$columnIndex = $relcriteriarow["columnindex"];
$criteria = array();
$criteria['columnname'] = $relcriteriarow["columnname"];
$criteria['comparator'] = $relcriteriarow["comparator"];
$advfilterval = $relcriteriarow["value"];
$col = explode(":", $relcriteriarow["columnname"]);
$moduleFieldLabel = $col[2];
$fieldName = $col[3];
list($module, $fieldLabel) = explode('__', $moduleFieldLabel, 2);
$fieldInfo = getFieldByReportLabel($module, $fieldLabel);
$fieldType = null;
if (!empty($fieldInfo)) {
$field = WebserviceField::fromArray($adb, $fieldInfo);
$fieldType = $field->getFieldDataType();
}
if ($fieldType == 'currency') {
if ($field->getUIType() == '71') {
$advfilterval = CurrencyField::convertToUserFormat($advfilterval, $current_user);
} else {
if ($field->getUIType() == '72') {
$advfilterval = CurrencyField::convertToUserFormat($advfilterval, $current_user, true);
}
}
}
$temp_val = explode(",", $relcriteriarow["value"]);
if ($col[4] == 'D' || $col[4] == 'T' && $col[1] != 'time_start' && $col[1] != 'time_end' || $col[4] == 'DT') {
$val = array();
for ($x = 0; $x < count($temp_val); $x++) {
if ($col[4] == 'D') {
$date = new DateTimeField(trim($temp_val[$x]));
$val[$x] = $date->getDisplayDate();
} elseif ($col[4] == 'DT') {
$date = new DateTimeField(trim($temp_val[$x]));
$val[$x] = $date->getDisplayDateTimeValue();
} else {
$date = new DateTimeField(trim($temp_val[$x]));
$val[$x] = $date->getDisplayTime();
}
}
$advfilterval = implode(",", $val);
}
//In vtiger6 report filter conditions, if the value has "(double quotes) then it is failed.
$criteria['value'] = Vtiger_Util_Helper::toSafeHTML(decode_html($advfilterval));
$criteria['column_condition'] = $relcriteriarow["column_condition"];
$advft_criteria[$relcriteriarow['groupid']]['columns'][$j] = $criteria;
$advft_criteria[$relcriteriarow['groupid']]['condition'] = $groupCondition;
$j++;
}
$i++;
}
// Clear the condition (and/or) for last group, if any.
if (!empty($advft_criteria[$i - 1]['condition'])) {
$advft_criteria[$i - 1]['condition'] = '';
}
$this->advft_criteria = $advft_criteria;
$log->info("Reports :: Successfully returned getAdvancedFilterList");
return true;
}
示例9: getAdvancedCriteria
/**
* Function to get the list of advanced filter conditions for the current custom view
* @return <Array> - All the advanced filter conditions for the custom view, grouped by the condition grouping
*/
public function getAdvancedCriteria()
{
$db = PearDatabase::getInstance();
$default_charset = vglobal('default_charset');
$cvId = $this->getId();
$advft_criteria = array();
if (empty($cvId)) {
return $advft_criteria;
}
$sql = 'SELECT * FROM vtiger_cvadvfilter_grouping WHERE cvid = ? ORDER BY groupid';
$groupsresult = $db->pquery($sql, array($this->getId()));
$i = 1;
$j = 0;
while ($relcriteriagroup = $db->fetch_array($groupsresult)) {
$groupId = $relcriteriagroup["groupid"];
$groupCondition = $relcriteriagroup["group_condition"];
$ssql = 'select vtiger_cvadvfilter.* from vtiger_customview
inner join vtiger_cvadvfilter on vtiger_cvadvfilter.cvid = vtiger_customview.cvid
left join vtiger_cvadvfilter_grouping on vtiger_cvadvfilter.cvid = vtiger_cvadvfilter_grouping.cvid
and vtiger_cvadvfilter.groupid = vtiger_cvadvfilter_grouping.groupid';
$ssql .= " where vtiger_customview.cvid = ? AND vtiger_cvadvfilter.groupid = ? order by vtiger_cvadvfilter.columnindex";
$result = $db->pquery($ssql, array($this->getId(), $groupId));
$noOfColumns = $db->num_rows($result);
if ($noOfColumns <= 0) {
continue;
}
while ($relcriteriarow = $db->fetch_array($result)) {
$criteria = array();
$criteria['columnname'] = html_entity_decode($relcriteriarow["columnname"], ENT_QUOTES, $default_charset);
$criteria['comparator'] = $relcriteriarow["comparator"];
$advfilterval = html_entity_decode($relcriteriarow["value"], ENT_QUOTES, $default_charset);
$col = explode(":", $relcriteriarow["columnname"]);
$temp_val = explode(",", $relcriteriarow["value"]);
if ($col[4] == 'D' || $col[4] == 'T' && $col[1] != 'time_start' && $col[1] != 'time_end' || $col[4] == 'DT') {
$val = array();
for ($x = 0; $x < count($temp_val); $x++) {
if ($col[4] == 'D') {
/** while inserting in db for due_date it was taking date and time values also as it is
* date time field. We only need to take date from that value
*/
if ($col[0] == 'vtiger_activity' && $col[1] == 'due_date') {
$originalValue = $temp_val[$x];
$dateTime = explode(' ', $originalValue);
$temp_val[$x] = $dateTime[0];
}
$date = new DateTimeField(trim($temp_val[$x]));
$val[$x] = $date->getDisplayDate();
} elseif ($col[4] == 'DT') {
$comparator = array('e', 'n', 'b', 'a');
if (in_array($criteria['comparator'], $comparator)) {
$originalValue = $temp_val[$x];
$dateTime = explode(' ', $originalValue);
$temp_val[$x] = $dateTime[0];
}
$date = new DateTimeField(trim($temp_val[$x]));
$val[$x] = $date->getDisplayDateTimeValue();
} else {
$date = new DateTimeField(trim($temp_val[$x]));
$val[$x] = $date->getDisplayTime();
}
}
$advfilterval = implode(",", $val);
}
$criteria['value'] = Vtiger_Util_Helper::toSafeHTML(decode_html($advfilterval));
$criteria['column_condition'] = $relcriteriarow["column_condition"];
$groupId = $relcriteriarow['groupid'];
$advft_criteria[$groupId]['columns'][$j] = $criteria;
$advft_criteria[$groupId]['condition'] = $groupCondition;
$j++;
}
if (!empty($advft_criteria[$groupId]['columns'][$j - 1]['column_condition'])) {
$advft_criteria[$groupId]['columns'][$j - 1]['column_condition'] = '';
}
$i++;
}
// Clear the condition (and/or) for last group, if any.
if (!empty($advft_criteria[$i - 1]['condition'])) {
$advft_criteria[$i - 1]['condition'] = '';
}
return $advft_criteria;
}
示例10: getDuplicateRecordsArr
//.........这里部分代码省略.........
}
$result[$col_arr[$k]] = $contactname;
}
if ($ui_type[$fld_arr[$k]] == 15 || $ui_type[$fld_arr[$k]] == 16) {
$result[$col_arr[$k]] = getTranslatedString($result[$col_arr[$k]], $module);
}
if ($ui_type[$fld_arr[$k]] == 33) {
$fieldvalue = explode(' |##| ', $result[$col_arr[$k]]);
$result[$col_arr[$k]] = array();
foreach ($fieldvalue as $picklistValue) {
$result[$col_arr[$k]][] = getTranslatedString($picklistValue, $module);
}
$result[$col_arr[$k]] = implode(', ', $result[$col_arr[$k]]);
}
if ($ui_type[$fld_arr[$k]] == 68) {
$parent_id = $result[$col_arr[$k]];
if ($parent_id != '') {
$parentname = getParentName($parent_id);
}
$result[$col_arr[$k]] = $parentname;
}
if ($ui_type[$fld_arr[$k]] == 53 || $ui_type[$fld_arr[$k]] == 52) {
if ($result[$col_arr[$k]] != '') {
$owner = getOwnerName($result[$col_arr[$k]]);
}
$result[$col_arr[$k]] = $owner;
}
if ($ui_type[$fld_arr[$k]] == 50 or $ui_type[$fld_arr[$k]] == 51) {
if ($module != 'Products') {
$entity_name = getAccountName($result[$col_arr[$k]]);
} else {
$entity_name = getProductName($result[$col_arr[$k]]);
}
if ($entity_name != '') {
$result[$col_arr[$k]] = $entity_name;
} else {
$result[$col_arr[$k]] = '';
}
}
if ($ui_type[$fld_arr[$k]] == 58) {
$campaign_name = getCampaignName($result[$col_arr[$k]]);
if ($campaign_name != '') {
$result[$col_arr[$k]] = $campaign_name;
} else {
$result[$col_arr[$k]] = '';
}
}
if ($ui_type[$fld_arr[$k]] == 59) {
$product_name = getProductName($result[$col_arr[$k]]);
if ($product_name != '') {
$result[$col_arr[$k]] = $product_name;
} else {
$result[$col_arr[$k]] = '';
}
}
/*uitype 10 handling*/
if ($ui_type[$fld_arr[$k]] == 10) {
$result[$col_arr[$k]] = getRecordInfoFromID($result[$col_arr[$k]]);
}
if ($ui_type[$fld_arr[$k]] == 5 || $ui_type[$fld_arr[$k]] == 6 || $ui_type[$fld_arr[$k]] == 23) {
if (${$result}[$col_arr[$k]] != '' && ${$result}[$col_arr[$k]] != '0000-00-00') {
$date = new DateTimeField(${$result}[$col_arr[$k]]);
$value = $date->getDisplayDate();
if (strpos(${$result}[$col_arr[$k]], ' ') > -1) {
$value .= ' ' . $date->getDisplayTime();
}
} elseif (${$result}[$col_arr[$k]] == '0000-00-00') {
$value = '';
} else {
$value = ${$result}[$col_arr[$k]];
}
$result[$col_arr[$k]] = $value;
}
if ($ui_type[$fld_arr[$k]] == 71) {
$result[$col_arr[$k]] = CurrencyField::convertToUserFormat($result[$col_arr[$k]]);
}
if ($ui_type[$fld_arr[$k]] == 72) {
$result[$col_arr[$k]] = CurrencyField::convertToUserFormat($result[$col_arr[$k]], null, true);
}
$fld_values[$grp][$ii][$fld_labl_arr[$k]] = $result[$col_arr[$k]];
}
$fld_values[$grp][$ii]['Entity Type'] = $result['deleted'];
$ii++;
$rec_cnt++;
}
$gro = "group";
for ($i = 0; $i < $no_rows; $i++) {
$ii = 0;
$dis_group[] = $fld_values[$gro . $i][$ii];
$count_group[$i] = count($fld_values[$gro . $i]);
$ii++;
$new_group[] = $dis_group[$i];
}
$fld_nam = $new_group[0];
$ret_arr[0] = $fld_values;
$ret_arr[1] = $fld_nam;
$ret_arr[2] = $ui_type;
$ret_arr["navigation"] = $navigationOutput;
return $ret_arr;
}
示例11: getSearch_criteria
function getSearch_criteria($criteria, $searchstring, $searchfield)
{
global $log;
$log->debug("Entering getSearch_criteria(" . $criteria . "," . $searchstring . "," . $searchfield . ") method ...");
$searchstring = ltrim(rtrim($searchstring));
if ($searchfield != "vtiger_troubletickets.update_log" && ($searchfield == "vtiger_crmentity.modifiedtime" || $searchfield == "vtiger_crmentity.createdtime" || stristr($searchfield, 'date'))) {
if ($search_string != '' && $search_string != '0000-00-00') {
$date = new DateTimeField($search_string);
$value = $date->getDisplayDate();
if (strpos($search_string, ' ') > -1) {
$value .= ' ' . $date->getDisplayTime();
}
} else {
$value = $search_string;
}
}
if ($searchfield == "vtiger_account.parentid") {
$searchfield = "vtiger_account2.accountname";
}
if ($searchfield == "vtiger_pricebook.currency_id" || $searchfield == "vtiger_quotes.currency_id" || $searchfield == "vtiger_invoice.currency_id" || $searchfield == "vtiger_purchaseorder.currency_id" || $searchfield == "vtiger_salesorder.currency_id") {
$searchfield = "vtiger_currency_info.currency_name";
}
$where_string = '';
switch ($criteria) {
case 'cts':
$where_string = $searchfield . " like '" . formatForSqlLike($searchstring) . "' ";
if ($searchstring == NULL) {
$where_string = "(" . $searchfield . " like '' or " . $searchfield . " is NULL)";
}
break;
case 'dcts':
if ($searchfield == "vtiger_users.user_name" || $searchfield == "vtiger_groups.groupname") {
$where_string = "(" . $searchfield . " not like '" . formatForSqlLike($searchstring) . "')";
} else {
$where_string = "(" . $searchfield . " not like '" . formatForSqlLike($searchstring) . "' or " . $searchfield . " is null)";
}
if ($searchstring == NULL) {
$where_string = "(" . $searchfield . " not like '' or " . $searchfield . " is not NULL)";
}
break;
case 'is':
$where_string = $searchfield . " = '" . $searchstring . "' ";
if ($searchstring == NULL) {
$where_string = "(" . $searchfield . " is NULL or " . $searchfield . " = '')";
}
break;
case 'isn':
if ($searchfield == "vtiger_users.user_name" || $searchfield == "vtiger_groups.groupname") {
$where_string = "(" . $searchfield . " <> '" . $searchstring . "')";
} else {
$where_string = "(" . $searchfield . " <> '" . $searchstring . "' or " . $searchfield . " is null)";
}
if ($searchstring == NULL) {
$where_string = "(" . $searchfield . " not like '' and " . $searchfield . " is not NULL)";
}
break;
case 'bwt':
$where_string = $searchfield . " like '" . formatForSqlLike($searchstring, 2) . "' ";
break;
case 'ewt':
$where_string = $searchfield . " like '" . formatForSqlLike($searchstring, 1) . "' ";
break;
case 'grt':
$where_string = $searchfield . " > '" . $searchstring . "' ";
break;
case 'lst':
$where_string = $searchfield . " < '" . $searchstring . "' ";
break;
case 'grteq':
$where_string = $searchfield . " >= '" . $searchstring . "' ";
break;
case 'lsteq':
$where_string = $searchfield . " <= '" . $searchstring . "' ";
break;
}
$log->debug("Exiting getSearch_criteria method ...");
return $where_string;
}
示例12: convertDateTimeIntoUsersDisplayFormat
/**
* Function to get the datetime value in user preferred hour format
* @param <DateTime> $dateTime
* @param <Vtiger_Users_Model> $userObject
* @return <String> date and time with hour format
*/
public static function convertDateTimeIntoUsersDisplayFormat($dateTime, $userObject = null)
{
require_once 'includes/runtime/LanguageHandler.php';
require_once 'includes/runtime/Globals.php';
if ($userObject) {
$userModel = Users_Privileges_Model::getInstanceFromUserObject($userObject);
} else {
$userModel = Users_Privileges_Model::getCurrentUserModel();
}
$date = new DateTime($dateTime);
$dateTimeField = new DateTimeField($date->format('Y-m-d H:i:s'));
$date = $dateTimeField->getDisplayDate($userModel);
$time = $dateTimeField->getDisplayTime($userModel);
return $date . ' ' . $time;
}
示例13: getListViewEntries
//.........这里部分代码省略.........
} elseif ($module == 'Documents' && $fieldName == 'filestatus') {
if ($value == 1) {
$value = getTranslatedString('yes', $module);
} elseif ($value == 0) {
$value = getTranslatedString('no', $module);
} else {
$value = '--';
}
} elseif ($module == 'Documents' && $fieldName == 'filetype') {
$downloadType = $db->query_result($result, $i, 'filelocationtype');
if ($downloadType == 'E' || $downloadType != 'I') {
$value = '--';
}
} elseif ($field->getUIType() == '27') {
if ($value == 'I') {
$value = getTranslatedString('LBL_INTERNAL', $module);
} elseif ($value == 'E') {
$value = getTranslatedString('LBL_EXTERNAL', $module);
} else {
$value = ' --';
}
} elseif ($field->getFieldDataType() == 'picklist') {
if ($value != '' && !$is_admin && $this->picklistRoleMap[$fieldName] && !in_array($value, $this->picklistValueMap[$fieldName])) {
$value = "<font color='red'>" . getTranslatedString('LBL_NOT_ACCESSIBLE', $module) . "</font>";
} else {
$value = getTranslatedString($value, $module);
$value = textlength_check($value);
}
} elseif ($field->getFieldDataType() == 'date' || $field->getFieldDataType() == 'datetime') {
if ($value != '' && $value != '0000-00-00') {
$date = new DateTimeField($value);
$value = $date->getDisplayDate();
if ($field->getFieldDataType() == 'datetime') {
$value .= ' ' . $date->getDisplayTime();
}
} elseif ($value == '0000-00-00') {
$value = '';
}
} elseif ($field->getFieldDataType() == 'currency') {
if ($value != '') {
if ($field->getUIType() == 72) {
if ($fieldName == 'unit_price') {
$currencyId = getProductBaseCurrency($recordId, $module);
$cursym_convrate = getCurrencySymbolandCRate($currencyId);
$currencySymbol = $cursym_convrate['symbol'];
} else {
$currencyInfo = getInventoryCurrencyInfo($module, $recordId);
$currencySymbol = $currencyInfo['currency_symbol'];
}
$value = number_format($value, 2, '.', '');
$currencyValue = CurrencyField::convertToUserFormat($value, null, true);
$value = CurrencyField::appendCurrencySymbol($currencyValue, $currencySymbol);
} else {
//changes made to remove vtiger_currency symbol infront of each
//vtiger_potential amount
if ($value != 0) {
$value = CurrencyField::convertToUserFormat($value);
}
}
}
} elseif ($field->getFieldDataType() == 'url') {
$matchPattern = "^[\\w]+:\\/\\/^";
preg_match($matchPattern, $rawValue, $matches);
if (!empty($matches[0])) {
$value = '<a href="' . $rawValue . '" target="_blank">' . textlength_check($value) . '</a>';
} else {
示例14: getGroupslist
$htmlStr .= '<span id="task_assign_team" style="' . $style_group . '">
<select name="task_assigned_group_id" class=small>';
} else {
$htmlStr .= '<span id="assign_team" style="' . $style_group . '">
<select name="assigned_group_id" class=small>';
}
$htmlStr .= getGroupslist();
$htmlStr .= '</select>
</span>';
}
return $htmlStr;
}
$date = new DateTimeField(null);
$endDate = new DateTimeField(date("Y-m-d H:i:s", time() + 1 * 24 * 60 * 60));
list($startYear, $startMonth, $startDay) = DateTimeField::convertToDBFormat($date->getDisplayDate());
list($startHour, $startMin) = explode(':', $date->getDisplayTime());
list($startYear, $startMonth, $startDay) = DateTimeField::convertToDBFormat($date->getDisplayDate());
list($startHour, $startMin) = explode(':', $date->getDisplayTime());
?>
<!-- Add Event DIV starts-->
<link rel="stylesheet" type="text/css" media="all" href="jscalendar/calendar-win2k-cold-1.css">
<script type="text/javascript" src="jscalendar/calendar.js"></script>
<script type="text/javascript" src="jscalendar/lang/calendar-<?php
echo $app_strings['LBL_JSCALENDAR_LANG'];
?>
.js"></script>
<script type="text/javascript" src="jscalendar/calendar-setup.js"></script>
<script type="text/javascript" src="include/js/ListView.js"></script>
<div class="calAddEvent layerPopup" style="display:none;width:700px;left:200px;" id="addEvent" align=center>
<form name="EditView" onSubmit="if(check_form()) { VtigerJS_DialogBox.block(); } else { return false; }" method="POST" action="index.php">
示例15: getActivityMailInfo
function getActivityMailInfo($return_id, $status, $activity_type)
{
$mail_data = array();
global $adb;
$qry = "select * from vtiger_activity where activityid=?";
$ary_res = $adb->pquery($qry, array($return_id));
$send_notification = $adb->query_result($ary_res, 0, "sendnotification");
$subject = $adb->query_result($ary_res, 0, "subject");
$priority = $adb->query_result($ary_res, 0, "priority");
$st_date = $adb->query_result($ary_res, 0, "date_start");
$st_time = $adb->query_result($ary_res, 0, "time_start");
$end_date = $adb->query_result($ary_res, 0, "due_date");
$end_time = $adb->query_result($ary_res, 0, "time_end");
$location = $adb->query_result($ary_res, 0, "location");
if (!empty($st_time)) {
$date = new DateTimeField($st_date . ' ' . $st_time);
$st_date = $date->getDisplayDate();
$st_time = $date->getDisplayTime();
}
if (!empty($end_time)) {
$date = new DateTimeField($end_date . ' ' . $end_time);
$end_date = $date->getDisplayDate();
$end_time = $date->getDisplayTime();
}
$owner_qry = "select smownerid from vtiger_crmentity where crmid=?";
$res = $adb->pquery($owner_qry, array($return_id));
$owner_id = $adb->query_result($res, 0, "smownerid");
$usr_res = $adb->pquery("select count(*) as count from vtiger_users where id=?", array($owner_id));
if ($adb->query_result($usr_res, 0, 'count') > 0) {
$assignType = "U";
$usr_id = $owner_id;
} else {
$assignType = "T";
$group_qry = "select groupname from vtiger_groups where groupid=?";
$grp_res = $adb->pquery($group_qry, array($owner_id));
$grp_name = $adb->query_result($grp_res, 0, "groupname");
}
$desc_qry = "select description from vtiger_crmentity where crmid=?";
$des_res = $adb->pquery($desc_qry, array($return_id));
$description = $adb->query_result($des_res, 0, "description");
$rel_qry = "select case vtiger_crmentity.setype when 'Leads' then vtiger_leaddetails.lastname when 'Accounts' then vtiger_account.accountname when 'Potentials' then vtiger_potential.potentialname when 'Quotes' then vtiger_quotes.subject when 'PurchaseOrder' then vtiger_purchaseorder.subject when 'SalesOrder' then vtiger_salesorder.subject when 'Invoice' then vtiger_invoice.subject when 'Campaigns' then vtiger_campaign.campaignname when 'HelpDesk' then vtiger_troubletickets.title end as relname from vtiger_seactivityrel inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_seactivityrel.crmid left join vtiger_leaddetails on vtiger_leaddetails.leadid = vtiger_seactivityrel.crmid left join vtiger_account on vtiger_account.accountid=vtiger_seactivityrel.crmid left join vtiger_potential on vtiger_potential.potentialid=vtiger_seactivityrel.crmid left join vtiger_quotes on vtiger_quotes.quoteid= vtiger_seactivityrel.crmid left join vtiger_purchaseorder on vtiger_purchaseorder.purchaseorderid = vtiger_seactivityrel.crmid left join vtiger_salesorder on vtiger_salesorder.salesorderid = vtiger_seactivityrel.crmid left join vtiger_invoice on vtiger_invoice.invoiceid = vtiger_seactivityrel.crmid left join vtiger_campaign on vtiger_campaign.campaignid = vtiger_seactivityrel.crmid left join vtiger_troubletickets on vtiger_troubletickets.ticketid = vtiger_seactivityrel.crmid where vtiger_seactivityrel.activityid=?";
$rel_res = $adb->pquery($rel_qry, array($return_id));
$rel_name = $adb->query_result($rel_res, 0, "relname");
$relatedContacts = getActivityRelatedContacts($return_id);
$mail_data['mode'] = "edit";
$mail_data['activity_mode'] = $activity_type;
$mail_data['sendnotification'] = $send_notification;
$mail_data['user_id'] = $usr_id;
$mail_data['subject'] = $subject;
$mail_data['status'] = $status;
$mail_data['taskpriority'] = $priority;
$mail_data['relatedto'] = $rel_name;
$mail_data['contact_name'] = implode(',', $relatedContacts);
$mail_data['description'] = $description;
$mail_data['assign_type'] = $assignType;
$mail_data['group_name'] = $grp_name;
$value = getaddEventPopupTime($st_time, $end_time, '24');
$start_hour = $value['starthour'] . ':' . $value['startmin'] . '' . $value['startfmt'];
if ($activity_type != 'Task') {
$end_hour = $value['endhour'] . ':' . $value['endmin'] . '' . $value['endfmt'];
}
$date = new DateTimeField($st_date . " " . $start_hour);
$endDate = new DateTimeField($end_date . " " . $end_hour);
$mail_data['st_date_time'] = $date->getDBInsertDateTimeValue();
$mail_data['end_date_time'] = $endDate->getDBInsertDateValue() . ' ' . $endDate->getDBInsertTimeValue();
$mail_data['location'] = $location;
return $mail_data;
}