diff --git a/data/CRMEntity.php b/data/CRMEntity.php index bd63100b45c0cff8ba1803ea1d1f22e562019f0d..e44091c544dde7fbc32a09acc4536f194818cc22 100644 --- a/data/CRMEntity.php +++ b/data/CRMEntity.php @@ -2039,7 +2039,7 @@ class CRMEntity { */ function transferRelatedRecords($module, $transferEntityIds, $entityId) { global $adb, $log; - $log->debug("Entering function transferRelatedRecords ($module, $transferEntityIds, $entityId)"); + $log->debug("Entering function transferRelatedRecords ($module, ".implode(',',$transferEntityIds).", $entityId)"); foreach ($transferEntityIds as $transferId) { // Pick the records related to the entity to be transfered, but do not pick the once which are already related to the current entity. @@ -3008,6 +3008,7 @@ class CRMEntity { * @return string */ function getQueryForDuplicates($module, $tableColumns, $selectedColumns = '', $ignoreEmpty = false,$requiredTables = array(),$columnTypes = null) { + $query=''; if(is_array($tableColumns)) { $tableColumnsString = implode(',', $tableColumns); } @@ -3058,6 +3059,7 @@ class CRMEntity { } $i = 1; + $duplicateCheckClause=''; foreach($tableColumns as $tableColumn){ $tableInfo = explode('.', $tableColumn); $duplicateCheckClause .= " ifnull($tableColumn,'null') = ifnull(temp.$tableInfo[1],'null')"; diff --git a/layouts/v7/modules/Vtiger/AddTagUI.tpl b/layouts/v7/modules/Vtiger/AddTagUI.tpl index f693d2820697f944a73aea274c792b8d50f88d65..965e16607bff2619b7995235a4691df300d0dbf0 100644 --- a/layouts/v7/modules/Vtiger/AddTagUI.tpl +++ b/layouts/v7/modules/Vtiger/AddTagUI.tpl @@ -40,16 +40,19 @@ <div class="dropdown-menu currentTagMenu"> <div class="scrollable" style="max-height:300px"> <ul style="padding-left:0px;"> - {foreach item=TAG_MODEL from=$ALL_USER_TAGS} - {if array_key_exists($TAG_MODEL->getId(), $TAGS_LIST)} - {continue} - {/if} - <li class="tag-item list-group-item"> - <a style="margin-left:0px;"> - {include file="Tag.tpl"|vtemplate_path:$MODULE NO_DELETE=true NO_EDIT=true} - </a> - </li> - {/foreach} + {if isset($ALL_USER_TAGS)} + {foreach item=TAG_MODEL from=$ALL_USER_TAGS} + {if array_key_exists($TAG_MODEL->getId(), $TAGS_LIST)} + {continue} + {/if} + <li class="tag-item list-group-item"> + <a style="margin-left:0px;"> + {include file="Tag.tpl"|vtemplate_path:$MODULE NO_DELETE=true NO_EDIT=true} + </a> + </li> + {/foreach} + {/if} + <li class="dummyExistingTagElement tag-item list-group-item hide"> <a style="margin-left:0px;"> {assign var=TAG_MODEL value=Vtiger_Tag_Model::getCleanInstance()} diff --git a/layouts/v7/modules/Vtiger/FindDuplicateContents.tpl b/layouts/v7/modules/Vtiger/FindDuplicateContents.tpl index 51cc1b3fde8be07cc12b2ceafb400b44755b32d5..ca944eafefa1e030482f2725ce5f6d978ae38ce7 100644 --- a/layouts/v7/modules/Vtiger/FindDuplicateContents.tpl +++ b/layouts/v7/modules/Vtiger/FindDuplicateContents.tpl @@ -87,7 +87,7 @@ {/foreach} {/foreach} </table> - {if $recordCount eq 0} + {if isset($recordCount) && $recordCount eq 0} <div class="col-md-12 col-sm-12 col-xs-12 col-lg-12 listViewContentDiv list-table-wrapper" id="listViewContents"> <table class="emptyRecordsDiv"> <tbody class="overflow-y"> diff --git a/layouts/v7/modules/Vtiger/MassEditForm.tpl b/layouts/v7/modules/Vtiger/MassEditForm.tpl index 17f24de829f49a6282f7b00437c693f82d03864c..9b4a370356ef78aaf6106107c6b96032a1db33e7 100644 --- a/layouts/v7/modules/Vtiger/MassEditForm.tpl +++ b/layouts/v7/modules/Vtiger/MassEditForm.tpl @@ -19,7 +19,7 @@ <input type="hidden" name="selected_ids" value={ZEND_JSON::encode($SELECTED_IDS)}> <input type="hidden" name="excluded_ids" value={ZEND_JSON::encode($EXCLUDED_IDS)}> <input type="hidden" name="tag_params" value={ZEND_JSON::encode($TAG_PARAMS)}> - <input type="hidden" name="search_params" value='{Vtiger_Util_Helper::toSafeHTML(ZEND_JSON::encode($SEARCH_PARAMS))}' /> + <input type="hidden" name="search_params" value='{(isset($SEARCH_PARAMS)) ? Vtiger_Util_Helper::toSafeHTML(ZEND_JSON::encode($SEARCH_PARAMS)) : ""}' /> <div> <header class="overlayHeader" style='flex:0 0 auto;'> {assign var=TITLE value="{vtranslate('LBL_MASS_EDITING',$MODULE)}"} diff --git a/layouts/v7/modules/Vtiger/partials/SidebarEssentials.tpl b/layouts/v7/modules/Vtiger/partials/SidebarEssentials.tpl index c6fe654cfb15b126e8eefacba45e4b30776bb7cd..bf43d357dbd9d85adb40a1ad61687180cd42739d 100644 --- a/layouts/v7/modules/Vtiger/partials/SidebarEssentials.tpl +++ b/layouts/v7/modules/Vtiger/partials/SidebarEssentials.tpl @@ -50,7 +50,7 @@ {assign var="SHARED_MEMBER_COUNT" value=1} {/if} {/foreach} - <li style="font-size:12px;" class='listViewFilter {if $VIEWID eq $CUSTOM_VIEW->getId() && ($CURRENT_TAG eq '')} active {if $smarty.foreach.customView.iteration gt 10} {assign var=count value=1} {/if} {else if $smarty.foreach.customView.iteration gt 10} filterHidden hide{/if} '> + <li style="font-size:12px;" class='listViewFilter {if $VIEWID eq $CUSTOM_VIEW->getId() && (isset($CURRENT_TAG) && $CURRENT_TAG eq '')} active {if $smarty.foreach.customView.iteration gt 10} {assign var=count value=1} {/if} {else if $smarty.foreach.customView.iteration gt 10} filterHidden hide{/if} '> {assign var=VIEWNAME value={vtranslate($CUSTOM_VIEW->get('viewname'), $MODULE)}} {append var="CUSTOM_VIEW_NAMES" value=$VIEWNAME} <a class="filterName listViewFilterElipsis" href="{$LISTVIEW_URL|cat:'&viewname='|cat:$CUSTOM_VIEW->getId()|cat:'&app='|cat:$SELECTED_MENU_CATEGORY}" oncontextmenu="return false;" data-filter-id="{$CUSTOM_VIEW->getId()}" title="{$VIEWNAME|@escape:'html'}">{$VIEWNAME|@escape:'html'}</a> @@ -149,8 +149,9 @@ <div class="menu-scroller scrollContainer" style="position:relative; top:0; left:0;"> <div class="list-menu-content"> <div id="listViewTagContainer" class="multiLevelTagList" - {if $ALL_CUSTOMVIEW_MODEL} data-view-id="{$ALL_CUSTOMVIEW_MODEL->getId()}" {/if} + {if isset($ALL_CUSTOMVIEW_MODEL) && $ALL_CUSTOMVIEW_MODEL} data-view-id="{$ALL_CUSTOMVIEW_MODEL->getId()}" {/if} data-list-tag-count="{Vtiger_Tag_Model::NUM_OF_TAGS_LIST}"> + {if isset($TAGS)} {foreach item=TAG_MODEL from=$TAGS name=tagCounter} {assign var=TAG_LABEL value=$TAG_MODEL->getName()} {assign var=TAG_ID value=$TAG_MODEL->getId()} @@ -173,6 +174,7 @@ {/foreach} </div> </div> + {/if} </div> {include file="AddTagUI.tpl"|vtemplate_path:$MODULE RECORD_NAME="" TAGS_LIST=array()} </div> diff --git a/modules/Accounts/Accounts.php b/modules/Accounts/Accounts.php index cb8fd9a84fce8cc90de02c7df90d83c4f05ef059..3d7703a681435a66fbe530a7745cd6fae06f0590 100644 --- a/modules/Accounts/Accounts.php +++ b/modules/Accounts/Accounts.php @@ -993,7 +993,7 @@ class Accounts extends CRMEntity { */ function transferRelatedRecords($module, $transferEntityIds, $entityId) { global $adb,$log; - $log->debug("Entering function transferRelatedRecords ($module, $transferEntityIds, $entityId)"); + $log->debug("Entering function transferRelatedRecords ($module, ".implode(',',$transferEntityIds).", $entityId)"); $rel_table_arr = Array("Contacts"=>"vtiger_contactdetails","Potentials"=>"vtiger_potential","Quotes"=>"vtiger_quotes", "SalesOrder"=>"vtiger_salesorder","Invoice"=>"vtiger_invoice","Activities"=>"vtiger_seactivityrel", diff --git a/modules/Vtiger/models/FindDuplicate.php b/modules/Vtiger/models/FindDuplicate.php index d4889a24322777ce0e55ae66ce4d3c49882cb59b..fdd976672aa5018d6831d4718396e4b97e38afce 100644 --- a/modules/Vtiger/models/FindDuplicate.php +++ b/modules/Vtiger/models/FindDuplicate.php @@ -110,7 +110,7 @@ class Vtiger_FindDuplicate_Model extends Vtiger_Base_Model { $fieldValues[$group][$groupRecordCount]['recordid'] = $row['recordid']; foreach($row as $field => $value) { if($i == 0 && $field != 'recordid') $temp[$field] = $value; - $fieldModel = $fieldModels[$field]; + $fieldModel = isset($fieldModels[$field]) ? $fieldModels[$field] : ""; $resultRow[$field] = $value; } $fieldValues[$group][$groupRecordCount++] = $resultRow; @@ -127,7 +127,7 @@ class Vtiger_FindDuplicate_Model extends Vtiger_Base_Model { } public function getRecordCount() { - if($this->rows) { + if(isset($this->rows)) { $rows = $this->rows; } else { $db = PearDatabase::getInstance(); diff --git a/modules/Vtiger/uitypes/Reference.php b/modules/Vtiger/uitypes/Reference.php index f18a14085c19550734405e65cebfbee708191dbd..de3e3442c7730d2922dd860fa675d518a7440f9b 100644 --- a/modules/Vtiger/uitypes/Reference.php +++ b/modules/Vtiger/uitypes/Reference.php @@ -68,8 +68,7 @@ class Vtiger_Reference_UIType extends Vtiger_Base_UIType { * @return link */ public function getEditViewDisplayValue($value) { - // file_put_contents("vtesting.log", sprintf("ENTRIES: %s\n", var_export($value, true)), FILE_APPEND); - if(!$value) return $value; + if(!$value) return ''; $referenceModule = $this->getReferenceModule($value); if($referenceModule) { $referenceModuleName = $referenceModule->get('name'); diff --git a/modules/Vtiger/views/FindDuplicates.php b/modules/Vtiger/views/FindDuplicates.php index 8fd57af1f1d9d9a5b6315f915ee84962aba23490..9f3546bebfa1dfbb561f0b58877664cb6f3695de 100644 --- a/modules/Vtiger/views/FindDuplicates.php +++ b/modules/Vtiger/views/FindDuplicates.php @@ -109,7 +109,7 @@ class Vtiger_FindDuplicates_View extends Vtiger_List_View { if(!$this->listViewHeaders){ $this->listViewHeaders = $dataModelInstance->getListViewHeaders(); } - if(!$this->rows) { + if(!isset($this->rows)) { $this->rows = $dataModelInstance->getRecordCount(); $viewer->assign('TOTAL_COUNT', $this->rows); }