diff --git a/data/VTEntityDelta.php b/data/VTEntityDelta.php index 305d3ed29454d8d22383261b7724a68d5686c1b7..3cb39e5905bef8704459316b87faaf0c69910a2b 100644 --- a/data/VTEntityDelta.php +++ b/data/VTEntityDelta.php @@ -92,12 +92,12 @@ class VTEntityDelta extends VTEventHandler { function getOldValue($moduleName, $recordId, $fieldName) { $entityDelta = self::$entityDelta[$moduleName][$recordId]; - return $entityDelta[$fieldName]['oldValue']; + return isset($entityDelta[$fieldName]['oldValue']) ? $entityDelta[$fieldName]['oldValue'] : ""; } function getCurrentValue($moduleName, $recordId, $fieldName) { $entityDelta = self::$entityDelta[$moduleName][$recordId]; - return $entityDelta[$fieldName]['currentValue']; + return isset($entityDelta[$fieldName]['currentValue']) ? $entityDelta[$fieldName]['currentValue'] : ""; } function getOldEntity($moduleName, $recordId) { diff --git a/include/InventoryPDFController.php b/include/InventoryPDFController.php index a5db2d535231a410283615c91c4e45e83d1a65bf..e872a3fa8e99a098c91b70935f0fff28e3f7ad68 100644 --- a/include/InventoryPDFController.php +++ b/include/InventoryPDFController.php @@ -17,7 +17,7 @@ include_once 'vtlib/Vtiger/PDF/inventory/ContentViewer2.php'; include_once 'vtlib/Vtiger/PDF/viewers/PagerViewer.php'; include_once 'vtlib/Vtiger/PDF/PDFGenerator.php'; include_once 'data/CRMEntity.php'; - +#[\AllowDynamicProperties] class Vtiger_InventoryPDFController { protected $module; @@ -131,7 +131,7 @@ class Vtiger_InventoryPDFController { $discountPercentage = $productLineItem["discount_percent{$productLineItemIndex}"]; $productName = decode_html($productLineItem["productName{$productLineItemIndex}"]); //get the sub product - $subProducts = $productLineItem["subProductArray{$productLineItemIndex}"]; + $subProducts = isset($productLineItem["subProductArray{$productLineItemIndex}"]) ? $productLineItem["subProductArray{$productLineItemIndex}"] : ""; if($subProducts != '') { foreach($subProducts as $subProduct) { $productName .="\n"." - ".decode_html($subProduct); @@ -202,7 +202,7 @@ class Vtiger_InventoryPDFController { if($final_details['taxtype'] == 'group') { $group_tax_details = $final_details['taxes']; for($i=0;$i<php7_count($group_tax_details);$i++) { - $group_total_tax_percent += $group_tax_details[$i]['percentage']; + $group_total_tax_percent += isset($group_tax_details[$i]['percentage']) ? $group_tax_details[$i]['percentage'] : 0.00; } $summaryModel->set(getTranslatedString("Tax:", $this->moduleName)."($group_total_tax_percent%)", $this->formatPrice($final_details['tax_totalamount'])); } diff --git a/include/ListView/ListViewController.php b/include/ListView/ListViewController.php index 233f3eb156ef9662fa4bb17a8a74cc0e59a1ca8f..cc826aa8965b4082524710032ff82b0553d0edca 100644 --- a/include/ListView/ListViewController.php +++ b/include/ListView/ListViewController.php @@ -273,7 +273,7 @@ class ListViewController { } if(in_array($uitype,array(15,33,16))){ - $value = html_entity_decode($rawValue,ENT_QUOTES,$default_charset); + $value = isset($rawValue) ? html_entity_decode($rawValue,ENT_QUOTES,$default_charset) : ''; } else { $value = $rawValue; } diff --git a/include/Webservices/DataTransform.php b/include/Webservices/DataTransform.php index d23d95a902bd6edc7b794f9e990e1c270f450e06..6111ce62cdeccefd57a31ef61a8e5433e1601d5f 100644 --- a/include/Webservices/DataTransform.php +++ b/include/Webservices/DataTransform.php @@ -39,7 +39,7 @@ } static function filterAndSanitize($row,$meta){ - $recordLabel = $row['label']; + $recordLabel = isset($row['label']) ? $row['label'] :""; $row = DataTransform::filterAllColumns($row,$meta); $row = DataTransform::sanitizeData($row,$meta); if(!empty($recordLabel)){ diff --git a/include/Webservices/LineItem/VtigerInventoryOperation.php b/include/Webservices/LineItem/VtigerInventoryOperation.php index 9812c99a8cda2506306e55abb730bd03afc062f2..162e7f21fb27da84c0fc812f3c4235de5fd0e604 100644 --- a/include/Webservices/LineItem/VtigerInventoryOperation.php +++ b/include/Webservices/LineItem/VtigerInventoryOperation.php @@ -204,7 +204,7 @@ class VtigerInventoryOperation extends VtigerModuleOperation { $element['LineItems'] = $lineItems; $recordCompoundTaxesElement = $this->getCompoundTaxesElement($element, $lineItems); $element = array_merge($element, $recordCompoundTaxesElement); - $element['productid'] = $lineItems[0]['productid']; + $element['productid'] = isset($lineItems[0]['productid']) ? $lineItems[0]['productid'] : ""; $element['LineItems_FinalDetails'] = $this->getLineItemFinalDetails($idComponents[1]); return $element; } @@ -480,7 +480,7 @@ class VtigerInventoryOperation extends VtigerModuleOperation { $result = $this->pearDB->pquery('SELECT * FROM vtiger_inventorychargesrel WHERE recordid = ?', array($id)); $rowData = $this->pearDB->fetch_array($result); - if ($rowData['charges']) { + if (isset($rowData['charges']) && $rowData['charges']) { $allCharges = getAllCharges(); $shippingTaxes = array(); $allShippingTaxes = getAllTaxes('all', 'sh'); diff --git a/include/Webservices/Utils.php b/include/Webservices/Utils.php index 08f3ecbb6767230266229012a4166e71ab4ffd01..d398829087a429ea2bd2a71d5a415e109f005d8b 100644 --- a/include/Webservices/Utils.php +++ b/include/Webservices/Utils.php @@ -121,6 +121,7 @@ function vtws_getIdComponents($elementid){ } function vtws_getId($objId, $elemId){ + if(is_array($elemId)){$elemId=implode(' ',$elemId);} return $objId."x".$elemId; } diff --git a/include/fields/CurrencyField.php b/include/fields/CurrencyField.php index ebad60bdec83691d1c232ee2702454f505cf10c8..c44f511b9c3aa90d6b2c675c3123ee63f09ac361 100644 --- a/include/fields/CurrencyField.php +++ b/include/fields/CurrencyField.php @@ -356,8 +356,8 @@ class CurrencyField { $decimalSeparator = $this->decimalSeparator; if(empty($currencySeparator)) $currencySeparator = ' '; if(empty($decimalSeparator)) $decimalSeparator = ' '; - $value = str_replace("$currencySeparator", "", $value); - $value = str_replace("$decimalSeparator", ".", $value); + $value = isset($value) ? str_replace("$currencySeparator", "", $value) : ''; + $value = isset($value) ? str_replace("$decimalSeparator", ".", $value) : ''; if($skipConversion == false) { $value = self::convertToDollar($value,$this->conversionRate); diff --git a/include/utils/EditViewUtils.php b/include/utils/EditViewUtils.php index 3b35f4924e1e1302d8b5b75febd8cbe6f2c91085..d012eab9999a835bcd07980a5dcfd57b7b7027b6 100755 --- a/include/utils/EditViewUtils.php +++ b/include/utils/EditViewUtils.php @@ -277,7 +277,7 @@ function getAssociatedProducts($module, $focus, $seid = '', $refModuleName = fal $product_Detail[$i]['hdnProductId'.$i] = $hdnProductId; $product_Detail[$i]['productName'.$i] = from_html($productname); /* Added to fix the issue Product Pop-up name display*/ - if($_REQUEST['action'] == 'CreateSOPDF' || $_REQUEST['action'] == 'CreatePDF' || $_REQUEST['action'] == 'SendPDFMail') + if((isset($_REQUEST['action'])) && ($_REQUEST['action'] == 'CreateSOPDF' || $_REQUEST['action'] == 'CreatePDF' || $_REQUEST['action'] == 'SendPDFMail')) $product_Detail[$i]['productName'.$i]= htmlspecialchars($product_Detail[$i]['productName'.$i]); $product_Detail[$i]['hdnProductcode'.$i] = $hdnProductcode; $product_Detail[$i]['productDescription'.$i]= from_html($productdescription); @@ -286,7 +286,7 @@ function getAssociatedProducts($module, $focus, $seid = '', $refModuleName = fal }else { $product_Detail[$i]['comment'.$i]= $comment; } - + $focus->object_name=isset($focus->object_name) ? $focus->object_name : ''; if($module != 'PurchaseOrder' && $focus->object_name != 'Order') { $product_Detail[$i]['qtyInStock'.$i]=decimalFormat($qtyinstock); } @@ -302,7 +302,7 @@ function getAssociatedProducts($module, $focus, $seid = '', $refModuleName = fal } $discount_percent = decimalFormat($adb->query_result($result,$i-1,'discount_percent')); $discount_amount = $adb->query_result($result,$i-1,'discount_amount'); - $discount_amount = decimalFormat(number_format($discount_amount, $no_of_decimal_places,'.','')); + $discount_amount = isset($discount_amount) ? decimalFormat(number_format($discount_amount, $no_of_decimal_places,'.','')):""; $discountTotal = 0; //Based on the discount percent or amount we will show the discount details diff --git a/include/utils/InventoryUtils.php b/include/utils/InventoryUtils.php index 2c949c58885ca57a8851199818d9d01ab879e711..284914d25db5b5ef01a95a77cf2466c73e5f932d 100644 --- a/include/utils/InventoryUtils.php +++ b/include/utils/InventoryUtils.php @@ -21,7 +21,7 @@ function updateStk($product_id,$qty,$mode,$ext_prod_arr,$module) { global $log; - $log->debug("Entering updateStk(".$product_id.",".$qty.",".$mode.",".$ext_prod_arr.",".$module.") method ..."); + $log->debug("Entering updateStk(".$product_id.",".$qty.",".$mode.",".implode('',$ext_prod_arr).",".$module.") method ..."); global $adb; global $current_user; @@ -427,6 +427,7 @@ function deleteInventoryProductDetails($focus) } } } + $focus->update_product_array=isset($focus->update_product_array) ? $focus->update_product_array :''; //to avoid undefined property warning. $updateInventoryProductRel_update_product_array = $focus->update_product_array; $adb->pquery("delete from vtiger_inventoryproductrel where id=?", array($focus->id)); $adb->pquery("delete from vtiger_inventorysubproductrel where id=?", array($focus->id)); @@ -439,6 +440,7 @@ function updateInventoryProductRel($entity) { global $log, $adb,$updateInventoryProductRel_update_product_array,$updateInventoryProductRel_deduct_stock; $entity_id = vtws_getIdComponents($entity->getId()); $entity_id = $entity_id[1]; + $statusFieldName = ''; $update_product_array = $updateInventoryProductRel_update_product_array; $log->debug("Entering into function updateInventoryProductRel(".$entity_id.")."); @@ -476,7 +478,7 @@ function updateInventoryProductRel($entity) { $updateInventoryProductRel_deduct_stock = false; deductProductsFromStock($entity_id); } - } elseif($recordDetails[$statusFieldName] == $statusFieldValue) { + } elseif(isset($recordDetails[$statusFieldName]) && $recordDetails[$statusFieldName] == $statusFieldValue) { $updateInventoryProductRel_deduct_stock = false; } @@ -615,6 +617,7 @@ function saveInventoryProductDetails(&$focus, $module, $update_prod_stock='false { global $log, $adb; $id=$focus->id; + $description=''; $log->debug("Entering into function saveInventoryProductDetails($module)."); //Added to get the convertid if(isset($_REQUEST['convert_from']) && $_REQUEST['convert_from'] !='') @@ -646,7 +649,7 @@ function saveInventoryProductDetails(&$focus, $module, $update_prod_stock='false for($i=1; $i<=$tot_no_prod; $i++) { //if the product is deleted then we should avoid saving the deleted products - if($_REQUEST["deleted".$i] == 1) + if(isset($_REQUEST["deleted".$i]) && $_REQUEST["deleted".$i] == 1) continue; $prod_id = vtlib_purify($_REQUEST['hdnProductId'.$i]); @@ -665,8 +668,8 @@ function saveInventoryProductDetails(&$focus, $module, $update_prod_stock='false $qty = vtlib_purify($_REQUEST['qty'.$i]); $listprice = vtlib_purify($_REQUEST['listPrice'.$i]); $comment = vtlib_purify($_REQUEST['comment'.$i]); - $purchaseCost = vtlib_purify($_REQUEST['purchaseCost'.$i]); - $margin = vtlib_purify($_REQUEST['margin'.$i]); + $purchaseCost = isset($_REQUEST['purchaseCost'.$i]) ? vtlib_purify($_REQUEST['purchaseCost'.$i]) : ""; + $margin = isset($_REQUEST['margin'.$i]) ? vtlib_purify($_REQUEST['margin'.$i]) : ""; if($module == 'SalesOrder') { if($updateDemand == '-') @@ -840,7 +843,7 @@ function saveInventoryProductDetails(&$focus, $module, $update_prod_stock='false //if the user gave - sign in adjustment then add with the value $adjustmentType = ''; - if($_REQUEST['adjustmentType'] == '-') + if(isset($_REQUEST['adjustmentType']) && $_REQUEST['adjustmentType'] == '-') $adjustmentType = vtlib_purify($_REQUEST['adjustmentType']); $adjustment = vtlib_purify($_REQUEST['adjustment']); @@ -992,7 +995,7 @@ function getInventorySHTaxPercent($id, $taxname, $taxnum=null) array($taxnum + 1, $id) ); $rowData = $adb->fetch_array($charges_result); - $charges = Zend_Json::decode(html_entity_decode($rowData['charges'])); + $charges = isset($rowData['charges']) ? Zend_Json::decode(html_entity_decode($rowData['charges'])):""; $taxpercentage = $charges; } diff --git a/include/utils/VtlibUtils.php b/include/utils/VtlibUtils.php index 24352abb1c1d0268e28d521776d3712e32b76fc9..0ead91d7b547dda2640ed5cceca9ea238a124ab2 100644 --- a/include/utils/VtlibUtils.php +++ b/include/utils/VtlibUtils.php @@ -1053,3 +1053,5 @@ function php7_htmlentities($str) { // PHP 8.x marks as deprecated return $str == null ? $str : htmlentities($str); } + + diff --git a/includes/runtime/BaseModel.php b/includes/runtime/BaseModel.php index 08f7b2e93407ed717aa82414df6293426cdba84a..af7e2c0a97bc044e3f3723f7fee006de3954b9c9 100644 --- a/includes/runtime/BaseModel.php +++ b/includes/runtime/BaseModel.php @@ -38,7 +38,7 @@ class Vtiger_Base_Model { * @return Raw Value for the given key */ public function getRaw($key){ - return $this->rawData[$key]; + return isset($this->rawData[$key]) ? $this->rawData[$key] : ''; } /** diff --git a/includes/runtime/Viewer.php b/includes/runtime/Viewer.php index da4837c96b063646c047fad3306ada6920e86588..a6148bcc69f3e079adb7f7504a9506b0b98a9e81 100644 --- a/includes/runtime/Viewer.php +++ b/includes/runtime/Viewer.php @@ -90,7 +90,7 @@ class Vtiger_Viewer extends Smarty { 'array_map', 'array_key_exists', 'get_class', 'vtlib_array', 'getDuplicatesPreventionMessage', 'htmlentities', 'purifyHtmlEventAttributes', 'getCurrencySymbolandCRate', 'mb_substr', 'isPermitted', 'getEntityName', 'function_exists', 'php7_trim', 'php7_htmlentities', 'strtolower', 'strtoupper', 'str_replace', 'urlencode', 'getTranslatedCurrencyString', 'getTranslatedString', 'is_object', 'is_numeric', - 'php7_sizeof', 'method_exists'); + 'php7_sizeof', 'method_exists','implode','mt_rand'); foreach ($modifiers as $modifier) { if (function_exists($modifier)) { $this->registerPlugin('modifier', $modifier, $modifier); diff --git a/layouts/v7/modules/Inventory/LineItemsDetail.tpl b/layouts/v7/modules/Inventory/LineItemsDetail.tpl index 2f861345f52f80d5e2d628d7a9c052d65fb703db..d941506c2237ca67d98afc576df8e59a4033f15d 100644 --- a/layouts/v7/modules/Inventory/LineItemsDetail.tpl +++ b/layouts/v7/modules/Inventory/LineItemsDetail.tpl @@ -39,7 +39,7 @@ {assign var=QUANTITY_VIEWABLE value=$LINEITEM_FIELDS['quantity']->isViewable()} {if $QUANTITY_VIEWABLE}{assign var=COL_SPAN1 value=($COL_SPAN1)+1}{/if} {/if} -{if $LINEITEM_FIELDS['purchase_cost']} +{if isset($LINEITEM_FIELDS['purchase_cost']) && $LINEITEM_FIELDS['purchase_cost']} {assign var=PURCHASE_COST_VIEWABLE value=$LINEITEM_FIELDS['purchase_cost']->isViewable()} {if $PURCHASE_COST_VIEWABLE}{assign var=COL_SPAN2 value=($COL_SPAN2)+1}{/if} {/if} @@ -47,7 +47,7 @@ {assign var=LIST_PRICE_VIEWABLE value=$LINEITEM_FIELDS['listprice']->isViewable()} {if $LIST_PRICE_VIEWABLE}{assign var=COL_SPAN2 value=($COL_SPAN2)+1}{/if} {/if} -{if $LINEITEM_FIELDS['margin']} +{if isset($LINEITEM_FIELDS['margin']) && $LINEITEM_FIELDS['margin']} {assign var=MARGIN_VIEWABLE value=$LINEITEM_FIELDS['margin']->isViewable()} {if $MARGIN_VIEWABLE}{assign var=COL_SPAN3 value=($COL_SPAN3)+1}{/if} {/if} @@ -191,8 +191,8 @@ </div> {if $ITEM_DISCOUNT_AMOUNT_VIEWABLE || $ITEM_DISCOUNT_PERCENT_VIEWABLE} <div> - {assign var=DISCOUNT_INFO value="{if $LINE_ITEM_DETAIL["discount_type$INDEX"] == 'amount'} {vtranslate('LBL_DIRECT_AMOUNT_DISCOUNT',$MODULE_NAME)} = {$LINE_ITEM_DETAIL["discountTotal$INDEX"]} - {elseif $LINE_ITEM_DETAIL["discount_type$INDEX"] == 'percentage'} {$LINE_ITEM_DETAIL["discount_percent$INDEX"]} % {vtranslate('LBL_OF',$MODULE_NAME)} {$LINE_ITEM_DETAIL["productTotal$INDEX"]} = {$LINE_ITEM_DETAIL["discountTotal$INDEX"]} + {assign var=DISCOUNT_INFO value="{if isset($LINE_ITEM_DETAIL["discount_type$INDEX"]) && $LINE_ITEM_DETAIL["discount_type$INDEX"] == 'amount'} {vtranslate('LBL_DIRECT_AMOUNT_DISCOUNT',$MODULE_NAME)} = {$LINE_ITEM_DETAIL["discountTotal$INDEX"]} + {elseif isset($LINE_ITEM_DETAIL["discount_type$INDEX"]) && $LINE_ITEM_DETAIL["discount_type$INDEX"] == 'percentage'} {$LINE_ITEM_DETAIL["discount_percent$INDEX"]} % {vtranslate('LBL_OF',$MODULE_NAME)} {$LINE_ITEM_DETAIL["productTotal$INDEX"]} = {$LINE_ITEM_DETAIL["discountTotal$INDEX"]} {/if}"} (-) <strong><a href="javascript:void(0)" class="individualDiscount inventoryLineItemDetails" tabindex="0" role="tooltip" id ="example" data-toggle="popover" data-trigger="focus" title="{vtranslate('LBL_DISCOUNT',$MODULE_NAME)}" data-content="{$DISCOUNT_INFO}">{vtranslate('LBL_DISCOUNT',$MODULE_NAME)}</a> : </strong> </div> @@ -305,7 +305,7 @@ <tr> <td width="83%"> <div align="right"> - {assign var=CHARGES_TAX_INFO value="{vtranslate('LBL_CHARGES_TOTAL',$MODULE_NAME)} = {$FINAL_DETAILS["shipping_handling_charge"]}<br /><br />{foreach key=CHARGE_ID item=CHARGE_INFO from=$SELECTED_CHARGES_AND_ITS_TAXES}{if $CHARGE_INFO['taxes']}{if $CHARGE_INFO['deleted']}({strtoupper(vtranslate('LBL_DELETED',$MODULE_NAME))}){/if} {$CHARGE_INFO['name']}<br />{foreach item=CHARGE_TAX_INFO from=$CHARGE_INFO['taxes']} {$CHARGE_TAX_INFO['name']}:  {$CHARGE_TAX_INFO['percent']}% {vtranslate('LBL_OF',$MODULE_NAME)} {if $CHARGE_TAX_INFO['method'] eq 'Compound'}({/if}{$CHARGE_INFO['amount']} {if $CHARGE_TAX_INFO['method'] eq 'Compound'}{foreach item=COMPOUND_TAX_ID from=$CHARGE_TAX_INFO['compoundon']}{if $CHARGE_INFO['taxes'][$COMPOUND_TAX_ID]['name']} + {$CHARGE_INFO['taxes'][$COMPOUND_TAX_ID]['name']}{/if}{/foreach}){/if} = {$CHARGE_TAX_INFO['amount']}<br />{/foreach}<br />{/if}{/foreach}\r\n{vtranslate('LBL_TOTAL_TAX_AMOUNT',$MODULE_NAME)} = {$FINAL_DETAILS['shtax_totalamount']}"} + {assign var=CHARGES_TAX_INFO value="{vtranslate('LBL_CHARGES_TOTAL',$MODULE_NAME)} = {$FINAL_DETAILS["shipping_handling_charge"]}<br /><br />{foreach key=CHARGE_ID item=CHARGE_INFO from=$SELECTED_CHARGES_AND_ITS_TAXES}{if $CHARGE_INFO['taxes']}{if $CHARGE_INFO['deleted']}({strtoupper(vtranslate('LBL_DELETED',$MODULE_NAME))}){/if} {$CHARGE_INFO['name']}<br />{foreach item=CHARGE_TAX_INFO from=$CHARGE_INFO['taxes']} {$CHARGE_TAX_INFO['name']}:  {$CHARGE_TAX_INFO['percent']}% {vtranslate('LBL_OF',$MODULE_NAME)} {if isset($CHARGE_TAX_INFO['method'] ) && $CHARGE_TAX_INFO['method'] eq 'Compound'}({/if}{$CHARGE_INFO['amount']} {if isset($CHARGE_TAX_INFO['method']) && $CHARGE_TAX_INFO['method'] eq 'Compound'}{foreach item=COMPOUND_TAX_ID from=$CHARGE_TAX_INFO['compoundon']}{if $CHARGE_INFO['taxes'][$COMPOUND_TAX_ID]['name']} + {$CHARGE_INFO['taxes'][$COMPOUND_TAX_ID]['name']}{/if}{/foreach}){/if} = {$CHARGE_TAX_INFO['amount']}<br />{/foreach}<br />{/if}{/foreach}\r\n{vtranslate('LBL_TOTAL_TAX_AMOUNT',$MODULE_NAME)} = {$FINAL_DETAILS['shtax_totalamount']}"} (+) <strong><a class="inventoryLineItemDetails" tabindex="0" role="tooltip" title = "{vtranslate('LBL_TAXES_ON_CHARGES',$MODULE_NAME)}" data-trigger ="focus" data-placement ="left" data-toggle="popover" href="javascript:void(0)" id="taxesOnChargesList" data-content="{$CHARGES_TAX_INFO}"> {vtranslate('LBL_TAXES_ON_CHARGES',$MODULE_NAME)} </a></strong> </div> diff --git a/layouts/v7/modules/Inventory/PopupEntries.tpl b/layouts/v7/modules/Inventory/PopupEntries.tpl index 3f05945817046af573bade838f37ca1f7ef09097..8f121ba65e5433b725bb296baff62da19e3488c7 100644 --- a/layouts/v7/modules/Inventory/PopupEntries.tpl +++ b/layouts/v7/modules/Inventory/PopupEntries.tpl @@ -69,8 +69,12 @@ {foreach item=LISTVIEW_HEADER from=$LISTVIEW_HEADERS} <td> {assign var=FIELD_UI_TYPE_MODEL value=$LISTVIEW_HEADER->getUITypeModel()} + {assign var=FIELD_SEARCH_INFO value=array("searchValue" => "")} + {if isset($SEARCH_DETAILS[$LISTVIEW_HEADER->getName()])} + {{assign var=FIELD_SEARCH_INFO value=$SEARCH_DETAILS[$LISTVIEW_HEADER->getName()]}} + {/if} {include file=vtemplate_path($FIELD_UI_TYPE_MODEL->getListSearchTemplateName(),$MODULE_NAME) - FIELD_MODEL= $LISTVIEW_HEADER SEARCH_INFO=$SEARCH_DETAILS[$LISTVIEW_HEADER->getName()] USER_MODEL=$CURRENT_USER_MODEL} + FIELD_MODEL= $LISTVIEW_HEADER SEARCH_INFO=$FIELD_SEARCH_INFO USER_MODEL=$CURRENT_USER_MODEL} </td> {/foreach} {if $RELATED_MODULE eq 'Products'} diff --git a/layouts/v7/modules/Inventory/partials/LineItemsContent.tpl b/layouts/v7/modules/Inventory/partials/LineItemsContent.tpl index 98878015f9306a3e7ace66413d895fc43795d363..3882af4975fef32465707b27d38c38ba70685d8c 100644 --- a/layouts/v7/modules/Inventory/partials/LineItemsContent.tpl +++ b/layouts/v7/modules/Inventory/partials/LineItemsContent.tpl @@ -39,14 +39,14 @@ {assign var="totalAfterDiscount" value="totalAfterDiscount"|cat:$row_no} {assign var="taxTotal" value="taxTotal"|cat:$row_no} {assign var="netPrice" value="netPrice"|cat:$row_no} - {assign var="FINAL" value=$RELATED_PRODUCTS.1.final_details} + {assign var="FINAL" value=(isset($RELATED_PRODUCTS.1.final_details)) ? $RELATED_PRODUCTS.1.final_details : ""} {assign var="productDeleted" value="productDeleted"|cat:$row_no} {assign var="productId" value=(isset($data[$hdnProductId])) ? $data[$hdnProductId] : ""} {assign var="listPriceValues" value=Products_Record_Model::getListPriceValues($productId)} {if $MODULE eq 'PurchaseOrder'} {assign var="listPriceValues" value=array()} - {assign var="purchaseCost" value="{if $data.$purchaseCost && $RECORD_CURRENCY_RATE && $data.$qty}{((float)$data.$purchaseCost) / ((float)$data.$qty * (float){$RECORD_CURRENCY_RATE})}{else}0{/if}"} + {assign var="purchaseCost" value="{if isset($data.$purchaseCost) && $data.$purchaseCost && $RECORD_CURRENCY_RATE && $data.$qty}{((float)$data.$purchaseCost) / ((float)$data.$qty * (float){$RECORD_CURRENCY_RATE})}{else}0{/if}"} {foreach item=currency_details from=$CURRENCIES} {append var='listPriceValues' value=$currency_details.conversionrate * $purchaseCost index=$currency_details.currency_id} {/foreach} diff --git a/layouts/v7/modules/Inventory/partials/LineItemsEdit.tpl b/layouts/v7/modules/Inventory/partials/LineItemsEdit.tpl index 1551cc8fc7bad804e6009d65dacbac24731aabc1..fa74b5c657bcb791eea846f00b43aae315d31a8c 100644 --- a/layouts/v7/modules/Inventory/partials/LineItemsEdit.tpl +++ b/layouts/v7/modules/Inventory/partials/LineItemsEdit.tpl @@ -57,7 +57,7 @@ {assign var=DISCOUNT_PERCENT_EDITABLE value=$LINEITEM_FIELDS['hdnDiscountPercent']->isEditable()} {/if} -{assign var="FINAL" value=$RELATED_PRODUCTS.1.final_details} +{assign var="FINAL" value=(isset($RELATED_PRODUCTS.1.final_details)) ? $RELATED_PRODUCTS.1.final_details :null} {assign var="IS_INDIVIDUAL_TAX_TYPE" value=false} {assign var="IS_GROUP_TAX_TYPE" value=true} @@ -185,7 +185,7 @@ {include file="partials/LineItemsContent.tpl"|@vtemplate_path:'Inventory' row_no=0 data=[] IGNORE_UI_REGISTRATION=true} </tr> {foreach key=row_no item=data from=$RELATED_PRODUCTS} - <tr id="row{$row_no}" data-row-num="{$row_no}" class="lineItemRow" {if isset($data["entityType$row_no"]) && $data["entityType$row_no"] eq 'Products'}data-quantity-in-stock={$data["qtyInStock$row_no"]}{/if}> + <tr id="row{$row_no}" data-row-num="{$row_no}" class="lineItemRow" {if isset($data["entityType$row_no"]) && $data["entityType$row_no"] eq 'Products'}data-quantity-in-stock={(isset($data["qtyInStock$row_no"])) ? $data["qtyInStock$row_no"] : ''}{/if}> {include file="partials/LineItemsContent.tpl"|@vtemplate_path:'Inventory' row_no=$row_no data=$data} </tr> {/foreach} @@ -245,9 +245,9 @@ <span class="pull-right">(-) <strong><a href="javascript:void(0)" id="finalDiscount">{vtranslate('LBL_OVERALL_DISCOUNT',$MODULE)} <span id="overallDiscount"> - {if $DISCOUNT_PERCENT_EDITABLE && $FINAL.discount_type_final eq 'percentage'} + {if isset($FINAL.discount_type_final) && $DISCOUNT_PERCENT_EDITABLE && $FINAL.discount_type_final eq 'percentage'} ({$FINAL.discount_percentage_final}%) - {else if $DISCOUNT_AMOUNT_EDITABLE && $FINAL.discount_type_final eq 'amount'} + {else if isset($FINAL.discount_type_final) && $DISCOUNT_AMOUNT_EDITABLE && $FINAL.discount_type_final eq 'amount'} ({$FINAL.discount_amount_final}) {else} (0) @@ -257,7 +257,7 @@ </span> </td> <td> - <span id="discountTotal_final" class="pull-right discountTotal_final">{if $FINAL.discountTotal_final}{$FINAL.discountTotal_final}{else}0{/if}</span> + <span id="discountTotal_final" class="pull-right discountTotal_final">{if (isset($FINAL.discountTotal_final)) ? $FINAL.discountTotal_final : ""}{$FINAL.discountTotal_final}{else}0{/if}</span> <!-- Popup Discount Div --> <div id="finalDiscountUI" class="finalDiscountUI validCheck hide"> @@ -281,13 +281,13 @@ {if $DISCOUNT_PERCENT_EDITABLE} <tr> <td><input type="radio" name="discount_final" class="finalDiscounts" data-discount-type="percentage" {if $DISCOUNT_TYPE_FINAL eq 'percentage'}checked{/if} /> % {vtranslate('LBL_OF_PRICE',$MODULE)}</td> - <td><span class="pull-right"> %</span><input type="text" data-rule-positive=true data-rule-inventory_percentage=true id="discount_percentage_final" name="discount_percentage_final" value="{$FINAL.discount_percentage_final}" class="discount_percentage_final span1 pull-right discountVal {if $DISCOUNT_TYPE_FINAL neq 'percentage'}hide{/if}" /></td> + <td><span class="pull-right"> %</span><input type="text" data-rule-positive=true data-rule-inventory_percentage=true id="discount_percentage_final" name="discount_percentage_final" value="{(isset($FINAL.discount_percentage_final)) ? $FINAL.discount_percentage_final : ""}" class="discount_percentage_final span1 pull-right discountVal {if $DISCOUNT_TYPE_FINAL neq 'percentage'}hide{/if}" /></td> </tr> {/if} {if $DISCOUNT_AMOUNT_EDITABLE} <tr> <td><input type="radio" name="discount_final" class="finalDiscounts" data-discount-type="amount" {if $DISCOUNT_TYPE_FINAL eq 'amount'}checked{/if} /> {vtranslate('LBL_DIRECT_PRICE_REDUCTION',$MODULE)}</td> - <td><input type="text" data-rule-positive=true id="discount_amount_final" name="discount_amount_final" value="{$FINAL.discount_amount_final}" class="span1 pull-right discount_amount_final discountVal {if $DISCOUNT_TYPE_FINAL neq 'amount'}hide{/if}" /></td> + <td><input type="text" data-rule-positive=true id="discount_amount_final" name="discount_amount_final" value="{(isset($FINAL.discount_amount_final)) ? $FINAL.discount_amount_final : ""}" class="span1 pull-right discount_amount_final discountVal {if $DISCOUNT_TYPE_FINAL neq 'amount'}hide{/if}" /></td> </tr> {/if} </tbody> @@ -297,8 +297,8 @@ </td> </tr> {/if} - {if $SH_PERCENT_EDITABLE && isset($FINAL.chargesAndItsTaxes)} - {assign var=CHARGE_AND_CHARGETAX_VALUES value=$FINAL.chargesAndItsTaxes} + {if $SH_PERCENT_EDITABLE } + {assign var=CHARGE_AND_CHARGETAX_VALUES value=(isset($FINAL.chargesAndItsTaxes)) ? $FINAL.chargesAndItsTaxes :NULL} <tr> <td width="83%"> <span class="pull-right">(+) <strong><a href="javascript:void(0)" id="charges">{vtranslate('LBL_CHARGES',$MODULE)}</a></strong></span> @@ -306,7 +306,7 @@ <table width="100%" border="0" cellpadding="5" cellspacing="0" class="table table-nobordered popupTable"> {foreach key=CHARGE_ID item=CHARGE_MODEL from=$INVENTORY_CHARGES} <tr> - {assign var=CHARGE_VALUE value=$CHARGE_AND_CHARGETAX_VALUES[$CHARGE_ID]['value']} + {assign var=CHARGE_VALUE value= (isset($CHARGE_AND_CHARGETAX_VALUES[$CHARGE_ID]['value'])) ? $CHARGE_AND_CHARGETAX_VALUES[$CHARGE_ID]['value']:NULL} {assign var=CHARGE_PERCENT value=0} {if $CHARGE_MODEL->get('format') eq 'Percent' && $CHARGE_AND_CHARGETAX_VALUES[$CHARGE_ID]['percent'] neq NULL} {assign var=CHARGE_PERCENT value=$CHARGE_AND_CHARGETAX_VALUES[$CHARGE_ID]['percent']} @@ -327,8 +327,8 @@ </div> </td> <td> - <input type="hidden" class="lineItemInputBox" id="chargesTotal" name="shipping_handling_charge" value="{if $FINAL.shipping_handling_charge}{$FINAL.shipping_handling_charge}{else}0{/if}" /> - <span id="chargesTotalDisplay" class="pull-right chargesTotalDisplay">{if $FINAL.shipping_handling_charge}{$FINAL.shipping_handling_charge}{else}0{/if}</span> + <input type="hidden" class="lineItemInputBox" id="chargesTotal" name="shipping_handling_charge" value="{if (isset($FINAL.shipping_handling_charge)) ? $FINAL.shipping_handling_charge : ""}{$FINAL.shipping_handling_charge}{else}0{/if}" /> + <span id="chargesTotalDisplay" class="pull-right chargesTotalDisplay">{if (isset($FINAL.shipping_handling_charge)) ? $FINAL.shipping_handling_charge : ""}{$FINAL.shipping_handling_charge}{else}0{/if}</span> </td> </tr> {/if} @@ -370,7 +370,7 @@ </div> <!-- End Popup Div Group Tax --> </td> - <td><span id="tax_final" class="pull-right tax_final">{if $FINAL.tax_totalamount}{$FINAL.tax_totalamount}{else}0{/if}</span></td> + <td><span id="tax_final" class="pull-right tax_final">{if (isset($FINAL.tax_totalamount)) ? $FINAL.tax_totalamount : ""}{$FINAL.tax_totalamount}{else}0{/if}</span></td> </tr> <!-- Group Tax - ends --> {if $SH_PERCENT_EDITABLE} @@ -381,7 +381,7 @@ <!-- Pop Div For Shipping and Handling TAX --> <div id="chargeTaxesBlock" class="hide validCheck chargeTaxesBlock"> <p class="popover_title hide"> - {vtranslate('LBL_TAXES_ON_CHARGES', $MODULE)} : <span id="SHChargeVal" class="SHChargeVal">{if $FINAL.shipping_handling_charge}{$FINAL.shipping_handling_charge}{else}0{/if}</span> + {vtranslate('LBL_TAXES_ON_CHARGES', $MODULE)} : <span id="SHChargeVal" class="SHChargeVal">{if (isset($FINAL.shipping_handling_charge)) ? $FINAL.shipping_handling_charge : ""}{$FINAL.shipping_handling_charge}{else}0{/if}</span> </p> <table class="table table-nobordered popupTable"> <tbody> @@ -420,8 +420,8 @@ <!-- End Popup Div for Shipping and Handling TAX --> </td> <td> - <input type="hidden" id="chargeTaxTotalHidden" class="chargeTaxTotal" name="s_h_percent" value="{if $FINAL.shtax_totalamount}{$FINAL.shtax_totalamount}{else}0{/if}" /> - <span class="pull-right" id="chargeTaxTotal">{if $FINAL.shtax_totalamount}{$FINAL.shtax_totalamount}{else}0{/if}</span> + <input type="hidden" id="chargeTaxTotalHidden" class="chargeTaxTotal" name="s_h_percent" value="{if (isset($FINAL.shtax_totalamount)) ? $FINAL.shtax_totalamount : ""}{$FINAL.shtax_totalamount}{else}0{/if}" /> + <span class="pull-right" id="chargeTaxTotal">{if (isset($FINAL.shtax_totalamount)) ? $FINAL.shtax_totalamount : ""}{$FINAL.shtax_totalamount}{else}0{/if}</span> </td> </tr> <tr> @@ -458,16 +458,16 @@ <div class="pull-right"> <strong>{vtranslate('LBL_ADJUSTMENT',$MODULE)} </strong> <span> - <input type="radio" name="adjustmentType" option value="+" {if $FINAL.adjustment gte 0}checked{/if}> {vtranslate('LBL_ADD',$MODULE)} + <input type="radio" name="adjustmentType" option value="+" {if isset($FINAL.adjustment) && $FINAL.adjustment gte 0}checked{/if}> {vtranslate('LBL_ADD',$MODULE)} </span> <span> - <input type="radio" name="adjustmentType" option value="-" {if $FINAL.adjustment lt 0}checked{/if}> {vtranslate('LBL_DEDUCT',$MODULE)} + <input type="radio" name="adjustmentType" option value="-" {if isset($FINAL.adjustment) && $FINAL.adjustment lt 0}checked{/if}> {vtranslate('LBL_DEDUCT',$MODULE)} </span> </div> </td> <td> <span class="pull-right"> - <input id="adjustment" name="adjustment" type="text" data-rule-positive="true" class="lineItemInputBox form-control" value="{if $FINAL.adjustment lt 0}{abs($FINAL.adjustment)}{elseif $FINAL.adjustment}{$FINAL.adjustment}{else}0{/if}"> + <input id="adjustment" name="adjustment" type="text" data-rule-positive="true" class="lineItemInputBox form-control" value="{if isset($FINAL.adjustment) && $FINAL.adjustment lt 0}{abs($FINAL.adjustment)}{elseif isset($FINAL.adjustment) && $FINAL.adjustment}{$FINAL.adjustment}{else}0{/if}"> </span> </td> </tr> @@ -476,7 +476,7 @@ <span class="pull-right"><strong>{vtranslate('LBL_GRAND_TOTAL',$MODULE)}</strong></span> </td> <td> - <span id="grandTotal" name="grandTotal" class="pull-right grandTotal">{$FINAL.grandTotal}</span> + <span id="grandTotal" name="grandTotal" class="pull-right grandTotal">{(isset($FINAL.grandTotal)) ? $FINAL.grandTotal : ""}</span> </td> </tr> {if $MODULE eq 'Invoice' or $MODULE eq 'PurchaseOrder'} diff --git a/layouts/v7/modules/PurchaseOrder/DetailViewHeaderTitle.tpl b/layouts/v7/modules/PurchaseOrder/DetailViewHeaderTitle.tpl index 32f1128bd5fbc87695c02881a56a200395a85c95..752eb68c00298085ccab17f58ba66111077268f3 100644 --- a/layouts/v7/modules/PurchaseOrder/DetailViewHeaderTitle.tpl +++ b/layouts/v7/modules/PurchaseOrder/DetailViewHeaderTitle.tpl @@ -12,7 +12,7 @@ {strip} <div class="col-lg-6 col-md-6 col-sm-6"> <div class="record-header clearfix"> - <div class="recordImage bgpurchaseorder app-{$SELECTED_MENU_CATEGORY}"> + <div class="recordImage bgpurchaseorder app-{(isset($SELECTED_MENU_CATEGORY)) ? $SELECTED_MENU_CATEGORY : ''}"> {assign var=IMAGE_DETAILS value=$RECORD->getImageDetails()} {foreach key=ITER item=IMAGE_INFO from=$IMAGE_DETAILS} {if !empty($IMAGE_INFO.url)} diff --git a/layouts/v7/modules/PurchaseOrder/uitypes/Text.tpl b/layouts/v7/modules/PurchaseOrder/uitypes/Text.tpl index 8eb7e244b2ff380e97fd7488079cbd006a014e0e..50dbde3ab78f32eb947ecd943358539424bd28d9 100644 --- a/layouts/v7/modules/PurchaseOrder/uitypes/Text.tpl +++ b/layouts/v7/modules/PurchaseOrder/uitypes/Text.tpl @@ -24,7 +24,7 @@ {else} {if $REQ->get('view') neq 'Detail'} {assign var=blockLabel value=$RECORD_STRUCTURE['LBL_PO_INFORMATION']} - {assign var=fieldModel value=$blockLabel['accountid']} + {assign var=fieldModel value=(isset($blockLabel['accountid'])) ? $blockLabel['accountid'] : ''} {$pickList = ['' => 'LBL_SELECT_ADDRESS_OPTION', 'company'=> 'LBL_COMPANY_ADDRESS', 'account' => 'LBL_ACCOUNT_ADDRESS', 'vendor'=> 'LBL_VENDOR_ADDRESS', 'contact' => 'LBL_CONTACT_ADDRESS' ]} diff --git a/layouts/v7/modules/Vtiger/AddCommentForm.tpl b/layouts/v7/modules/Vtiger/AddCommentForm.tpl index a3771e2286b142b69af0f26bef23a5fcdf4a4453..ebb4b5bf61314ae2b2a99412507d0b911a2a4904 100644 --- a/layouts/v7/modules/Vtiger/AddCommentForm.tpl +++ b/layouts/v7/modules/Vtiger/AddCommentForm.tpl @@ -18,10 +18,10 @@ <input type="hidden" name="viewname" value="{$CVID}" /> <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="search_key" value= "{$SEARCH_KEY}" /> + <input type="hidden" name="search_key" value= "{(isset($SEARCH_KEY)) ? $SEARCH_KEY : ''}" /> <input type="hidden" name="operator" value="{$OPERATOR}" /> - <input type="hidden" name="search_value" value="{$ALPHABET_VALUE}" /> - <input type="hidden" name="search_params" value='{Vtiger_Util_Helper::toSafeHTML(ZEND_JSON::encode($SEARCH_PARAMS))}' /> + <input type="hidden" name="search_value" value="{(isset($ALPHABET_VALUE)) ? $ALPHABET_VALUE : ''}" /> + <input type="hidden" name="search_params" value='{(isset($SEARCH_PARAMS)) ? Vtiger_Util_Helper::toSafeHTML(ZEND_JSON::encode($SEARCH_PARAMS)) : ''}' /> <input type="hidden" name="tag_params" value={ZEND_JSON::encode($TAG_PARAMS)}> {assign var=HEADER_TITLE value={vtranslate('LBL_ADDING_COMMENT', $MODULE)}} diff --git a/layouts/v7/modules/Vtiger/ComposeEmailForm.tpl b/layouts/v7/modules/Vtiger/ComposeEmailForm.tpl index c622bb971dc6c7d69dc7caa24c2c59dbf1186686..eda1cf45d9978bcbc192e8efbc80734ab99ce578 100644 --- a/layouts/v7/modules/Vtiger/ComposeEmailForm.tpl +++ b/layouts/v7/modules/Vtiger/ComposeEmailForm.tpl @@ -144,7 +144,7 @@ {else} {assign var=FILE_TYPE value="file"} {/if} - <div class="MultiFile-label customAttachment" data-file-id="{$ATTACHMENT['fileid']}" data-file-type="{$FILE_TYPE}" data-file-size="{$ATTACHMENT['size']}" {if $FILE_TYPE eq "document"} data-document-id="{$DOCUMENT_ID}"{/if}> + <div class="MultiFile-label customAttachment" data-file-id="{(isset($ATTACHMENT['fileid'])) ? $ATTACHMENT['fileid'] : ''}" data-file-type="{$FILE_TYPE}" data-file-size="{$ATTACHMENT['size']}" {if $FILE_TYPE eq "document"} data-document-id="{$DOCUMENT_ID}"{/if}> {if $ATTACHMENT['nondeletable'] neq true} <a name="removeAttachment" class="cursorPointer">x </a> {/if} diff --git a/layouts/v7/modules/Vtiger/ListViewQuickPreview.tpl b/layouts/v7/modules/Vtiger/ListViewQuickPreview.tpl index f03215f9325342f60390a9350683430056d4eb7e..9e89ddb470de4a9596f9c6165f6e2d5a4dbe39da 100644 --- a/layouts/v7/modules/Vtiger/ListViewQuickPreview.tpl +++ b/layouts/v7/modules/Vtiger/ListViewQuickPreview.tpl @@ -29,16 +29,16 @@ <div class="quickPreviewActions clearfix"> <div class="btn-group pull-left"> - <button class="btn btn-success btn-xs" onclick="window.location.href = '{$RECORD->getFullDetailViewUrl()}&app={$SELECTED_MENU_CATEGORY}'"> + <button class="btn btn-success btn-xs" onclick="window.location.href = '{$RECORD->getFullDetailViewUrl()}&app={(isset($SELECTED_MENU_CATEGORY)) ? $SELECTED_MENU_CATEGORY : ''}'"> {vtranslate('LBL_VIEW_DETAILS', $MODULE_NAME)} </button> </div> {if $NAVIGATION} <div class="btn-group pull-right"> - <button class="btn btn-default btn-xs" id="quickPreviewPreviousRecordButton" data-record="{$PREVIOUS_RECORD_ID}" data-app="{$SELECTED_MENU_CATEGORY}" {if empty($PREVIOUS_RECORD_ID)} disabled="disabled" {*{else} onclick="Vtiger_List_Js.triggerPreviewForRecord({$PREVIOUS_RECORD_ID})"*}{/if} > + <button class="btn btn-default btn-xs" id="quickPreviewPreviousRecordButton" data-record="{$PREVIOUS_RECORD_ID}" data-app="{(isset($SELECTED_MENU_CATEGORY)) ? $SELECTED_MENU_CATEGORY : ''}" {if empty($PREVIOUS_RECORD_ID)} disabled="disabled" {*{else} onclick="Vtiger_List_Js.triggerPreviewForRecord({$PREVIOUS_RECORD_ID})"*}{/if} > <i class="fa fa-chevron-left"></i> </button> - <button class="btn btn-default btn-xs" id="quickPreviewNextRecordButton" data-record="{$NEXT_RECORD_ID}" data-app="{$SELECTED_MENU_CATEGORY}" {if empty($NEXT_RECORD_ID)} disabled="disabled" {*{else} onclick="Vtiger_List_Js.triggerPreviewForRecord({$NEXT_RECORD_ID})"*}{/if}> + <button class="btn btn-default btn-xs" id="quickPreviewNextRecordButton" data-record="{$NEXT_RECORD_ID}" data-app="{(isset($SELECTED_MENU_CATEGORY)) ? $SELECTED_MENU_CATEGORY : ''}" {if empty($NEXT_RECORD_ID)} disabled="disabled" {*{else} onclick="Vtiger_List_Js.triggerPreviewForRecord({$NEXT_RECORD_ID})"*}{/if}> <i class="fa fa-chevron-right"></i> </button> </div> diff --git a/layouts/v7/modules/Vtiger/uitypes/Email.tpl b/layouts/v7/modules/Vtiger/uitypes/Email.tpl index 633b8a801937a8d6532c9c0d4533587a15a526c3..d77907f27457b71f8af12f92647c38fdfbab3fe6 100644 --- a/layouts/v7/modules/Vtiger/uitypes/Email.tpl +++ b/layouts/v7/modules/Vtiger/uitypes/Email.tpl @@ -16,7 +16,7 @@ {assign var="FIELD_NAME" value=$FIELD_MODEL->getFieldName()} {/if} <input id="{$MODULE}_editView_fieldName_{$FIELD_NAME}" class="inputElement" name="{$FIELD_NAME}" type="text" - value="{$FIELD_MODEL->get('fieldvalue')}" {if $MODE eq 'edit' && $FIELD_MODEL->get('uitype') eq '106'} readonly {/if} {if !empty($SPECIAL_VALIDATOR)}data-validator="{Zend_Json::encode($SPECIAL_VALIDATOR)}"{/if} + value="{$FIELD_MODEL->get('fieldvalue')}" {if isset($MODE) && $MODE eq 'edit' && $FIELD_MODEL->get('uitype') eq '106'} readonly {/if} {if !empty($SPECIAL_VALIDATOR)}data-validator="{Zend_Json::encode($SPECIAL_VALIDATOR)}"{/if} {if $FIELD_INFO["mandatory"] eq true} data-rule-required="true" {/if} data-rule-email="true" data-rule-illegal="true" {if php7_count($FIELD_INFO['validator'])} data-specific-rules='{ZEND_JSON::encode($FIELD_INFO["validator"])}' diff --git a/layouts/v7/modules/Vtiger/uitypes/StringDetailView.tpl b/layouts/v7/modules/Vtiger/uitypes/StringDetailView.tpl index 6ece8c7be5b01a602de767c258a1bf861f90b40f..191305623205c05202f78720227a6c5dd3b3bfdf 100644 --- a/layouts/v7/modules/Vtiger/uitypes/StringDetailView.tpl +++ b/layouts/v7/modules/Vtiger/uitypes/StringDetailView.tpl @@ -35,7 +35,7 @@ {assign var=CURRENCY_SYMBOL value=$CURRENCY_INFO['symbol']} {/if} {if $SYMBOL_PLACEMENT eq '$1.0'} - {$CURRENCY_SYMBOL} <span class="currencyValue">{$FIELD_MODEL->getDisplayValue($FIELD_MODEL->get('fieldvalue'))}</span> + {(isset($CURRENCY_SYMBOL)) ? $CURRENCY_SYMBOL : ""} <span class="currencyValue">{$FIELD_MODEL->getDisplayValue($FIELD_MODEL->get('fieldvalue'))}</span> {else} <span class="currencyValue">{$FIELD_MODEL->getDisplayValue($FIELD_MODEL->get('fieldvalue'))}</span> {$CURRENCY_SYMBOL} {/if} diff --git a/modules/Inventory/actions/GetTaxes.php b/modules/Inventory/actions/GetTaxes.php index 4c861866cf4464d000a13b600422bb02ac79cae9..37e85b07e6a101a0224530ab4c76c284c5cf53dd 100644 --- a/modules/Inventory/actions/GetTaxes.php +++ b/modules/Inventory/actions/GetTaxes.php @@ -86,7 +86,7 @@ class Inventory_GetTaxes_Action extends Vtiger_Action_Controller { 'description' => $descriptionsList[$id], 'baseCurrencyId' => $baseCurrencyIdsList[$id], 'quantityInStock' => $quantitiesList[$id], - 'imageSource' => $imageSourcesList[$id] + 'imageSource' => isset($imageSourcesList[$id]) ? $imageSourcesList[$id] : "" ); $info[] = array($id => $resultData); diff --git a/modules/Inventory/models/Record.php b/modules/Inventory/models/Record.php index 728a222a2b483a8415bb63d1e05a9bbe66518fe3..40fe25099b5fbd6480c32f51a3f8a5339e715f9b 100644 --- a/modules/Inventory/models/Record.php +++ b/modules/Inventory/models/Record.php @@ -77,8 +77,8 @@ class Inventory_Record_Model extends Vtiger_Record_Model { $productIdsList = array(); for ($i=1;$i<=$productsCount; $i++) { $product = $relatedProducts[$i]; - $productId = $product['hdnProductId'.$i]; - $totalAfterDiscount = $product['totalAfterDiscount'.$i]; + $productId = isset($product['hdnProductId'.$i]) ? $product['hdnProductId'.$i] : ""; + $totalAfterDiscount = isset($product['totalAfterDiscount'.$i]) ? $product['totalAfterDiscount'.$i]:""; if ($taxtype == 'individual') { $taxDetails = getTaxDetailsForProduct($productId, 'all'); @@ -124,13 +124,13 @@ class Inventory_Record_Model extends Vtiger_Record_Model { $preTaxTotal+=$totalAfterDiscount; } - if ($relatedProducts[$i]['entityType'.$i] == 'Products') { + if (isset($relatedProducts[$i]['entityType'.$i]) && $relatedProducts[$i]['entityType'.$i] == 'Products') { $productIdsList[] = $productId; } } //Updating Pre tax total if not calculated from individual taxtype - if (!$preTaxTotal) { + if (!isset($preTaxTotal)) { $preTaxTotal = (float)$relatedProducts[1]['final_details']['hdnSubTotal'] + (float)$relatedProducts[1]['final_details']['shipping_handling_charge'] - (float)$relatedProducts[1]['final_details']['discountTotal_final']; @@ -208,7 +208,7 @@ class Inventory_Record_Model extends Vtiger_Record_Model { for ($i=1; $i<=$productsCount; $i++) { $product = $relatedProducts[$i]; $productId = $product['hdnProductId'.$i]; - $imageDetails = $imageDetailsList[$productId]; + $imageDetails = isset($imageDetailsList[$productId]) ? $imageDetailsList[$productId] : ""; if ($imageDetails) { $relatedProducts[$i]['productImage'.$i] = $imageDetails[0]['path'].'_'.$imageDetails[0]['orgname']; } diff --git a/modules/Inventory/views/Detail.php b/modules/Inventory/views/Detail.php index dd882433606c365a0bcf4333419006d12fd609a2..14029b7668b2c103e0e2ce409fa740ed94371ee8 100644 --- a/modules/Inventory/views/Detail.php +++ b/modules/Inventory/views/Detail.php @@ -181,7 +181,7 @@ class Inventory_Detail_View extends Vtiger_Detail_View { foreach ($selectedChargesList as $chargeId => $chargeModel) { $chargeInfo['name'] = $chargeModel->getName(); $chargeInfo['amount'] = Vtiger_Currency_UIType::transformDisplayValue($selectedChargesAndItsTaxes[$chargeId]['value'], null, true); - $chargeInfo['percent'] = $selectedChargesAndItsTaxes[$chargeId]['percent']; + $chargeInfo['percent'] = isset($selectedChargesAndItsTaxes[$chargeId]['percent']) ? $selectedChargesAndItsTaxes[$chargeId]['percent'] : ""; $chargeInfo['taxes'] = $selectedTaxesList[$chargeId]; $chargeInfo['deleted'] = $chargeModel->get('deleted'); diff --git a/modules/Inventory/views/Edit.php b/modules/Inventory/views/Edit.php index f6762d408fc2f610c08b4737421b2bdabddd08e3..17dc2e481f7fa1e4fe39b8945899ccc8210541ba 100644 --- a/modules/Inventory/views/Edit.php +++ b/modules/Inventory/views/Edit.php @@ -169,7 +169,7 @@ Class Inventory_Edit_View extends Vtiger_Edit_View { $viewer->assign('MODULE', $moduleName); $viewer->assign('CURRENTDATE', date('Y-n-j')); $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel()); - + $taxRegions = $recordModel->getRegionsList(); $defaultRegionInfo = $taxRegions[0]; unset($taxRegions[0]); diff --git a/modules/Invoice/Invoice.php b/modules/Invoice/Invoice.php index 7850dcc0b6a2cf802128437c032ba51aeb947174..0d06f2089e6a909fdc7f01f1b09652029a0806ca 100755 --- a/modules/Invoice/Invoice.php +++ b/modules/Invoice/Invoice.php @@ -138,6 +138,7 @@ class Invoice extends CRMEntity { $this->createRecurringInvoiceFromSO(); } else if(isset($_REQUEST)) { + $_REQUEST['ajxaction']=isset($_REQUEST['ajxaction']) ? $_REQUEST['ajxaction'] : ''; if($_REQUEST['action'] != 'InvoiceAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW' && $_REQUEST['action'] != 'MassEditSave' && $_REQUEST['action'] != 'ProcessDuplicates' && $_REQUEST['action'] != 'SaveAjax' && $this->isLineItemUpdate != false && $_REQUEST['action'] != 'FROM_WS') { diff --git a/modules/PurchaseOrder/PurchaseOrder.php b/modules/PurchaseOrder/PurchaseOrder.php index 8a6f646d068bdf18baf259d0ce01266c17a923e3..8e00b1198dbfa8ccc17cca40052941e8418b34a1 100644 --- a/modules/PurchaseOrder/PurchaseOrder.php +++ b/modules/PurchaseOrder/PurchaseOrder.php @@ -112,7 +112,7 @@ class PurchaseOrder extends CRMEntity { $updateInventoryProductRel_deduct_stock = false; $requestProductIdsList = $requestQuantitiesList = array(); - $totalNoOfProducts = $_REQUEST['totalProductCount']; + $totalNoOfProducts = isset($_REQUEST['totalProductCount']) ? $_REQUEST['totalProductCount'] : ''; for($i=1; $i<=$totalNoOfProducts; $i++) { $productId = $_REQUEST['hdnProductId'.$i]; $requestProductIdsList[$productId] = $productId; @@ -247,7 +247,7 @@ class PurchaseOrder extends CRMEntity { if (isset($_REQUEST['REQUEST_FROM_WS']) && $_REQUEST['REQUEST_FROM_WS']) { unset($_REQUEST['totalProductCount']); } - + $_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'] != 'PurchaseOrderAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW' && $_REQUEST['action'] != 'MassEditSave' && $_REQUEST['action'] != 'ProcessDuplicates' diff --git a/modules/PurchaseOrder/actions/GetTaxes.php b/modules/PurchaseOrder/actions/GetTaxes.php index 19f8d026a8bfe0d71a7aa36b54c064b8abf7f6f2..6c516263d3abbd8a82ed16e4df5048f6774c740f 100644 --- a/modules/PurchaseOrder/actions/GetTaxes.php +++ b/modules/PurchaseOrder/actions/GetTaxes.php @@ -78,7 +78,7 @@ class PurchaseOrder_GetTaxes_Action extends Inventory_GetTaxes_Action { 'description' => $descriptionsList[$id], 'baseCurrencyId' => $baseCurrencyIdsList[$id], 'quantityInStock' => $quantitiesList[$id], - 'imageSource' => $imageSourcesList[$id] + 'imageSource' => isset($imageSourcesList[$id]) ? $imageSourcesList[$id] :'' ); $info[] = array($id => $resultData); diff --git a/modules/Quotes/Quotes.php b/modules/Quotes/Quotes.php index 21435be09db44aed8eaca813aac569503d0b674a..67ed551f76ca8a09188512c3b4aa2d9a85a9298a 100755 --- a/modules/Quotes/Quotes.php +++ b/modules/Quotes/Quotes.php @@ -125,7 +125,7 @@ class Quotes extends CRMEntity { if (isset($_REQUEST['REQUEST_FROM_WS']) && $_REQUEST['REQUEST_FROM_WS']) { unset($_REQUEST['totalProductCount']); } - + $_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' && $_REQUEST['action'] != 'MassEditSave' && $_REQUEST['action'] != 'ProcessDuplicates' diff --git a/modules/SalesOrder/SalesOrder.php b/modules/SalesOrder/SalesOrder.php index 3ad88894f0483866f34a834aaf9857e1e40db586..0ed39d9ef869e18466bf4a74d2cd8ba1a6431eef 100644 --- a/modules/SalesOrder/SalesOrder.php +++ b/modules/SalesOrder/SalesOrder.php @@ -126,7 +126,7 @@ class SalesOrder extends CRMEntity { unset($_REQUEST['totalProductCount']); } - + $_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'] != 'SalesOrderAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW' && $_REQUEST['action'] != 'MassEditSave' && $_REQUEST['action'] != 'ProcessDuplicates' @@ -545,8 +545,9 @@ class SalesOrder extends CRMEntity { $tableColumnsString = implode(',', $tableColumns); } $selectClause = "SELECT " . $this->table_name . "." . $this->table_index . " AS recordid," . $tableColumnsString; - - // Select Custom Field Table Columns if present + $query = ''; + $duplicateCheckClause = ''; + // Select Custom Field Table Columns if present if (isset($this->customFieldTable)) $query .= ", " . $this->customFieldTable[0] . ".* "; diff --git a/modules/SalesOrder/actions/SaveAjax.php b/modules/SalesOrder/actions/SaveAjax.php index 3a04b4049fcbf16a3c6e4839b35dad479ed97c86..aecd9416666ca472fb3277e669a1261c8497d246 100755 --- a/modules/SalesOrder/actions/SaveAjax.php +++ b/modules/SalesOrder/actions/SaveAjax.php @@ -17,6 +17,7 @@ class SalesOrder_SaveAjax_Action extends Inventory_SaveAjax_Action { public function getRecordModelFromRequest(Vtiger_Request $request) { $moduleName = $request->getModule(); $recordId = $request->get('record'); + $enableRecurrence = false; if($request->get('field') == 'enable_recurring'){ $enableRecurrence = true; diff --git a/modules/Settings/Picklist/models/Module.php b/modules/Settings/Picklist/models/Module.php index 52b8917db7554e8e030d2a8d20fcf1a03ab8f547..80ab0204966c7a7589f6e70d2ca3da3238982f77 100644 --- a/modules/Settings/Picklist/models/Module.php +++ b/modules/Settings/Picklist/models/Module.php @@ -499,6 +499,7 @@ class Settings_Picklist_Module_Model extends Vtiger_Module_Model { $db = PearDatabase::getInstance(); $primaryKey = Vtiger_Util_Helper::getPickListId($fieldName); $columns = $db->getColumnNames("vtiger_$fieldName"); + $pickListColorMap = array(); if(is_array($columns) && in_array('color',$columns)) { $query = 'SELECT '.$primaryKey.',color,'.$fieldName.' FROM vtiger_'.$fieldName; $result = $db->pquery($query, array()); diff --git a/modules/Users/models/ListView.php b/modules/Users/models/ListView.php index 963de8b27749b6617c6a1d0a6d14649653b22833..0acd0f8ff7c75fe4c33038cebd6fd12ec4d47c8f 100644 --- a/modules/Users/models/ListView.php +++ b/modules/Users/models/ListView.php @@ -69,6 +69,7 @@ class Users_ListView_Model extends Vtiger_ListView_Model { $listQuery = parent::getQuery(); $searchKey = $this->get('search_key'); $db = PearDatabase::getInstance(); + $param=array(); if(!empty($searchKey)) { $listQueryComponents = explode(" WHERE vtiger_users.status='Active' AND", $listQuery); diff --git a/modules/Vtiger/actions/ExportData.php b/modules/Vtiger/actions/ExportData.php index d8c4e51aca5b2eae41d3166b38ff6b5f9b6234a6..0d5b94452757b151bf38e119104e34b533072483 100644 --- a/modules/Vtiger/actions/ExportData.php +++ b/modules/Vtiger/actions/ExportData.php @@ -325,7 +325,7 @@ class Vtiger_ExportData_Action extends Vtiger_Mass_Action { } elseif($uitype == 52 || $type == 'owner') { $value = Vtiger_Util_Helper::getOwnerName($value); }elseif($type == 'reference'){ - $value = trim($value); + $value = isset($value) ? trim($value) :''; if(!empty($value)) { $parent_module = getSalesEntityType($value); $displayValueArray = getEntityName($parent_module, $value); diff --git a/modules/Vtiger/views/ComposeEmail.php b/modules/Vtiger/views/ComposeEmail.php index d66dec4501e104eab25612c2b3d31d0789c484f6..b26e682fff6d1a296572fda0d4fcfdcb49e68992 100644 --- a/modules/Vtiger/views/ComposeEmail.php +++ b/modules/Vtiger/views/ComposeEmail.php @@ -205,6 +205,10 @@ class Vtiger_ComposeEmail_View extends Vtiger_Footer_View { $to = $requestTo; } + if(is_array($to)) { + $to = implode(',',$to); + } + $documentsModel = Vtiger_Module_Model::getInstance('Documents'); $documentsURL = $documentsModel->getInternalDocumentsURL(); diff --git a/modules/Vtiger/views/List.php b/modules/Vtiger/views/List.php index 8e2c0a8a1fd946511146b1024f3f50aea51fc95c..faf167abf9267f9246757b153ad376a78dce6a90 100644 --- a/modules/Vtiger/views/List.php +++ b/modules/Vtiger/views/List.php @@ -244,6 +244,7 @@ class Vtiger_List_View extends Vtiger_Index_View { if(empty($searchParams)) { $searchParams = isset($orderParams['search_params']) ? $orderParams['search_params'] : ""; } + if(empty($starFilterMode)) { $starFilterMode = isset($orderParams['star_filter_mode']) ? $orderParams['star_filter_mode'] : ""; } diff --git a/modules/Vtiger/views/ListAjax.php b/modules/Vtiger/views/ListAjax.php index e822d42a8e038891c99d9c7ba031d3297939b224..af04a535855ea4470d360502c766b277e2f2b532 100644 --- a/modules/Vtiger/views/ListAjax.php +++ b/modules/Vtiger/views/ListAjax.php @@ -97,7 +97,7 @@ class Vtiger_ListAjax_View extends Vtiger_List_View { $selectedFields = array(); foreach ($cvSelectedFields as $cvFieldName) { - $selectedFields[$cvFieldName] = $cvSelectedFieldModelsMapping[$cvFieldName]; + $selectedFields[$cvFieldName] = isset($cvSelectedFieldModelsMapping[$cvFieldName]) ? $cvSelectedFieldModelsMapping[$cvFieldName] : ''; } $viewer->assign('CV_MODEL',$cvModel); diff --git a/modules/Vtiger/views/Popup.php b/modules/Vtiger/views/Popup.php index 712607f7e04420377689b6cf75efa93ec55e71d9..92dc923047da20f1c9a59c7afdc4e69ba17de6d3 100644 --- a/modules/Vtiger/views/Popup.php +++ b/modules/Vtiger/views/Popup.php @@ -99,6 +99,7 @@ class Vtiger_Popup_View extends Vtiger_Footer_View { $searchParams=$request->get('search_params'); $relationId = $request->get('relationId'); + $label=''; //To handle special operation when selecting record from Popup $getUrl = $request->get('get_url'); diff --git a/vtlib/Vtiger/PDF/TCPDF.php b/vtlib/Vtiger/PDF/TCPDF.php index e7d4bf46ec50622a18eff4755972c6d29963aa5e..2681d821d3629c2dbaf0796d91ad216dc3b09f66 100644 --- a/vtlib/Vtiger/PDF/TCPDF.php +++ b/vtlib/Vtiger/PDF/TCPDF.php @@ -35,7 +35,7 @@ class Vtiger_PDF_TCPDF extends TCPDF { $sa = substr($sa,0,-1); $blocks = explode("\n",$sa); - $wmax = $w - (2 * $this->cMargin); + $wmax = $w - (2 * isset($this->cMargin) ? $this->cMargin : 0); $lines = 0; $spacesize = $this->GetCharWidth(32); diff --git a/vtlib/Vtiger/PDF/inventory/ContentViewer2.php b/vtlib/Vtiger/PDF/inventory/ContentViewer2.php index 9d403ddd107fda678a61f3fbe69092b922cfba43..8e4ed5bd743032e5e78679e1e7d1c20d3859e19b 100644 --- a/vtlib/Vtiger/PDF/inventory/ContentViewer2.php +++ b/vtlib/Vtiger/PDF/inventory/ContentViewer2.php @@ -20,7 +20,8 @@ class Vtiger_PDF_InventoryTaxGroupContentViewer extends Vtiger_PDF_InventoryCont 'Quantity' => 20, 'Price' => 25, 'Discount' => 20, - 'Total' => 30 + 'Total' => 30, + 'Tax' => 0, ); }