diff --git a/config.template.php b/config.template.php index 5c8fe7c9cca78fdc3d29f1fc16a2663527f59a4c..58806a2f35d3ae94203fa80c92729b60b36fec77 100644 --- a/config.template.php +++ b/config.template.php @@ -175,5 +175,8 @@ if(isset($default_timezone) && function_exists('date_default_timezone_set')) { //Set the default layout $default_layout = 'v7'; +//Maximum Listview Fields Selection Size +$maxListFieldsSelectionSize = 15; + include_once 'config.security.php'; ?> diff --git a/includes/runtime/Controller.php b/includes/runtime/Controller.php index 8793a12c7df186ba593a0b903338fbae70da1a36..dd22cd2bd6ce4122f70df854d9f48609b973a186 100644 --- a/includes/runtime/Controller.php +++ b/includes/runtime/Controller.php @@ -158,11 +158,12 @@ abstract class Vtiger_View_Controller extends Vtiger_Action_Controller { function getViewer(Vtiger_Request $request) { if(!$this->viewer) { - global $vtiger_current_version, $vtiger_display_version, $onlyV7Instance, $current_user; + global $vtiger_current_version, $vtiger_display_version, $onlyV7Instance, $current_user, $maxListFieldsSelectionSize; $viewer = new Vtiger_Viewer(); $viewer->assign('APPTITLE', getTranslatedString('APPTITLE')); $viewer->assign('VTIGER_VERSION', $vtiger_current_version); $viewer->assign('VTIGER_DISPLAY_VERSION', $vtiger_display_version); + $viewer->assign('MAX_LISTFIELDS_SELECTION_SIZE', isset($maxListFieldsSelectionSize)? max(3, $maxListFieldsSelectionSize) : 15); $viewer->assign('ONLY_V7_INSTANCE', $onlyV7Instance); $this->viewer = $viewer; diff --git a/layouts/v7/modules/Vtiger/Footer.tpl b/layouts/v7/modules/Vtiger/Footer.tpl index db2747ea710765ab18b6ab6398b7a311e7045f67..9f9398bf1470739e52e78d9ebdaa137b5ba0e6c8 100644 --- a/layouts/v7/modules/Vtiger/Footer.tpl +++ b/layouts/v7/modules/Vtiger/Footer.tpl @@ -24,8 +24,9 @@ </div> <div id='helpPageOverlay'></div> <div id="js_strings" class="hide noprint">{Zend_Json::encode($LANGUAGE_STRINGS)}</div> +<div id="maxListFieldsSelectionSize" class="hide noprint">{$MAX_LISTFIELDS_SELECTION_SIZE}</div> <div class="modal myModal fade"></div> {include file='JSResources.tpl'|@vtemplate_path} </body> -</html> \ No newline at end of file +</html> diff --git a/layouts/v7/modules/Vtiger/resources/List.js b/layouts/v7/modules/Vtiger/resources/List.js index 7281ca4c3c535bd59fca19883533dc560cac2ecf..1f81e90bc47554738bd81935e7092b024db7b34f 100644 --- a/layouts/v7/modules/Vtiger/resources/List.js +++ b/layouts/v7/modules/Vtiger/resources/List.js @@ -2435,8 +2435,9 @@ Vtiger.Class("Vtiger_List_Js", { //add available field to selected list availFieldsList.on('click', '.item', function (e) { var selectedFieldsEles = selectedFieldsList.find('.item'); - if (selectedFieldsEles.length > 15) { - app.helper.showErrorNotification({message: app.vtranslate('JS_ADD_MAX_15_ITEMS')}); + var limit = jQuery('#maxListFieldsSelectionSize').text(); + if (selectedFieldsEles.length > limit) { + app.helper.showErrorNotification({message: app.vtranslate('JS_YOU_CAN_SELECT_ONLY')+' '+limit+' '+app.vtranslate('JS_ITEMS')}); return false; } var sourceFieldEle = jQuery(e.currentTarget); @@ -2786,4 +2787,4 @@ Vtiger.Class("Vtiger_List_Js", { return count; } -}); \ No newline at end of file +});