diff --git a/include/ListView/ListViewSession.php b/include/ListView/ListViewSession.php index 083c266fff50a1ec1b925ba30cfb665fbfff697d..168b08b1ec21a9ec28009bed9af2b3a9c2674267 100644 --- a/include/ListView/ListViewSession.php +++ b/include/ListView/ListViewSession.php @@ -93,7 +93,7 @@ class ListViewSession { foreach ($recordIdList as $index=>$recordId) { $recordList[] = $recordId; $recordPageMapping[$recordId] = $start; - if(isset($searchKey) && $recordId == $currentRecordId){ + if($recordId == $currentRecordId){ $searchKey = php7_count($recordList)-1; $_REQUEST['start'] = $start; } diff --git a/include/QueryGenerator/EnhancedQueryGenerator.php b/include/QueryGenerator/EnhancedQueryGenerator.php index 74ef79dbaeb87dee4a5a748d34b65a7fc960afe3..3f6bcb5d52ffad4f4a780d691264bfcf3ff0248c 100644 --- a/include/QueryGenerator/EnhancedQueryGenerator.php +++ b/include/QueryGenerator/EnhancedQueryGenerator.php @@ -196,7 +196,7 @@ class EnhancedQueryGenerator extends QueryGenerator { } } $this->endGroup(); - $groupConditionGlue = $groupcolumns['condition']; + $groupConditionGlue = isset($groupcolumns['condition']) ? $groupcolumns['condition'] : ""; if ($groupConditionGlue) { $this->addConditionGlue($groupConditionGlue); } diff --git a/include/Webservices/DataTransform.php b/include/Webservices/DataTransform.php index 08312d1a4ae1b359be6906b66de97c10e45fd506..d23d95a902bd6edc7b794f9e990e1c270f450e06 100644 --- a/include/Webservices/DataTransform.php +++ b/include/Webservices/DataTransform.php @@ -315,7 +315,7 @@ $row[$fieldName."_raw"] = $row[$fieldName]; $row[$fieldName] = CurrencyField::convertToUserFormat($row[$fieldName],$current_user); } else if($fieldObj->getUIType() == '72') { - $currencyConversionRate = isset($row['conversion_rate']); + $currencyConversionRate = isset($row['conversion_rate']) ? $row['conversion_rate'] : 0; if (!empty($currencyConversionRate)) { $rawBaseCurrencyValue = CurrencyField::convertToDollar($row[$fieldName], $currencyConversionRate); $row[$fieldName."_raw"] = $rawBaseCurrencyValue; diff --git a/include/fields/DateTimeField.php b/include/fields/DateTimeField.php index 1bfd3f4e08c88675918318333e8622590551ee5e..b907bdbfe9d696eff40a0b2405a1e0dd3f3e979f 100644 --- a/include/fields/DateTimeField.php +++ b/include/fields/DateTimeField.php @@ -137,11 +137,15 @@ class DateTimeField { list($d, $m, $y) = explode('-', $date); break; case 'mm-dd-yyyy': - list($m, $d, $y) = explode('-', $date); - break; + if (strpos($date, '-') !== false && count(explode('-', $date)) === 3) { + list($m, $d, $y) = explode('-', $date); + } + break; case 'yyyy-mm-dd': - list($y, $m, $d) = explode('-', $date); - break; + if (strpos($date, '-') !== false && count(explode('-', $date)) === 3) { + list($y, $m, $d) = explode('-', $date); + } + break; } if (!empty($y) && !empty($m) && !empty($d)) { diff --git a/modules/Products/Products.php b/modules/Products/Products.php index 2352d90c826de6d3788d17765cd0f1382ed66f61..570da446870583381075ccec1040b1c624dafd24 100755 --- a/modules/Products/Products.php +++ b/modules/Products/Products.php @@ -123,7 +123,7 @@ class Products extends CRMEntity { $tax_per = ''; //Save the Product - tax relationship if corresponding tax check box is enabled //Delete the existing tax if any - if($this->mode == 'edit' && $_REQUEST['action'] != 'MassEditSave') + if($this->mode == 'edit' && isset($_REQUEST['action']) != 'MassEditSave') { for($i=0;$i<php7_count($tax_details);$i++) { @@ -182,7 +182,7 @@ class Products extends CRMEntity { $currency_details = getAllCurrencies('all'); //Delete the existing currency relationship if any - if($this->mode == 'edit' && $_REQUEST['action'] !== 'CurrencyUpdate') + if($this->mode == 'edit' && isset($_REQUEST['action']) !== 'CurrencyUpdate') { for($i=0;$i<php7_count($currency_details);$i++) { @@ -1059,9 +1059,10 @@ class Products extends CRMEntity { $button = ''; - if((isPermitted("Products",1,"") == 'yes') && isset($app_strings['LBL_NEW_PRODUCT'])) + if((isPermitted("Products",1,"") == 'yes') && vtranslate('LBL_NEW_PRODUCT', 'Products') != '') { - $button .= '<input title="'.$app_strings['LBL_NEW_PRODUCT'].'" accessyKey="F" class="button" onclick="this.form.action.value=\'EditView\';this.form.module.value=\'Products\';this.form.return_module.value=\'Products\';this.form.return_action.value=\'DetailView\'" type="submit" name="button" value="'.$app_strings['LBL_NEW_PRODUCT'].'"> '; + $newProductLabel = vtranslate('LBL_NEW_PRODUCT', 'Products'); + $button .= '<input title="'.$newProductLabel.'" accessyKey="F" class="button" onclick="this.form.action.value=\'EditView\';this.form.module.value=\'Products\';this.form.return_module.value=\'Products\';this.form.return_action.value=\'DetailView\'" type="submit" name="button" value="'.$newProductLabel.'"> '; } if($singlepane_view == 'true') $returnset = '&return_module=Products&return_action=DetailView&is_parent=1&return_id='.$id; diff --git a/modules/Products/models/Module.php b/modules/Products/models/Module.php index 5d43f2ba29198123635a136cd8d773331c0d43b6..1df90d2e377507e4d4fb2d72bce7b51ccc989921 100644 --- a/modules/Products/models/Module.php +++ b/modules/Products/models/Module.php @@ -225,8 +225,8 @@ class Products_Module_Model extends Vtiger_Module_Model { } public function getAdditionalImportFields() { - $this->importableFields = array(); - if (!$this->importableFields) { + if (!isset($this->importableFields)) { + $this->importableFields = array(); $taxModels = Inventory_TaxRecord_Model::getProductTaxes(); foreach ($taxModels as $taxId => $taxModel) { if ($taxModel->isDeleted()) { diff --git a/modules/Vtiger/models/Field.php b/modules/Vtiger/models/Field.php index ad76c357386f042e52ccd87f11e1ad2b69e00d7a..05e49e664fd823c044dd860db1aeeb8c46deedc4 100644 --- a/modules/Vtiger/models/Field.php +++ b/modules/Vtiger/models/Field.php @@ -156,9 +156,8 @@ class Vtiger_Field_Model extends Vtiger_Field { } public function getModule() { - if(!isset($this->block)) return null; if(!isset($this->module) || !$this->module) { - $moduleObj = $this->block->module; + $moduleObj = isset($this->block->module) ? $this->block->module : ""; if(empty($moduleObj)) { return false; } diff --git a/pkg/vtiger/modules/Import/layouts/v7/modules/Import/ImportUndoResult.tpl b/pkg/vtiger/modules/Import/layouts/v7/modules/Import/ImportUndoResult.tpl index a2a5a5b64f5f83872b8909a9a8e056ecc9c967b5..dbe0902335d93e68a7588fac448365c63bb65e05 100644 --- a/pkg/vtiger/modules/Import/layouts/v7/modules/Import/ImportUndoResult.tpl +++ b/pkg/vtiger/modules/Import/layouts/v7/modules/Import/ImportUndoResult.tpl @@ -21,7 +21,7 @@ </span> <hr style="margin-top:12px;margin-bottom:12px;"> <table class = "table table-borderless"> - {if $ERROR_MESSAGE neq ''} + {if isset($ERROR_MESSAGE) && $ERROR_MESSAGE neq ''} <span> <h4> {$ERROR_MESSAGE} diff --git a/pkg/vtiger/modules/Import/layouts/v7/modules/Import/Import_Mapping.tpl b/pkg/vtiger/modules/Import/layouts/v7/modules/Import/Import_Mapping.tpl index 7d1078fdf99827c6de839c82f2fb9e1951c288d2..c94085a3d772eabaf28bc9a9431415141da5ddb3 100644 --- a/pkg/vtiger/modules/Import/layouts/v7/modules/Import/Import_Mapping.tpl +++ b/pkg/vtiger/modules/Import/layouts/v7/modules/Import/Import_Mapping.tpl @@ -9,7 +9,7 @@ {strip} <input type="hidden" name="merge_type" value='{$USER_INPUT->get('merge_type')}' /> - <input type="hidden" name="merge_fields" value='{$MERGE_FIELDS}' /> + <input type="hidden" name="merge_fields" value='{if isset($MERGE_FIELDS)}{$MERGE_FIELDS}{else}""{/if}' /> <input type="hidden" name="lineitem_currency" value='{if isset($LINEITEM_CURRENCY)}{$LINEITEM_CURRENCY}{else}''{/if}'> <input type="hidden" id="mandatory_fields" name="mandatory_fields" value='{$ENCODED_MANDATORY_FIELDS}' /> <input type="hidden" name="field_mapping" id="field_mapping" value="" />