diff --git a/data/CRMEntity.php b/data/CRMEntity.php index 4562709e1081cb5f41a40c6133230178f4b9b2f5..9875fc1ecce45b47fd3587d8aad27cba756d1c3c 100644 --- a/data/CRMEntity.php +++ b/data/CRMEntity.php @@ -159,7 +159,7 @@ class CRMEntity { */ function uploadAndSaveFile($id, $module, $file_details, $attachmentType='Attachment') { global $log; - $log->debug("Entering into uploadAndSaveFile($id,$module,$file_details) method."); + $log->debug("Entering into uploadAndSaveFile($id,$module," . var_export($file_details, true) . ") method."); global $adb, $current_user; global $upload_badext; @@ -3136,7 +3136,7 @@ class TrackableObject implements ArrayAccess, IteratorAggregate { #[\ReturnTypeWillChange] function offsetSet($key, $value) { - if(is_array($value)) $value = empty($value) ? "" : $value[0]; + if(is_array($value)) $value = empty($value) ? "" : isset($value[0]); if($this->tracking && $this->trackingEnabled) { $olderValue = $this->offsetGet($key); // decode_html only expects string diff --git a/include/ListView/ListViewSession.php b/include/ListView/ListViewSession.php index 7653e3ec63950907d09ca2a9b700342090aa47b7..eaa6f46203b8b5bd754b3724891df0855099dc91 100644 --- a/include/ListView/ListViewSession.php +++ b/include/ListView/ListViewSession.php @@ -103,7 +103,7 @@ class ListViewSession { } } - $list_query = $_SESSION[$currentModule.'_listquery']; + $list_query = isset($_SESSION[$currentModule.'_listquery'])?$_SESSION[$currentModule.'_listquery']:''; if($reUseData === false && !empty($list_query)){ $recordNavigationInfo = array(); diff --git a/include/utils/InventoryUtils.php b/include/utils/InventoryUtils.php index 223bce80a16dacb34084327d793646265c846fcc..5cb1b6de7d6f6ff1c55a432d6be62dc94b670da1 100644 --- a/include/utils/InventoryUtils.php +++ b/include/utils/InventoryUtils.php @@ -200,7 +200,7 @@ function getProductTaxPercentage($type,$productid,$default='') if($current_user->truncate_trailing_zeros == true) { $taxpercentage = decimalFormat($taxpercentage); } - return array('percentage' => $taxpercentage, 'regions' => Zend_Json::decode(html_entity_decode($adb->query_result($res, $i, 'regions')))); + return array('percentage' => $taxpercentage, 'regions' => Zend_Json::decode(html_entity_decode(!empty($adb->query_result($res,0, 'regions'))))); } /** Function used to add the history entry in the relevant tables for PO, SO, Quotes and Invoice modules @@ -383,7 +383,7 @@ function getTaxDetailsForProduct($productid, $available='all') $tax_details[$i]['type'] = $adb->query_result($res, $i, 'type'); $tax_details[$i]['regions'] = Zend_Json::decode(html_entity_decode($adb->query_result($res, $i, 'taxregions'))); $tax_details[$i]['compoundon'] = Zend_Json::decode(html_entity_decode($adb->query_result($res, $i, 'compoundon'))); - $tax_details[$i]['productregions']= Zend_Json::decode(html_entity_decode($adb->query_result($res, $i, 'productregions'))); + $tax_details[$i]['productregions']= Zend_Json::decode(html_entity_decode(!empty($adb->query_result($res, $i, 'productregions')))); } } else diff --git a/layouts/v7/modules/Vtiger/Comment.tpl b/layouts/v7/modules/Vtiger/Comment.tpl index 56df0f3668a50450c91de5fd1be0ef6ed84cc186..7234907a5b50f1333274d4a7b2fc4a29c62baeb1 100644 --- a/layouts/v7/modules/Vtiger/Comment.tpl +++ b/layouts/v7/modules/Vtiger/Comment.tpl @@ -36,7 +36,7 @@ <span class="creatorName" style="color:blue"> {$CREATOR_NAME} </span> - {if $ROLLUP_STATUS and $COMMENT->get('module') ne $MODULE_NAME} + {if isset ($ROLLUP_STATUS) && $ROLLUP_STATUS and $COMMENT->get('module') ne $MODULE_NAME} {assign var=SINGULR_MODULE value='SINGLE_'|cat:$COMMENT->get('module')} {assign var=ENTITY_NAME value=getEntityName($COMMENT->get('module'), array($COMMENT->get('related_to')))} <span class="text-muted"> @@ -69,12 +69,12 @@ <br> <div class="commentActionsContainer"> <span class="commentActions"> - {if $CHILDS_ROOT_PARENT_MODEL} + {if isset ($CHILDS_ROOT_PARENT_MODEL) && $CHILDS_ROOT_PARENT_MODEL} {assign var=CHILDS_ROOT_PARENT_ID value=$CHILDS_ROOT_PARENT_MODEL->getId()} {/if} {if $COMMENTS_MODULE_MODEL->isPermitted('EditView')} - {if $CHILDS_ROOT_PARENT_MODEL} + {if isset ($CHILDS_ROOT_PARENT_MODEL) && $CHILDS_ROOT_PARENT_MODEL} {assign var=CHILDS_ROOT_PARENT_ID value=$CHILDS_ROOT_PARENT_MODEL->getId()} {/if} <a href="javascript:void(0);" class="cursorPointer replyComment feedback" style="color: blue;"> @@ -89,7 +89,7 @@ {/if} {assign var=CHILD_COMMENTS_COUNT value=$COMMENT->getChildCommentsCount()} - {if $CHILD_COMMENTS_MODEL neq null and ($CHILDS_ROOT_PARENT_ID neq $PARENT_COMMENT_ID)} + {if $CHILD_COMMENTS_MODEL neq null and (isset($CHILDS_ROOT_PARENT_ID)&& $CHILDS_ROOT_PARENT_ID neq $PARENT_COMMENT_ID)} {if $COMMENTS_MODULE_MODEL->isPermitted('EditView')} {/if} <span class="viewThreadBlock" data-child-comments-count="{$CHILD_COMMENTS_COUNT}"> <a href="javascript:void(0)" class="cursorPointer viewThread" style="color: blue;"> @@ -101,7 +101,7 @@ <span class="childCommentsCount">{$CHILD_COMMENTS_COUNT}</span> {if $CHILD_COMMENTS_COUNT eq 1}{vtranslate('LBL_REPLY',$MODULE_NAME)}{else}{vtranslate('LBL_REPLIES',$MODULE_NAME)}{/if} </a> </span> - {elseif $CHILD_COMMENTS_MODEL neq null and ($CHILDS_ROOT_PARENT_ID eq $PARENT_COMMENT_ID)} + {elseif $CHILD_COMMENTS_MODEL neq null and (isset($CHILDS_ROOT_PARENT_ID)&& $CHILDS_ROOT_PARENT_ID eq $PARENT_COMMENT_ID)} {if $COMMENTS_MODULE_MODEL->isPermitted('EditView')} {/if} <span class="viewThreadBlock" data-child-comments-count="{$CHILD_COMMENTS_COUNT}" style="display:none;"> <a href="javascript:void(0)" class="cursorPointer viewThread" style="color: blue;"> diff --git a/layouts/v7/modules/Vtiger/CommentsList.tpl b/layouts/v7/modules/Vtiger/CommentsList.tpl index 2d7764f9d2c10ef0cd010f86c5feca7fd8aa86b7..25bb39f92e8c10394bc1405ea8d3452047027c8d 100644 --- a/layouts/v7/modules/Vtiger/CommentsList.tpl +++ b/layouts/v7/modules/Vtiger/CommentsList.tpl @@ -13,7 +13,7 @@ {if !empty($PARENT_COMMENTS)} <ul class="unstyled"> - {if $CURRENT_COMMENT} + {if isset($CURRENT_COMMENT) && $CURRENT_COMMENT} {assign var=CHILDS_ROOT_PARENT_MODEL value=$CURRENT_COMMENT} {assign var=CURRENT_COMMENT_PARENT_MODEL value=$CURRENT_COMMENT->getParentCommentModel()} {while $CURRENT_COMMENT_PARENT_MODEL neq false} @@ -30,7 +30,7 @@ <li class="commentDetails"> {include file='Comment.tpl'|@vtemplate_path COMMENT=$COMMENT COMMENT_MODULE_MODEL=$COMMENTS_MODULE_MODEL} - {if $CHILDS_ROOT_PARENT_MODEL} + {if isset($CHILDS_ROOT_PARENT_MODEL) && $CHILDS_ROOT_PARENT_MODEL} {if $CHILDS_ROOT_PARENT_MODEL->getId() eq $PARENT_COMMENT_ID} {assign var=CHILD_COMMENTS_MODEL value=$CHILDS_ROOT_PARENT_MODEL->getChildComments()} {include file='CommentsListIteration.tpl'|@vtemplate_path CHILD_COMMENTS_MODEL=$CHILD_COMMENTS_MODEL} diff --git a/layouts/v7/modules/Vtiger/ComposeEmailForm.tpl b/layouts/v7/modules/Vtiger/ComposeEmailForm.tpl index dea10cf2bb9f9de46f2dfd1a372970e0ff97b513..8df4a905fc626e1cf8ea8c5dfa0447baaa6ef618 100644 --- a/layouts/v7/modules/Vtiger/ComposeEmailForm.tpl +++ b/layouts/v7/modules/Vtiger/ComposeEmailForm.tpl @@ -171,7 +171,7 @@ </div> <div class="row templateContent"> <div class="col-lg-12"> - <textarea style="width:390px;height:200px;" id="description" name="description">{$DESCRIPTION}</textarea> + <textarea style="width:390px;height:200px;" id="description" name="description">{isset$DESCRIPTION}</textarea> </div> </div> diff --git a/layouts/v7/modules/Vtiger/OverlayEditView.tpl b/layouts/v7/modules/Vtiger/OverlayEditView.tpl index 66c58bdf9ae297d8d5d72671695e90f43da33ddf..0268557fde4e30d917d76297aa95098b699c0e33 100644 --- a/layouts/v7/modules/Vtiger/OverlayEditView.tpl +++ b/layouts/v7/modules/Vtiger/OverlayEditView.tpl @@ -13,7 +13,7 @@ <div class='fc-overlay-modal modal-content overlayEdit'> <div class="overlayHeader"> - {assign var=TITLE value="{vtranslate('LBL_EDITING', $MODULE)} {vtranslate($SINGLE_MODULE_NAME, $MODULE)} - {$RECORD_STRUCTURE_MODEL->getRecordName()}"} + {assign var=TITLE value="{vtranslate('LBL_EDITING', $MODULE)} {vtranslate(isset($SINGLE_MODULE_NAME), $MODULE)} - {$RECORD_STRUCTURE_MODEL->getRecordName()}"} {include file="ModalHeader.tpl"|vtemplate_path:$MODULE} </div> <form class="form-horizontal recordEditView" id="EditView" name="edit" method="post" action="index.php" enctype="multipart/form-data"> diff --git a/layouts/v7/modules/Vtiger/partials/EditViewContents.tpl b/layouts/v7/modules/Vtiger/partials/EditViewContents.tpl index 004763b240c58dd0b8dd146172bed0aa0d35c759..106011ffc94504b8abd9752caed8d2b284d22eec 100644 --- a/layouts/v7/modules/Vtiger/partials/EditViewContents.tpl +++ b/layouts/v7/modules/Vtiger/partials/EditViewContents.tpl @@ -14,7 +14,7 @@ {/if} <div name='editContent'> - {if $DUPLICATE_RECORDS} + {if isset($DUPLICATE_RECORDS) && $DUPLICATE_RECORDS} <div class="fieldBlockContainer duplicationMessageContainer"> <div class="duplicationMessageHeader"><b>{vtranslate('LBL_DUPLICATES_DETECTED', $MODULE)}</b></div> <div>{getDuplicatesPreventionMessage($MODULE, $DUPLICATE_RECORDS)}</div> diff --git a/layouts/v7/modules/Vtiger/uitypes/ProductTax.tpl b/layouts/v7/modules/Vtiger/uitypes/ProductTax.tpl index ff8f81c875685b5dbbf5543788e568079b4f468a..5c69cf1271450ef8c0beb0585e7be7fb2260e090 100644 --- a/layouts/v7/modules/Vtiger/uitypes/ProductTax.tpl +++ b/layouts/v7/modules/Vtiger/uitypes/ProductTax.tpl @@ -21,7 +21,7 @@ {/if} {if $tax_count gt 1} - <td class="fieldLabel alignMiddle{if $PULL_RIGHT} pull-right{/if}">{*pull-right required in Quick create only*} + <td class="fieldLabel alignMiddle{if isset($PULL_RIGHT) && $PULL_RIGHT} pull-right{/if}">{*pull-right required in Quick create only*} <label class=""> {/if} <span class="taxLabel alignBottom">{vtranslate($tax.taxlabel, $MODULE)}<span class="paddingLeft10px">(%)</span></span> diff --git a/modules/Documents/Documents.php b/modules/Documents/Documents.php index b34a3fd32daf0032af78d0d23e6a817d00d12ca9..93f0adcb81baeddf9740206440b98b2aa3cc4442 100644 --- a/modules/Documents/Documents.php +++ b/modules/Documents/Documents.php @@ -552,6 +552,7 @@ class Documents extends CRMEntity { function get_related_list($id, $cur_tab_id, $rel_tab_id,$actions = false) { $related_module = vtlib_getModuleNameById($rel_tab_id); $other = CRMEntity::getInstance($related_module); + $more_relation=''; vtlib_setup_modulevars('Documents', $this); vtlib_setup_modulevars($related_module, $other); diff --git a/modules/Products/models/Record.php b/modules/Products/models/Record.php index 967f4eaac4dfa80c7ded039ae0d249717ca35196..8659fecc8afd68462483b06f058eb94b55ef5756 100644 --- a/modules/Products/models/Record.php +++ b/modules/Products/models/Record.php @@ -370,7 +370,7 @@ class Products_Record_Model extends Vtiger_Record_Model { $imageNamesList[] = $imageName; $imageUrlsList[] = $url; } - + $imageOriginalNamesList=array(); if(is_array($imageOriginalNamesList)) { $countOfImages = php7_count($imageOriginalNamesList); for($j=0; $j<$countOfImages; $j++) { diff --git a/modules/Vtiger/actions/MentionedUsers.php b/modules/Vtiger/actions/MentionedUsers.php index d6bd2cba374f675d978cc4ec6e32e840f160d38c..7ab3b92b83054f2e7254ab55e8937d0373a6e17b 100644 --- a/modules/Vtiger/actions/MentionedUsers.php +++ b/modules/Vtiger/actions/MentionedUsers.php @@ -37,7 +37,7 @@ class Vtiger_MentionedUsers_Action extends Vtiger_Action_Controller { if(($key = array_search(strtolower($currentUserName), $mentionedUsers)) !== false) { unset($mentionedUsers[$key]); } - + $mentionedUsersData=''; if(!empty($mentionedUsers)){ $usersString = '@'.implode(' @', $mentionedUsers); $mentionedUsersData['usersString'] = $usersString.' '; diff --git a/modules/Vtiger/models/RelationListView.php b/modules/Vtiger/models/RelationListView.php index 2a32d8a3fcb1d8ee7ff5a0f4397b08a8b9896176..054045afa4cad9789d776f35c486858402a0f229 100644 --- a/modules/Vtiger/models/RelationListView.php +++ b/modules/Vtiger/models/RelationListView.php @@ -281,7 +281,7 @@ class Vtiger_RelationListView_Model extends Vtiger_Base_Model { if (is_array($fieldValue)) { $comparator = $fieldValue[1]; $searchValue = $fieldValue[2]; - $type = $fieldValue[3]; + $type = isset($fieldValue[3])?$fieldValue[3]:''; if ($type == 'time') { $searchValue = Vtiger_Time_UIType::getTimeValueWithSeconds($searchValue); } @@ -350,8 +350,10 @@ class Vtiger_RelationListView_Model extends Vtiger_Base_Model { } } //To show the value of "Assigned to" + if(isset($row['smownerid'])){ $ownerId = $row['smownerid']; $newRow['assigned_user_id'] = $row['smownerid']; + } if($relationModuleName == 'Calendar') { $visibleFields = array('activitytype','date_start','time_start','due_date','time_end','assigned_user_id','visibility','smownerid','parent_id'); $visibility = true; diff --git a/modules/Vtiger/views/Detail.php b/modules/Vtiger/views/Detail.php index 847a51cbac806a8974a14795805efa0eca143f61..0ffcfcf6cf969dc7841a669a0977ccb4141bfa7a 100644 --- a/modules/Vtiger/views/Detail.php +++ b/modules/Vtiger/views/Detail.php @@ -561,6 +561,7 @@ class Vtiger_Detail_View extends Vtiger_Index_View { } if($targetControllerClass) { $targetController = new $targetControllerClass(); + file_put_contents('testing.log',print_r($targetController,true),FILE_APPEND); if($targetController->checkPermission($request)){ return $targetController->process($request); } @@ -579,10 +580,12 @@ class Vtiger_Detail_View extends Vtiger_Index_View { $currentUserModel = Users_Record_Model::getCurrentUserModel(); $modCommentsModel = Vtiger_Module_Model::getInstance('ModComments'); $moduleName = $parentCommentModel->getParentRecordModel()->getModuleName(); - + $CREATOR_NAME=decode_html($parentCommentModel->getCommentedByName()); + $shortName = substr($CREATOR_NAME, 0, 2); $viewer = $this->getViewer($request); $viewer->assign('PARENT_COMMENTS', $childComments); $viewer->assign('CURRENTUSER', $currentUserModel); + $viewer->assign('shortName',$shortName); $viewer->assign('COMMENTS_MODULE_MODEL', $modCommentsModel); $viewer->assign('MODULE_NAME', $moduleName); diff --git a/modules/Vtiger/views/RelatedList.php b/modules/Vtiger/views/RelatedList.php index c3784e2f6cee5e64d587d3e9613460bcaf439da6..7cce7ba711d93fc1f7099ca5797899f8d168fc12 100644 --- a/modules/Vtiger/views/RelatedList.php +++ b/modules/Vtiger/views/RelatedList.php @@ -109,7 +109,6 @@ 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/pkg/vtiger/modules/ModComments/modules/ModComments/views/DetailAjax.php b/pkg/vtiger/modules/ModComments/modules/ModComments/views/DetailAjax.php index 19404144ddf8679bf9fed7f0e5bdf68e1e0ce2c8..c54f0c640ea13ec833e575de9f024bc9ce070336 100644 --- a/pkg/vtiger/modules/ModComments/modules/ModComments/views/DetailAjax.php +++ b/pkg/vtiger/modules/ModComments/modules/ModComments/views/DetailAjax.php @@ -16,13 +16,15 @@ class ModComments_DetailAjax_View extends Vtiger_IndexAjax_View { $recordModel = ModComments_Record_Model::getInstanceById($record); $currentUserModel = Users_Record_Model::getCurrentUserModel(); $modCommentsModel = Vtiger_Module_Model::getInstance('ModComments'); - + $CREATOR_NAME=decode_html($recordModel->getCommentedByName()); + $shortName = substr($CREATOR_NAME, 0, 2); $viewer = $this->getViewer($request); $viewer->assign('CURRENTUSER', $currentUserModel); $viewer->assign('COMMENT', $recordModel); $viewer->assign('MODULE_NAME', $recordModel->getParentRecordModel()->getModuleName()); $viewer->assign('COMMENTS_MODULE_MODEL', $modCommentsModel); $viewer->assign('ROLLUP_STATUS', false); + $viewer->assign('shortName',$shortName); $viewer->assign('CHILDS_ROOT_PARENT_MODEL', null); echo $viewer->view('Comment.tpl', $moduleName, true); } diff --git a/pkg/vtiger/modules/ModComments/modules/ModComments/views/InRelation.php b/pkg/vtiger/modules/ModComments/modules/ModComments/views/InRelation.php index 3f46bfb8762e05bf44ecd46642097ddc7cd678e0..9803498bcd585cbefdef4bacbb59ba0103f721c8 100644 --- a/pkg/vtiger/modules/ModComments/modules/ModComments/views/InRelation.php +++ b/pkg/vtiger/modules/ModComments/modules/ModComments/views/InRelation.php @@ -27,11 +27,15 @@ class ModComments_InRelation_View extends Vtiger_RelatedList_View { $startindex = $startindex + 10; } else { $parentCommentModels = ModComments_Record_Model::getAllParentComments($parentRecordId); + $CREATOR_NAME=decode_html($parentCommentModels->getCommentedByName()); + $shortName = substr($CREATOR_NAME, 0, 2); } $currentCommentModel = null; if (!empty($commentRecordId)) { $currentCommentModel = ModComments_Record_Model::getInstanceById($commentRecordId); + $CREATOR_NAME=decode_html($currentCommentModel->getCommentedByName()); + $shortName = substr($CREATOR_NAME, 0, 2); } // To get field model of filename @@ -45,7 +49,7 @@ class ModComments_InRelation_View extends Vtiger_RelatedList_View { $viewer->assign('FIELD_MODEL', $fileFieldModel); $viewer->assign('MAX_UPLOAD_LIMIT_MB', Vtiger_Util_Helper::getMaxUploadSize()); $viewer->assign('MAX_UPLOAD_LIMIT_BYTES', Vtiger_Util_Helper::getMaxUploadSizeInBytes()); - + $viewer->assign('shortName',$shortName); $viewer->assign('MODULE_NAME', $request->getModule()); $viewer->assign('MODULE_RECORD', $parentRecordId); $viewer->assign('ROLLUP_STATUS', $rollupStatus); diff --git a/vtlib/Vtiger/Functions.php b/vtlib/Vtiger/Functions.php index dde52a193ee31cf3754fe4e3bc8a4335bab7d972..cc5ddece5be1e91b33aa738cc787a62578ce132c 100644 --- a/vtlib/Vtiger/Functions.php +++ b/vtlib/Vtiger/Functions.php @@ -519,10 +519,12 @@ class Vtiger_Functions { // Utility static function formatDecimal($value){ $fld_value = $value; - if(strpos($value, '.')) { - $fld_value = rtrim($value, '0'); + if(!empty($value)){ + if(strpos($value, '.')) { + $fld_value = rtrim($value, '0'); + } + $value = rtrim($fld_value, '.'); } - $value = rtrim($fld_value, '.'); return $value; }