Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • vtiger/vtigercrm
  • varma/vtigercrm
  • alanbell/vtigercrm
  • mariusz.krzaczkowski/vtigercrm
  • manu.k/vtigercrm
  • adrgranado/vtigercrm
  • uma.s/vtigercrm
  • sardoj/vtigercrm
  • preexo/vtigercrm
  • david.valminos/vtigercrm
  • luca.saba/vtigercrm
  • dubwise/vtigercrm
  • valmir.ttcasolucoes/vtigercrm
  • lord_alan/vtigercrm
  • adrien.futschik/vtigercrm
  • edonit.rexhepi/vtigercrm
  • robert.heinze/vtigercrm
  • nrdimatteo/vtigercrm
  • sebastianzahan/vtigercrm
  • Miky/vtigercrm
  • germanf/vtigercrm
  • bernhardkau1/vtigercrm
  • olegtsoy/vtigercrm
  • grandel/vtigercrm
  • mario.thummler/vtigercrm
  • sutharsan/vtigercrm
  • james.douglas/vtigercrm
  • vikas/vtigercrm
  • jeffmchristensen/vtigercrm
  • lukasz.g/vtigercrm
  • nicolas.gasnier/vtigercrm
  • hamish.theitcompany/vtigercrm
  • engrbm87/vtigercrm
  • Quoc/vtigercrm
  • peter.maria.engeli/vtigercrm
  • kiranraju.j/vtigercrm
  • manuel.lozano/vtigercrm
  • dhaupin/vtigercrm
  • Ragupathyranesh/vtigercrm
  • Stefanbauer/vtigercrm
  • ruben.estrada/vtigercrm
  • sg_mwi1/vtigercrm
  • khaluk/vtigercrm
  • franzfroemel/vtigercrm
  • milan9615/vtigercrm
  • carlos.martin/vtigercrm
  • cmaggi/vtigercrm
  • Soltoon.theLeader/vtigercrm
  • alex.kaplun/vtigercrm
  • navid.hosseini/vtigercrm
  • maie/vtigercrm
  • simonetravaglini/vtigercrm
  • bertrand.wattel/vtigercrm
  • balaji.m/vtigercrm
  • mclarke4/vtigercrm
  • lajeeshk/vtigercrm
  • liam/vtigercrm
  • novikov.sergey/vtigercrm
  • johnwayne.williamson/vtigercrm
  • florian.strahberger-schramm/vtigercrm
  • daniel.schaefer/vtigercrm
  • christopher.gunther/vtigercrm
  • adrien.faveraux/vtigercrm
  • carsten.brandt/vtigercrm
  • stephane.molano/vtigercrm
  • krastan.petrov/vtigercrm
  • alfredo.bravo/vtigercrm
  • flipflop.Joe/vtigercrm
  • mirko.stagni/vtigercrm
  • remigio.ruberto/vtigercrm
  • gautam.dhudashiya/vtigercrm
  • manish.devitechnosolutions1/vtigercrm
  • matinbeigi/vtigercrm
  • devs/vtigercrm
  • happy.dev/vtigercrm
  • m.gigon/vtigercrm
  • manuelmigone/vtigercrm
  • eduardo.gqf/vtigercrm
  • elsayedEl-araby/vtigercrm
  • mirza.mehran/vtigercrm
  • maurice.courtois/vtigercrm
  • zuhri.utama/vtigercrm
  • shilpa.k/vtigercrm
  • Ignazio/vtigercrm
  • code80team/vtigercrm
  • code80/vtigercrm
  • nilay.automatesmb/cache
  • greeshma.kk/vtigercrm
  • vijay.tilak/vtigercrm
  • Paolo.Palamini/vtigercrm
  • estevan/vtigercrm
  • mobilcmcdk/vtigercrm
  • massimiliano.vessi/vtigercrm
  • daniel.voelskow/vtigercrm
  • james1/vtigercrm
  • lokesh.s/vtigercrm
  • rdb/vtigercrm
  • neftaliyagua/vtigercrm
  • angelo.paglialonga/vtigercrm
  • webmarka/vtigercrm
  • javanile/vtigercrm
  • akshath/vtigercrm
  • Hemanth/vtigercrm
  • opencrmitalia/vtigercrm
  • direzione/vtigercrm
  • umadas306/vtigercrm
  • jd-wraptec/vtigercrm
  • felipe.camacho/vtigercrm
  • Martin.allen/vtigercrm
  • amit.r/vtigercrm
  • vicus/vtigercrm
  • dev.osmi/vtigercrm
  • laurent.guillout/vtigercrm
  • christian.blaeul/vtigercrm
  • ap.js100/vtigercrm
  • yoann.mourot/vtigercrm-temp
  • christian.cruz/vtigercrm
  • zyli/vtigercrm
  • kaushik.p/vtigercrm
  • Madhuk/vtigercrm
  • cinakzm/vtigercrm
  • raquel.martinez/vtigercrm
  • tosajibadhi/vtigercrm
  • melvin.i/vtigercrm-melvin
  • ashashingadia/vtigercrm
  • stefanwarnat/vtigercrm
  • saran.s/vtigercrm
  • eduardomozart/vtigercrm
  • Daniel.Lennartz1/vtigercrm
  • juergen.fassmann/vtigercrm
  • Michel.Ram/vtigercrm
  • vincenzo.bruno/vtigercrm
  • Hitesh.Solanki/vtigercrm
133 results
Show changes
Showing
with 110 additions and 67 deletions
......@@ -352,21 +352,21 @@ function isPermitted($module,$actionname,$record_id='')
}
}
//Checking for vtiger_tab permission
if($profileTabsPermission[$tabid] !=0)
if(isset($profileTabsPermission[$tabid]) && $profileTabsPermission[$tabid] !=0)
{
$permission = "no";
$log->debug("Exiting isPermitted method ...");
return $permission;
}
//Checking for Action Permission
if(strlen($profileActionPermission[$tabid][$actionid]) < 1 && $profileActionPermission[$tabid][$actionid] == '')
if(isset($profileActionPermission[$tabid][$actionid]) && strlen($profileActionPermission[$tabid][$actionid]) < 1 && $profileActionPermission[$tabid][$actionid] == '')
{
$permission = "yes";
$log->debug("Exiting isPermitted method ...");
return $permission;
}
if($profileActionPermission[$tabid][$actionid] != 0 && $profileActionPermission[$tabid][$actionid] != '')
if(isset($profileActionPermission[$tabid][$actionid]) && $profileActionPermission[$tabid][$actionid] != 0 && $profileActionPermission[$tabid][$actionid] != '')
{
$permission = "no";
$log->debug("Exiting isPermitted method ...");
......@@ -2132,7 +2132,7 @@ function getPermittedModuleNames()
{
foreach($tab_seq_array as $tabid=>$seq_value)
{
if($seq_value === 0 && $profileTabsPermission[$tabid] === 0)
if($seq_value === 0 && (isset($profileTabsPermission[$tabid]) && $profileTabsPermission[$tabid] === 0))
{
$permittedModules[]=getTabModuleName($tabid);
}
......@@ -2171,7 +2171,7 @@ function getPermittedModuleIdList() {
if($is_admin == false && $profileGlobalPermission[1] == 1 &&
$profileGlobalPermission[2] == 1) {
foreach($tab_seq_array as $tabid=>$seq_value) {
if($seq_value === 0 && $profileTabsPermission[$tabid] === 0) {
if($seq_value === 0 && isset($profileTabsPermission[$tabid]) && $profileTabsPermission[$tabid] === 0) {
$permittedModules[]=($tabid);
}
}
......
......@@ -441,7 +441,7 @@ class VTCacheUtils {
static $_report_field_bylabel = array();
public static function getReportFieldByLabel($module, $label) {
return self::$_report_field_bylabel[$module][$label];
return isset(self::$_report_field_bylabel[$module][$label]) ? self::$_report_field_bylabel[$module][$label] : array();
}
public static function setReportFieldByLabel($module, $label, $fieldInfo) {
......
......@@ -822,15 +822,16 @@ function purifyHtmlEventAttributes($value,$replaceAll = false){
$value = Vtiger_Functions::stripInlineOffice365Image($value,true,$office365ImageMarkers);
$tmp_markers = array_merge($tmp_markers, $office365ImageMarkers);
// remove malicious html attributes with its value.
$pattern='/\b(alert|on\w+)\s*\([^)]*\)|\s*(?:on\w+)=(".*?"|\'.*?\'|[^\'">\s]+)\s*/';
if ($replaceAll) {
$value = preg_replace('/\b(alert|on\w+)\s*\([^)]*\)|\s*(?:on\w+)=(".*?"|\'.*?\'|[^\'">\s]+)\s*/', '', $value);
$value = preg_replace($pattern, '', $value);
//remove script tag with contents
$value = purifyScript($value);
//purify javascript alert from the tag contents
$value = purifyJavascriptAlert($value);
} else {
if (preg_match("/\s*(" . $htmlEventAttributes . ")\s*=/i", $value)) {
if (preg_match($pattern, $value)) {
$value = str_replace("=", "&equals;", $value);
}
}
......@@ -998,7 +999,7 @@ function vtlib_addSettingsLink($linkName, $linkURL, $blockName = false) {
/**
* PHP Strict helpers.
*/
require_once "vtlib/Vtiger/Utils/GuardedArray.php";
require_once __DIR__ . "/../../vtlib/Vtiger/Utils/GuardedArray.php"; /* absolute path used to overcome need of chdir in subpaths */
function vtlib_array($data = null) {
return new Vtiger_GuardedArray($data);
}
......@@ -1054,4 +1055,3 @@ function php7_htmlentities($str) {
return $str == null ? $str : htmlentities($str);
}
......@@ -126,7 +126,7 @@ function get_user_array($add_blank=true, $status="Active", $assigned_user="",$pr
}
static $user_array = null;
if(!$module){
$module=$_REQUEST['module'];
$module=isset($_REQUEST['module']) ? $_REQUEST['module'] : "";
}
......@@ -197,7 +197,7 @@ function get_group_array($add_blank=true, $status="Active", $assigned_user="",$p
}
static $group_array = null;
if(!$module){
$module=$_REQUEST['module'];
$module=isset($_REQUEST['module']) ? $_REQUEST['module'] : "";
}
if($group_array == null)
......
......@@ -24,7 +24,7 @@ class Vtiger_WebUI extends Vtiger_EntryPoint {
protected function checkLogin (Vtiger_Request $request) {
if (!$this->hasLogin()) {
$return_params = $_SERVER['QUERY_STRING'];
if($return_params && !$_SESSION['return_params']) {
if(isset($return_params) && $return_params && !$_SESSION['return_params']) {
//Take the url that user would like to redirect after they have successfully logged in.
$return_params = urlencode($return_params);
Vtiger_Session::set('return_params', $return_params);
......
......@@ -201,7 +201,7 @@ abstract class Vtiger_View_Controller extends Vtiger_Action_Controller {
$viewer->assign('NO_EDIT', '');
$viewer->assign('SOURCE_MODULE', '');
$viewer->assign('OPERATOR', '');
$viewer->assign('LISTVIEW_COUNT', 0);
$viewer->assign('LISTVIEW_COUNT', '');
$viewer->assign('FOLDER_ID', 0);
$viewer->assign('FOLDER_VALUE', '');
$viewer->assign('VIEWTYPE', '');
......
......@@ -58,7 +58,9 @@ class Vtiger_Language_Handler {
public static function getLanguageTranslatedString($language, $key, $module = '') {
$moduleStrings = array();
$module = str_replace(':', '.', $module);
if ($module !== null) {
$module = str_replace(':', '.', $module);
}
if (is_array($module))
return null;
$moduleStrings = self::getModuleStringsFromFile($language, $module);
......@@ -66,7 +68,7 @@ class Vtiger_Language_Handler {
return $moduleStrings['languageStrings'][$key];
}
// Lookup for the translation in base module, in case of sub modules, before ending up with common strings
if (strpos($module, '.') > 0) {
if ($module != null && strpos($module, '.') > 0) {
$baseModule = substr($module, 0, strpos($module, '.'));
if ($baseModule == 'Settings') {
$baseModule = 'Settings.Vtiger';
......@@ -124,7 +126,7 @@ class Vtiger_Language_Handler {
* @return <array> - array if module has language strings else returns empty array
*/
public static function getModuleStringsFromFile($language, $module='Vtiger'){
$module = str_replace(':', '.', $module);
if($module !== null) $module = str_replace(':', '.', $module);
if (!empty(self::$languageContainer[$language][$module])) {
return self::$languageContainer[$language][$module];
}
......
......@@ -65,7 +65,18 @@ class Vtiger_Theme extends Vtiger_Viewer {
* @return <string> - theme folder
*/
public static function getBaseThemePath(){
return 'layouts'. '/' . self::getLayoutName(). '/skins';
$basepath = 'layouts'. '/' . self::getLayoutName();
$useskin = static::DEFAULTSKIN;
// do we have any override valid custom skin?
$customskin = isset($_SESSION) && isset($_SESSION['authenticated_user_skin']) ? $_SESSION['authenticated_user_skin'] : '';
if ($customskin && !preg_match("/[^a-zA-Z0-9_-]/", $customskin)) { // strict-check to avoid file-inclusion attack.
$customskin = "custom_skins/" . $customskin; // lookup path
if (file_exists($basepath . '/' . $customskin)) { // ensure validity
$useskin = $customskin;
}
}
return $basepath . '/' . $useskin;
}
/**
......@@ -108,7 +119,11 @@ class Vtiger_Theme extends Vtiger_Viewer {
* @return <Array>
*/
public static function getAllSkins(){
return Vtiger_Util_Helper::getAllSkins();
$dirs = glob("layouts/". static::DEFAULTLAYOUT . "/custom_skins/*", GLOB_ONLYDIR);
if (!empty($dirs)) {
$dirs = array_map('basename', $dirs);
}
return $dirs;
}
/**
......
......@@ -11,6 +11,7 @@
class Vtiger_Viewer extends Smarty {
const DEFAULTLAYOUT = 'v7';
const DEFAULTSKIN = 'skins';
const DEFAULTTHEME = 'softed';
static $currentLayout;
......@@ -72,13 +73,27 @@ class Vtiger_Viewer extends Smarty {
}
// TODO: Refactor to specific module dependency.
$inSettings = isset($_REQUEST["parent"]) && $_REQUEST["parent"] == "Settings";
$classes = array('Vtiger_MenuStructure_Model', 'Users_Privileges_Model',
'Vtiger_Module_Model', 'Settings_MenuEditor_Module_Model', 'Vtiger_Util_Helper',
'ZEND_JSON', 'Zend_Json', 'Zend_JSON', 'ZEND_json',
'Vtiger_Theme', 'Users_Record_Model', 'Vtiger_Module_Model', 'Vtiger_Field_Model', 'Vtiger_Record_Model',
'Settings_Picklist_Module_Model', 'CustomView_Record_Model', 'Vtiger_Extension_View',
'Vtiger_Tag_Model', 'Settings_Vtiger_Module_Model', 'PBXManager_Server_Model',
'Vtiger_Functions', 'Users', 'CurrencyField');
'Vtiger_Functions', 'Users', 'CurrencyField', 'Reports_Field_Model',
'DateTimeField', 'Calendar_Time_UIType', 'Calendar_Field_Model',
'Vtiger_Date_UIType', 'Vtiger_Time_UIType', 'Vtiger_RelationListView_Model',
'Inventory_TaxRegion_Model', 'EmailTemplates_Module_Model');
if ($inSettings) {
$classes = array_merge($classes, array(
'getInventoryModules', 'Settings_Vtiger_MenuItem_Model', 'Settings_Webforms_Record_Model',
'Settings_Vtiger_CompanyDetails_Model', 'Inventory_Charges_Model', 'Settings_PBXManager_Module_Model',
'PBXManager_PBXManager_Connector', 'Settings_Webforms_Record_Model', 'Google_Config_Connector'
));
}
foreach ($classes as $clazz) {
if (class_exists($clazz)) {
$this->registerClass($clazz, $clazz);
......@@ -86,11 +101,11 @@ class Vtiger_Viewer extends Smarty {
}
$modifiers = array('vtranslate', 'vtlib_isModuleActive', 'vimage_path', 'strstr', 'stripos', 'strpos', 'date', 'vtemplate_path', 'vresource_url',
'decode_html', 'vtlib_purify', 'php7_count', 'getUserFullName', 'array_flip', 'explode', 'trim', 'array_push',
'html_entity_decode', 'decode_html', 'vtlib_purify', 'php7_count', 'getUserFullName', 'array_flip', 'explode', 'trim', 'array_push', 'array_merge',
'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','implode','mt_rand','substr','in_array');
'getCurrencySymbolandCRate', 'getProductBaseCurrency', 'mb_substr', 'isPermitted', 'getOwnerName', 'getEntityName', 'function_exists', 'php7_trim', 'php7_htmlentities',
'strtolower', 'strtoupper', 'str_replace', 'urlencode', 'getTranslatedCurrencyString', 'getTranslatedString', 'is_object', 'is_numeric','preg_match',
'php7_sizeof', 'method_exists','implode','mt_rand','substr','in_array','array_keys', 'json_decode', 'getCurrencyDecimalPlaces', 'number_format', 'isRecordExists');
foreach ($modifiers as $modifier) {
if (function_exists($modifier)) {
$this->registerPlugin('modifier', $modifier, $modifier);
......
......@@ -24,4 +24,5 @@ $languageStrings = array(
'LBL_RUNNING' => 'Running',
'LBL_ACTIVE' => 'Active',
'LBL_INACTIVE' => 'In Active',
'LBL_ERROR' => 'ERROR',
);
......@@ -35,6 +35,7 @@ $languageStrings = array(
'LBL_ALL_USERS' => 'All Users',
'LBL_USERS_WITH_LOWER_LEVEL' => 'Users having Subordinate Role',
'LBL_USERS_WITH_SAME_OR_LOWER_LEVEL' => 'Users having Same Role or Subordinate Role',
'LBL_USERS_WITH_SAME_LEVEL_AND_SUBORDINATES' => 'Users having Same Level or Subordinate Role',
/*Vtiger7 String*/
'LBL_EDIT_ROLE' => 'Edit Role',
......
......@@ -38,7 +38,11 @@
{assign var=FIELD_INFO value=$FIELD_MODEL->getFieldInfo()}
{assign var=PICKLIST_VALUES value=$FIELD_INFO['picklistvalues']}
{assign var=FIELD_INFO value=Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode($FIELD_INFO))}
{assign var=SEARCH_VALUES value=explode(',',$SEARCH_INFO['searchValue'])}
{if isset($SEARCH_INFO) && isset($SEARCH_INFO['searchValue'])}
{assign var=SEARCH_VALUES value=explode(',', $SEARCH_INFO['searchValue'])}
{else}
{assign var=SEARCH_VALUES value=array()}
{/if}
<select class="select2 listSearchContributor" name="{$FIELD_MODEL->get('name')}" multiple data-fieldinfo='{$FIELD_INFO|escape}'>
{foreach item=PICKLIST_LABEL key=PICKLIST_KEY from=$PICKLIST_VALUES}
<option {if $PICKLIST_KEY|in_array:$TASK_FILTERS['status']}selected{/if} value="{$PICKLIST_KEY}">{$PICKLIST_LABEL}</option>
......@@ -83,4 +87,4 @@
</div>
</div>
</div>
{/strip}
\ No newline at end of file
{/strip}
......@@ -14,8 +14,13 @@
{assign var=ASSIGNED_USER_ID value=$FIELD_MODEL->get('name')}
{assign var="FIELD_INFO" value=$FIELD_MODEL->getFieldInfo()}
{assign var=ALL_ACTIVEUSER_LIST value=$FIELD_INFO['picklistvalues'][vtranslate('LBL_USERS')]}
{assign var=SEARCH_VALUES value=explode(',',$SEARCH_INFO['searchValue'])}
{assign var=SEARCH_VALUES value=array_map("trim",$SEARCH_VALUES)}
{if isset($SEARCH_INFO) && isset($SEARCH_INFO['searchValue'])}
{assign var=SEARCH_VALUES value=explode(',',$SEARCH_INFO['searchValue'])}
{assign var=SEARCH_VALUES value=array_map("trim",$SEARCH_VALUES)}
{else}
{assign var=SEARCH_VALUES value=array()}
{/if}
{if $FIELD_MODEL->get('uitype') eq '52' || $FIELD_MODEL->get('uitype') eq '77'}
{assign var=ALL_ACTIVEGROUP_LIST value=array()}
......@@ -52,4 +57,4 @@
{/if}
</select>
</div>
{/strip}
\ No newline at end of file
{/strip}
......@@ -41,7 +41,7 @@
<p class="current-filter-name filter-name pull-left cursorPointer" title="{$CVNAME}">&nbsp;<span class="fa fa-angle-right pull-left" aria-hidden="true"></span><a href='{$MODULE_MODEL->getListViewUrl()}&viewname={$VIEWID}'>&nbsp;{$CVNAME}&nbsp;</a> </p>
{/if}
{assign var=SINGLE_MODULE_NAME value='SINGLE_'|cat:$MODULE}
{if isset($RECORD) and $REQ->get('view') eq 'Edit'}
{if isset($RECORD) and $RECORD and $REQ->get('view') eq 'Edit'}
<p class="current-filter-name filter-name pull-left "><span class="fa fa-angle-right pull-left" aria-hidden="true"></span><a title="{$RECORD->get('label')}">&nbsp;{vtranslate('LBL_EDITING', $MODULE)} : {$RECORD->get('label')}&nbsp;</a></p>
{else if $REQ->get('view') eq 'Edit'}
<p class="current-filter-name filter-name pull-left "><span class="fa fa-angle-right pull-left" aria-hidden="true"></span><a>&nbsp;{vtranslate('LBL_ADDING_NEW', $MODULE)}&nbsp;</a></p>
......
......@@ -152,7 +152,7 @@
<div class="menu-scroller scrollContainer" style="position:relative; top:0; left:0;">
<div class="list-menu-content">
<div id="listViewTagContainer" class="multiLevelTagList"
{if isset($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}">
{foreach item=TAG_MODEL from=$TAGS name=tagCounter}
{assign var=TAG_LABEL value=$TAG_MODEL->getName()}
......
......@@ -12,7 +12,7 @@
{strip}
{include file="partials/EditViewContents.tpl"|@vtemplate_path:'Vtiger'}
<div name='editContent'>
<div class='fieldBlockContainer' data-block="{(isset($BLOCK_LABEL)) ? $BLOCK_LABEL :""}">
<div class='fieldBlockContainer' data-block="{(isset($BLOCK_LABEL)) ? $BLOCK_LABEL :''}">
<h4 class='fieldBlockHeader'>{vtranslate('LBL_INVITE_USER_BLOCK', $MODULE)}</h4>
<hr>
<table class="table table-borderless">
......@@ -72,4 +72,4 @@
<!--Confirmation modal for updating Recurring Events-->
</div>
</div>
{/strip}
\ No newline at end of file
{/strip}
......@@ -33,7 +33,7 @@
<div class="input-group">
<input id="{$FIELD_NAME}_display" name="{$FIELD_NAME}_display" data-fieldname="{$FIELD_NAME}" data-fieldtype="reference" type="text"
class="marginLeftZero autoComplete inputElement"
value="{(isset($displayId))?$FIELD_MODEL->getEditViewDisplayValue($displayId):""}"
value="{(isset($displayId))?$FIELD_MODEL->getEditViewDisplayValue($displayId):''}"
data-fieldinfo='{json_encode($FIELD_INFO)}' data-fieldtype="multireference" placeholder="{vtranslate('LBL_TYPE_SEARCH',$MODULE)}"
{if $FIELD_INFO["mandatory"] eq true} data-rule-required="true" {/if}
/>
......
......@@ -66,42 +66,42 @@
{if $PRODUCT_EDITABLE}
<td>
<!-- Product Re-Ordering Feature Code Addition Starts -->
<input type="hidden" name="hidtax_row_no{$row_no}" id="hidtax_row_no{$row_no}" value="{(isset($tax_row_no)) ? $tax_row_no : ""}"/>
<input type="hidden" name="hidtax_row_no{$row_no}" id="hidtax_row_no{$row_no}" value="{(isset($tax_row_no)) ? $tax_row_no : ''}"/>
<!-- Product Re-Ordering Feature Code Addition ends -->
<div class="itemNameDiv form-inline">
<div class="row">
<div class="col-lg-10">
<div class="input-group" style="width:100%">
<input type="text" id="{$productName}" name="{$productName}" value="{(isset($data.$productName)) ? $data.$productName : ""}" class="productName form-control {if $row_no neq 0} autoComplete {/if} " placeholder="{vtranslate('LBL_TYPE_SEARCH',$MODULE)}"
<input type="text" id="{$productName}" name="{$productName}" value="{(isset($data.$productName)) ? $data.$productName : ''}" class="productName form-control {if $row_no neq 0} autoComplete {/if} " placeholder="{vtranslate('LBL_TYPE_SEARCH',$MODULE)}"
data-rule-required=true {if !empty($data.$productName)} disabled="disabled" {/if}>
{if isset($data.$productDeleted) && !$data.$productDeleted}
<span class="input-group-addon cursorPointer clearLineItem" title="{vtranslate('LBL_CLEAR',$MODULE)}">
<i class="fa fa-times-circle"></i>
</span>
{/if}
<input type="hidden" id="{$hdnProductId}" name="{$hdnProductId}" value="{(isset($data.$hdnProductId)) ? $data.$hdnProductId : ""}" class="selectedModuleId"/>
<input type="hidden" id="{$hdnProductId}" name="{$hdnProductId}" value="{(isset($data.$hdnProductId)) ? $data.$hdnProductId : ''}" class="selectedModuleId"/>
<input type="hidden" id="lineItemType{$row_no}" name="lineItemType{$row_no}" value="{$entityType}" class="lineItemType"/>
<div class="col-lg-2">
{if $row_no eq 0}
<span class="lineItemPopup cursorPointer" data-popup="ServicesPopup" title="{vtranslate('Services',$MODULE)}" data-module-name="Services" data-field-name="serviceid">{Vtiger_Module_Model::getModuleIconPath('Services')}</span>
<span class="lineItemPopup cursorPointer" data-popup="ProductsPopup" title="{vtranslate('Products',$MODULE)}" data-module-name="Products" data-field-name="productid">{Vtiger_Module_Model::getModuleIconPath('Products')}</span>
{elseif $entityType eq '' and $PRODUCT_ACTIVE eq 'true'}
<span class="lineItemPopup cursorPointer" data-popup="ProductsPopup" title="{vtranslate('Products',$MODULE)}" data-module-name="Products" data-field-name="productid">{Vtiger_Module_Model::getModuleIconPath('Products')}</span>
{elseif $entityType eq '' and $SERVICE_ACTIVE eq 'true'}
<span class="lineItemPopup cursorPointer" data-popup="ServicesPopup" title="{vtranslate('Services',$MODULE)}" data-module-name="Services" data-field-name="serviceid">{Vtiger_Module_Model::getModuleIconPath('Services')}</span>
{else}
{if ($entityType eq 'Services') and (isset($data.$productDeleted) && !$data.$productDeleted)}
<span class="lineItemPopup cursorPointer" data-popup="ServicesPopup" title="{vtranslate('Services',$MODULE)}" data-module-name="Services" data-field-name="serviceid">{Vtiger_Module_Model::getModuleIconPath('Services')}</span>
{elseif (!$data.$productDeleted)}
<span class="lineItemPopup cursorPointer" data-popup="ProductsPopup" title="{vtranslate('Products',$MODULE)}" data-module-name="Products" data-field-name="productid">{Vtiger_Module_Model::getModuleIconPath('Products')}</span>
{/if}
{/if}
</div>
</div>
</div>
<div class="col-lg-2">
{if $row_no eq 0}
<span class="lineItemPopup cursorPointer" data-popup="ServicesPopup" title="{vtranslate('Services',$MODULE)}" data-module-name="Services" data-field-name="serviceid">{Vtiger_Module_Model::getModuleIconPath('Services')}</span>
<span class="lineItemPopup cursorPointer" data-popup="ProductsPopup" title="{vtranslate('Products',$MODULE)}" data-module-name="Products" data-field-name="productid">{Vtiger_Module_Model::getModuleIconPath('Products')}</span>
{elseif $entityType eq '' and $PRODUCT_ACTIVE eq 'true'}
<span class="lineItemPopup cursorPointer" data-popup="ProductsPopup" title="{vtranslate('Products',$MODULE)}" data-module-name="Products" data-field-name="productid">{Vtiger_Module_Model::getModuleIconPath('Products')}</span>
{elseif $entityType eq '' and $SERVICE_ACTIVE eq 'true'}
<span class="lineItemPopup cursorPointer" data-popup="ServicesPopup" title="{vtranslate('Services',$MODULE)}" data-module-name="Services" data-field-name="serviceid">{Vtiger_Module_Model::getModuleIconPath('Services')}</span>
{else}
{if ($entityType eq 'Services') and (isset($data.$productDeleted) && !$data.$productDeleted)}
<span class="lineItemPopup cursorPointer" data-popup="ServicesPopup" title="{vtranslate('Services',$MODULE)}" data-module-name="Services" data-field-name="serviceid">{Vtiger_Module_Model::getModuleIconPath('Services')}</span>
{elseif (!$data.$productDeleted)}
<span class="lineItemPopup cursorPointer" data-popup="ProductsPopup" title="{vtranslate('Products',$MODULE)}" data-module-name="Products" data-field-name="productid">{Vtiger_Module_Model::getModuleIconPath('Products')}</span>
{/if}
{/if}
</div>
</div>
</div>
<input type="hidden" value="{(isset($data.$subproduct_ids)) ? $data.$subproduct_ids : ""}" id="{$subproduct_ids}" name="{$subproduct_ids}" class="subProductIds" />
<input type="hidden" value="{(isset($data.$subproduct_ids)) ? $data.$subproduct_ids : ''}" id="{$subproduct_ids}" name="{$subproduct_ids}" class="subProductIds" />
<div id="{$subprod_names}" name="{$subprod_names}" class="subInformation">
<span class="subProductsContainer">
{if isset($data.$subprod_qty_list)}
......@@ -138,7 +138,7 @@
{if $QUANTITY_EDITABLE eq false} disabled=disabled {/if} />
{if isset($PURCHASE_COST_EDITABLE) && $PURCHASE_COST_EDITABLE eq false and $MODULE neq 'PurchaseOrder'}
<input id="{$purchaseCost}" type="hidden" value="{if ((float)$data.$purchaseCost)}{((float)$data.$purchaseCost) / ((float)$data.$qty)}{else}0{/if}" />
<input id="{$purchaseCost}" type="hidden" value="{if $data.$purchaseCost && $data.$qty}{((float)$data.$purchaseCost) / ((float)$data.$qty)}{else}0{/if}" />
<span style="display:none" class="purchaseCost">0</span>
<input name="{$purchaseCost}" type="hidden" value="{if $data.$purchaseCost}{$data.$purchaseCost}{else}0{/if}" />
{/if}
......@@ -158,7 +158,7 @@
{if isset($PURCHASE_COST_EDITABLE) && $PURCHASE_COST_EDITABLE}
<td>
<input id="{$purchaseCost}" type="hidden" value="{if $data.$purchaseCost}{((float)$data.$purchaseCost) / ((float)$data.$qty)}{else}0{/if}" />
<input id="{$purchaseCost}" type="hidden" value="{if $data.$purchaseCost && $data.$qty}{((float)$data.$purchaseCost) / ((float)$data.$qty)}{else}0{/if}" />
<input name="{$purchaseCost}" type="hidden" value="{if $data.$purchaseCost}{$data.$purchaseCost}{else}0{/if}" />
<span class="pull-right purchaseCost">{if $data.$purchaseCost}{$data.$purchaseCost}{else}0{/if}</span>
</td>
......@@ -223,19 +223,19 @@
</td>
<td>
<span class="pull-right">&nbsp;%</span>
<input type="text" data-rule-positive=true data-rule-inventory_percentage=true id="discount_percentage{$row_no}" name="discount_percentage{$row_no}" value="{(isset($data.$discount_percent)) ? $data.$discount_percent : ""}" class="discount_percentage span1 pull-right discountVal {if empty($data.$checked_discount_percent)}hide{/if}" />
<input type="text" data-rule-positive=true data-rule-inventory_percentage=true id="discount_percentage{$row_no}" name="discount_percentage{$row_no}" value="{(isset($data.$discount_percent)) ? $data.$discount_percent : ''}" class="discount_percentage span1 pull-right discountVal {if empty($data.$checked_discount_percent)}hide{/if}" />
</td>
</tr>
{/if}
{if $ITEM_DISCOUNT_AMOUNT_EDITABLE}
<tr>
<td class="LineItemDirectPriceReduction">
<input type="radio" name="discount{$row_no}" {(isset($data.$checked_discount_amount)) ? $data.$checked_discount_amount : ""} class="discounts" data-discount-type="amount" />
<input type="radio" name="discount{$row_no}" {(isset($data.$checked_discount_amount)) ? $data.$checked_discount_amount : ''} class="discounts" data-discount-type="amount" />
&nbsp;
{vtranslate('LBL_DIRECT_PRICE_REDUCTION',$MODULE)}
</td>
<td>
<input type="text" data-rule-positive=true id="discount_amount{$row_no}" name="discount_amount{$row_no}" value="{(isset($data.$discount_amount)) ? $data.$discount_amount : ""}" class="span1 pull-right discount_amount discountVal {if empty($data.$checked_discount_amount)}hide{/if}"/>
<input type="text" data-rule-positive=true id="discount_amount{$row_no}" name="discount_amount{$row_no}" value="{(isset($data.$discount_amount)) ? $data.$discount_amount : ''}" class="span1 pull-right discount_amount discountVal {if empty($data.$checked_discount_amount)}hide{/if}"/>
</td>
</tr>
{/if}
......
......@@ -67,7 +67,7 @@
{/if}
<input type="hidden" class="numberOfCurrencyDecimal" value="{$USER_MODEL->get('no_of_currency_decimals')}" />
<input type="hidden" name="totalProductCount" id="totalProductCount" value="{(isset($row_no)) ? $row_no : ""}" />
<input type="hidden" name="totalProductCount" id="totalProductCount" value="{(isset($row_no)) ? $row_no : ''}" />
<input type="hidden" name="subtotal" id="subtotal" value="" />
<input type="hidden" name="total" id="total" value="" />
......@@ -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} />&nbsp; % {vtranslate('LBL_OF_PRICE',$MODULE)}</td>
<td><span class="pull-right">&nbsp;%</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>
<td><span class="pull-right">&nbsp;%</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} />&nbsp;{vtranslate('LBL_DIRECT_PRICE_REDUCTION',$MODULE)}</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>
<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>
......@@ -338,7 +338,7 @@
</td>
<td>
{assign var=PRE_TAX_TOTAL value="{(isset($FINAL.preTaxTotal)) ? $FINAL.preTaxTotal:""}"}
{assign var=PRE_TAX_TOTAL value="{(isset($FINAL.preTaxTotal)) ? $FINAL.preTaxTotal:''}"}
<span class="pull-right" id="preTaxTotal">{if $PRE_TAX_TOTAL}{$PRE_TAX_TOTAL}{else}0{/if}</span>
<input type="hidden" id="pre_tax_total" name="pre_tax_total" value="{if $PRE_TAX_TOTAL}{$PRE_TAX_TOTAL}{else}0{/if}"/>
</td>
......
......@@ -2144,7 +2144,7 @@ Vtiger_Edit_Js("Inventory_Edit_Js", {
chargesTrigger.popover('show');
popOverEle.css('opacity',1).css('z-index','');
}else{
chargesTrigger.popover('hide');
// chargesTrigger.popover('hide'); /* disabled to avoid removal of input DOM elements. */
popOverEle.css('opacity',0).css('z-index','-1');
}
});
......@@ -2209,7 +2209,7 @@ Vtiger_Edit_Js("Inventory_Edit_Js", {
finalTaxTriggerer.popover('show');
popOverEle.css('opacity',1).css('z-index','');
} else {
finalTaxTriggerer.popover('hide');
// finalTaxTriggerer.popover('hide'); /* disabled to avoid removal of input DOM elements. */
popOverEle.css('opacity',0).css('z-index','-1');
}
});
......@@ -2272,7 +2272,7 @@ Vtiger_Edit_Js("Inventory_Edit_Js", {
popOverEle.find('.popover-title').text(popOverEle.find('.popover_title').text());
popOverEle.css('opacity',1).css('z-index','');
} else {
chargeTaxTriggerer.popover('hide');
// chargeTaxTriggerer.popover('hide'); /* disabled to avoid removal of input DOM elements. */
popOverEle.css('opacity',0).css('z-index','-1');
}
});
......@@ -2333,7 +2333,7 @@ Vtiger_Edit_Js("Inventory_Edit_Js", {
deductTaxesTriggerer.popover('show');
popOverEle.css('opacity',1).css('z-index','');
} else {
deductTaxesTriggerer.popover('hide');
// deductTaxesTriggerer.popover('hide'); /* disabled to avoid removal of input DOM elements. */
popOverEle.css('opacity',0).css('z-index','-1');
}
});
......