diff --git a/include/Webservices/Utils.php b/include/Webservices/Utils.php index d398829087a429ea2bd2a71d5a415e109f005d8b..2c3c6871de1fa02c95ccc25d3f4365ffd2c3fca7 100644 --- a/include/Webservices/Utils.php +++ b/include/Webservices/Utils.php @@ -117,7 +117,7 @@ function vtws_getUserWebservicesGroups($tabId,$user){ } function vtws_getIdComponents($elementid){ - return explode("x",$elementid); + return explode("x",(string)$elementid); } function vtws_getId($objId, $elemId){ diff --git a/layouts/v7/modules/Vtiger/AdvanceFilter.tpl b/layouts/v7/modules/Vtiger/AdvanceFilter.tpl index d3ba3e864dfb5800ae26227fbea775fddf1602c3..50048b7f079d502e7df625543de21896fb50f65e 100644 --- a/layouts/v7/modules/Vtiger/AdvanceFilter.tpl +++ b/layouts/v7/modules/Vtiger/AdvanceFilter.tpl @@ -10,8 +10,8 @@ ********************************************************************************/ -->*} {strip} - {assign var=ALL_CONDITION_CRITERIA value=$ADVANCE_CRITERIA[1] } - {assign var=ANY_CONDITION_CRITERIA value=$ADVANCE_CRITERIA[2] } + {assign var=ALL_CONDITION_CRITERIA value=(isset($ADVANCE_CRITERIA[1])?$ADVANCE_CRITERIA[1]:[])} + {assign var=ANY_CONDITION_CRITERIA value=(isset($ADVANCE_CRITERIA[2])?$ADVANCE_CRITERIA[2]:[])} {if empty($ALL_CONDITION_CRITERIA) } {assign var=ALL_CONDITION_CRITERIA value=array()} @@ -37,9 +37,11 @@ </div> <div class="contents"> <div class="conditionList"> + {if isset($ALL_CONDITION_CRITERIA['columns'])} {foreach item=CONDITION_INFO from=$ALL_CONDITION_CRITERIA['columns']} {include file='AdvanceFilterCondition.tpl'|@vtemplate_path:$QUALIFIED_MODULE RECORD_STRUCTURE=$RECORD_STRUCTURE CONDITION_INFO=$CONDITION_INFO MODULE=$MODULE} {/foreach} + {/if} {if php7_count($ALL_CONDITION_CRITERIA) eq 0} {include file='AdvanceFilterCondition.tpl'|@vtemplate_path:$QUALIFIED_MODULE RECORD_STRUCTURE=$RECORD_STRUCTURE MODULE=$MODULE CONDITION_INFO=array()} {/if} @@ -51,11 +53,13 @@ <button type="button" class="btn btn-default"><i class="fa fa-plus"></i> {vtranslate('LBL_ADD_CONDITION',$MODULE)}</button> </div> <div class="groupCondition"> + {if isset($ALL_CONDITION_CRITERIA['condition'])} {assign var=GROUP_CONDITION value=$ALL_CONDITION_CRITERIA['condition']} {if empty($GROUP_CONDITION)} {assign var=GROUP_CONDITION value="and"} {/if} <input type="hidden" name="condition" value="{$GROUP_CONDITION}" /> + {/if} </div> </div> </div> @@ -67,9 +71,11 @@ </div> <div class="contents"> <div class="conditionList"> + {if isset($ANY_CONDITION_CRITERIA['columns'])} {foreach item=CONDITION_INFO from=$ANY_CONDITION_CRITERIA['columns']} {include file='AdvanceFilterCondition.tpl'|@vtemplate_path:$QUALIFIED_MODULE RECORD_STRUCTURE=$RECORD_STRUCTURE CONDITION_INFO=$CONDITION_INFO MODULE=$MODULE CONDITION="or"} {/foreach} + {/if} {if php7_count($ANY_CONDITION_CRITERIA) eq 0} {include file='AdvanceFilterCondition.tpl'|@vtemplate_path:$QUALIFIED_MODULE RECORD_STRUCTURE=$RECORD_STRUCTURE MODULE=$MODULE CONDITION_INFO=array() CONDITION="or"} {/if} diff --git a/layouts/v7/modules/Vtiger/ModuleRelatedTabs.tpl b/layouts/v7/modules/Vtiger/ModuleRelatedTabs.tpl index eb103a24c3c872ef279db739d0fc0c4c03052a09..0f148239c95c315e09db55d50f98c7030c8eb767 100644 --- a/layouts/v7/modules/Vtiger/ModuleRelatedTabs.tpl +++ b/layouts/v7/modules/Vtiger/ModuleRelatedTabs.tpl @@ -29,7 +29,9 @@ </li> {/foreach} - {assign var=RELATEDTABS value=$DETAILVIEW_LINKS['DETAILVIEWRELATED']} + {if isset($DETAILVIEW_LINKS['DETAILVIEWRELATED'])} + {assign var=RELATEDTABS value=$DETAILVIEW_LINKS['DETAILVIEWRELATED']} + {/if} {if !empty($RELATEDTABS)} {assign var=COUNT value=$RELATEDTABS|@count} diff --git a/modules/CustomView/actions/Save.php b/modules/CustomView/actions/Save.php index 6900d392f7f100c9aa9f3d40b5f5c5f7da12d17a..0d7c1fd8a1f0abcb046877eac481db7ac5a6fca5 100644 --- a/modules/CustomView/actions/Save.php +++ b/modules/CustomView/actions/Save.php @@ -16,6 +16,7 @@ class CustomView_Save_Action extends Vtiger_Action_Controller { } public function process(Vtiger_Request $request) { + $moduleName = $request->get('module'); $sourceModuleName = $request->get('source_module'); $moduleModel = Vtiger_Module_Model::getInstance($sourceModuleName); $customViewModel = $this->getCVModelFromRequest($request); diff --git a/modules/Emails/models/Mailer.php b/modules/Emails/models/Mailer.php index 8741cdbce83f3def4a4d37c562c7d94bf499ec1e..5cb044a4380d3647d9a832466b3ee9e05bf8cab6 100644 --- a/modules/Emails/models/Mailer.php +++ b/modules/Emails/models/Mailer.php @@ -16,6 +16,7 @@ include_once 'include/database/PearDatabase.php'; class Emails_Mailer_Model extends Vtiger_Mailer { private $dom = null; + public $Signature; public static function getInstance() { return new self(); diff --git a/modules/Quotes/Quotes.php b/modules/Quotes/Quotes.php index 67ed551f76ca8a09188512c3b4aa2d9a85a9298a..7b57ba6ad0c837fe5f8d0216764ddc22f13967a5 100755 --- a/modules/Quotes/Quotes.php +++ b/modules/Quotes/Quotes.php @@ -127,7 +127,7 @@ class Quotes extends CRMEntity { } $_REQUEST['ajxaction']=isset($_REQUEST['ajxaction']) ? $_REQUEST['ajxaction'] :""; //in ajax save we should not call this function, because this will delete all the existing product values - if($_REQUEST['action'] != 'QuotesAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW' + if($_REQUEST['action'] != 'QuotesAjax' && isset($_REQUEST['ajaxaction']) && $_REQUEST['ajxaction'] != 'DETAILVIEW' && $_REQUEST['action'] != 'MassEditSave' && $_REQUEST['action'] != 'ProcessDuplicates' && $_REQUEST['action'] != 'SaveAjax' && $this->isLineItemUpdate != false) { //Based on the total Number of rows we will save the product relationship with this entity diff --git a/pkg/vtiger/modules/Import/modules/Import/actions/Data.php b/pkg/vtiger/modules/Import/modules/Import/actions/Data.php index d4ca1b2ad068eda319f27bab801bc54f974d9690..07bc71fed20b7f0118884b72477db9a95b6b5655 100644 --- a/pkg/vtiger/modules/Import/modules/Import/actions/Data.php +++ b/pkg/vtiger/modules/Import/modules/Import/actions/Data.php @@ -408,7 +408,7 @@ class Import_Data_Action extends Vtiger_Action_Controller { } if ($createRecord || $mergeType == Import_Utils_Helper::$AUTO_MERGE_MERGEFIELDS || $mergeType == Import_Utils_Helper::$AUTO_MERGE_OVERWRITE) { $entityIdComponents = vtws_getIdComponents($entityInfo['id']); - $recordId = $entityIdComponents[1]; + $recordId = isset($entityIdComponents[1]) ? $entityIdComponents[1] : ''; if (!empty($recordId)) { $entityfields = getEntityFieldNames($this->module); switch ($this->module) { @@ -433,7 +433,7 @@ class Import_Data_Action extends Vtiger_Action_Controller { $this->entityData[] = VTEntityData::fromCRMEntity($focus); } - $label = trim($label); + $label = isset($label) ? trim($label) : ''; $adb->pquery('UPDATE vtiger_crmentity SET label=? WHERE crmid=?', array($label, $recordId)); //Creating entity data of updated records for post save events if (in_array($entityInfo['status'], array(self::$IMPORT_RECORD_MERGED, self::$IMPORT_RECORD_UPDATED))) { diff --git a/pkg/vtiger/modules/Projects/Project/layouts/v7/modules/Project/SelectEmailFields.tpl b/pkg/vtiger/modules/Projects/Project/layouts/v7/modules/Project/SelectEmailFields.tpl index 0ded0e236a56465280f0e641ee99137823d3af22..fccf3eb079bf8f4934437e33b9e98f4ca9eb27d0 100644 --- a/pkg/vtiger/modules/Projects/Project/layouts/v7/modules/Project/SelectEmailFields.tpl +++ b/pkg/vtiger/modules/Projects/Project/layouts/v7/modules/Project/SelectEmailFields.tpl @@ -20,10 +20,10 @@ <input type="hidden" name="viewname" value="{$VIEWNAME}" /> <input type="hidden" name="module" value="{$MODULE}"/> <input type="hidden" name="view" value="ComposeEmail"/> - <input type="hidden" name="search_key" value= "{$SEARCH_KEY}" /> + <input type="hidden" name="search_key" value="{if isset($SEARCH_KEY)}{$SEARCH_KEY}{else}''{/if}"/> <input type="hidden" name="operator" value="{$OPERATOR}" /> - <input type="hidden" name="search_value" value="{$ALPHABET_VALUE}" /> - {if $SEARCH_PARAMS} + <input type="hidden" name="search_value" value="{if isset($ALPHABET_VALUE)}{$ALPHABET_VALUE}{else}''{/if}" /> + {if isset($SEARCH_PARAMS)} <input type="hidden" name="search_params" value='{ZEND_JSON::encode($SEARCH_PARAMS)}' /> {/if} <input type="hidden" name="fieldModule" value={$SOURCE_MODULE} /> @@ -77,7 +77,7 @@ </div> <div class="preferenceDiv" style="padding: 0px 0px 10px 35px;"> <label class="checkbox displayInlineBlock"> - <input type="checkbox" name="saveRecipientPrefs" id="saveRecipientPrefs" {if $RECIPIENT_PREF_ENABLED}checked="true"{/if}/> + <input type="checkbox" name="saveRecipientPrefs" id="saveRecipientPrefs" {if isset($RECIPIENT_PREF_ENABLED)}checked="true"{/if}/> {vtranslate('LBL_REMEMBER_MY_PREF',$MODULE)} </label> <i class="fa fa-info-circle" title="{vtranslate('LBL_EDIT_EMAIL_PREFERENCE_TOOLTIP', $MODULE)}"></i> diff --git a/pkg/vtiger/modules/Projects/Project/modules/Project/Project.php b/pkg/vtiger/modules/Projects/Project/modules/Project/Project.php index 1ffe087157e17e332de38696f8f1d72fd82bcfe8..eb564ec3659a35bbf2520161691225102c27b62f 100644 --- a/pkg/vtiger/modules/Projects/Project/modules/Project/Project.php +++ b/pkg/vtiger/modules/Projects/Project/modules/Project/Project.php @@ -447,7 +447,7 @@ class Project extends CRMEntity { parent::delete_related_module($module, $crmid, $with_module, $with_crmid); return; } - $destinationModule = vtlib_purify($_REQUEST['destination_module']); + $destinationModule = isset($_REQUEST['destination_module']) ? vtlib_purify($_REQUEST['destination_module']) : ''; if(empty($destinationModule)) $destinationModule = $with_module; if (!is_array($with_crmid)) $with_crmid = Array($with_crmid); foreach($with_crmid as $relcrmid) { diff --git a/pkg/vtiger/modules/Projects/Project/modules/Project/models/Record.php b/pkg/vtiger/modules/Projects/Project/modules/Project/models/Record.php index e3efa04d5a2cc898c862bd7ed3748cbcb4e8602a..344900685bf7186fd01430da54bd2ce5be6b984c 100644 --- a/pkg/vtiger/modules/Projects/Project/modules/Project/models/Record.php +++ b/pkg/vtiger/modules/Projects/Project/modules/Project/models/Record.php @@ -91,6 +91,7 @@ $result = $db->pquery($sql, array($recordId)); $i = -1; + $projectTasks = array(); while($record = $db->fetchByAssoc($result)){ $record['id'] = $i; $record['name'] = decode_html(textlength_check($record['name'])); diff --git a/pkg/vtiger/modules/Projects/Project/modules/Project/views/MassActionAjax.php b/pkg/vtiger/modules/Projects/Project/modules/Project/views/MassActionAjax.php index 5b892168165a188c942a127e158e53f749821282..b55ea0a61a1775013c3f46c9110257417570407f 100644 --- a/pkg/vtiger/modules/Projects/Project/modules/Project/views/MassActionAjax.php +++ b/pkg/vtiger/modules/Projects/Project/modules/Project/views/MassActionAjax.php @@ -58,7 +58,7 @@ class Project_MassActionAjax_View extends Vtiger_MassActionAjax_View { if (empty($refModuleEmailFields)) { continue; } - $refModuleEmailPrefs = $refModuleEmailPrefs = isset($recipientPrefs[$refModule->getId()]) ? $recipientPrefs[$refModule->getId()] : ''; + $refModuleEmailPrefs = isset($recipientPrefs[$refModule->getId()]) ? $recipientPrefs[$refModule->getId()] : ''; foreach ($refModuleEmailFields as $refModuleEmailField) { if ($refModuleEmailField->isViewable()) { $refModuleEmailField->set('baseRefField', $referenceField->getFieldName()); @@ -120,7 +120,7 @@ class Project_MassActionAjax_View extends Vtiger_MassActionAjax_View { $refModuleModel = Vtiger_Module_Model::getInstance($refModuleName); if (!$refModuleModel || !$refModuleModel->isActive() || !Users_Privileges_Model::isPermitted($refModuleModel->getName(), 'DetailView')) continue; - $refModuleEmailPrefs = $recipientPrefs[$refModuleModel->getId()]; + $refModuleEmailPrefs = isset($recipientPrefs[$refModuleModel->getId()]) ? $recipientPrefs[$refModuleModel->getId()] : ''; $refModuleEmailFields = $refModuleModel->getFieldsByType('email'); if (empty($refModuleEmailFields)) continue; diff --git a/pkg/vtiger/modules/Projects/ProjectTask/layouts/v7/modules/ProjectTask/SelectEmailFields.tpl b/pkg/vtiger/modules/Projects/ProjectTask/layouts/v7/modules/ProjectTask/SelectEmailFields.tpl index c3fb8828cf5cea48334fa98f8090ca05a084233f..8a6fc441516bf1f067e7c41cde6a76206d3c6d88 100644 --- a/pkg/vtiger/modules/Projects/ProjectTask/layouts/v7/modules/ProjectTask/SelectEmailFields.tpl +++ b/pkg/vtiger/modules/Projects/ProjectTask/layouts/v7/modules/ProjectTask/SelectEmailFields.tpl @@ -20,10 +20,10 @@ <input type="hidden" name="viewname" value="{$VIEWNAME}" /> <input type="hidden" name="module" value="{$MODULE}"/> <input type="hidden" name="view" value="ComposeEmail"/> - <input type="hidden" name="search_key" value= "{$SEARCH_KEY}" /> + <input type="hidden" name="search_key" value="{if isset($SEARCH_KEY)}{$SEARCH_KEY}{else}''{/if}"/> <input type="hidden" name="operator" value="{$OPERATOR}" /> - <input type="hidden" name="search_value" value="{$ALPHABET_VALUE}" /> - {if $SEARCH_PARAMS} + <input type="hidden" name="search_value" value="{if isset($ALPHABET_VALUE)}{$ALPHABET_VALUE}{else}''{/if}" /> + {if isset($SEARCH_PARAMS)} <input type="hidden" name="search_params" value='{ZEND_JSON::encode($SEARCH_PARAMS)}' /> {/if} <input type="hidden" name="fieldModule" value={$SOURCE_MODULE} /> @@ -77,7 +77,7 @@ </div> <div class="preferenceDiv" style="padding: 0px 0px 10px 35px;"> <label class="checkbox displayInlineBlock"> - <input type="checkbox" name="saveRecipientPrefs" id="saveRecipientPrefs" {if $RECIPIENT_PREF_ENABLED}checked="true"{/if}/> + <input type="checkbox" name="saveRecipientPrefs" id="saveRecipientPrefs" {if isset($RECIPIENT_PREF_ENABLED)}checked="true"{/if}/> {vtranslate('LBL_REMEMBER_MY_PREF',$MODULE)} </label> <i class="fa fa-info-circle" title="{vtranslate('LBL_EDIT_EMAIL_PREFERENCE_TOOLTIP', $MODULE)}"></i> diff --git a/pkg/vtiger/modules/Projects/ProjectTask/modules/ProjectTask/ProjectTask.php b/pkg/vtiger/modules/Projects/ProjectTask/modules/ProjectTask/ProjectTask.php index 88706e27c37d835e7f332f8b49816505c1c3c299..931aa6c2d5fdea6ec46b1ced1d3b5bd8e150961d 100644 --- a/pkg/vtiger/modules/Projects/ProjectTask/modules/ProjectTask/ProjectTask.php +++ b/pkg/vtiger/modules/Projects/ProjectTask/modules/ProjectTask/ProjectTask.php @@ -474,7 +474,7 @@ class ProjectTask extends CRMEntity { require_once "modules/$relModuleName/$relModuleName.php"; $relModuleFocus = new $relModuleName(); vtlib_setup_modulevars($relModuleName, $relModuleFocus); - + $button = ''; $returnSet = '&return_module='.$currentModule.'&return_action=CallRelatedList&return_id='.$recordId; diff --git a/pkg/vtiger/modules/Projects/ProjectTask/modules/ProjectTask/views/MassActionAjax.php b/pkg/vtiger/modules/Projects/ProjectTask/modules/ProjectTask/views/MassActionAjax.php index ed91bbae6c9d7b7c10f4f4db1c5ee25d1692c562..5ae7b1b73db2b971c550b447dbf5be1e3a123263 100644 --- a/pkg/vtiger/modules/Projects/ProjectTask/modules/ProjectTask/views/MassActionAjax.php +++ b/pkg/vtiger/modules/Projects/ProjectTask/modules/ProjectTask/views/MassActionAjax.php @@ -16,10 +16,11 @@ class ProjectTask_MassActionAjax_View extends Project_MassActionAjax_View { //get parent email fields and their reference email fields $moduleModel = Vtiger_Module_Model::getInstance('Project'); $recipientPrefModel = Vtiger_RecipientPreference_Model::getInstance($sourceModule); + $recipientPrefs = array(); if ($recipientPrefModel) $recipientPrefs = $recipientPrefModel->getPreferences(); - $moduleEmailPrefs = $recipientPrefs[$moduleModel->getId()]; + $moduleEmailPrefs = isset($recipientPrefs[$moduleModel->getId()]) ? $recipientPrefs[$moduleModel->getId()] : ''; $emailAndRefFields = $moduleModel->getFieldsByType(array('email', 'reference')); $accesibleFields = array(); $referenceFieldValues = array(); @@ -58,7 +59,7 @@ class ProjectTask_MassActionAjax_View extends Project_MassActionAjax_View { if (empty($refModuleEmailFields)) { continue; } - $refModuleEmailPrefs = $recipientPrefs[$refModule->getId()]; + $refModuleEmailPrefs = isset($recipientPrefs[$refModule->getId()]) ? $recipientPrefs[$refModule->getId()] : ''; foreach ($refModuleEmailFields as $refModuleEmailField) { if ($refModuleEmailField->isViewable()) { $refModuleEmailField->set('baseRefField', $referenceField->getFieldName()); @@ -120,7 +121,7 @@ class ProjectTask_MassActionAjax_View extends Project_MassActionAjax_View { $refModuleModel = Vtiger_Module_Model::getInstance($refModuleName); if (!$refModuleModel || !$refModuleModel->isActive() || !Users_Privileges_Model::isPermitted($refModuleModel->getName(), 'DetailView')) continue; - $refModuleEmailPrefs = $recipientPrefs[$refModuleModel->getId()]; + $refModuleEmailPrefs = isset($recipientPrefs[$refModuleModel->getId()]) ? $recipientPrefs[$refModuleModel->getId()] : ''; $refModuleEmailFields = $refModuleModel->getFieldsByType('email'); if (empty($refModuleEmailFields)) continue;