diff --git a/data/CRMEntity.php b/data/CRMEntity.php index 469dae8ed1fd3737b7f81364e380934dd1415e1b..4562709e1081cb5f41a40c6133230178f4b9b2f5 100644 --- a/data/CRMEntity.php +++ b/data/CRMEntity.php @@ -269,6 +269,7 @@ class CRMEntity { $ownerid = $this->column_fields['assigned_user_id']; $groupid = $this->column_fields['group_id']; + $insertion_mode = $this->mode; if (empty($groupid)) $groupid = 0; @@ -299,6 +300,7 @@ class CRMEntity { $this->column_fields['label'] = $label; if ($this->mode == 'edit') { + $description_val = from_html($this->column_fields['description'], ($insertion_mode == 'edit') ? true : false); $tabid = getTabid($module); @@ -648,7 +650,7 @@ class CRMEntity { foreach($IMG_FILES as $fileIndex => $file) { if($file['error'] == 0 && $file['name'] != '' && $file['size'] > 0) { if($_REQUEST[$fileIndex.'_hidden'] != '') - $file['original_name'] = vtlib_purify($_REQUEST[$fileindex.'_hidden']); + $file['original_name'] = vtlib_purify($_REQUEST[$fileIndex.'_hidden']); else { $file['original_name'] = stripslashes($file['name']); } @@ -686,8 +688,8 @@ class CRMEntity { $uploadedFileNames = array(); foreach($UPLOADED_FILES as $fileIndex => $file) { if($file['error'] == 0 && $file['name'] != '' && $file['size'] > 0) { - if($_REQUEST[$fileindex.'_hidden'] != '') { - $file['original_name'] = vtlib_purify($_REQUEST[$fileindex.'_hidden']); + if(isset($_REQUEST[$fileIndex.'_hidden']) && $_REQUEST[$fileIndex.'_hidden'] != '') { + $file['original_name'] = vtlib_purify($_REQUEST[$fileIndex.'_hidden']); } else { $file['original_name'] = stripslashes($file['name']); } @@ -743,9 +745,9 @@ class CRMEntity { $changedFields = $this->column_fields->getChanged(); if(php7_count($changedFields) > 0) { $update = array(); - $update_params = array(); + $update_params =array(); foreach($changedFields as $field) { - $fieldColumn = $updateFieldNameColumnNameMap[$field]; + $fieldColumn = isset($updateFieldNameColumnNameMap[$field])?$updateFieldNameColumnNameMap[$field]:' '; if(@array_key_exists($fieldColumn, $updateFieldValues)) { array_push($update, $fieldColumn.'=?'); array_push($update_params, $updateFieldValues[$fieldColumn]); diff --git a/data/VTEntityDelta.php b/data/VTEntityDelta.php index cada93fde487d6892422ce5d2fb15fa5302bc882..a0c7bb16f5c1b569fdfa2b7817c658c6945918b7 100644 --- a/data/VTEntityDelta.php +++ b/data/VTEntityDelta.php @@ -112,15 +112,18 @@ class VTEntityDelta extends VTEventHandler { if(empty(self::$oldEntity[$moduleName][$recordId])) { return false; } - $fieldDelta = self::$entityDelta[$moduleName][$recordId][$fieldName]; - if(is_array($fieldDelta)) { + $fieldDelta = isset(self::$entityDelta[$moduleName][$recordId][$fieldName]) ? self::$entityDelta[$moduleName][$recordId][$fieldName] :' '; + if(is_array($fieldDelta) && isset($fieldDelta['oldValue']) && isset($fieldDelta['currentValue'])) { $fieldDelta = array_map('decode_html', $fieldDelta); + $result = $fieldDelta['oldValue'] != $fieldDelta['currentValue']; + if ($fieldValue !== NULL) { + $result = $result && ($fieldDelta['currentValue'] === $fieldValue); + } + return $result; } - $result = $fieldDelta['oldValue'] != $fieldDelta['currentValue']; - if ($fieldValue !== NULL) { - $result = $result && ($fieldDelta['currentValue'] === $fieldValue); + else{ + return; } - return $result; } } diff --git a/include/fields/DateTimeField.php b/include/fields/DateTimeField.php index 21f4d2de793e43b0c9b2a75911e16c9c27b9dbd3..147fc8ac8d12b6b44e2511dfee1361659f78fea6 100644 --- a/include/fields/DateTimeField.php +++ b/include/fields/DateTimeField.php @@ -192,7 +192,10 @@ class DateTimeField { public static function __convertToUserFormat($date, $format) { $date = self::convertToInternalFormat($date); - list($y, $m, $d) = explode('-', $date[0]); + $dates=explode('-', $date[0]); + $y=isset($dates[0])?$dates[0]:' '; + $m=isset($dates[1])?$dates[1]:' '; + $d=isset($dates[2])?$dates[2]:' '; switch ($format) { case 'dd.mm.yyyy': @@ -278,7 +281,7 @@ class DateTimeField { // create datetime object for given time in source timezone $sourceTimeZone = new DateTimeZone($sourceTimeZoneName); if($time == '24:00') $time = '00:00'; - $myDateTime = new DateTime($time, $sourceTimeZone); + $myDateTime = new DateTime($time ?? '', $sourceTimeZone); // convert this to target timezone using the DateTimeZone object $targetTimeZone = new DateTimeZone($targetTimeZoneName); diff --git a/layouts/v7/modules/Calendar/uitypes/DateTime.tpl b/layouts/v7/modules/Calendar/uitypes/DateTime.tpl index 42f245c96013777da976a3b68c2a85e9ca81989a..2e079045816bcee44e8b3dd50e5e9efd2f7c2e8e 100644 --- a/layouts/v7/modules/Calendar/uitypes/DateTime.tpl +++ b/layouts/v7/modules/Calendar/uitypes/DateTime.tpl @@ -20,8 +20,10 @@ {/if} {assign var=DATE_TIME_VALUE value=$FIELD_MODEL->get('fieldvalue')} -{assign var=DATE_TIME_COMPONENTS value=explode(' ' ,$DATE_TIME_VALUE)} -{if !empty($TIME_FIELD)} +{if $DATE_TIME_VALUE !== null} + {assign var=DATE_TIME_COMPONENTS value=explode(' ', $DATE_TIME_VALUE)} +{/if} +{if !empty($TIME_FIELD) && isset($DATE_TIME_COMPONENTS)} {assign var=TIME_FIELD value=$TIME_FIELD->set('fieldvalue',$DATE_TIME_COMPONENTS[1])} {/if} {if $TIME_FIELD} @@ -30,6 +32,7 @@ {assign var=DATE_TIME_COMPONENTS value=explode(' ' ,$DATE_TIME_CONVERTED_VALUE)} {assign var=DATE_FIELD value=$DATE_FIELD->set('fieldvalue',$DATE_TIME_COMPONENTS[0])} {/if} + <div> {include file=vtemplate_path('uitypes/Date.tpl',$MODULE) BLOCK_FIELDS=$BLOCK_FIELDS FIELD_MODEL=$DATE_FIELD} </div> diff --git a/layouts/v7/modules/Events/uitypes/DateTime.tpl b/layouts/v7/modules/Events/uitypes/DateTime.tpl index 16648420cd248b14687ad4d9f2a80ca329a6db7f..71ac7ba2826ef746a799bd4cf19f0b0051ddcef3 100644 --- a/layouts/v7/modules/Events/uitypes/DateTime.tpl +++ b/layouts/v7/modules/Events/uitypes/DateTime.tpl @@ -21,13 +21,16 @@ {/if} {assign var=DATE_TIME_VALUE value=$FIELD_MODEL->get('fieldvalue')} +{if $DATE_TIME_VALUE!== null} {assign var=DATE_TIME_COMPONENTS value=explode(' ' ,$DATE_TIME_VALUE)} {assign var=TIME_FIELD value=$TIME_FIELD->set('fieldvalue',$DATE_TIME_COMPONENTS[1])} - +{/if} {* Set the date after converting with repsect to timezone *} {assign var=DATE_TIME_CONVERTED_VALUE value=DateTimeField::convertToUserTimeZone($DATE_TIME_VALUE)->format('Y-m-d H:i:s')} +{if $DATE_TIME_CONVERTED_VALUE!== null} {assign var=DATE_TIME_COMPONENTS value=explode(' ' ,$DATE_TIME_CONVERTED_VALUE)} {assign var=DATE_FIELD value=$DATE_FIELD->set('fieldvalue',$DATE_TIME_COMPONENTS[0])} +{/if} <div> {include file=vtemplate_path('uitypes/Date.tpl',$MODULE) BLOCK_FIELDS=$BLOCK_FIELDS FIELD_MODEL=$DATE_FIELD} diff --git a/layouts/v7/modules/Vtiger/DetailViewBlockView.tpl b/layouts/v7/modules/Vtiger/DetailViewBlockView.tpl index f2a99adfeeebedfe2cf40b996156fe25bbcd9862..0d2e196fd19070e5349e265a38efbbd81947a85d 100644 --- a/layouts/v7/modules/Vtiger/DetailViewBlockView.tpl +++ b/layouts/v7/modules/Vtiger/DetailViewBlockView.tpl @@ -18,7 +18,7 @@ <div class="block block_{$BLOCK_LABEL_KEY}" data-block="{$BLOCK_LABEL_KEY}" data-blockid="{$BLOCK_LIST[$BLOCK_LABEL_KEY]->get('id')}"> {assign var=IS_HIDDEN value=$BLOCK->isHidden()} {assign var=WIDTHTYPE value=$USER_MODEL->get('rowheight')} - <input type=hidden name="timeFormatOptions" data-value='{$DAY_STARTS}' /> + <input type=hidden name="timeFormatOptions" data-value='{if isset($DAY_STARTS)}{/if}' /> <div> <h4 class="textOverflowEllipsis maxWidth50"> <img class="cursorPointer alignMiddle blockToggle {if !($IS_HIDDEN)} hide {/if}" src="{vimage_path('arrowRight.png')}" data-mode="hide" data-id={$BLOCK_LIST[$BLOCK_LABEL_KEY]->get('id')}> diff --git a/layouts/v7/modules/Vtiger/OverlayDetailView.tpl b/layouts/v7/modules/Vtiger/OverlayDetailView.tpl index 1bd8d59879cfc2c5517cd8e2d82334929615b744..26add60a04b2130f36116fecd4ecc82a93e3c629 100644 --- a/layouts/v7/modules/Vtiger/OverlayDetailView.tpl +++ b/layouts/v7/modules/Vtiger/OverlayDetailView.tpl @@ -54,11 +54,13 @@ <div class="clearfix"> <div class = "btn-group"> <button class="btn btn-default fullDetailsButton" onclick="window.location.href = '{$RECORD->getFullDetailViewUrl()}&app={$SELECTED_MENU_CATEGORY}'">{vtranslate('LBL_DETAILS',$MODULE_NAME)}</button> - {foreach item=DETAIL_VIEW_BASIC_LINK from=$DETAILVIEW_LINKS['DETAILVIEWBASIC']} - {if $DETAIL_VIEW_BASIC_LINK && $DETAIL_VIEW_BASIC_LINK->getLabel() == 'LBL_EDIT'} - <button class="btn btn-default editRelatedRecord" value = "{$RECORD->getEditViewUrl()}">{vtranslate('LBL_EDIT',$MODULE_NAME)}</button> - {/if} - {/foreach} + {if isset($DETAILVIEW_LINKS)} + {foreach item=DETAIL_VIEW_BASIC_LINK from=$DETAILVIEW_LINKS['DETAILVIEWBASIC']} + {if $DETAIL_VIEW_BASIC_LINK && $DETAIL_VIEW_BASIC_LINK->getLabel() == 'LBL_EDIT'} + <button class="btn btn-default editRelatedRecord" value = "{$RECORD->getEditViewUrl()}">{vtranslate('LBL_EDIT',$MODULE_NAME)}</button> + {/if} + {/foreach} + {/if} </div> <div class="pull-right " > <button type="button" class="close" aria-label="Close" data-dismiss="modal"> diff --git a/layouts/v7/modules/Vtiger/RecentActivities.tpl b/layouts/v7/modules/Vtiger/RecentActivities.tpl index ab22c6e86948a99bc4cd3dffa7d2caffa21f61db..c7200ef719a1807adee26fd12a0df8a4729a537f 100644 --- a/layouts/v7/modules/Vtiger/RecentActivities.tpl +++ b/layouts/v7/modules/Vtiger/RecentActivities.tpl @@ -92,8 +92,13 @@ {assign var=PRE_DISPLAY_VALUE value=$TIME_PRE_DISPLAY_VALUE} {assign var=POST_DISPLAY_VALUE value=$TIME_POST_DISPLAY_VALUE} {/if} + {if isset($TIME_PRE_DISPLAY_VALUE)} + {assign var=PRE_DISPLAY_TITLE value=$TIME_PRE_DISPLAY_VALUE} + + {else} + {assign var=PRE_DISPLAY_TITLE value=''} + {/if} - {assign var=PRE_DISPLAY_TITLE value=$TIME_PRE_DISPLAY_VALUE} {if $FIELDMODEL && $FIELDMODEL->getFieldInstance() && $FIELDMODEL->getFieldInstance()->isViewable() && $FIELDMODEL->getFieldInstance()->getDisplayType() neq '5'} diff --git a/layouts/v7/modules/Vtiger/partials/RelatedListHeader.tpl b/layouts/v7/modules/Vtiger/partials/RelatedListHeader.tpl index 36b24a959db984e895baa56c66266f889420bd6e..3cef97ed0fbdcf3b969d89d887f91f87b25c290b 100644 --- a/layouts/v7/modules/Vtiger/partials/RelatedListHeader.tpl +++ b/layouts/v7/modules/Vtiger/partials/RelatedListHeader.tpl @@ -38,7 +38,7 @@ {if $IS_SELECT_BUTTON eq true} data-moduleName="{$RELATED_LINK->get('_module')->get('name')}" {/if} {if ($RELATED_LINK->isPageLoadLink())} {if $RELATION_FIELD} data-name="{$RELATION_FIELD->getName()}" {/if} - data-url="{$RELATED_LINK->getUrl()}{if $SELECTED_MENU_CATEGORY}&app={$SELECTED_MENU_CATEGORY}{/if}" + data-url="{$RELATED_LINK->getUrl()}{if isset($SELECTED_MENU_CATEGORY)}&app={$SELECTED_MENU_CATEGORY}{/if}" {/if} >{if $IS_SELECT_BUTTON eq false}<i class="fa fa-plus"></i> {/if} {$RELATED_LINK->getLabel()}</button> {/if} diff --git a/layouts/v7/modules/Vtiger/uitypes/Date.tpl b/layouts/v7/modules/Vtiger/uitypes/Date.tpl index 3d0f6c9ae3ea5ad84db66e8f59834801c323cc29..3aadfbdda43ccd9c0cd7dac134ed8952239c27c3 100644 --- a/layouts/v7/modules/Vtiger/uitypes/Date.tpl +++ b/layouts/v7/modules/Vtiger/uitypes/Date.tpl @@ -13,7 +13,7 @@ {assign var="FIELD_INFO" value=$FIELD_MODEL->getFieldInfo()} {assign var="SPECIAL_VALIDATOR" value=$FIELD_MODEL->getValidator()} {assign var="dateFormat" value=$USER_MODEL->get('date_format')} -{if (!$FIELD_NAME)} +{if (!isset($FIELD_NAME))} {assign var="FIELD_NAME" value=$FIELD_MODEL->getFieldName()} {/if} <div class="input-group inputElement" style="margin-bottom: 3px"> diff --git a/layouts/vlayout/modules/Vtiger/uitypes/Date.tpl b/layouts/vlayout/modules/Vtiger/uitypes/Date.tpl index 50fa8504be4220a2bce435ae461656bcb893d4ad..7e75b6d1a2602c27e6dff3dcb2faff3c3db53e36 100644 --- a/layouts/vlayout/modules/Vtiger/uitypes/Date.tpl +++ b/layouts/vlayout/modules/Vtiger/uitypes/Date.tpl @@ -17,7 +17,7 @@ <div class="span12 row-fluid date"> {assign var=FIELD_NAME value=$FIELD_MODEL->get('name')} <input id="{$MODULE}_editView_fieldName_{$FIELD_NAME}" type="text" class="dateField" name="{$FIELD_MODEL->getFieldName()}" data-date-format="{$dateFormat}" - type="text" value="{$FIELD_MODEL->getEditViewDisplayValue($FIELD_MODEL->get('fieldvalue'))}" data-validation-engine="validate[{if $FIELD_MODEL->isMandatory() eq true} required,{/if}funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" {if !empty($SPECIAL_VALIDATOR)}data-validator='{Zend_Json::encode($SPECIAL_VALIDATOR)}'{/if} data-fieldinfo='{$FIELD_INFO}' + type="text" data-validation-engine="validate[{if $FIELD_MODEL->isMandatory() eq true} required,{/if}funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" {if !empty($SPECIAL_VALIDATOR)}data-validator='{Zend_Json::encode($SPECIAL_VALIDATOR)}'{/if} data-fieldinfo='{$FIELD_INFO}' {if $MODE eq 'edit' && $FIELD_NAME eq 'due_date'} data-user-changed-time="true" {/if} /> <span class="add-on"><i class="icon-calendar"></i></span> </div> diff --git a/modules/Calendar/Activity.php b/modules/Calendar/Activity.php index d92db4f65f1b9c58e185afb82a9375e1708efed2..62b46d146e06ab204a0815bc564071a2a4452aa9 100644 --- a/modules/Calendar/Activity.php +++ b/modules/Calendar/Activity.php @@ -145,7 +145,7 @@ class Activity extends CRMEntity { } } $adb->pquery($sql, $params); - } else if ($_REQUEST['contactidlist'] == '' && $insertion_mode == "edit") { + } else if (isset($_REQUEST['contactidlist'] ) && $_REQUEST['contactidlist'] == '' && $insertion_mode == "edit") { $adb->pquery('DELETE FROM vtiger_cntactivityrel WHERE activityid = ?', array($recordId)); } @@ -180,7 +180,7 @@ class Activity extends CRMEntity { $this->insertIntoReminderTable('vtiger_activity_reminder',$module,""); //Handling for invitees - $selected_users_string = $_REQUEST['inviteesid']; + $selected_users_string = isset($_REQUEST['inviteesid'])?$_REQUEST['inviteesid']:' '; $invitees_array = explode(';',$selected_users_string); $this->insertIntoInviteeTable($module,$invitees_array); @@ -242,7 +242,7 @@ class Activity extends CRMEntity { } else { $status = 1; } - + $callback_query=''; if(isset($reminderid)) { $callback_query = "UPDATE vtiger_activity_reminder_popup set status = ?, date_start = ?, time_start = ? WHERE reminderid = ?"; $callback_params = array($status, $cbdate, $cbtime, $reminderid); @@ -386,7 +386,9 @@ function insertIntoRecurringTable(& $recurObj) function insertIntoInviteeTable($module,$invitees_array) { global $log,$adb; - $log->debug("Entering insertIntoInviteeTable(".$module.",".$invitees_array.") method ..."); + // file_put_contents('test5.log',print_r($invitees_array,true),FILE_APPEND); + // file_put_contents('test5.log',print_r(implode(',',$invitees_array),true),FILE_APPEND); + $log->debug("Entering insertIntoInviteeTable(".$module.",".implode(',',$invitees_array).") method ..."); if($this->mode == 'edit'){ $sql = "DELETE FROM vtiger_invitees WHERE activityid=?"; $adb->pquery($sql, array($this->id)); diff --git a/modules/Calendar/RepeatEvents.php b/modules/Calendar/RepeatEvents.php index 4219cc9a4edba0b6f078d864a33476a3edaf0d55..563ad7c29f69413324edffcae46220d4e1f84f76 100644 --- a/modules/Calendar/RepeatEvents.php +++ b/modules/Calendar/RepeatEvents.php @@ -394,7 +394,7 @@ class Calendar_RepeatEvents { } static function checkRecurringDataChanged($recurObjRequest, $recurObjDb) { - if(($recurObjRequest->recur_type == $recurObjDb->recur_type) && ($recurObjRequest->recur_freq == $recurObjDb->recur_freq) + if(($recurObjRequest!==null && $recurObjDb!==null) && ($recurObjRequest->recur_type == $recurObjDb->recur_type) && ($recurObjRequest->recur_freq == $recurObjDb->recur_freq) && ($recurObjRequest->recurringdates[0] == $recurObjDb->recurringdates[0]) && ($recurObjRequest->recurringenddate == $recurObjDb->recurringenddate) && ($recurObjRequest->dayofweek_to_rpt == $recurObjDb->dayofweek_to_rpt) && ($recurObjRequest->repeat_monthby == $recurObjDb->repeat_monthby) && ($recurObjRequest->rptmonth_datevalue == $recurObjDb->rptmonth_datevalue) && ($recurObjRequest->rptmonth_daytype == $recurObjDb->rptmonth_daytype)) { diff --git a/modules/Calendar/models/Field.php b/modules/Calendar/models/Field.php index cb81df21944800b02ad1010760b1f81a211bc105..880f40678e7d4415c54fbe8cc234efcc07d22427 100644 --- a/modules/Calendar/models/Field.php +++ b/modules/Calendar/models/Field.php @@ -80,6 +80,7 @@ class Calendar_Field_Model extends Vtiger_Field_Model { } else if ($this->getName() == 'due_date') { $dateTimeValue = $value . ' '. $recordInstance->get('time_end'); $value = $this->getUITypeModel()->getDisplayValue($dateTimeValue); + if (substr_count($value, ' ') == 0) $value .= ' '; // if $startTime is missing then added a space to it to avoid undefined array key warning. list($startDate, $startTime) = explode(' ', $value); $currentUser = Users_Record_Model::getCurrentUserModel(); diff --git a/modules/Calendar/models/Record.php b/modules/Calendar/models/Record.php index d13c3c4ba7320c12ca4e9cd774b9d005efdb8937..d58e2fa7fbf06ca8ee1520650265b50bb19fcebc 100644 --- a/modules/Calendar/models/Record.php +++ b/modules/Calendar/models/Record.php @@ -99,7 +99,7 @@ class Calendar_Record_Model extends Vtiger_Record_Model { function save() { //Time should changed to 24hrs format $_REQUEST['time_start'] = Vtiger_Time_UIType::getTimeValueWithSeconds($_REQUEST['time_start']); - $_REQUEST['time_end'] = Vtiger_Time_UIType::getTimeValueWithSeconds($_REQUEST['time_end']); + $_REQUEST['time_end'] = isset($_REQUEST['time_end']) ? Vtiger_Time_UIType::getTimeValueWithSeconds($_REQUEST['time_end']): ''; parent::save(); } diff --git a/modules/Calendar/uitypes/Time.php b/modules/Calendar/uitypes/Time.php index afd349279abeefb3e597e7d9ee1d354f061a88da..3e1d887065ec1d187a339fd758e2f0999004eeae 100644 --- a/modules/Calendar/uitypes/Time.php +++ b/modules/Calendar/uitypes/Time.php @@ -36,8 +36,8 @@ class Calendar_Time_UIType extends Vtiger_Time_UIType { * @return <Vtiger_Time_UIType> - getTimeValue */ public function getDisplayTimeDifferenceValue($fieldName, $value){ - $userModel = Users_Privileges_Model::getCurrentUserModel(); - $date = new DateTime($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)) { diff --git a/modules/Calendar/views/Detail.php b/modules/Calendar/views/Detail.php index 186583fb7e952add457393681224bf2da3f65b07..2301a0a32ad4e543905a190865091428ba6c2408 100644 --- a/modules/Calendar/views/Detail.php +++ b/modules/Calendar/views/Detail.php @@ -144,7 +144,6 @@ class Calendar_Detail_View extends Vtiger_Detail_View { $relatedContacts = array(); } - $viewer = $this->getViewer($request); $viewer->assign('RECORD', $recordModel); $viewer->assign('RECORD_STRUCTURE', $structuredValues); @@ -152,10 +151,13 @@ class Calendar_Detail_View extends Vtiger_Detail_View { $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStrucure); $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel()); $viewer->assign('MODULE_NAME', $moduleName); + $viewer->assign('DAY_STARTS',' '); $viewer->assign('RELATED_CONTACTS', $relatedContacts); $viewer->assign('IS_AJAX_ENABLED', $this->isAjaxEnabled($recordModel)); $viewer->assign('RECURRING_INFORMATION', $recordModel->getRecurringDetails()); + $appName = !empty($request->get('app'))?$request->get('app'):''; + $viewer->assign('SELECTED_MENU_CATEGORY',$appName); $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName); $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Vtiger_Functions::jsonEncode($picklistDependencyDatasource)); diff --git a/modules/Events/actions/Save.php b/modules/Events/actions/Save.php index 9113275cef57ff994311469149f223ae6d26dae5..bc095debfeaf38a9f2e8b84c1611f565da4d7a29 100644 --- a/modules/Events/actions/Save.php +++ b/modules/Events/actions/Save.php @@ -80,7 +80,7 @@ class Events_Save_Action extends Calendar_Save_Action { $recurObj = getrecurringObjValue(); $recurringDataChanged = Calendar_RepeatEvents::checkRecurringDataChanged($recurObj, $recurObjDb); //TODO: remove the dependency on $_REQUEST - if(($_REQUEST['recurringtype'] != '' && $_REQUEST['recurringtype'] != '--None--' && $recurringEditMode != 'current') || ($recurringDataChanged && empty($recurObj))) { + if((isset($_REQUEST['recurringtype']))&&($_REQUEST['recurringtype'] != '' && $_REQUEST['recurringtype'] != '--None--' && $recurringEditMode != 'current') || ($recurringDataChanged && empty($recurObj))) { $focus = CRMEntity::getInstance('Events'); //get all the stored data to this object $focus->column_fields = new TrackableObject($recordModel->getData()); diff --git a/modules/Vtiger/models/Field.php b/modules/Vtiger/models/Field.php index 8fe19db1b3e1b66540df101519b2a0a72b528281..82ad26d1e102e377bca183a337cd505c4fcf936f 100644 --- a/modules/Vtiger/models/Field.php +++ b/modules/Vtiger/models/Field.php @@ -1347,7 +1347,7 @@ class Vtiger_Field_Model extends Vtiger_Field { } public function hasDefaultValue() { - return trim($this->defaultvalue) == '' ? false : true; + return ($this->defaultvalue !== null && trim($this->defaultvalue) === '') ? false : true; } public function isActiveField() { diff --git a/modules/Vtiger/uitypes/Time.php b/modules/Vtiger/uitypes/Time.php index 4ee1b37e0efbef87245f4d8120cfc3b1349d872c..a8030bff5930a18886c325f9dbe613522b6d1855 100644 --- a/modules/Vtiger/uitypes/Time.php +++ b/modules/Vtiger/uitypes/Time.php @@ -64,15 +64,17 @@ class Vtiger_Time_UIType extends Vtiger_Base_UIType { */ public static function getTimeValueWithSeconds($time) { if($time){ + if (substr_count($time, ':') < 2) $time .= ':'; // adding : if seconds value is missing to avoid undefined array key error $timeDetails = explode(' ', $time); + // if(php7_count(explode(':', $timeDetails[0])) == 2)$timeDetails[0].=":";// adding : if seconds value is missing to avoid undefined array key error list($hours, $minutes, $seconds) = explode(':', $timeDetails[0]); //If pm exists and if it not 12 then we need to make it to 24 hour format - if ($timeDetails[1] === 'PM' && $hours != '12') { + if (isset($timeDetails[1]) && $timeDetails[1] === 'PM' && $hours != '12') { $hours = $hours+12; } - if($timeDetails[1] === 'AM' && $hours == '12'){ + if(isset($timeDetails[1]) && $timeDetails[1] === 'AM' && $hours == '12'){ $hours = '00'; } diff --git a/modules/Vtiger/views/Detail.php b/modules/Vtiger/views/Detail.php index 6248b3d4173c9d31359ea230a9a70e0f3ca0f265..847a51cbac806a8974a14795805efa0eca143f61 100644 --- a/modules/Vtiger/views/Detail.php +++ b/modules/Vtiger/views/Detail.php @@ -319,7 +319,7 @@ class Vtiger_Detail_View extends Vtiger_Index_View { $viewer->assign('MODULE_NAME', $moduleName); $viewer->assign('IS_AJAX_ENABLED', $this->isAjaxEnabled($recordModel)); $viewer->assign('MODULE', $moduleName); - + $viewer->assign('DAY_STARTS',' '); $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName); $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Vtiger_Functions::jsonEncode($picklistDependencyDatasource)); diff --git a/modules/Vtiger/views/MassActionAjax.php b/modules/Vtiger/views/MassActionAjax.php index d014c41109ec0fe61b22c948ed3bd4d3bbdc0aec..5a1dbf8eb2be1107a9a204fec1960c7b39487ae9 100644 --- a/modules/Vtiger/views/MassActionAjax.php +++ b/modules/Vtiger/views/MassActionAjax.php @@ -210,11 +210,15 @@ class Vtiger_MassActionAjax_View extends Vtiger_IndexAjax_View { $viewer->assign('ALPHABET_VALUE',$searchValue); $viewer->assign('SEARCH_KEY',$searchKey); } + else{ + $viewer->assign('OPERATOR',''); + $viewer->assign('ALPHABET_VALUE',' '); + $viewer->assign('SEARCH_KEY',' '); + } + + $searchParams = !empty($request->get('search_params'))?$request->get('search_params'):' '; + $viewer->assign('SEARCH_PARAMS',$searchParams); - $searchParams = $request->get('search_params'); - if(!empty($searchParams)) { - $viewer->assign('SEARCH_PARAMS',$searchParams); - } $to = $request->get('to'); if (!$to) { diff --git a/modules/Vtiger/views/RelatedList.php b/modules/Vtiger/views/RelatedList.php index 7cce7ba711d93fc1f7099ca5797899f8d168fc12..c3784e2f6cee5e64d587d3e9613460bcaf439da6 100644 --- a/modules/Vtiger/views/RelatedList.php +++ b/modules/Vtiger/views/RelatedList.php @@ -109,6 +109,7 @@ class Vtiger_RelatedList_View extends Vtiger_Index_View { $viewer->assign('RELATED_ENTIRES_COUNT', $noOfEntries); $viewer->assign('RELATION_FIELD', $relationField); $appName = $request->get('app'); + // file_put_contents('test089.log',print_r($appName.'Hello',true),FILE_APPEND); if(!empty($appName)){ $viewer->assign('SELECTED_MENU_CATEGORY',$appName); } diff --git a/vtlib/Vtiger/Functions.php b/vtlib/Vtiger/Functions.php index 106558c75197775a5d833b834a983f05bb1f2b85..f9c137232aff0a435e0a5b71c50f9f910fed95e8 100644 --- a/vtlib/Vtiger/Functions.php +++ b/vtlib/Vtiger/Functions.php @@ -1739,17 +1739,17 @@ class Vtiger_Functions { $endchar = ""; // HTML embed in attributes (eg. img src="..."). - $startidx = strpos($input, '"data:', $offset); + $startidx = strpos($input ??'', '"data:', $offset); if ($startidx !== false) { $endchar = '"'; } else { // HTML embed in attributes (eg. img src='...'). - $startidx = strpos($input, "'data:", $offset); + $startidx = strpos($input ??'', "'data:", $offset); if ($startidx !== false) { $endchar = "'"; } else { // TEXT embed with wrap [eg. (data...)] - $startidx = strpos($input, "(data:", $offset); + $startidx = strpos($input ??'', "(data:", $offset); if ($startidx !== false) { $endchar = ")"; } else { @@ -1778,7 +1778,7 @@ class Vtiger_Functions { $offset = $endidx + 1; } while (true); - if ($offset < strlen($input)) { + if ($offset < strlen($input ?? '')) { $parts[] = substr($input, $offset); } return implode("", $parts);