From 692bf2233ea7a70c9f6890d9cfab6088ea4dade2 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Tue, 11 Aug 2015 13:19:37 +0200 Subject: [PATCH 001/489] Improved display of errors --- include/main/WebUI.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/main/WebUI.php b/include/main/WebUI.php index fdba5bb0f539..5f450c0dfa70 100644 --- a/include/main/WebUI.php +++ b/include/main/WebUI.php @@ -222,9 +222,10 @@ function process(Vtiger_Request $request) } else { throw new AppException(vtranslate('LBL_HANDLER_NOT_FOUND')); } - } catch (Exception $e) { + } catch (AppException $e) { $log = vglobal('log'); - if ($view) { + $request = new Vtiger_Request($_REQUEST); + if (!$request->isAjax()) { // Log for developement. $log->error($e->getMessage() . ' => ' . $e->getFile() . ':' . $e->getLine()); Vtiger_Functions::throwNewException($e->getMessage()); From 79671f74b10a29a65e2942e4e90c515f86dbd3df Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Tue, 11 Aug 2015 13:20:15 +0200 Subject: [PATCH 002/489] Removal of unnecessary code --- modules/OSSMail/views/index.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/OSSMail/views/index.php b/modules/OSSMail/views/index.php index ffc65db991a4..adc097e6e12b 100644 --- a/modules/OSSMail/views/index.php +++ b/modules/OSSMail/views/index.php @@ -23,9 +23,6 @@ public function process(Vtiger_Request $request) $rcUser = (isset($_SESSION['AutoLoginUser']) && array_key_exists($_SESSION['AutoLoginUser'], $account)) ? $account[$_SESSION['AutoLoginUser']] : reset($account); require_once 'modules/OSSMail/RoundcubeLogin.class.php'; $rcl = new RoundcubeLogin($url, false); - //$rcl->setHostname('fdc.org.pl'); - //$rcl->setPort(143); - //$rcl->setSSL(false); try { if ($rcl->isLoggedIn()) { if ($rcl->getUsername() != $rcUser['username']) { From 3be0809d104978b4d1f9f13ed8369b99c6cf411e Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Tue, 11 Aug 2015 13:21:11 +0200 Subject: [PATCH 003/489] Removal of unnecessary code --- vtlib/Vtiger/Functions.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/vtlib/Vtiger/Functions.php b/vtlib/Vtiger/Functions.php index 8698e99143cf..2976ac9f755f 100644 --- a/vtlib/Vtiger/Functions.php +++ b/vtlib/Vtiger/Functions.php @@ -1056,15 +1056,18 @@ static function getArrayFromValue($values) return $array; } - static function throwNewException($Message) + static function throwNewException($message) { $request = new Vtiger_Request($_REQUEST); - if (!$request->get('action') != '') { + if ($request->isAjax()) { + $response = new Vtiger_Response(); + $response->setEmitType(Vtiger_Response::$EMIT_JSON); + $response->setError($message); + $response->emit(); + } else { $viewer = new Vtiger_Viewer(); $viewer->assign('MESSAGE', $Message); $viewer->view('OperationNotPermitted.tpl', 'Vtiger'); - } else { - echo $Message; } } From 998df0df932e6306b03ec3473b70ee440a5e4054 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Tue, 11 Aug 2015 13:21:51 +0200 Subject: [PATCH 004/489] Added types of modules --- modules/Vtiger/models/Module.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/Vtiger/models/Module.php b/modules/Vtiger/models/Module.php index fb891a06de10..d576c059999d 100644 --- a/modules/Vtiger/models/Module.php +++ b/modules/Vtiger/models/Module.php @@ -21,6 +21,7 @@ class Vtiger_Module_Model extends Vtiger_Module protected $moduleMeta = false; protected $fields = false; protected $relations = null; + protected $moduleType = 'Basic'; /** * Function to get the Module/Tab id @@ -63,6 +64,11 @@ public function isSummaryViewSupported() return true; } + public function getModuleType() + { + return $this->moduleType; + } + /** * Function to get singluar label key * @return - Singular module label key From 5bf475d627ee1cbdc93c1d21afac3b0ac830f93e Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Tue, 11 Aug 2015 13:23:31 +0200 Subject: [PATCH 005/489] Added a new type of modules for vtlib --- .../languages/en_us/_ModuleName_.php | 20 ++++ .../modules/_ModuleName_/_ModuleName_.php | 102 ++++++++++++++++++ .../modules/_ModuleName_/actions/MassSave.php | 11 ++ .../modules/_ModuleName_/actions/Save.php | 11 ++ .../_ModuleName_/models/DetailView.php | 11 ++ .../modules/_ModuleName_/models/Module.php | 11 ++ .../modules/_ModuleName_/models/Record.php | 11 ++ .../modules/_ModuleName_/views/Detail.php | 11 ++ .../modules/_ModuleName_/views/Edit.php | 11 ++ vtlib/Vtiger/ModuleBasic.php | 7 +- 10 files changed, 202 insertions(+), 4 deletions(-) create mode 100644 vtlib/ModuleDir/SupplieModule/languages/en_us/_ModuleName_.php create mode 100644 vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/_ModuleName_.php create mode 100644 vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/actions/MassSave.php create mode 100644 vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/actions/Save.php create mode 100644 vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/models/DetailView.php create mode 100644 vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/models/Module.php create mode 100644 vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/models/Record.php create mode 100644 vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/views/Detail.php create mode 100644 vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/views/Edit.php diff --git a/vtlib/ModuleDir/SupplieModule/languages/en_us/_ModuleName_.php b/vtlib/ModuleDir/SupplieModule/languages/en_us/_ModuleName_.php new file mode 100644 index 000000000000..27027c02fc29 --- /dev/null +++ b/vtlib/ModuleDir/SupplieModule/languages/en_us/_ModuleName_.php @@ -0,0 +1,20 @@ +' => '', + 'SINGLE_' => '', + ' ID' => ' ID', + + 'LBL_CUSTOM_INFORMATION' => 'Custom Information', + 'LBL__INFORMATION' => ' Information', + + '' => '', +]; diff --git a/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/_ModuleName_.php b/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/_ModuleName_.php new file mode 100644 index 000000000000..89b972d08b64 --- /dev/null +++ b/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/_ModuleName_.php @@ -0,0 +1,102 @@ + extends Vtiger_CRMEntity { + var $table_name = 'vtiger_'; + var $table_index= 'id'; + + /** + * Mandatory table for supporting custom fields. + */ + var $customFieldTable = Array('vtiger_cf', 'id'); + + /** + * Mandatory for Saving, Include tables related to this module. + */ + var $tab_name = Array('vtiger_crmentity', 'vtiger_', 'vtiger_cf'); + + /** + * Mandatory for Saving, Include tablename and tablekey columnname here. + */ + var $tab_name_index = Array( + 'vtiger_crmentity' => 'crmid', + 'vtiger_' => 'id', + 'vtiger_cf'=>'id'); + + /** + * Mandatory for Listing (Related listview) + */ + var $list_fields = Array ( + /* Format: Field Label => Array(tablename, columnname) */ + // tablename should not have prefix 'vtiger_' + '' => Array('', ''), + 'Assigned To' => Array('crmentity','smownerid') + ); + var $list_fields_name = Array ( + /* Format: Field Label => fieldname */ + '' => '', + 'Assigned To' => 'assigned_user_id', + ); + + // Make the field link to detail view + var $list_link_field = ''; + + // For Popup listview and UI type support + var $search_fields = Array( + /* Format: Field Label => Array(tablename, columnname) */ + // tablename should not have prefix 'vtiger_' + '' => Array('', ''), + 'Assigned To' => Array('vtiger_crmentity','assigned_user_id'), + ); + var $search_fields_name = Array ( + /* Format: Field Label => fieldname */ + '' => '', + 'Assigned To' => 'assigned_user_id', + ); + + // For Popup window record selection + var $popup_fields = Array (''); + + // For Alphabetical search + var $def_basicsearch_col = ''; + + // Column value to use on detail view record text display + var $def_detailview_recname = ''; + + // Used when enabling/disabling the mandatory fields for the module. + // Refers to vtiger_field.fieldname values. + var $mandatory_fields = Array('','assigned_user_id'); + + var $default_order_by = ''; + var $default_sort_order='ASC'; + + /** + * Invoked when special actions are performed on the module. + * @param String Module name + * @param String Event Type + */ + function vtlib_handler($moduleName, $eventType) { + $adb = PearDatabase::getInstance(); + if($eventType == 'module.postinstall') { + // TODO Handle actions after this module is installed. + } else if($eventType == 'module.disabled') { + // TODO Handle actions before this module is being uninstalled. + } else if($eventType == 'module.preuninstall') { + // TODO Handle actions when this module is about to be deleted. + } else if($eventType == 'module.preupdate') { + // TODO Handle actions before this module is updated. + } else if($eventType == 'module.postupdate') { + // TODO Handle actions after this module is updated. + } + } +} diff --git a/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/actions/MassSave.php b/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/actions/MassSave.php new file mode 100644 index 000000000000..baaa4cbe4f97 --- /dev/null +++ b/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/actions/MassSave.php @@ -0,0 +1,11 @@ + MassSave Action Class + * @package YetiForce.Actions + * @license licenses/License.html + * @author Mariusz Krzaczkowski + */ +class _MassSave_Action extends Supplies_MassSave_Action +{ + +} diff --git a/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/actions/Save.php b/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/actions/Save.php new file mode 100644 index 000000000000..a16f8f8b2d8a --- /dev/null +++ b/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/actions/Save.php @@ -0,0 +1,11 @@ + Save Action Class + * @package YetiForce.Actions + * @license licenses/License.html + * @author Mariusz Krzaczkowski + */ +class _Save_Action extends Supplies_Save_Action +{ + +} diff --git a/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/models/DetailView.php b/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/models/DetailView.php new file mode 100644 index 000000000000..9a11a82417ea --- /dev/null +++ b/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/models/DetailView.php @@ -0,0 +1,11 @@ + Record Model Class + * @package YetiForce.Model + * @license licenses/License.html + * @author Mariusz Krzaczkowski + */ +class _DetailView_Model extends Supplies_DetailView_Model +{ + +} diff --git a/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/models/Module.php b/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/models/Module.php new file mode 100644 index 000000000000..3efc16cc2158 --- /dev/null +++ b/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/models/Module.php @@ -0,0 +1,11 @@ + Record Model Class + * @package YetiForce.Model + * @license licenses/License.html + * @author Mariusz Krzaczkowski + */ +class _Module_Model extends Supplies_Module_Model +{ + +} diff --git a/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/models/Record.php b/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/models/Record.php new file mode 100644 index 000000000000..7eaa306d318e --- /dev/null +++ b/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/models/Record.php @@ -0,0 +1,11 @@ + Record Model Class + * @package YetiForce.Model + * @license licenses/License.html + * @author Mariusz Krzaczkowski + */ +class _Record_Model extends Supplies_Record_Model +{ + +} diff --git a/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/views/Detail.php b/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/views/Detail.php new file mode 100644 index 000000000000..5961d5dfed9a --- /dev/null +++ b/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/views/Detail.php @@ -0,0 +1,11 @@ + View Model Class + * @package YetiForce.View + * @license licenses/License.html + * @author Mariusz Krzaczkowski + */ +class _Detail_View extends Supplies_Detail_View +{ + +} diff --git a/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/views/Edit.php b/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/views/Edit.php new file mode 100644 index 000000000000..39d0f81f8b66 --- /dev/null +++ b/vtlib/ModuleDir/SupplieModule/modules/_ModuleName_/views/Edit.php @@ -0,0 +1,11 @@ + View Model Class + * @package YetiForce.View + * @license licenses/License.html + * @author Mariusz Krzaczkowski + */ +class _Edit_View extends Supplies_Edit_View +{ + +} diff --git a/vtlib/Vtiger/ModuleBasic.php b/vtlib/Vtiger/ModuleBasic.php index 541821b56732..8e9a1f9f1d46 100644 --- a/vtlib/Vtiger/ModuleBasic.php +++ b/vtlib/Vtiger/ModuleBasic.php @@ -300,10 +300,9 @@ function initTables($basetable = false, $basetableid = false) Vtiger_Utils::CreateTable($this->basetable, "($this->basetableid int(19) PRIMARY KEY, CONSTRAINT `fk_1_$this->basetable` FOREIGN KEY (`$this->basetableid`) REFERENCES `vtiger_crmentity` (`crmid`) ON DELETE CASCADE)", true); Vtiger_Utils::CreateTable($this->customtable, "($this->basetableid int(19) PRIMARY KEY, CONSTRAINT `fk_1_$this->customtable` FOREIGN KEY (`$this->basetableid`) REFERENCES `$this->basetable` (`$this->basetableid`) ON DELETE CASCADE)", true); if($this->type == 'SupplieModule'){ - Vtiger_Utils::CreateTable($this->basetable. '_supfield', "(id int(19) AUTO_INCREMENT PRIMARY KEY, columnname varchar(30) NOT NULL,suptype varchar(30) NOT NULL, -fieldlabel varchar(50) NOT NULL,presence int(1) unsigned NOT NULL DEFAULT '1',defaultvalue varchar(255),sequence int(10) unsigned DEFAULT NULL, -block int(1) unsigned DEFAULT NULL,displaytype int(1) unsigned DEFAULT NULL)", true); - Vtiger_Utils::CreateTable($this->basetable. '_sups', "(id int(19) PRIMARY KEY)", true); + Vtiger_Utils::CreateTable($this->basetable. '_supfield', "(id int(19) AUTO_INCREMENT PRIMARY KEY, columnname varchar(30) NOT NULL, label varchar(50) NOT NULL, suptype varchar(30) NOT NULL,presence tinyint(1) unsigned NOT NULL DEFAULT '0', + defaultvalue varchar(255),sequence int(10) unsigned NOT NULL, block tinyint(1) unsigned NOT NULL,displaytype tinyint(1) unsigned NOT NULL, params text, colspan tinyint(1) unsigned NOT NULL DEFAULT '1')", true); + Vtiger_Utils::CreateTable($this->basetable. '_sups', "(id int(19) PRIMARY KEY,seq int(10),CONSTRAINT `fk_1_$this->basetable` FOREIGN KEY (`id`) REFERENCES `$this->basetable` (`$this->basetableid`) ON DELETE CASCADE)", true); } } From 9cbc19bceb131ffb556c1e242ed18ec9beff174d Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Tue, 11 Aug 2015 13:28:01 +0200 Subject: [PATCH 006/489] Added a basis for a new module type inventory --- .../modules/Supplies/DetailViewSupplies.tpl | 39 + layouts/vlayout/modules/Supplies/EditView.tpl | 4 + .../modules/Supplies/EditViewSupplies.tpl | 115 +++ .../vlayout/modules/Supplies/TopEditView.tpl | 2 + .../Supplies/fields/DetailViewCurrency.tpl | 4 + .../Supplies/fields/DetailViewDiscount.tpl | 4 + .../Supplies/fields/DetailViewName.tpl | 5 + .../Supplies/fields/DetailViewNetPrice.tpl | 4 + .../Supplies/fields/DetailViewPrice.tpl | 4 + .../Supplies/fields/DetailViewQuantity.tpl | 4 + .../Supplies/fields/DetailViewReference.tpl | 4 + .../Supplies/fields/DetailViewTaxType.tpl | 4 + .../Supplies/fields/DetailViewTotalPrice.tpl | 4 + .../Supplies/fields/EditViewCurrency.tpl | 20 + .../Supplies/fields/EditViewDiscount.tpl | 15 + .../Supplies/fields/EditViewDiscountMode.tpl | 7 + .../Supplies/fields/EditViewGrossPrice.tpl | 6 + .../Supplies/fields/EditViewMargin.tpl | 5 + .../Supplies/fields/EditViewMarginP.tpl | 8 + .../modules/Supplies/fields/EditViewName.tpl | 51 ++ .../Supplies/fields/EditViewNetPrice.tpl | 6 + .../modules/Supplies/fields/EditViewPrice.tpl | 26 + .../Supplies/fields/EditViewPurchase.tpl | 7 + .../Supplies/fields/EditViewQuantity.tpl | 5 + .../Supplies/fields/EditViewReference.tpl | 33 + .../modules/Supplies/fields/EditViewTax.tpl | 9 + .../Supplies/fields/EditViewTaxMode.tpl | 7 + .../modules/Supplies/fields/EditViewValue.tpl | 10 + .../modules/Supplies/resources/Edit.js | 764 ++++++++++++++++++ .../modules/Supplies/resources/Edit.min.js | 2 + layouts/vlayout/skins/images/Discount24.png | Bin 0 -> 18717 bytes layouts/vlayout/skins/images/Tax24.png | Bin 0 -> 18707 bytes layouts/vlayout/skins/twilight/style.css | 6 + layouts/vlayout/skins/twilight/style.min.css | 2 +- .../Settings/ModuleManager/models/Module.php | 1 + modules/Supplies/actions/GetDetails.php | 76 ++ modules/Supplies/actions/MassSave.php | 11 + modules/Supplies/actions/Save.php | 23 + modules/Supplies/fields/Basic.php | 119 +++ modules/Supplies/fields/Currency.php | 16 + modules/Supplies/fields/Discount.php | 29 + modules/Supplies/fields/DiscountMode.php | 28 + modules/Supplies/fields/GrossPrice.php | 26 + modules/Supplies/fields/Margin.php | 26 + modules/Supplies/fields/MarginP.php | 26 + modules/Supplies/fields/Name.php | 31 + modules/Supplies/fields/NetPrice.php | 26 + modules/Supplies/fields/Price.php | 26 + modules/Supplies/fields/Purchase.php | 26 + modules/Supplies/fields/Quantity.php | 27 + modules/Supplies/fields/Reference.php | 28 + modules/Supplies/fields/Tax.php | 30 + modules/Supplies/fields/TaxMode.php | 28 + modules/Supplies/fields/Value.php | 16 + modules/Supplies/models/DetailView.php | 11 + modules/Supplies/models/EditView.php | 11 + modules/Supplies/models/Module.php | 33 + modules/Supplies/models/Record.php | 85 ++ modules/Supplies/models/SupField.php | 186 +++++ modules/Supplies/views/Detail.php | 32 + modules/Supplies/views/Edit.php | 140 ++++ 61 files changed, 2302 insertions(+), 1 deletion(-) create mode 100644 layouts/vlayout/modules/Supplies/DetailViewSupplies.tpl create mode 100644 layouts/vlayout/modules/Supplies/EditView.tpl create mode 100644 layouts/vlayout/modules/Supplies/EditViewSupplies.tpl create mode 100644 layouts/vlayout/modules/Supplies/TopEditView.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/DetailViewCurrency.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/DetailViewDiscount.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/DetailViewName.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/DetailViewNetPrice.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/DetailViewPrice.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/DetailViewQuantity.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/DetailViewReference.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/DetailViewTaxType.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/DetailViewTotalPrice.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewCurrency.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewDiscount.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewDiscountMode.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewGrossPrice.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewMargin.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewMarginP.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewName.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewNetPrice.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewPrice.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewPurchase.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewQuantity.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewReference.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewTax.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewTaxMode.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewValue.tpl create mode 100644 layouts/vlayout/modules/Supplies/resources/Edit.js create mode 100644 layouts/vlayout/modules/Supplies/resources/Edit.min.js create mode 100644 layouts/vlayout/skins/images/Discount24.png create mode 100644 layouts/vlayout/skins/images/Tax24.png create mode 100644 modules/Supplies/actions/GetDetails.php create mode 100644 modules/Supplies/actions/MassSave.php create mode 100644 modules/Supplies/actions/Save.php create mode 100644 modules/Supplies/fields/Basic.php create mode 100644 modules/Supplies/fields/Currency.php create mode 100644 modules/Supplies/fields/Discount.php create mode 100644 modules/Supplies/fields/DiscountMode.php create mode 100644 modules/Supplies/fields/GrossPrice.php create mode 100644 modules/Supplies/fields/Margin.php create mode 100644 modules/Supplies/fields/MarginP.php create mode 100644 modules/Supplies/fields/Name.php create mode 100644 modules/Supplies/fields/NetPrice.php create mode 100644 modules/Supplies/fields/Price.php create mode 100644 modules/Supplies/fields/Purchase.php create mode 100644 modules/Supplies/fields/Quantity.php create mode 100644 modules/Supplies/fields/Reference.php create mode 100644 modules/Supplies/fields/Tax.php create mode 100644 modules/Supplies/fields/TaxMode.php create mode 100644 modules/Supplies/fields/Value.php create mode 100644 modules/Supplies/models/DetailView.php create mode 100644 modules/Supplies/models/EditView.php create mode 100644 modules/Supplies/models/Module.php create mode 100644 modules/Supplies/models/Record.php create mode 100644 modules/Supplies/models/SupField.php create mode 100644 modules/Supplies/views/Detail.php create mode 100644 modules/Supplies/views/Edit.php diff --git a/layouts/vlayout/modules/Supplies/DetailViewSupplies.tpl b/layouts/vlayout/modules/Supplies/DetailViewSupplies.tpl new file mode 100644 index 000000000000..f0eb130b91c1 --- /dev/null +++ b/layouts/vlayout/modules/Supplies/DetailViewSupplies.tpl @@ -0,0 +1,39 @@ +{**} +{strip} + {assign var="FIELDS" value=Supplies_SupField_Model::getFields($SUP_MODULE, true)} + {assign var="SUP_RECORD_DATA" value=Supplies_SupField_Model::getRecordData($SUP_MODULE, $SUP_RECORD)} + {assign var="MAIN_PARAMS" value=Supplies_SupField_Model::getMainParams($FIELDS[1])} + + + {if count($FIELDS[0]) neq 0} + + + {foreach item=FIELD from=$FIELDS[0]} + + {/foreach} + + {/if} + + {foreach item=FIELD from=$FIELDS[1]} + + {/foreach} + + + + {foreach key=KEY item=SUP_DATA from=$SUP_RECORD_DATA} + {assign var="ROW_NO" value=$KEY+1} + + {foreach item=FIELD from=$FIELDS[1]} + + {/foreach} + + {/foreach} + +
{vtranslate('LBL_ITEM_DETAILS', $SUP_MODULE)} + {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('DetailView')} + {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$SUP_MODULE) SUP_VALUE=$SUP_DATA[$FIELD->get('columnname')]} +
{vtranslate($FIELD->get('label'), $SUP_MODULE)}
+ {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('DetailView')} + {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$SUP_MODULE) SUP_VALUE=$SUP_DATA[$FIELD->get('columnname')]} +
+{/strip} diff --git a/layouts/vlayout/modules/Supplies/EditView.tpl b/layouts/vlayout/modules/Supplies/EditView.tpl new file mode 100644 index 000000000000..678fd7c286b3 --- /dev/null +++ b/layouts/vlayout/modules/Supplies/EditView.tpl @@ -0,0 +1,4 @@ +{**} +{include file="EditViewBlocks.tpl"|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl('EditViewBlocks.tpl',$MODULE)} +{include file="EditViewSupplies.tpl"|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl('EditViewSupplies.tpl',$MODULE)} +{include file="EditViewActions.tpl"|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl('EditViewActions.tpl',$MODULE)} diff --git a/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl b/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl new file mode 100644 index 000000000000..f57530bc8f2d --- /dev/null +++ b/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl @@ -0,0 +1,115 @@ +{**} +{strip} + {assign var="SUPMODULE" value='Supplies'} + {assign var="FIELDS" value=$SUPFIELD_MODEL->getFields($MODULE, true)} + {if count($FIELDS) neq 0} + {assign var="COLUMNS" value=$SUPFIELD_MODEL->getColumns($MODULE)} + {assign var="SUP_RECORD_DATA" value=$RECORD->getSupplieData()} + {assign var="MAIN_PARAMS" value=$SUPFIELD_MODEL->getMainParams($FIELDS[1])} + {assign var="BLACK_SUP_DATA" value=[]} + + + + {if count($FIELDS[0]) neq 0} + + + + {foreach item=FIELD from=$FIELDS[0]} + + {/foreach} + + + +
+ {vtranslate($FIELD->get('label'), $SUPMODULE)}   + {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('EditView')} + {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$MODULE) SUP_VALUE=$SUP_RECORD_DATA[0][$FIELD->get('columnname')]} +
+ {/if} + + + + + {foreach item=FIELD from=$FIELDS[1]} + + {/foreach} + + + + {foreach key=KEY item=SUP_DATA from=$SUP_RECORD_DATA} + {assign var="ROW_NO" value=$KEY+1} + + + {foreach item=FIELD from=$FIELDS[1]} + + {/foreach} + + {/foreach} + + + + + + +
  {vtranslate($FIELD->get('label'), $SUPMODULE)}
+ +   {vtranslate('LBL_DRAG',$SUPMODULE)} + + + {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('EditView')} + {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$MODULE) SUP_VALUE=$SUP_DATA[$FIELD->get('columnname')]} +
+ {foreach item=MAIN_MODULE from=$MAIN_PARAMS['modules']} + {assign var="CRMEntity" value=CRMEntity::getInstance($MAIN_MODULE)} + + + + {/foreach} +
+
+
+
+ +
+
+ + + {foreach item=FIELD from=$FIELDS[2]} + + + + + {/foreach} + +
+ xx + + vv +
+
+
+
+ {assign var="SUP_DATA" value=[]} + + + {assign var="ROW_NO" value='_NUM_'} + + + {foreach item=FIELD from=$FIELDS[1]} + + {/foreach} + + + +
+ {/if} +{/strip} diff --git a/layouts/vlayout/modules/Supplies/TopEditView.tpl b/layouts/vlayout/modules/Supplies/TopEditView.tpl new file mode 100644 index 000000000000..ac3cf2dea5c1 --- /dev/null +++ b/layouts/vlayout/modules/Supplies/TopEditView.tpl @@ -0,0 +1,2 @@ +{**} + diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewCurrency.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewCurrency.tpl new file mode 100644 index 000000000000..fdbab255bd8b --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/DetailViewCurrency.tpl @@ -0,0 +1,4 @@ +{**} +{strip} + {$FIELD->getDisplayValue($SUP_DATA[$FIELD->get('columnname')])} +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewDiscount.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewDiscount.tpl new file mode 100644 index 000000000000..fdbab255bd8b --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/DetailViewDiscount.tpl @@ -0,0 +1,4 @@ +{**} +{strip} + {$FIELD->getDisplayValue($SUP_DATA[$FIELD->get('columnname')])} +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewName.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewName.tpl new file mode 100644 index 000000000000..e41a9e8c4908 --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/DetailViewName.tpl @@ -0,0 +1,5 @@ +{**} +{strip} + {$FIELD->getDisplayValue($SUP_DATA[$FIELD->get('columnname')])}
+ {$SUP_DATA['comment']} +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewNetPrice.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewNetPrice.tpl new file mode 100644 index 000000000000..fdbab255bd8b --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/DetailViewNetPrice.tpl @@ -0,0 +1,4 @@ +{**} +{strip} + {$FIELD->getDisplayValue($SUP_DATA[$FIELD->get('columnname')])} +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewPrice.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewPrice.tpl new file mode 100644 index 000000000000..fdbab255bd8b --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/DetailViewPrice.tpl @@ -0,0 +1,4 @@ +{**} +{strip} + {$FIELD->getDisplayValue($SUP_DATA[$FIELD->get('columnname')])} +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewQuantity.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewQuantity.tpl new file mode 100644 index 000000000000..fdbab255bd8b --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/DetailViewQuantity.tpl @@ -0,0 +1,4 @@ +{**} +{strip} + {$FIELD->getDisplayValue($SUP_DATA[$FIELD->get('columnname')])} +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewReference.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewReference.tpl new file mode 100644 index 000000000000..fdbab255bd8b --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/DetailViewReference.tpl @@ -0,0 +1,4 @@ +{**} +{strip} + {$FIELD->getDisplayValue($SUP_DATA[$FIELD->get('columnname')])} +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewTaxType.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewTaxType.tpl new file mode 100644 index 000000000000..fdbab255bd8b --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/DetailViewTaxType.tpl @@ -0,0 +1,4 @@ +{**} +{strip} + {$FIELD->getDisplayValue($SUP_DATA[$FIELD->get('columnname')])} +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewTotalPrice.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewTotalPrice.tpl new file mode 100644 index 000000000000..fdbab255bd8b --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/DetailViewTotalPrice.tpl @@ -0,0 +1,4 @@ +{**} +{strip} + {$FIELD->getDisplayValue($SUP_DATA[$FIELD->get('columnname')])} +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewCurrency.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewCurrency.tpl new file mode 100644 index 000000000000..4c81e2990a95 --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/EditViewCurrency.tpl @@ -0,0 +1,20 @@ +{**} +{strip} + {assign var=CURRENCIES value=Vtiger_Functions::getAllCurrency(true)} + {assign var=SELECTED_CURRENCY value=$SUP_VALUE} + {if $SELECTED_CURRENCY eq ''} + {assign var=USER_CURRENCY_ID value=$USER_MODEL->get('currency_id')} + {foreach item=CURRENCY from=$CURRENCIES} + {if $CURRENCY.id eq $USER_CURRENCY_ID} + {assign var=SELECTED_CURRENCY value=$CURRENCY.id} + {/if} + {/foreach} + {/if} + +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewDiscount.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewDiscount.tpl new file mode 100644 index 000000000000..22b9d713113c --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/EditViewDiscount.tpl @@ -0,0 +1,15 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} +
+
+ + {if $DISCOUNTS_CONFIG['discounts'][0] != ''} + + + {vtranslate('LBL_DISCOUNT', $SUP_VALUE)} + + {/if} +
+
+{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewDiscountMode.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewDiscountMode.tpl new file mode 100644 index 000000000000..2a7380456234 --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/EditViewDiscountMode.tpl @@ -0,0 +1,7 @@ +{**} +{strip} + +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewGrossPrice.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewGrossPrice.tpl new file mode 100644 index 000000000000..bcf08b2f32a3 --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/EditViewGrossPrice.tpl @@ -0,0 +1,6 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} + + {$FIELD->getEditValue($VALUE)} +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewMargin.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewMargin.tpl new file mode 100644 index 000000000000..bf74711ee292 --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/EditViewMargin.tpl @@ -0,0 +1,5 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} + +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewMarginP.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewMarginP.tpl new file mode 100644 index 000000000000..2b03eedc619a --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/EditViewMarginP.tpl @@ -0,0 +1,8 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} +
+ + % +
+{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewName.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewName.tpl new file mode 100644 index 000000000000..7a2980588a95 --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/EditViewName.tpl @@ -0,0 +1,51 @@ +{**} +{strip} +
+ {if $SUP_VALUE == '0'} + {assign var="REFERENCE_MODULE" value=reset($MAIN_PARAMS['modules'])} + {else} + {assign var="REFERENCE_MODULE" value=Vtiger_Functions::getCRMRecordType($SUP_VALUE)} + {/if} + + {assign var="FIELD_NAME" value={$FIELD->getColumnName()}|cat:$ROW_NO} + {assign var="FIELD_INFO" value=Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode(['mandatory'=>true]))} + {assign var="CRMEntity" value=CRMEntity::getInstance($REFERENCE_MODULE)} + +
+ + get('displaytype') == 10}readonly="readonly"{/if} /> + + {assign var="displayId" value=$SUP_VALUE} + {if $FIELD->get('displaytype') != 10} + + + + {/if} + + get('displaytype') != 10}placeholder="{vtranslate('LBL_TYPE_SEARCH',$SUPMODULE)}"{/if} + {if $FIELD->get('displaytype') == 10}readonly="readonly"{/if}/> + + {if $FIELD->get('displaytype') != 10} + + + + {/if} + + {assign var=REFERENCE_MODULE_MODEL value=Vtiger_Module_Model::getInstance($REFERENCE_MODULE)} + {if $REFERENCE_MODULE_MODEL->isQuickCreateSupported() && $FIELD->get('displaytype') != 10} + + + + {/if} +
+
+
    +
+
+
+ +
+
+{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewNetPrice.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewNetPrice.tpl new file mode 100644 index 000000000000..7fa910152a90 --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/EditViewNetPrice.tpl @@ -0,0 +1,6 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} + + {$FIELD->getEditValue($VALUE)} +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewPrice.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewPrice.tpl new file mode 100644 index 000000000000..405932db496a --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/EditViewPrice.tpl @@ -0,0 +1,26 @@ +{**} +{strip} +
+ {if $SUP_VALUE == ''} + {assign var="VALUE" value=$FIELD->get('defaultvalue')} + {else} + {assign var="VALUE" value=$SUP_VALUE} + {/if} + + + + {assign var=PRICEBOOK_MODULE_MODEL value=Vtiger_Module_Model::getInstance('PriceBooks')} + {if $PRICEBOOK_MODULE_MODEL->isPermitted('DetailView')} + + {vtranslate('PriceBooks',$SUPMODULE)} + + {/if} +
+
+ {assign var="TOTAL_PRICE" value=floatval($SUP_DATA['qty']) * floatval($SUP_DATA['price'])} + {vtranslate('LBL_TOTAL_PRICE',$SUPMODULE)}:   + {$TOTAL_PRICE} +
+{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewPurchase.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewPurchase.tpl new file mode 100644 index 000000000000..a060bfe0583a --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/EditViewPurchase.tpl @@ -0,0 +1,7 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} + +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewQuantity.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewQuantity.tpl new file mode 100644 index 000000000000..06dd7bdfe097 --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/EditViewQuantity.tpl @@ -0,0 +1,5 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} + get('displaytype') == 10}readonly="readonly"{/if}/> +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewReference.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewReference.tpl new file mode 100644 index 000000000000..ea4fce9ff0b5 --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/EditViewReference.tpl @@ -0,0 +1,33 @@ +{**} +{strip} + {assign var="REFERENCE_MODULE" value=$FIELD->get('params')} + {assign var="FIELD_NAME" value={$FIELD->getColumnName()}|cat:$ROW_NO} + {assign var="FIELD_INFO" value=Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode(['mandatory'=>true]))} + +
+ + get('displaytype') == 10}readonly="readonly"{/if} /> + {assign var="displayId" value=$SUP_VALUE} + {if $FIELD->get('displaytype') != 10} + + + + {/if} + get('displaytype') != 10}placeholder="{vtranslate('LBL_TYPE_SEARCH',$SUPMODULE)}"{/if} + {if $FIELD->get('displaytype') == 10}readonly="readonly"{/if}/> + {if $FIELD->get('displaytype') != 10} + + + + {/if} + {assign var=REFERENCE_MODULE_MODEL value=Vtiger_Module_Model::getInstance($REFERENCE_MODULE)} + + {if $smarty.request.view eq 'Edit' && $REFERENCE_MODULE_MODEL->isQuickCreateSupported() && $FIELD->get('displaytype') != 10} + + + + {/if} +
+{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewTax.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewTax.tpl new file mode 100644 index 000000000000..b8f8beaa551b --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/EditViewTax.tpl @@ -0,0 +1,9 @@ +{**} +{strip} +
+ + + {vtranslate('LBL_TAX', $SUP_VALUE)} + +
+{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewTaxMode.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewTaxMode.tpl new file mode 100644 index 000000000000..7bd99c8fa44a --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/EditViewTaxMode.tpl @@ -0,0 +1,7 @@ +{**} +{strip} + +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewValue.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewValue.tpl new file mode 100644 index 000000000000..ac92dab957ff --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/EditViewValue.tpl @@ -0,0 +1,10 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} + {assign var="INPUT_TYPE" value='text'} + {if $FIELD->get('displaytype') == 10} + {assign var="INPUT_TYPE" value='hidden'} + {$SUP_VALUE} + {/if} + +{/strip} diff --git a/layouts/vlayout/modules/Supplies/resources/Edit.js b/layouts/vlayout/modules/Supplies/resources/Edit.js new file mode 100644 index 000000000000..dc23224ccfbd --- /dev/null +++ b/layouts/vlayout/modules/Supplies/resources/Edit.js @@ -0,0 +1,764 @@ +/*+*********************************************************************************** + * The contents of this file are subject to the vtiger CRM Public License Version 1.0 + * ("License"); You may not use this file except in compliance with the License + * The Original Code is: vtiger CRM Open Source + * The Initial Developer of the Original Code is vtiger. + * Portions created by vtiger are Copyright (C) vtiger. + * All Rights Reserved. + *************************************************************************************/ + +Vtiger_Edit_Js("Supplies_Edit_Js", {}, { + lineItemContentsContainer: false, + rowClass: 'tr.rowSup', + discountMondalFields: ['aggregationType', 'globalDiscount', 'groupCheckbox', 'groupDiscount', 'individualDiscount', 'individualDiscountType'], + /** + * Function that is used to get the line item container + * @return : jQuery object + */ + getSupTableContainer: function () { + if (this.lineItemContentsContainer == false) { + this.lineItemContentsContainer = $('.suppliesItemTable'); + } + return this.lineItemContentsContainer; + }, + getNextLineItemRowNumber: function () { + var rowNumber = $(this.rowClass, this.getSupTableContainer()).length; + $('#suppliesRowNo').val(rowNumber + 1); + return ++rowNumber; + }, + checkDeleteIcon: function () { + var subTable = this.getSupTableContainer(); + if (subTable.find(this.rowClass).length > 1) { + this.showLineItemsDeleteIcon(); + } else { + this.hideLineItemsDeleteIcon(); + } + }, + showLineItemsDeleteIcon: function () { + this.getSupTableContainer().find('.deleteRow').removeClass('hide'); + }, + hideLineItemsDeleteIcon: function () { + this.getSupTableContainer().find('.deleteRow').addClass('hide'); + }, + getClosestRow: function (element) { + return element.closest(this.rowClass); + }, + /** + * Function which will return the basic row which can be used to add new rows + * @return jQuery object which you can use to + */ + getBasicRow: function () { + var newRow = $('#blackSuppliesTable tr').clone(true, true); + return newRow; + }, + isRecordSelected: function (element) { + var parentRow = element.closest('tr'); + var productField = parentRow.find('.recordLabel'); + var response = productField.validationEngine('validate'); + return response; + }, + parsePrice: function (val) { + var numberOfDecimal = parseInt($('.numberOfCurrencyDecimal').val()); + return parseFloat(val).toFixed(numberOfDecimal); + }, + getTaxModeSelectElement: function (row) { + var subTable = this.getSupTableContainer(); + if (subTable.find('thead .taxMode').length > 0) { + return $('.taxMode'); + } + return row.find('.taxMode'); + }, + isIndividualTaxMode: function (row) { + var taxModeElement = this.getTaxModeSelectElement(row); + var selectedOption = taxModeElement.find('option:selected'); + if (selectedOption.val() == '1') { + return true; + } + return false; + }, + isGroupTaxMode: function () { + var taxTypeElement = this.getTaxModeSelectElement(); + var selectedOption = taxTypeElement.find('option:selected'); + if (selectedOption.val() == '0') { + return true; + } + return false; + }, + showIndividualTax: function (row) { + var thisInstance = this; + var colTax = thisInstance.getSupTableContainer().find('.colTax'); + if (thisInstance.isIndividualTaxMode()) { + colTax.removeClass('hide'); + } else { + colTax.addClass('hide'); + colTax.find('.tax').val('0'); + thisInstance.rowsCalculations(); + } + }, + getDiscountModeSelectElement: function (row) { + var subTable = this.getSupTableContainer(); + if (subTable.find('thead .discountMode').length > 0) { + return $('.discountMode'); + } + return row.find('.discountMode'); + }, + isIndividualDiscountMode: function (row) { + var discountModeElement = this.getDiscountModeSelectElement(row); + var selectedOption = discountModeElement.find('option:selected'); + if (selectedOption.val() == '1') { + return true; + } + return false; + }, + showIndividualDiscount: function (row) { + var thisInstance = this; + var colDiscount = thisInstance.getSupTableContainer().find('.colDiscount'); + if (thisInstance.isIndividualDiscountMode()) { + colDiscount.removeClass('hide'); + } else { + colDiscount.addClass('hide'); + colDiscount.find('.discount').val('0'); + thisInstance.rowsCalculations(); + } + }, + getCurrency: function () { + var currency = $('[name="currency"]', this.getSupTableContainer()); + return currency.find('option:selected').val(); + }, + getTax: function (row) { + return parseFloat($('.tax', row).val()); + }, + getQuantityValue: function (row) { + return parseFloat($('.qty', row).val()); + }, + getListPriceValue: function (row) { + return parseFloat($('.listPrice', row).val()); + }, + getDiscount: function (row) { + var discount = $('.discount', row).val(); + if (discount == undefined) { + discount = 0; + } + return parseFloat(discount); + }, + getNetPrice: function (row) { + return parseFloat($('.netPrice', row).val()); + }, + getTotalPrice: function (row) { + return parseFloat($('.totalPriceText', row).text()); + }, + getPurchase: function (row) { + var qty = this.getQuantityValue(row); + return parseFloat($('.purchase', row).val()) * qty; + }, + setListPriceValue: function (row, val) { + val = this.parsePrice(val); + row.find('.listPrice').val(val).attr('title', val); + return this; + }, + setNetPrice: function (row, val) { + val = this.parsePrice(val); + $('.netPriceText', row).text(val); + $('.netPrice', row).val(val); + }, + setGrossPrice: function (row, val) { + val = this.parsePrice(val); + $('.grossPriceText', row).text(val); + $('.grossPrice', row).val(val); + }, + setTotalPrice: function (row, val) { + val = this.parsePrice(val); + $('.totalPriceText', row).text(val); + }, + setMargin: function (row, val) { + val = this.parsePrice(val); + $('.margin', row).val(val); + }, + setMarginP: function (row, val) { + val = this.parsePrice(val); + $('.marginp', row).val(val); + }, + quantityChangeActions: function (row) { + this.rowCalculations(row); + this.sumaryCalculations(); + }, + rowCalculations: function (row) { + this.calculateTotalPrice(row); + this.calculateNetPrice(row); + this.calculateGrossPrice(row); + this.calculateMargin(row); + }, + rowsCalculations: function () { + var thisInstance = this; + this.getSupTableContainer().find(this.rowClass).each(function (index) { + thisInstance.quantityChangeActions($(this)); + }); + }, + sumaryCalculations: function (row) { + + }, + calculateNetPrice: function (row) { + var netPrice = this.getTotalPrice(row) - this.getDiscount(row); + this.setNetPrice(row, netPrice); + }, + calculateGrossPrice: function (row) { + var netPrice = this.getNetPrice(row); + if (this.isIndividualTaxMode(row)) { + var tax = this.getTax(row); + netPrice += tax; + } + this.setGrossPrice(row, netPrice); + }, + calculateTotalPrice: function (row) { + var netPriceBeforeDiscount = this.getQuantityValue(row) * this.getListPriceValue(row); + this.setTotalPrice(row, netPriceBeforeDiscount); + }, + calculateMargin: function (row) { + var netPrice = this.getNetPrice(row); + var purchase = this.getPurchase(row); + var margin = netPrice - purchase; + + this.setMargin(row, margin); + var marginp = '0'; + if (purchase !== 0) { + marginp = (margin / purchase) * 100; + } + this.setMarginP(row, marginp); + }, + calculateDiscount: function (row, mondal) { + var netPriceBeforeDiscount = this.getTotalPrice(row), + valuePrices = netPriceBeforeDiscount, + globalDiscount = 0, + groupDiscount = 0, + individualDiscount = 0, + valueDiscount = 0; + + var discountsType = mondal.find('.discountsType').val(); + + if (discountsType == '0' || discountsType == '1') { + if (mondal.find('.activepanel .globalDiscount').length > 0) { + var globalDiscount = mondal.find('.activepanel .globalDiscount').val(); + } + if (mondal.find('.activepanel .individualDiscountType').length > 0) { + var individualTypeDiscount = mondal.find('.activepanel .individualDiscountType[name="individual"]:checked').val(); + var value = mondal.find('.activepanel .individualDiscountValue').val(); + if (individualTypeDiscount == 'percentage') { + individualDiscount = (value / 100) * netPriceBeforeDiscount; + } else { + individualDiscount = value; + } + } + if (mondal.find('.activepanel .groupCheckbox').length > 0 && mondal.find('.activepanel .groupCheckbox').prop("checked") == true) { + var groupDiscount = mondal.find('.groupValue').val(); + groupDiscount = netPriceBeforeDiscount * (parseFloat(groupDiscount) / 100); + } + + valuePrices = valuePrices * ((100 - parseFloat(globalDiscount)) / 100); + valuePrices = valuePrices - parseFloat(individualDiscount); + valuePrices = valuePrices - parseFloat(groupDiscount); + } else if (discountsType == '2') { + mondal.find('.activepanel').each(function (index) { + var panel = $(this); + if (panel.find('.globalDiscount').length > 0) { + var globalDiscount = parseFloat(panel.find('.globalDiscount').val()); + valuePrices = valuePrices * ((100 - globalDiscount) / 100); + } else if (panel.find('.groupCheckbox').length > 0 && panel.find('.groupCheckbox').prop("checked") == true) { + var groupDiscount = parseFloat(panel.find('.groupValue').val()); + valuePrices = valuePrices * ((100 - groupDiscount) / 100); + } else if (panel.find('.individualDiscountType').length > 0) { + var value = parseFloat(panel.find('.individualDiscountValue').val()); + if (panel.find('.individualDiscountType[name="individual"]:checked').val() == 'percentage') { + valuePrices = valuePrices * ((100 - value) / 100); + } else { + valuePrices = valuePrices - value; + } + } + }); + } + + mondal.find('.valuePrices').text(this.parsePrice(valuePrices)); + mondal.find('.valueDiscount').text(netPriceBeforeDiscount - this.parsePrice(valuePrices)); + }, + updateRowSequence: function () { + var subTable = this.getSupTableContainer(); + subTable.find(this.rowClass).each(function (index) { + $(this).find('.sequence').val(index + 1); + }); + }, + registerSuppliesSaveData: function (container) { + container.on(Vtiger_Edit_Js.recordPreSave, function (e, data) { + var table = container.find('#blackSuppliesTable'); + table.find('[name]').removeAttr('name'); + }); + }, + /** + * Function which will be used to handle price book popup + * @params : popupImageElement - popup image element + */ + pricebooksPopupHandler: function (popupImageElement) { + var thisInstance = this; + var lineItemRow = popupImageElement.closest(this.rowClass); + var rowName = lineItemRow.find('.rowName'); + var params = {}; + params.module = 'PriceBooks'; + params.src_module = $('[name="popupReferenceModule"]', rowName).val(); + params.src_record = $('.sourceField', rowName).val(); + params.src_field = $('[name="popupReferenceModule"]', rowName).data('field'); + params.get_url = 'getProductListPriceURL'; + params.currency_id = thisInstance.getCurrency(); + + this.showPopup(params).then(function (data) { + var responseData = JSON.parse(data); + for (var id in responseData) { + thisInstance.setListPriceValue(lineItemRow, responseData[id]); + } + thisInstance.quantityChangeActions(thisInstance.getClosestRow(rowName)); + }); + }, + showPopup: function (params) { + var aDeferred = $.Deferred(); + var popupInstance = Vtiger_Popup_Js.getInstance(); + popupInstance.show(params, function (data) { + aDeferred.resolve(data); + }); + return aDeferred.promise(); + }, + subProductsCashe: [], + loadSubProducts: function (parentRow, indicator) { + var thisInstance = this; + var recordId = jQuery('input.sourceField', parentRow).val(); + thisInstance.removeSubProducts(parentRow); + if (recordId == '0') { + return false; + } + if (thisInstance.subProductsCashe[recordId]) { + thisInstance.addSubProducts(parentRow, thisInstance.subProductsCashe[recordId]); + return false; + } + var subProrductParams = { + 'module': "Products", + 'action': "SubProducts", + 'record': recordId + } + if (indicator) { + var progressInstace = jQuery.progressIndicator(); + } + AppConnector.request(subProrductParams).then( + function (data) { + var responseData = data.result; + thisInstance.subProductsCashe[recordId] = responseData; + thisInstance.addSubProducts(parentRow, responseData); + if (progressInstace) { + progressInstace.hide(); + } + }, + function (error, err) { + if (progressInstace) { + progressInstace.hide(); + } + //TODO : handle the error case + } + ); + }, + removeSubProducts: function (parentRow) { + var subProductsContainer = $('.subProductsContainer ul', parentRow); + subProductsContainer.find("li").remove(); + }, + addSubProducts: function (parentRow, responseData) { + var subProductsContainer = $('.subProductsContainer ul', parentRow); + for (var id in responseData) { + var priductText = $("
  • ").text(responseData[id]); + subProductsContainer.append(priductText); + } + }, + mapResultsToFields: function (referenceModule, parentRow, responseData) { + var thisInstance = this; + + for (var id in responseData) { + var recordId = id; + var recordData = responseData[id]; + var description = recordData.description; + var listPriceValues = recordData.listpricevalues; + var listPriceValuesJson = JSON.stringify(listPriceValues); + var taxes = recordData.taxes; + + for (var field in recordData) { + parentRow.find('input.' + field).val(recordData[field]); + } + + var currencyId = thisInstance.getCurrency(); + if (typeof listPriceValues[currencyId] !== 'undefined') { + thisInstance.setListPriceValue(parentRow, listPriceValues[currencyId]); + }else{ + + } + + $('input.listPrice', parentRow).attr('list-info', listPriceValuesJson); + $('textarea.commentTextarea', parentRow).val(description); + + //var taxUI = thisInstance.getTaxDiv(taxes, parentRow); + //$('.taxDivContainer', parentRow).html(taxUI); + thisInstance.showIndividualTax(parentRow); + } + if (referenceModule === 'Products') { + thisInstance.loadSubProducts(parentRow, true); + } + this.quantityChangeActions(parentRow); + }, + saveDiscountsParameters: function (parentRow, mondal) { + var thisInstance = this; + var info = {}; + var extend = ['aggregationType', 'groupCheckbox', 'individualDiscountType']; + $.each(thisInstance.discountMondalFields, function (index, param) { + if ($.inArray(param, extend) >= 0) { + if (mondal.find('[name="' + param + '"]:checked').length > 1) { + info[param] = []; + mondal.find('[name="' + param + '"]:checked').each(function (index) { + info[param].push($(this).val()); + }); + } else { + info[param] = mondal.find('[name="' + param + '"]:checked').val(); + } + } else { + info[param] = mondal.find('[name="' + param + '"]').val(); + } + }); + parentRow.find('.discountParam').val(JSON.stringify(info)); + }, + initDiscountsParameters: function (parentRow, mondal) { + var thisInstance = this; + var parameters = parentRow.find('.discountParam').val(); + if (parameters == '') { + return; + } + var parameters = JSON.parse(parameters); + $.each(thisInstance.discountMondalFields, function (index, param) { + var parameter = parameters[param]; + var field = mondal.find('[name="' + param + '"]'); + + if (field.attr('type') == 'checkbox' || field.attr('type') == 'radio') { + var array = parameter; + if (!$.isArray(array)) { + array = [array]; + } + $.each(array, function (index, arrayValue) { + var value = field.filter('[value="' + arrayValue + '"]').prop('checked', true) + if (param == 'aggregationType') { + value.closest('.panel').find('.panel-body').show(); + value.closest('.panel').addClass('activepanel'); + } + }); + } else if (field.prop("tagName") == 'SELECT') { + field.find('option[value="' + parameter + '"]').prop('selected', 'selected').change(); + } else { + mondal.find('[name="' + param + '"]').val(parameter); + } + }); + + thisInstance.calculateDiscount(parentRow, mondal); + }, + registerAddRow: function (container) { + var thisInstance = this; + var subTable = this.getSupTableContainer(); + container.find('.btn-toolbar .addButton').on('click', function (e, data) { + var table = container.find('#blackSuppliesTable'); + var newRow = thisInstance.getBasicRow() + var sequenceNumber = thisInstance.getNextLineItemRowNumber(); + var module = $(e.currentTarget).data('module'); + var field = $(e.currentTarget).data('field'); + + var replaced = newRow.html().replace(/_NUM_/g, sequenceNumber); + newRow.html(replaced); + newRow = newRow.appendTo(subTable.find('tbody')); + + newRow.find('.rowName input[name="popupReferenceModule"]').val(module).data('field', field); + thisInstance.initRow(); + thisInstance.registerAutoCompleteFields(newRow); + }); + }, + registerSortableRow: function () { + var thisInstance = this; + var subTable = thisInstance.getSupTableContainer(); + subTable.sortable({ + handle: '.dragHandle', + items: thisInstance.rowClass, + revert: true, + tolerance: 'pointer', + placeholder: "ui-state-highlight", + helper: function (e, ui) { + ui.children().each(function (index, element) { + element = $(element); + element.width(element.width()); + }) + return ui; + }, + start: function (event, ui) { + var textareaId = ui.item.find('textarea').attr('id'); + if (typeof textareaId != 'undefined') { + var editorInstance = CKEDITOR.instances[textareaId]; + editorInstance.destroy(); + } + }, + stop: function (event, ui) { + var customConfig = {}; + var textarea = ui.item.find('textarea'); + if (typeof textarea.attr('id') != 'undefined') { + thisInstance.loadCkEditorElement(textarea); + } + thisInstance.updateRowSequence(); + } + }); + }, + /** + * Function which will regisrer price book popup + */ + registerPriceBookPopUp: function (container) { + var thisInstance = this; + container.on('click', '.priceBookPopup', function (e) { + var element = $(e.currentTarget); + var response = thisInstance.isRecordSelected(element); + if (response == true) { + return; + } + thisInstance.pricebooksPopupHandler(element); + }); + }, + registerRowChangeEvent: function (container) { + var thisInstance = this; + container.on('focusout', '.qty', function (e) { + var element = $(e.currentTarget); + thisInstance.quantityChangeActions(thisInstance.getClosestRow(element)); + }); + container.on('focusout', '.listPrice', function (e) { + var element = $(e.currentTarget); + thisInstance.quantityChangeActions(thisInstance.getClosestRow(element)); + }); + container.on('focusout', '.purchase', function (e) { + var element = $(e.currentTarget); + thisInstance.quantityChangeActions(thisInstance.getClosestRow(element)); + }); + container.on('change', '.taxMode', function (e) { + var element = $(e.currentTarget); + thisInstance.showIndividualTax(thisInstance.getClosestRow(element)); + }); + container.on('change', '.discountMode', function (e) { + var element = $(e.currentTarget); + thisInstance.showIndividualDiscount(thisInstance.getClosestRow(element)); + }); + }, + registerSubProducts: function (container) { + var thisInstance = this; + container.find(this.rowClass).each(function (index) { + thisInstance.loadSubProducts($(this), false); + }); + }, + registerClearReferenceSelection: function (container) { + var thisInstance = this; + container.on('click', '.clearReferenceSelection', function (e) { + var element = $(e.currentTarget); + var row = thisInstance.getClosestRow(element) + thisInstance.removeSubProducts(row); + row.find('.listPrice,.tax,.discount,.margin,.purchase').val('0'); + row.find('textarea').val(''); + thisInstance.quantityChangeActions(row); + }); + }, + registerDeleteLineItemEvent: function (container) { + var thisInstance = this; + container.on('click', '.deleteRow', function (e) { + var element = $(e.currentTarget); + thisInstance.getClosestRow(element).remove(); + thisInstance.checkDeleteIcon(); + }); + }, + registerChangeDiscount: function (container) { + var thisInstance = this; + container.on('click', '.changeDiscount', function (e) { + var element = $(e.currentTarget); + var parentRow = element.closest(thisInstance.rowClass); + + var params = { + module: 'Products', + view: 'Discounts', + record: parentRow.find('.rowName .sourceField').val(), + currency: thisInstance.getCurrency(), + sourceModule: app.getModuleName(), + sourceRecord: app.getRecordId(), + totalPrice: thisInstance.getTotalPrice(parentRow), + accountField: container.find('#accountReferenceField').val(), + } + + var progressInstace = jQuery.progressIndicator(); + AppConnector.request(params).then( + function (data) { + app.showModalWindow(data, function (data) { + thisInstance.initDiscountsParameters(parentRow, $(data)); + thisInstance.registerChangeDiscountModal(data, parentRow, params); + }); + progressInstace.hide(); + }, + function (error, err) { + progressInstace.hide(); + } + ); + }); + }, + registerChangeDiscountModal: function (mondal, parentRow, params) { + var thisInstance = this; + mondal.on('change', '.individualDiscountType', function (e) { + var element = $(e.currentTarget); + mondal.find('.individualDiscountContainer .input-group-addon').text(element.data('symbol')); + }); + mondal.on('change', '.activeCheckbox[name="aggregationType"]', function (e) { + var element = $(e.currentTarget); + + if (element.attr('type') == 'checkbox' && this.checked) { + element.closest('.panel').find('.panel-body').show(); + element.closest('.panel').addClass('activepanel'); + } else if (element.attr('type') == 'radio') { + mondal.find('.panel').removeClass('activepanel'); + mondal.find('.panel .panel-body').hide(); + element.closest('.panel').find('.panel-body').show(); + element.closest('.panel').addClass('activepanel'); + } else { + element.closest('.panel').find('.panel-body').hide(); + element.closest('.panel').removeClass('activepanel'); + } + }); + mondal.on('change', '.activeCheckbox, .globalDiscount,.individualDiscountValue,.individualDiscountType,.groupCheckbox', function (e) { + var element = $(e.currentTarget); + thisInstance.calculateDiscount(parentRow, mondal); + }); + mondal.on('click', '.saveDiscount', function (e) { + parentRow.find('.discount').val(mondal.find('.valueDiscount').text()); + thisInstance.quantityChangeActions(parentRow); + thisInstance.saveDiscountsParameters(parentRow, mondal); + app.hideModalWindow(); + }); + }, + registerChangeTax: function (container) { + var thisInstance = this; + container.on('click', '.changeTax', function (e) { + var element = $(e.currentTarget); + var parentRow = element.closest(thisInstance.rowClass); + + var params = { + module: 'Products', + view: 'Taxs', + record: parentRow.find('.rowName .sourceField').val(), + currency: thisInstance.getCurrency(), + sourceModule: app.getModuleName(), + sourceRecord: app.getRecordId(), + totalPrice: thisInstance.getTotalPrice(parentRow), + } + + var progressInstace = jQuery.progressIndicator(); + AppConnector.request(params).then( + function (data) { + app.showModalWindow(data, function (data) { + //thisInstance.initTaxParameters(parentRow, $(data)); + //thisInstance.registerChangeTaxModal(data, parentRow, params); + }); + progressInstace.hide(); + }, + function (error, err) { + progressInstace.hide(); + } + ); + }); + }, + registerChangeTaxModal: function (mondal, parentRow, params) { + var thisInstance = this; + mondal.on('change', '.individualDiscountType', function (e) { + var element = $(e.currentTarget); + mondal.find('.individualDiscountContainer .input-group-addon').text(element.data('symbol')); + }); + mondal.on('change', '.activeCheckbox[name="aggregationType"]', function (e) { + var element = $(e.currentTarget); + + if (element.attr('type') == 'checkbox' && this.checked) { + element.closest('.panel').find('.panel-body').show(); + element.closest('.panel').addClass('activepanel'); + } else if (element.attr('type') == 'radio') { + mondal.find('.panel').removeClass('activepanel'); + mondal.find('.panel .panel-body').hide(); + element.closest('.panel').find('.panel-body').show(); + element.closest('.panel').addClass('activepanel'); + } else { + element.closest('.panel').find('.panel-body').hide(); + element.closest('.panel').removeClass('activepanel'); + } + }); + mondal.on('change', '.activeCheckbox, .globalDiscount,.individualDiscountValue,.individualDiscountType,.groupCheckbox', function (e) { + var element = $(e.currentTarget); + thisInstance.calculateDiscount(parentRow, mondal); + }); + mondal.on('click', '.saveDiscount', function (e) { + parentRow.find('.discount').val(mondal.find('.valueDiscount').text()); + thisInstance.quantityChangeActions(parentRow); + thisInstance.saveDiscountsParameters(parentRow, mondal); + app.hideModalWindow(); + }); + }, + registerRowAutoComplete: function (container) { + var thisInstance = this; + var sourceFieldElement = container.find('.rowName .sourceField'); + sourceFieldElement.on(Vtiger_Edit_Js.postReferenceSelectionEvent, function (e, rq) { + var element = $(e.currentTarget); + var parentRow = element.closest(thisInstance.rowClass); + + if (rq.data.label) { + var record = rq.data.id; + } else { + for (var id in rq.data) { + var record = id; + } + } + + var element = parentRow.find('.rowName .recordLabel'); + var selectedModule = parentRow.find('.rowName [name="popupReferenceModule"]').val(); + var popupElement = parentRow.find('.rowName .relatedPopup'); + + var dataUrl = "index.php?module=" + app.getModuleName() + "&action=GetDetails&record=" + record + "¤cy_id=" + thisInstance.getCurrency(); + AppConnector.request(dataUrl).then( + function (data) { + for (var id in data) { + if (typeof data[id] == "object") { + var recordData = data[id]; + thisInstance.mapResultsToFields(selectedModule, parentRow, recordData); + } + } + }, + function (error, err) { + } + ); + }); + }, + initRow: function (container) { + var thisInstance = this; + if (typeof container == 'undefined') { + container = thisInstance.getSupTableContainer(); + } + thisInstance.registerDeleteLineItemEvent(container); + thisInstance.registerPriceBookPopUp(container); + thisInstance.registerRowChangeEvent(container); + thisInstance.registerRowAutoComplete(container); + thisInstance.checkDeleteIcon(); + }, + /** + * Function which will register all the events + */ + registerBasicEvents: function (container) { + this._super(container); + this.registerSuppliesSaveData(container); + this.registerAddRow(container); + + this.initRow(); + this.registerSortableRow(); + this.registerSubProducts(container); + this.registerChangeDiscount(container); + this.registerChangeTax(container); + this.registerClearReferenceSelection(container); + }, +}); + diff --git a/layouts/vlayout/modules/Supplies/resources/Edit.min.js b/layouts/vlayout/modules/Supplies/resources/Edit.min.js new file mode 100644 index 000000000000..32950c22dd4b --- /dev/null +++ b/layouts/vlayout/modules/Supplies/resources/Edit.min.js @@ -0,0 +1,2 @@ + +Vtiger_Edit_Js("Supplies_Edit_Js",{},{lineItemContentsContainer:false,rowClass:"tr.rowSup",discountMondalFields:["aggregationType","globalDiscount","groupCheckbox","groupDiscount","individualDiscount","individualDiscountType"],getSupTableContainer:function(){if(this.lineItemContentsContainer==false){this.lineItemContentsContainer=$(".suppliesItemTable")}return this.lineItemContentsContainer},getNextLineItemRowNumber:function(){var a=$(this.rowClass,this.getSupTableContainer()).length;$("#suppliesRowNo").val(a+1);return ++a},checkDeleteIcon:function(){var a=this.getSupTableContainer();if(a.find(this.rowClass).length>1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackSuppliesTable tr").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},parsePrice:function(a){var b=parseInt($(".numberOfCurrencyDecimal").val());return parseFloat(a).toFixed(b)},getTaxModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(c){var b=this;var a=b.getSupTableContainer().find(".colTax");if(b.isIndividualTaxMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".tax").val("0");b.rowsCalculations()}},getDiscountModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(c){var b=this;var a=b.getSupTableContainer().find(".colDiscount");if(b.isIndividualDiscountMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".discount").val("0");b.rowsCalculations()}},getCurrency:function(){var a=$('[name="currency"]',this.getSupTableContainer());return a.find("option:selected").val()},getTax:function(a){return parseFloat($(".tax",a).val())},getQuantityValue:function(a){return parseFloat($(".qty",a).val())},getListPriceValue:function(a){return parseFloat($(".listPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return parseFloat(b)},getNetPrice:function(a){return parseFloat($(".netPrice",a).val())},getTotalPrice:function(a){return parseFloat($(".totalPriceText",a).text())},getPurchase:function(a){var b=this.getQuantityValue(a);return parseFloat($(".purchase",a).val())*b},setListPriceValue:function(b,a){a=this.parsePrice(a);b.find(".listPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=this.parsePrice(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=this.parsePrice(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=this.parsePrice(a);$(".totalPriceText",b).text(a)},setMargin:function(b,a){a=this.parsePrice(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=this.parsePrice(a);$(".marginp",b).val(a)},quantityChangeActions:function(a){this.rowCalculations(a);this.sumaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getSupTableContainer().find(this.rowClass).each(function(b){a.quantityChangeActions($(this))})},sumaryCalculations:function(a){},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getListPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,c){var e=this.getTotalPrice(j),b=e,k=0,f=0,g=0,a=0;var i=c.find(".discountsType").val();if(i=="0"||i=="1"){if(c.find(".activepanel .globalDiscount").length>0){var k=c.find(".activepanel .globalDiscount").val()}if(c.find(".activepanel .individualDiscountType").length>0){var d=c.find('.activepanel .individualDiscountType[name="individual"]:checked').val();var h=c.find(".activepanel .individualDiscountValue").val();if(d=="percentage"){g=(h/100)*e}else{g=h}}if(c.find(".activepanel .groupCheckbox").length>0&&c.find(".activepanel .groupCheckbox").prop("checked")==true){var f=c.find(".groupValue").val();f=e*(parseFloat(f)/100)}b=b*((100-parseFloat(k))/100);b=b-parseFloat(g);b=b-parseFloat(f)}else{if(i=="2"){c.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=parseFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=parseFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=parseFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}c.find(".valuePrices").text(this.parsePrice(b));c.find(".valueDiscount").text(e-this.parsePrice(b))},updateRowSequence:function(){var a=this.getSupTableContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerSuppliesSaveData:function(a){a.on(Vtiger_Edit_Js.recordPreSave,function(d,c){var b=a.find("#blackSuppliesTable");b.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductListPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setListPriceValue(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(f,a){var d=this;var c=jQuery("input.sourceField",f).val();d.removeSubProducts(f);if(c=="0"){return false}if(d.subProductsCashe[c]){d.addSubProducts(f,d.subProductsCashe[c]);return false}var e={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(e).then(function(h){var g=h.result;d.subProductsCashe[c]=g;d.addSubProducts(f,g);if(b){b.hide()}},function(g,h){if(b){b.hide()}})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(h,m,d){var k=this;for(var b in d){var f=b;var a=d[b];var l=a.description;var c=a.listpricevalues;var e=JSON.stringify(c);var g=a.taxes;for(var i in a){m.find("input."+i).val(a[i])}var j=k.getCurrency();if(typeof c[j]!=="undefined"){k.setListPriceValue(m,c[j])}else{}$("input.listPrice",m).attr("list-info",e);$("textarea.commentTextarea",m).val(l);k.showIndividualTax(m)}if(h==="Products"){k.loadSubProducts(m,true)}this.quantityChangeActions(m)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".discountParam").val(JSON.stringify(c))},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(l,j){var h=a.find("#blackSuppliesTable");var f=c.getBasicRow();var d=c.getNextLineItemRowNumber();var g=$(l.currentTarget).data("module");var k=$(l.currentTarget).data("field");var i=f.html().replace(/_NUM_/g,d);f.html(i);f=f.appendTo(b.find("tbody"));f.find('.rowName input[name="popupReferenceModule"]').val(g).data("field",k);c.initRow();c.registerAutoCompleteFields(f)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(d,e){var f=e.item.find("textarea").attr("id");if(typeof f!="undefined"){var c=CKEDITOR.instances[f];c.destroy()}},stop:function(e,f){var c={};var d=f.item.find("textarea");if(typeof d.attr("id")!="undefined"){b.loadCkEditorElement(d)}b.updateRowSequence()}})},registerPriceBookPopUp:function(a){var b=this;a.on("click",".priceBookPopup",function(f){var d=$(f.currentTarget);var c=b.isRecordSelected(d);if(c==true){return}b.pricebooksPopupHandler(d)})},registerRowChangeEvent:function(a){var b=this;a.on("focusout",".qty",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("focusout",".listPrice",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("focusout",".purchase",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("change",".taxMode",function(d){var c=$(d.currentTarget);b.showIndividualTax(b.getClosestRow(c))});a.on("change",".discountMode",function(d){var c=$(d.currentTarget);b.showIndividualDiscount(b.getClosestRow(c))})},registerSubProducts:function(a){var b=this;a.find(this.rowClass).each(function(c){b.loadSubProducts($(this),false)})},registerClearReferenceSelection:function(a){var b=this;a.on("click",".clearReferenceSelection",function(d){var c=$(d.currentTarget);var f=b.getClosestRow(c);b.removeSubProducts(f);f.find(".listPrice,.tax,.discount,.margin,.purchase").val("0");f.find("textarea").val("");b.quantityChangeActions(f)})},registerDeleteLineItemEvent:function(a){var b=this;a.on("click",".deleteRow",function(d){var c=$(d.currentTarget);b.getClosestRow(c).remove();b.checkDeleteIcon()})},registerChangeDiscount:function(a){var b=this;a.on("click",".changeDiscount",function(g){var d=$(g.currentTarget);var f=d.closest(b.rowClass);var h={module:"Products",view:"Discounts",record:f.find(".rowName .sourceField").val(),currency:b.getCurrency(),sourceModule:app.getModuleName(),sourceRecord:app.getRecordId(),totalPrice:b.getTotalPrice(f),accountField:a.find("#accountReferenceField").val(),};var c=jQuery.progressIndicator();AppConnector.request(h).then(function(e){app.showModalWindow(e,function(i){b.initDiscountsParameters(f,$(i));b.registerChangeDiscountModal(i,f,h)});c.hide()},function(e,i){c.hide()})})},registerChangeDiscountModal:function(a,c,d){var b=this;a.on("change",".individualDiscountType",function(g){var f=$(g.currentTarget);a.find(".individualDiscountContainer .input-group-addon").text(f.data("symbol"))});a.on("change",'.activeCheckbox[name="aggregationType"]',function(g){var f=$(g.currentTarget);if(f.attr("type")=="checkbox"&&this.checked){f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{if(f.attr("type")=="radio"){a.find(".panel").removeClass("activepanel");a.find(".panel .panel-body").hide();f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{f.closest(".panel").find(".panel-body").hide();f.closest(".panel").removeClass("activepanel")}}});a.on("change",".activeCheckbox, .globalDiscount,.individualDiscountValue,.individualDiscountType,.groupCheckbox",function(g){var f=$(g.currentTarget);b.calculateDiscount(c,a)});a.on("click",".saveDiscount",function(f){c.find(".discount").val(a.find(".valueDiscount").text());b.quantityChangeActions(c);b.saveDiscountsParameters(c,a);app.hideModalWindow()})},registerChangeTax:function(a){var b=this;a.on("click",".changeTax",function(g){var d=$(g.currentTarget);var f=d.closest(b.rowClass);var h={module:"Products",view:"Taxs",record:f.find(".rowName .sourceField").val(),currency:b.getCurrency(),sourceModule:app.getModuleName(),sourceRecord:app.getRecordId(),totalPrice:b.getTotalPrice(f),};var c=jQuery.progressIndicator();AppConnector.request(h).then(function(e){app.showModalWindow(e,function(i){});c.hide()},function(e,i){c.hide()})})},registerChangeTaxModal:function(a,c,d){var b=this;a.on("change",".individualDiscountType",function(g){var f=$(g.currentTarget);a.find(".individualDiscountContainer .input-group-addon").text(f.data("symbol"))});a.on("change",'.activeCheckbox[name="aggregationType"]',function(g){var f=$(g.currentTarget);if(f.attr("type")=="checkbox"&&this.checked){f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{if(f.attr("type")=="radio"){a.find(".panel").removeClass("activepanel");a.find(".panel .panel-body").hide();f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{f.closest(".panel").find(".panel-body").hide();f.closest(".panel").removeClass("activepanel")}}});a.on("change",".activeCheckbox, .globalDiscount,.individualDiscountValue,.individualDiscountType,.groupCheckbox",function(g){var f=$(g.currentTarget);b.calculateDiscount(c,a)});a.on("click",".saveDiscount",function(f){c.find(".discount").val(a.find(".valueDiscount").text());b.quantityChangeActions(c);b.saveDiscountsParameters(c,a);app.hideModalWindow()})},registerRowAutoComplete:function(a){var b=this;var c=a.find(".rowName .sourceField");c.on(Vtiger_Edit_Js.postReferenceSelectionEvent,function(j,g){var h=$(j.currentTarget);var m=h.closest(b.rowClass);if(g.data.label){var i=g.data.id}else{for(var f in g.data){var i=f}}var h=m.find(".rowName .recordLabel");var d=m.find('.rowName [name="popupReferenceModule"]').val();var l=m.find(".rowName .relatedPopup");var k="index.php?module="+app.getModuleName()+"&action=GetDetails&record="+i+"¤cy_id="+b.getCurrency();AppConnector.request(k).then(function(n){for(var o in n){if(typeof n[o]=="object"){var e=n[o];b.mapResultsToFields(d,m,e)}}},function(e,n){})})},initRow:function(a){var b=this;if(typeof a=="undefined"){a=b.getSupTableContainer()}b.registerDeleteLineItemEvent(a);b.registerPriceBookPopUp(a);b.registerRowChangeEvent(a);b.registerRowAutoComplete(a);b.checkDeleteIcon()},registerBasicEvents:function(a){this._super(a);this.registerSuppliesSaveData(a);this.registerAddRow(a);this.initRow();this.registerSortableRow();this.registerSubProducts(a);this.registerChangeDiscount(a);this.registerChangeTax(a);this.registerClearReferenceSelection(a)},}); \ No newline at end of file diff --git a/layouts/vlayout/skins/images/Discount24.png b/layouts/vlayout/skins/images/Discount24.png new file mode 100644 index 0000000000000000000000000000000000000000..0eb1f572404a42fbeba423f0c18b22adc62c0705 GIT binary patch literal 18717 zcmeI3cTiJX*M|>+^d{02(Ev)5kVb+DAqb&LlP1LiA&t-yNR*-=s1z$AB25qr(gYC{ zML-deUIfGj2r7!Gz`cNiSCKE+jheYL-~0aaPBN3^tiASct+SuK_Rcw(IeXXJSxAU3 z6$Jo5!phRrk^QYW{}vWxe-4Hi&al5k7?$o#01#U||K7*Oed-ean)^tZXVUVNA{wUc*b!`<9>2>ic zCm+Z;+*o90CZN=q9nXL0P}BiA2OaT!qW6V{R8Ae*eL8+$^ZUo!Py5}inttB)@zOoq z@VUv%vJRmdVew;@2nS@8c)rQgpd4>8_0yUC98Xh091P%vm))U?viaU9DOp zbPeDO?G_UTYHTxVpv&Usq+Xh&ZQ_gC!&k#fTw^U9B@3(#KV)(iSZmG~m6@vU1Y`>U zUM)oLr@(qJ;H9zic{dQ1Ig_@X57>BAMUF2!5dbYF$D0B^2Ee(F4g1UhHz*)Wv93b{ z_rUJT5J1qf^hyc*TiLV-PLfUNn1EB5cz#nQvtY*J~Z z*ou{Cv*?Y&;2!Q#VZvAGY*-Kup~-W6`zvQHgkf)1IcADD#asO~j6 zqIGLk*Bt4|fX;h<+yD|N@x}3NPXy;}Ci1_v){u5%)jXL7fQd@_jXRpc{82u;A9sYz zjT_BcWUm6EC{{;;0AP#hN?qsXGNT4z05Hvt)-Ewtn!2H=QzN+S#=^cEVjsLvdrVf= z)tX3~h?1g~1$$|o+hw8|+g75i?FG5BR#~sc!6!C}A*oyIaz)aRA@vVIIO~RHRkVnJ zaij2Jg37~qKJR^QYKMds(qd**ZdeM)>|Y6LikEdzwN6A@!W{QGgIp|?Ck%rZpyM`~ zUrjV<1mL?q#8z3rjz*U{7~T=Tgs;fcU%JQql-O+&3znWBpPg|#_~KH-1E`b3w+nrw z9wy-M4bYkwib9Awf2eN#O_K|2bVQPfEf-YJi5J!{E!l96zjE&zV#kFL0hwsC8WEI0 zhzW?W+}P61#?9`&WgckRO1(u7Mf64Z_c+vQs3zrEUsS)k=v|$nHyjq{W~rlgS0-UG zM0$HXzD|Fo%w9ZPqvG%as|#nGyJWh|y8<26Ms)Hs^emUEB{e-H`IQQxkLrL{H^vNQ z4&59=3@Ht%Ol%a*^j;fuX2$7>rem}3x+Tw~pXoglB&WiST~4Pv_UD~+UW82WFey4& z?s(oIE^o2k)^v2+Zh0%~oT5|7-AjEGe5PsVU$Cw&>Q7#7mvY;+t7XLEMam2QsSt6A zSh?K|@l?$v8Hz%R)FmN`=TmLYF6rLCq`?`g4||n5oF{X*M=9ow`kQ)iVc_Zt@E zpG4yk>kzJGj*~|zMnX?hgJzDi>_mn&b5kZG_dSvw*LtF*bXL!%0!H5CS8y!lm|LM` zp+lj?t7=s7Xl~}&YO_lB_tBEZ4eK;EX;@Gb+81UHJ3Vmf&lSy;w>8APDb_9U%TYR6 zX&Q1pFn269>)Mv6EE{_6qp<4Xf0ji+W}RmP{>gn~A?_wvCcaXzSG-*jdkYyv$0|b_ zdjEF7Z@#$}pF>C{q&(h}SkZ|+-D7^xTQAc+s;j75+rG3NOLw%b zIIDHmz{bF)p{=#;RNLJ&WQHN^9(*`sIOAT%z-2FwP!FB*yz(n#tI{Elv+iT%Re>=c zX!jg97mv+l=0%xBtL|17Rpu_rt*}e7E6ln}y;<^ic~g1*JK|b*wi*n;(aFy~)fd%cvdA z>pee)8l#QH^_^(dJE4{3j$q!t*@z!>c-Cnob|M+-H*hY}9&aB_y)>)_Awm*ei|&OX=%a`$Z2uescKxyAk_JUBd z?~OK&-niiXO!y9!>xYamz2vv04@Qj-WLFr=87J&2+V$*4k%~{_>%&DV)5EFliS0DW znDvn_?%oz6JSXhG87Zz26BpweYjlVa@3yoPmVylF?87q$O#d-GX8I_D3bRL_2d_hF z;|g?ru@CjH>RmOe*QL0(_PAxbS@~NpL+ff6qXPY}4SX1#jC+##MC|Eyg;Yr6W=7b_ z_S&hKT={%m86C{AwKnl~YmWY9EUld3Njw~6QlMg+R8DzZ%$wEzjWrxo#bO(!;o1A^&?4fy2Td0&ucBNcz+uMvjR+zQA zZM3zlx%aUC@$nOLqcXKJkB^k+#9F(8mEE3KpYuhRVuQkZMW4zoTphbX@ErEazH;q= z9{a*k*OcPOYV~kizvwMDns?o}#OL=)%tiEBOvJ0cd!w7}-5~A*mk9sFW-8(2_U;|8Yi*b@g8&+?xsP98=m}^;Yk7 zPw&R6=~-OUwO$uK7uz065Ba^-`?6`H;=KhUGsoTsY%a132pVnR@8X{oQj;vdS8=CD zxy#VmG2!m&R~C{DE3SRa91j6Ypd?%l9syd zrYb{xP0}aQ%`=?R-*5EZc-6iY*LnBlqwo(Fy(^@S>tWr))=fG$(H@TM>Q16gbR5V` z&WwoEeb?vJd#Zfb7sFJYJbzT(QZoVl2G+(ss)9h*Fk*d;e5**x&MVcYCtXhW*u(;q>WS({Bdk z`y+!jX4_jTAB1R(6;;_+c}}ezHGY8akLxko__6Q)c;8Onnvm?t&OVE2!I<409~0js zNZ}VIq$RY(O2od(T7yHQpBM$tj(o_)caS>NvlKp_`q)yeAP3Mapy)(7*WXeQJ z()EBHIkPWoUM)G_TVGqh{902e0=8vp!~4-2A$=jr2~h> zq$Np7a{~OSlOKo(a4!I0pfqPUmYb~&hDZ<4C6MUeWZlpJ2Kz!30I)`(3eMRsT$!#v7s1tfB-U!016H8 z4`gCO4OKtI#jua(n<1*8PhD7khN{N%2|;eQ>p^&WFd2l@MS+P>ls-rwtqViy>+9+3 zfZ$LV5&}g)5Ku52fzg9v^x&W`FIAi<`v@CMqF@|N&A+5$TZXDWEEWR;frNyF=!PJ4 z>A_S842?!Zpl}Er4rccNGs6N|givrGQ|)t*uW?MtOkyyN!J^RvLGy75-t?_3LsixJ zMBiRt#udQ$mMD<=o#vnr+ z$xQmzU?SOU8#$1r_PdiH5x>P@Yz_AR#D_$Lkp0O4YzdQn^042Y0^{o)$T#^Xu~&-eFeWK#l*jGI@2p=-b}s51Vpv!b`BVf%ucihN&%zMFp54&4~m46iC+`_5bT#k_Q5pvzC`f^!q`F{@esn?%_FzFOl2qBnkOl4Qdzgd}| zqy8-843CA(@74aa|H4Et3ETdE)9~+B)&Imae6M1n4VvG_aHpopB`*WCy{XoEaZ31zg4mS zd0YSak2f6C(ZU2|Wrjz=&?pobt_%Ay%n$v3h%^5qhhgtF?8+y6TIFobFKwLt-R5@< z|E-_;>%*b!7X&u{`9=Dpn^Wq}UHYS&Q~F)$5=dj=;9s(FH2ba5s6lxbxxg@^Eng;coJ9ap%L~<>BH0!rkQI z;?9S|%frP1guBVZ#hnj_mxqf32zQf*i#s0DIJ`Vu96-36 zJY3xQaCmvRIDl|BdAPXq;qdZsaRA|N@^EqI!{O!O;sCY@g@iqIhek-#BwT;@a?u#&v&rzAI=_vI2Ri<|SvNnt~Pg zyrp`r7wkF%I%Rw~DP2(8HsJO-Rp?2UFQ76=A(_OVZkRt-G@`>kSIG zD`;tbcs}5)U>Qp)xolbHxh_h4t7Z_M;V=V!eZFQ`d#R_;@{F~cSgD=HK1-6OV9g`EjX&tWt zZIC$eP;iQ`q)^*67FlB;7ja!_Lrj;if6D6K$Ks(fESaf=x})l}WvQiM5>s$*qZ#|b zl9up9=M9^7sSj460{UT6SHyJ`-)`3`Od98BT5%B) z^>%?+;IxOFfST|d_jiqvbyxm!@mloPsu|EsgcQ=FY0ovm_`>BUu6T`KC zUS7brYQJHP)(zu9^q~Hr_Fqd%LI$x{1j83=!o5l#HbhAs+|cZ=_ej`Z9=nOG5Jg?s zvAd+os)X;=%9+WlgaEZQzI}4pwi`VaTbE*6Pr*pL-o)Bwx9yU6BQ7J`G}3dls_nTM zpNg<-ym93PDcQG%{MjCh7n*pH6T4p8>92rHeCSuKePXUABWsBYb2zM!pZPlGpyGsi z8O+bQwc=%$)4HkfTkkTu5yLC4?0mf1+EpiQxl#Z)5UFHY8;c$99-CU4qU&iibuanV z3P|IVj*uc?;RH7KUWXN`dQ0TMO!KM+_2rv!i%haThlXaI4Gt-)9n_J*5BBA(u0|v& zcuF#9o~_iJL@rXiOYNMPFE|xu1_5l&zo( z^F4QJnTIt(JYQ4WtG}mI>z#sCo#F+joaCSa4O$afUd_1nZS>&F1;ux&TaHD9ho3Er zJlkz3sT#XhUhSY_lQ$^VQrhOSfyP-XW@C&bxzFHlm3^jTtPjmSO0UWk?;bjM=yh|c xKVDeWt|=@r@;EI-iWNS4y3PEIoYDsbK+uw|x@Q?y#NI;yD>FOOViT`j{|67(GK2sC literal 0 HcmV?d00001 diff --git a/layouts/vlayout/skins/images/Tax24.png b/layouts/vlayout/skins/images/Tax24.png new file mode 100644 index 0000000000000000000000000000000000000000..a07db68bb3122348251b56d88ae4a4e576e5f2b8 GIT binary patch literal 18707 zcmeI3c{G&o`^O)VoiBppJA~D#3O{N@KF;t&VAQ*iloujieyRMkgjrB3?;VPH3@7wA{(Z zlGasA^!52<8Zx7KhRou|DXmQOxyn!Wr;b2xt@ zy|_i7QcyI>2x*ND6FsN1dP!eIeQn*7LCB_XVMRY+v0yP-E^tPH2bc=Q3v4pr2}@5=vIR2v0M|y6 z+W=q%23(c*JZ%HQ(x;B?blxRJ`Vxenml3Ai>WCF zxDxSg;O95^=j7eo24;s^^87Xdz!OGj>#Q2IcxBi|{xF}}Q)|cgJhqBtZl8>CFIu$e zGLSjaVL#zF&qn{`;nK&ChXx1RO=@+Vh_~%`&r++mRoc&Ze+b2Ynta!HyFcxQvW!;)Yu6`miz&oBkOLi zy*Eeh?^T=T)$BzB7d$n2cE*EqTu8j{O_dirFe>{e0pLv;z3RS-Aa9sQ#FG~0+_=_^ zVdh#O%-#5iKLBjiQ-lz17i-lE0)Sp-xatLMnYUHT)hhW{RW0nQ68Yqc*{7peTdlKL zN0=P8D!_GJ{$3rGsHO|Ds;ODM z5#>6fdE5>7zMJQ*>VA7tv3u(SEF-rgPKqRsqvzGzGzd;#(;6(Eo!V>hMEjk4!OKi?t z@6TC=+MbGSijXok%_=yR*tXI`+GCP-{u$%ilJ3OS7Rh(*?=_AXK1+Va`<5vx79|-` zA5B$Rk+xi5Iduhd`S}#Hvn$$SR@4(<>hKpS!^ajKquV*CmZWu=OvaGwLKhNt8}sH@va@JWhpbVWicAL=T2gE zktRs{Vw;Jh?pgu^DgIN(85TmrD%r^sp$B^;#@F?)lR1krD}_^>y>gS1lN|Dl@~ra= zUsPZUN3+wGPKS$Y*PAFiD;rV|H7`sbwtZ~doh_U#Wv+pHR|v`V%91%*rpLVD zn?072aeZr8h8aD(C%9txTqRq?kH_`rdyezc7^R>0E zOU)+TEMg)t`N_Wc(pLQG2L}HbEQ+PoIS(if_|*B-omS#kl2bA@e{MdOYGYn{cHP;H zW*g1wo9;B7YI=AKou&bQgcwd6PJ5Krd&PB2&=$3loRX^)&m@ z?6$ZR8x*7$tbJHkP?o(UyVN4VA}`}1wdTU>l3OL`uB^B))Xv{oSmIN%n@Dw&re3*O zSTmMTk+A#P?tf-91jP0~7SEI2A{!cbDL?|Z8P}8Ae0)r6_szFSBT%YC%i@-HI5;>6w^XknHwbZo?r(PabfRdo`_63hFT*+eQ zP7=qZHQ#FnoEXp?z^nHldK|aiQLntxaHY|*hMuu4vR8MH!W?-nWUdv+4qMAZ+>JObTqosy(c@9=*vwLGN$o>>3-%6G707usygXbWH#wZr9N$b6kF*MX z_VBI%@hLH;CR9{8a(|?KlvbQyw8P3)cru#V+NB%VtM^eaNv|i33b(|b2b-W(HFF`J z_zv}JsB2nv5O>Er4;<1RjJ-`)VIiu87+>$}y`M%W_V=gviwx|PPJuSK_ywPAu6`St zEp-mER1KH3$t>Dp!_imTi&b-^V%NS|##|dG99%71O_hhXVp^lyb)8jLTf8w+H4i!R zGQJ!gtauZdr8ZQ$Px;*8ax*cr?lfG6RO$|p4?+W10gpHmf7o9qSI#`4g!-KN)O|-| zJ|(hf_NH&l73k_jfm>e1hw~RYf`vd`gxjvgd&IF5L#O(e#Ue~YSrx!dpGAYzMxmpa@u_Jb8{u6<=H9KUfvQST* z)HkUHX|}1;PHs-uEbnNxK78I2^2xAs&7$KdykoG*1mPB~V`Ohz0`*NxYn&ApzB=;PNGGoIYjpNkpZSiZ5@`OQ_vo1)I4W%gI?Q_thJ`8;Pl$Im9T zS=N^wFH0>fb@nP93#qug(|vM8CPTfs`)x(=YpJ=14>GVC-4zod^vRo(?|P-WLj#m& znj6a=GnK~*$}P*cz1=jb{aCkq{{t`-HrSk#M*4VqYNzgED^$fs=G7IKSHhV<;I*~UU?DQM`_gBOpQTT@z3CcjBexZ$%a zYvy_7ixuZP>#FNkU%wTEgl~Pjd3v;p*~OF{Ki#{?a&Q-DkIJ0Khl}rQ?`BUYtVl?h zpdcS_-#}cD zhWzKaIM(O+W~e;qa~Fn}hP?LtfFK8RE08WdfC558Fkli4qYhHXLf~k1b(Fdq2mynm zp)e#A2?HaLI1~(rLV&)$cbtu$!PntfmWI3sgW-pRLYYh^go%XE1E^3q z7K??#5KsgH%<2IS4EALZgTTIl3SWYJi=#&gBn8m?7&N*sXg)5{jlP|sAum5a(D&EZ zdHMK#AILZGD?1iNXb{m43Wva;e-W9RbC&t|{81Um(BHwjlCLxSFTwBIFOcu@UoPXj`>(TS z(AE5Wc0U^t8bN8pfX90Iu>hQPsKKLz>HlP!ih zEBDDn2JzoS`K2#=96Fii9{jJO{OI{>40Cgwv2P%Q=u4s)>uIv)4x!P=I3fj0A`waM zU?dUa4o1775MV5tb=Uwyz)|iSPoQ4Wp304fIp6-v+V_pt0%_(fg-9^K&7y z22&@q$_NEcWYr8f9E^pbSO+A00~mvGLvFxO&~O;(`w)K!^V?8Hv_Mui1^<*~tX%tC zd2A{EzqWpJc+);t5Iux2_55{beJcpR z??gPAgmb3{_z)SIG#?_B0`>Ey;-Nnpe~gL$QG;~p-t+)-I+>!$s%d{}{-cWZ&zsek zKi)J0Z47ll#`?M#I2MBeBOvgf!~E3mr#SOpayVACVP!t?^Dbv;ersdz?=W9AytjYu zua1DRUQqb_@vHP_H@no4v-D>-yYz?B&X>l}M0_2Mt@$U_{5LV~GgMpFO(R8F!k!rA2F;>?H5%f-b8gtN)T#hDMA zmy3%H2xpUvi!&cKFBcaZ5Y8qS7iT_fUM?;+Ae>DuF3x<|yj)ytKscLRT%7r^dAYdQ zfN(asxH$7+^Kx;q0pVs+1a&d9y!{+7UVgth2AK7-( z008(F80%>hf;x^TnS03EN!0Hd?%6o8wPR(f5^ZGvz0EOaVj$P7x*S9xW((t0CH0+? z`kC6!SFQE*pLal<1^M|df;>;UM4y7(SCx`nxc2TDa~U)A1N^{rYU%LRlwfGv$1^vN zVUb;p>2n`G_Rht=Oz&#BA-?2JzIv`mz?yc=h^Wf-m8;~P8<+6k=@!xJT2+ zFXM?7>Vv&P-u3hZrl00-Jxxs`W}PpZIgGz{0?$iGco*zv*L zoSc=V27H3~7qW^rV-}=^@fl@h#!BalixwX-&U&b${FLli8)JCJ0jUxpQ*|A&e0q`m zb+P<~apL(EMr)k;QNf~99S5mvP1d()p4bX)tVb8;@a>c)yR0$DO+4IqOL&b?>?Hpd z%=_E72@hce?~dD8$MdZv=+05Gy`M79 z-f~F&s3`U%!s9)$tXreEsffl>wuSFxzPKFXtV8QA4b&b z>M;e|nDx&Z{ED}l3iZfUlL_hfJy1^R?;|5`PD)A1v?x`%9Ii;1?p?5&cvBnYpq3gd zP$vc}9$9`F?cbKR2)SbdQ2LukownJRSoH8oz3mQ&YgV)f9(1#)cYb81i36 z9ahR%o~Rb11_2lQ(GJ{5a;nWyseAR@ZeO33?YPNZY=l4_`aEi;2zN61sK*&Y@p#o-lh}ikam#&5FMgUNBn>YT zI=^>Xu8_;na4-a=@yt3dwVqqmWJsYP7DR-y{1mYMjwC9 hc$47DH$FuL>;pSG`k#ErpMSR8Sl>dgP{(!e{{c+ZE-?TA literal 0 HcmV?d00001 diff --git a/layouts/vlayout/skins/twilight/style.css b/layouts/vlayout/skins/twilight/style.css index 8e6a5e3443db..d0d26dbc58f7 100644 --- a/layouts/vlayout/skins/twilight/style.css +++ b/layouts/vlayout/skins/twilight/style.css @@ -3469,3 +3469,9 @@ span[name=existingImages] img{ .individualTaxContainer { text-align: left !important; } +.input-group .autoComplete.form-control{ + min-width: 100px; +} +.rowName .input-group .autoComplete.form-control{ + min-width: 200px; +} diff --git a/layouts/vlayout/skins/twilight/style.min.css b/layouts/vlayout/skins/twilight/style.min.css index d22de907ddcf..525bd24458c6 100644 --- a/layouts/vlayout/skins/twilight/style.min.css +++ b/layouts/vlayout/skins/twilight/style.min.css @@ -1,2 +1,2 @@ -@media print{.noprint{display:none}}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}.hide-text{overflow:hidden;text-indent:100%;white-space:nowrap}.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot');src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.woff') format('woff'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.ttf') format('truetype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg')}body{width:100%;font-family:'Open Sans','Lucida Grande',Verdana,Tahoma,Arial,sans-serif!important;font-size:12px!important;background:#fff;color:#2b2b2b}hr{margin:8px 0;border-bottom:1px solid #ddd}.navbar.navbar-fixed-top .navbar-collapse{padding-right:15px!important}.navbar-nav.navbar-left .open ul{display:none}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background:0}.navbar-default .navbar-nav>li:hover{background:#e7e7e7}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background:0}.navbar-inverse .navbar-nav>li:hover{background:#080808}.navbar-nav .hovernav:hover>.dropdown-menu{display:block}#collapsedMenu{display:block;position:relative}#collapsedMenu a{color:#fff}#collapsedMenu .dropdown-menu .shortDropdown{max-height:300px;overflow-y:scroll;padding:10px;position:relative;z-index:10000;-webkit-overflow-scrolling:touch;-webkit-transform:translateZ(0)}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames{margin-bottom:2px}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a{font-size:.9em;padding:3%!important;color:#2b2b2b!important}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a:hover{text-decoration:none;background:#404952;color:#fff!important}.moreMenus{width:52em;padding:24%;left:0;border-radius:2px}.moreMenus.leftAligned:after,.moreMenus.leftAligned:before{left:21px!important}.moreMenus strong{font-size:1.1em;color:#2b2b2b}.moreMenus:after,.moreMenus:before{left:292px!important}.announcement{// display:none;background:#fafad2;// padding:2px 0;// border-bottom:1px solid #ccc;// max-height:24px;// width:100%}.announcement .marStyle{// width:100%}#headerLinks{padding:10px 0 7px;min-width:240px;float:right!important}#headerLinks .headerLinksContainer{margin-right:10px}#headerLinks .headerLinksContainer>[class*="span"]{float:left;margin-left:15px}#headerLinks .headerLinksContainer .dropdown.open .dropdown-toggle{background:transparent}#headerLinks .headerLinksContainer ul.dropdown-menu{top:30px}#headerLinks .headerLinksContainer ul.dropdown-menu:after,#headerLinks .headerLinksContainer ul.dropdown-menu:before{right:15px;left:auto}#headerLinks .headerLinksContainer>span a img,#headerLinks .headerLinksContainer>span a.userName{color:#fff;cursor:pointer;text-decoration:none!important}#headerLinks .headerLinksContainer>span a img .caret,#headerLinks .headerLinksContainer>span a.userName .caret{border-top:4px solid #fff}.dropdown-menu.pull-right{right:0;left:auto;cursor:pointer}.themeMenuContainer{min-width:110px;width:110px;left:-84px!important;padding:10px 0}.themeMenuContainer .themeMenu{padding:0 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement{cursor:pointer;margin:5px;height:20px;width:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement:hover{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}.themeMenuContainer .themeMenu .themeSelected{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}@media screen and (min-width:1161px){#mediumNav,#shortNav,#headerLinksCompact{display:none}#largeNav{margin-left:10px;margin-right:0}}@media screen and (max-width:1160px) and (min-width:960px){.companyLogo{width:100%}.customFilterMainSpan .select2-container{width:300px!important}*{zoom:1!important}}@media screen and (max-width:960px){.bodyContents{margin:0!important}#centerPanel{width:100%!important}.col-md-3#headerLinks{padding:5px 5px 0}.menuBar .col-md-9,.col-md-3#headerLinks{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-width:80px}.menuBar .col-md-9 .qCreate,.col-md-3#headerLinks .qCreate{display:inline-block;margin:0}.menuBar .col-md-9 .qCreate img,.col-md-3#headerLinks .qCreate img{margin-bottom:3px;margin-right:5px}.menuBar .col-md-9 .qCreate ul li.title,.col-md-3#headerLinks .qCreate ul li.title{padding:5px 0 0 15px}.menuBar .col-md-9 li.tabs:first-child>a,.col-md-3#headerLinks li.tabs:first-child>a{padding:10px 12px 9px}.customFilterMainSpan .select2-container{width:300px!important}#quickCreateModules{width:100%!important;padding:0!important}.CompactQC{max-height:300px;overflow-y:scroll;overflow-x:hidden}.CompactQC a:hover{text-decoration:none}}.commonActionsContainer .quickActions{height:3em}.commonActionsContainer .quickActions img{height:60%;margin:40% auto}.commonActionsContainer .quickActions #companyLogo-container img{height:98%;margin:0 auto}.commonActionsContainer .actionsContainer{background:#f3f3f3}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown{min-width:715px;top:28px;margin:0;padding-top:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a{padding:2px;border:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mainContainer{min-height:500px;margin-top:103px;background:#eeeff2;min-width:1200px}.mainContainer>.col-md-2{// padding:0 1.06383%;height:auto!important;// min-width:174px}.mainContainer .contentsDiv{min-height:500px;background:#fafafb;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;border-left:1px solid #e6e6e6;position:relative}.mainContainer #leftPanel{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.toggleButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;left:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-left:0;display:inline-block}.toggleButton .glyphicon-chevron-left{background-position:-434px -72px!important}.toggleButton .glyphicon-chevron-right{background-position:-460px -72px!important}.toggleRightPanelButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;right:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-right:0;display:inline-block}.quickLinksDiv{margin:10px 0}.quickLinksDiv p{font-size:1.2em;padding:3% 0 0 6%;height:40px;cursor:pointer;box-shadow:0 0 0 1px #ddd;border-top:1px solid #fff!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);position:relative;border-radius:2px}.quickLinksDiv p a{color:#2b2b2b}.quickLinksDiv p a:hover{text-decoration:none}.quickLinksDiv p.selectedQuickLink{background-color:#2a2f35;background-image:-moz-linear-gradient(top,#2a2f35,#2a2f35);background-image:-ms-linear-gradient(top,#2a2f35,#2a2f35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#2a2f35),to(#2a2f35));background-image:-webkit-linear-gradient(top,#2a2f35,#2a2f35);background-image:-o-linear-gradient(top,#2a2f35,#2a2f35);background-image:linear-gradient(top,#2a2f35,#2a2f35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2a2f35',endColorstr='#2a2f35',GradientType=0);border-color:#2a2f35 #2a2f35 #08090a;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);background-image:none;position:relative;border:1px solid #fff;box-shadow:4px 0 3px -4px #000 inset}.quickLinksDiv p.selectedQuickLink a{color:#fff}.quickLinksDiv p.selectedQuickLink a:after{border-bottom:19px solid rgba(0,0,0,0);border-left:10px solid #2a2f35;border-top:19px solid rgba(0,0,0,0);content:" ";display:inline-block;position:absolute;left:100%;top:0}.quickWidgetContainer li a{overflow:hidden;white-space:normal;padding:5px;margin:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.quickWidgetContainer .quickWidget{margin-bottom:10px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.sidebarTitleBlock{padding:12px 0}.sidebarTitleBlock a{color:#373737!important}.sidebarTitleBlock a:hover{text-decoration:none}#selectAllMsgDiv,#deSelectAllMsgDiv{display:none;background-color:#fafad2;padding:.01%;text-align:center}.blockUI form,#globalmodal form{margin:0}.dashboardHeading h2{padding-bottom:8px}.dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardHeading .dropdown-menu{left:-70px;right:0}.dashboardContainer{padding:0}.dashboardContainer .dashboardHeading{padding:10px 0 0;background:#f5f5f5}.dashboardContainer .dashboardHeading h2{padding:0 0 8px 20px}.dashboardContainer .dashboardHeading .btn-toolbar{padding:3px 20px 0 0}.dashboardContainer .dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardContainer .dashboardHeading .dropdown-menu{left:-82px}.widgetsList{max-height:400px;overflow-y:auto;overflow-x:hidden}.widgetsList li{display:block}.widgetsList li a{white-space:normal;word-wrap:break-word}.dashboard_notebookWidget_view .row{margin-bottom:5px}.gridster{margin-left:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.gridster ul{width:auto;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:460px}.gridster ul{list-style:none}.gridster ul li.dashboardWidget{background:#fff;border-radius:1px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.gridster ul li.dashboardWidget .dashboardWidgetHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd;color:#444;cursor:move;padding:5px}.gridster ul li.dashboardWidget .dashboardWidgetHeader table{height:28px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .dashboardTitle{text-align:left;padding-left:10px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .widgeticons{opacity:.5;padding-right:6px}.gridster ul li.dashboardWidget .filterContainer{position:absolute;border:1px solid #ddd;background:#fff;margin-left:-7px;margin-right:3px;margin-top:4px;padding:8px 0;border-radius:0 0 5px 5px;box-shadow:0 5px 8px -5px #888}.gridster ul li.dashboardWidget .filterContainer div span{margin-top:6px}.gridster ul li.dashboardWidget .filterContainer .col-md-5{margin-top:3px}.gridster ul li.dashboardWidget .dashboardWidgetContent{padding:10px 0;line-height:20px}.gridster ul li.dashboardWidget .dashboardWidgetContent .dashboard_notebookWidget_viewarea{height:200px}.gridster ul li.dashboardWidget .widgeticons{min-width:50px;height:30px;margin-right:30px}.gridster ul li.dashboardWidget .widgeticons a{cursor:pointer;text-decoration:none}.gridster ul .widgetChartContainer{margin-left:10px}.listViewPageDiv{margin:11px 0}.customFilterMainSpan{width:100%}.customFilterMainSpan .select2-container{width:95%!important}.select2-container .select2-choice{border-radius:2px;background:#fff;border-color:#ddd;font-size:14px;letter-spacing:.01em;color:#2b2b2b}.select2-container .select2-choice div{border-radius:0;border-left:0;background:#fff}.select2-drop{border-color:#ddd}.select2-dropdown ul.filterActions{list-style:none!important;padding-left:15px}.select2-dropdown ul.filterActions li{cursor:pointer}.ui-autocomplete .ui-menu-item #ui-active-menuitem{background:#404952;border-radius:0}li.ui-timepicker-selected,.ui-timepicker-list li:hover,.ui-timepicker-list:hover .ui-timepicker-selected:hover{background:#404952}#relatedTabOrder .select2-input{min-width:200px}.alphabetSorting .alphabetSearch a{vertical-align:middle;display:inline-block;margin-bottom:2px}.alphabetSorting .alphabetSearch:hover{background:#eeeff2}.listViewActions .settingsIcon{display:inline-block;margin-left:5px}.listViewActions>.btn-group{min-width:105px}#listViewPageJumpDropDown,#relatedListPageJumpDropDown{left:-60px}.pageNumbers{display:inline-block;margin-right:5px;margin-top:6px;vertical-align:top}.pageNumbers .totalNumberOfRecords{margin:0 5px}.contents-topscroll,#reportDetails{overflow-x:auto!important;overflow-y:visible}.contents-bottomscroll{overflow-x:auto!important}.bottomscroll-div,.topscroll-div{display:table;min-width:100%}.listViewLoadingImageBlock{background:0;border-radius:0;box-shadow:none;text-align:center}.detailViewContainer{padding:0 20px}.userPreferences .contents{padding-left:0!important}.userPreferences .details{border-right:0!important}.detailViewTitle{padding:1% 0 0 1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .recordLabel{font-size:16px;font-weight:bold}.detailViewTitle .detailViewButtoncontainer{margin-top:8px}.detailViewTitle .detailViewPagingButton{margin-top:8px;padding-right:10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .btn-toolbar{margin:0}.detailview-table th,.detailview-table td{vertical-align:middle}.detailview-table th label,.detailview-table td label{margin-bottom:3px}.detailViewInfo{box-shadow:0 -4px 4px -4px #959595;margin-top:5px}.detailViewInfo .details{// min-height:600px;padding-right:1.5%;border-right:4px solid #404952;padding-bottom:10px;padding-top:10px}.detailViewInfo .related .nav-pills .active>a,.detailViewInfo .related .nav-pills .active>a:hover{background:#404952;border-radius:1px;margin-top:0;margin-bottom:2px}.fieldLabel{width:20%;background:#f7f7f9}.fieldLabel label.marginRight10px{text-align:right}.summaryView{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.summaryView .summary-table tr.summaryViewEntries:last-child .fieldValue,.summaryView .summary-table tr.summaryViewEntries:last-child .fieldLabel{border-bottom:1px solid #ddd}.summaryView .summaryViewEntries .fieldLabel{vertical-align:top;padding:5px 0 5px 5%;border-top:1px solid #ddd;border-right:1px solid #ddd}.summaryView .summaryViewEntries .fieldValue{vertical-align:top;padding:5px 0 5px 5px;border-top:1px solid #ddd}.summaryView .summaryViewEntries:hover .summaryViewEdit{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryView .summaryViewEntries .summaryViewEdit{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryView .toggleViewByMode{margin:8px 0;padding-right:0}.summaryView .toggleViewByMode .changeDetailViewMode{white-space:normal!important}.summaryWidgetContainer{border-radius:2px;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border:1px solid #eaeaea;background:#fff;margin-bottom:10px;padding:15px}.commentContainer .commentTitle{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;margin-bottom:10px}.commentContainer .commentTitle textarea{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordDetails .squeezedWell{padding:3% 0;min-height:105px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordEditView .contentHeader{padding:.5% 0 1% 0}.recordEditView .table .fieldLabel,.recordEditView .table .fieldValue{vertical-align:middle}.recordEditView .table tbody tr:hover td,.recordEditView .table tbody tr:hover th{background:#f7f7f9}.commentContainer{border-radius:2px}.commentContainer hr{margin:0!important}.commentContainer .addCommentBlock .commentsControls{display:inline-block}.commentContainer .commentsList>.liStyleNone>.commentDetails .commentDiv{width:100%}.commentContainer .commentDetails{background:#fff;border:1px solid #ddd;margin-bottom:5px;border-radius:2px;padding:10px 10px 5px;display:inline-block;min-width:354px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentContainer .commentorInfo p{margin-bottom:0}.commentContainer .addCommentBlock{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border:1px solid #ddd;padding:12px 12px 5px;min-height:115px;margin-top:15px;display:block}.commentContainer .addCommentBlock .commentcontent{padding:8px!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;resize:none}.commentContainer .commentInfoContent{padding:1px 0;word-wrap:break-word}.commentTitle .col-md-1{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentTitle .col-md-1 img{width:32px;height:32px}.commentsList>ul{margin-left:0}.singleComment .editedStatus{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:5px 0 5px 32px}.singleComment .editedStatus p{margin-bottom:0}.singleComment .commentActionsDiv{display:none}.singleComment .commentActionsDiv p{margin-bottom:0}.singleComment:hover .commentActionsDiv{display:block;margin-bottom:3px}.recentComments{margin:0;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recentComments .commentDiv{min-width:100%}.recentComments .addCommentBlock{border:0;margin-top:0;display:block}.recentComments .commentDetails{display:block}.singleComment:hover .commentActions .replyComment{display:inline-block}.commentActionsContainer a:hover{text-decoration:none}.commentActionsContainer .editStatus{padding:5px 2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentActionsContainer .editStatus p{margin-bottom:0}.table{background:#fff}.table-bordered{border-radius:1px;margin-bottom:0}.table-bordered th{border-top:1px solid #fff!important}.table th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;color:#444}.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td,.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td{border-left:0;border-right:0}.listViewEntriesTable tbody tr td:first-child{border-left:0 none}.equalSplit td:nth-child(odd){width:20%}.equalSplit td:nth-child(even){width:30%}td.fieldValue input,td.fieldValue .input-group{margin-bottom:0}.actionImage,.actionImages{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.listViewHeaders a{color:#444}.listViewEntriesDiv .listViewHeaders th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd}.listViewEntriesDiv,.listViewEntriesDiv td{overflow:visible}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues{color:#444}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues:hover{text-decoration:none}.listViewEntriesTable td.listViewEntryValue,.listViewEntries td{vertical-align:middle;cursor:pointer;overflow:visible;padding:5px}.listViewEntriesTable td.listViewEntryValue:hover .actionImages,.listViewEntries td:hover .actionImages,.listViewEntriesTable td.listViewEntryValue:hover .actions,.listViewEntries td:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryViewEntries .summaryViewEdit,.activityStatus .editStatus,.activityDescription .editDescription,.addedCalendars .actionImage{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryViewEntries:hover .fieldValue .summaryViewEdit,.activityStatus:hover .editStatus,.activityDescription:hover .editDescription,.addedCalendars:hover .actionImage{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewEntriesTable tr:hover td .actions .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewBasicAction.dropdown-menu{width:100%}.listViewBasicAction.dropdown-menu input{border-radius:2px;height:24px;margin-bottom:0;margin-top:-2px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.emptyRecordsDiv{width:100%;border:1px solid #ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.emptyRecordsDiv td{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.CustomFilterViewTitle{padding-top:1%}#CustomView .filterActions{padding-bottom:20px;overflow:hidden}.filterConditionsDiv{padding-bottom:0}.conditionGroup .header{margin-bottom:20px;font-size:1.2em}.conditionGroup .contents .conditionRow{margin-bottom:10px}.conditionGroup .contents .conditionRow select,.conditionGroup .contents .conditionRow input{width:90%}.conditionGroup .contents .conditionRow .chzn-results li{line-height:20px}.conditionGroup .deleteCondition{vertical-align:bottom}.searchUIBasic{border-collapse:separate!important;border-spacing:10px!important;margin:0 10%}.searchUIBasic .importContents{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.searchUIBasic .listRow .listViewHeaders>td{color:#404952}.searchUIBasic .listRow .defaultInputTextContainer{max-width:87%!important;margin-bottom:0!important}#lineItemTab.table tr:first-child:hover th ~ td{background-color:#f3f3f4;background-image:-moz-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-ms-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f3f3f4),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-o-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:linear-gradient(top,#f3f3f4,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f4',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}#lineItemTab.table tr:nth-child(2):hover td{background:0}.lineItemTable tr td{width:0}.lineItemTable tr td div.finalDiscountUI,.lineItemTable tr td div.discountUI,.lineItemTable tr td div#shipping_handling_div,.lineItemTable tr td div.taxUI,.lineItemTable tr td div.finalTaxUI{border:2px solid #c4c4c4;border-radius:2px}.lineItemTable tr td div.finalDiscountUI table tr td,.lineItemTable tr td div.discountUI table tr td,.lineItemTable tr td div#shipping_handling_div table tr td,.lineItemTable tr td div.taxUI table tr td,.lineItemTable tr td div.finalTaxUI table tr td,.lineItemTable tr td div.finalDiscountUI table tr th,.lineItemTable tr td div.discountUI table tr th,.lineItemTable tr td div#shipping_handling_div table tr th,.lineItemTable tr td div.taxUI table tr th,.lineItemTable tr td div.finalTaxUI table tr th{border-left:0}.lineItemTable tr:hover td{width:0}.lineItemTable tr:hover td div.finalDiscountUI table tr td{background:none!important}.lineItemTable tr:hover td div.discountUI table tr td{background:none!important}.lineItemTable tr:hover td div#shipping_handling_div table tr td{background:none!important}.lineItemTable tr:hover td span.taxDivContainer div table tr td{background:none!important}.lineItemTable tr:hover td div.finalTaxUI table tr td{background:none!important}.lineItemResult{width:70.5%!important}.lineItemResult a:hover{color:#404952}.lineItemInputBox{width:45%;float:right;text-align:right}.discountUI,.taxUI,.finalDiscountUI,.finalTaxUI,#shipping_handling_div{position:absolute;left:46%;width:30%;z-index:500;box-shadow:1px 0 7px #ddd;border-radius:6px}.discountUI table.table,.taxUI table.table,.finalDiscountUI table.table,.finalTaxUI table.table,#shipping_handling_div table.table{margin-bottom:0}.discountUI .table tbody tr:first-child th:first-child,.taxUI .table tbody tr:first-child th:first-child,.finalDiscountUI .table tbody tr:first-child th:first-child,.finalTaxUI .table tbody tr:first-child th:first-child,#shipping_handling_div .table tbody tr:first-child th:first-child{border-radius:4px 0 0 0!important}.discountUI .table tbody tr:first-child th:last-child,.taxUI .table tbody tr:first-child th:last-child,.finalDiscountUI .table tbody tr:first-child th:last-child,.finalTaxUI .table tbody tr:first-child th:last-child,#shipping_handling_div .table tbody tr:first-child th:last-child{border-radius:0 4px 0 0!important}.LineItemDirectPriceReduction{width:65%!important}th.htColHeader,.handsontable thead th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd;padding:6px 2px}.contentHeader{padding:15px;padding-left:5px;line-height:20px}.contentsDiv>div{padding:0 20px}#settingsQuickWidgetContainer .widgetContainer.accordion-body{border-bottom:none!important;border-bottom:3px solid #ddd}#settingsQuickWidgetContainer .widgetContainer.accordion-body>div:hover{background:#eeeff2}#settingsShortCutsContainer{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:1% 3%}#settingsShortCutsContainer .moduleBlock{min-height:60px}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin{display:inline-block;opacity:.4}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin:hover{opacity:.8}.settingsIndexPage .settingsSummary{text-align:center;margin-top:10px}.settingsIndexPage .settingsSummary a{display:inline-block;background:#f3f3f4;color:#444;border-radius:2px;min-width:200px;padding:20px 0 10px;border:1px solid #ddd}.settingsIndexPage .settingsSummary a .summaryText{display:inline-block;margin-top:20px;font-size:15px}.settingsIndexPage .settingsSummary a:hover .summaryText,.settingsIndexPage .settingsSummary a:hover .summaryCount{color:#404952}.settingsIndexPage .moduleBlock h5{font-size:1.2em;margin-bottom:5px}.settingsIndexPage .moduleBlock:hover{background:#f3f3f4}#userPageHeader{padding:8px 0 0}#userPageHeader #userHeading h3{margin-top:10px}.treeView li{border-left:4px solid #ddd;list-style:none;padding-top:15px}.treeView li .toolbar-handle{margin-left:10px;position:relative}.treeView li .toolbar-handle .btn{margin:0}.treeView li .toolbar-handle a:before{background:none repeat scroll 0 0 #ddd;content:" ";display:inline-block;height:4px;left:-10px;position:absolute;top:12px;width:10px}.treeView .btn{margin-bottom:10px}.profilesEditView tr.blockHeader th{text-align:center}.profilesEditView tr.blockHeader th:first-child{text-align:left}.profilesEditView input{margin-right:5px}.profilesEditView tr td.row table.table{border-left:none;margin-bottom:20px}.profilesEditView tr:hover td.row{background:0}.profilesEditView tr:hover td.row table.table tr td{background:0}.profilesEditView tr:hover td.row table.table tr:hover td{background:0}.profilesEditView tr:hover td.row table.table td{background:#f3f3f4}#s2id_memberList li>div,.groupMembersColors li>div{margin-left:10px}#s2id_memberList .Users,.groupMembersColors .Users{background-color:#f99984!important;padding:5px;margin-bottom:2px;background-image:none}#s2id_memberList .Groups,.groupMembersColors .Groups{background-color:#acd5ff!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .Roles,.groupMembersColors .Roles{background-color:#ffec98!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .RoleAndSubordinates,.groupMembersColors .RoleAndSubordinates{background-color:#c4dea2!important;background-image:none;padding:5px;margin-bottom:2px}.collectiveGroupMembers{border:1px solid #ddd;border-top:0}.collectiveGroupMembers ul{padding:0;margin:0}.collectiveGroupMembers ul li{padding:4px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.collectiveGroupMembers ul li a{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;margin:0}.collectiveGroupMembers ul li.groupLabel{background-color:#f3f3f4;border-bottom:1px solid #ddd;border-top:1px solid #ddd;padding:10px 5px;margin:0;color:#444}.mini-slider-control{width:50px}.mini-slider-control+div{margin-left:15px}.mini-slider-control .ui-slider-handle{border:0;border-radius:50%;height:16px;top:-2px;width:16px;cursor:pointer}.mini-slider-control .ui-slider-handle:focus{outline:0}.ui-widget-content{border-radius:6px;border-color:#fff;box-shadow:0 0 3px -1px inset;margin-top:2px;margin-left:5px;height:12px}.ui-slider-disabled{opacity:.5;border-color:#ddd;box-shadow:none;cursor:not-allowed}.ui-slider-disabled .ui-slider-handle{cursor:not-allowed}.ui-slider-disabled+div{opacity:.5;cursor:not-allowed}.mini-slider-control[data-value="0"] .ui-slider-handle{background:#7d7e7d;background:-moz-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#7d7e7d),color-stop(100%,#0e0e0e));background:-webkit-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-o-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-ms-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:linear-gradient(to bottom,#7d7e7d 0,#0e0e0e 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7d7e7d',endColorstr='#0e0e0e',GradientType=0)}.mini-slider-control[data-value="1"] .ui-slider-handle{background:#ffb76b;background:-moz-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ffb76b),color-stop(0%,#ffa73d),color-stop(49%,#ff7c00),color-stop(100%,#ff7f04));background:-webkit-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-o-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-ms-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:linear-gradient(to bottom,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffb76b',endColorstr='#ff7f04',GradientType=0)}.mini-slider-control[data-value="2"] .ui-slider-handle{background:#bfd255;background:-moz-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#bfd255),color-stop(79%,#8eb92a),color-stop(100%,#72aa00),color-stop(100%,#9ecb2d));background:-webkit-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-o-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-ms-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:linear-gradient(to bottom,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bfd255',endColorstr='#9ecb2d',GradientType=0)}#moduleManagerContents{padding-bottom:10px}#moduleManagerContents .moduleManagerBlock .btn-group.open .dropdown-menu{left:-144%}#moduleManagerContents .modulesTable td{width:50%}#importModules .contents .row{margin-bottom:2.2%}.extensionWidgetContainer{background-color:#fff;border:1px solid #ddd;min-height:200px;padding:2%;background:#fafafa;box-shadow:0 0 10px -4px #777}.extensionWidgetContainer .extension_contents{margin-top:2%;background:#fff;padding:10px;box-sizing:border-box;max-height:160px}.extension_contents:hover{border-radius:4px}.thumbnailImage{height:130px;width:130px;float:right}.extensionWidgetContainer .extension_contents .slimScrollDiv{padding-right:10px}.extensionWidgetContainer .extension_header .font-x-x-large{font-size:1.5em;padding-left:3px;font-weight:bold;color:#404952}.extensionWidgetContainer .extensionDescription{line-height:20px}.extensionWidgetContainer .extensionInfo{padding-top:5px}.extensionWidgetContainer .extensionInfo .rating,.extensionDetails .rating{vertical-align:middle;margin-top:2px;display:inline-block}.extensionDetails .authorInfo{margin:3px 0}.extensionDetails .extensionDetailActions{padding:15px 0}.extensionWidgetContainer .tab-pane .bx-wrapper .imageSlider{margin:0}.sliderImage{width:90%;height:360px}.opacity .actions{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.opacity:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.sharingAccessDetails{margin-bottom:30px}.sharingAccessDetails td,.sharingAccessDetails th{text-align:center;vertical-align:middle!important}.sharingAccessDetails tr td:first-child,.sharingAccessDetails tr th:first-child{text-align:left}.sharingAccessDetails td.row>div{display:block}.sharingAccessDetails .customRuleContainer:hover{background:0}.sharingAccessDetails hr{border-bottom:1px solid #bcbcbc}.sharingAccessDetails .title{padding:1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.sharingAccessDetails .title .rulehead{padding-top:5px}.sharingAccessDetails .customRuleEntries:hover .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.layoutContent{border-top:4px solid #404952}.layoutContent #moduleBlocks .editFieldsTable{margin-bottom:20px}.layoutContent #moduleBlocks .editFieldsTable .fieldLabel{background:0}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockLabel{padding-top:13px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group{margin-top:5px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group .dropdown-menu{left:-100%}.layoutContent .relatedTabModulesList{padding:2% 1%}.fieldDetailsForm .search-choice-close{padding:0}.border1px{border:1px solid #ddd}.blockFieldsList .opacity{margin-left:.5%!important}.blockFieldsList .opacity .dropdown-menu a{padding:0!important}.blockFieldsList .opacity a.dropdown-toggle.editFieldDetails{box-shadow:none}.blockFieldsList .editFields .dropdown-menu{z-index:1000003;padding:0;left:-215px;position:absolute}.blockFieldsList .editFieldsWidget .dropdown-menu{z-index:1000003;padding:0;left:-315px;position:absolute}.blockFieldsList .editFields .dropdown-menu .modal-header{border-width:0;border-bottom-width:1px}.blockFieldsList .editFields .dropdown-menu .modal-header .cancel{padding-right:0;font-weight:bold}.blockFieldsList .editFields:hover{background:#f3f3f4!important}#modulePickListValuesContainer .layoutContent{padding-left:2%}#modulePickListValuesContainer .layoutContent .selectedCell,#modulePickListValuesContainer .layoutContent .selectedListItem{background:#a5afb9;white-space:nowrap}#modulePickListValuesContainer .layoutContent .pickListValue{cursor:pointer}.nonEditableValuesDiv .nonEditablePicklistValues{margin-left:0}.nonEditableValuesDiv .nonEditablePicklistValues li{padding:3px 15px;margin-bottom:2px;background:#e0f2ff}.popover{z-index:1000023!important}.popover-content .fieldLabel{width:35%;white-space:normal}#dependencyGraph .tableHeading{text-align:center;padding-top:30px;font-size:1.2em;font-weight:bold}#dependencyGraph .depandencyTable{border:1px solid #ddd;background:#f3f3f4}#dependencyGraph .depandencyTable .blockHeader{border-bottom:1px solid #ddd}#dependencyGraph .depandencyTable .picklistValueMapping{border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping{text-align:center;border-left:1px solid #ddd;border-right:1px solid #ddd;background:#fff}#dependencyGraph .dependencyMapping .mCSB_container{margin-bottom:16px!important}#dependencyGraph .dependencyMapping .pickListDependencyTable{border:0}#dependencyGraph .dependencyMapping .pickListDependencyTable .blockHeader th{background:#f3f3f4;border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping .pickListDependencyTable .selectedCell{background:#a5afb9}.webformFieldInfo{margin-bottom:250px}.targetFieldsTableContainer input[type="text"]{min-width:100px}#customRecordNumbering.table thead th{vertical-align:middle}.addMailBoxBlock{margin-left:83px;padding:0!important;font-size:12px}.addMailBoxStep{background:#fff;padding:30px 0;border:1px solid #ddd;border-radius:1px;min-height:170px}.mailConveterDesc{height:350px;width:96%;border:1.5px solid;border-radius:2px;border-color:#ddd;font-size:11pt;margin-top:55px;margin-left:20px;background:#fff}#mailBoxLabel{margin-top:15px;margin-left:-18px;font-size:12pt;width:75px}.mailBoxDropdownWrapper{height:49px;width:70%;background:url('../images/mailbox-icon.png') no-repeat 5px 5px;overflow:hidden;border:1px solid #ddd}.mailBoxDropdown{background:transparent url('../images/downArrowBlue.png') no-repeat 236px 13px;width:110%;height:50px;font-size:14pt;color:#0065a6;padding:10px 55px;padding-right:0}#mailConverterDragIcon{margin-top:12px}#mailConverterBody{padding-top:20px;margin-left:0}.ruleHead{padding:6px 0;background:#d8d8dc}.mailConverterRuleBlock{font-size:14px;line-height:30px;border:1.5px solid;border-color:#ddd}.mailConverterRuleLegend{font-size:14px;color:#0065a6;margin-bottom:10px;background:#f3f3f4}#mailConverterStats{font-size:10pt;margin-top:5px;margin-left:-10px}.addMailBoxBlock{border-color:#ddd;margin-left:83px;margin-top:20px;padding-top:30px;padding-left:200px;padding-bottom:20px;padding-right:30px;font-size:11pt}.taskTypeUi>.row{margin:10px 0}#taskListContainer .listViewEntriesTable tr td:last-child{border-left:1px solid #ddd}#workflow_step2>.row{padding:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:400px}#open_email_con .detailViewTitle{padding:0}#open_email_con .detailViewTitle .detailViewPagingButton{margin-top:0;padding-right:0}#foldersList .list-group{padding-right:0}.massEditTable th+th,.massEditTable td+td,.massEditTable th+td,.massEditTable td+th{border-left:0}.nav.massEditTabs{margin-bottom:0;border-bottom:0}.nav.massEditTabs li.active a{background:#404952;color:#fff;margin-left:10px}.nav.massEditTabs li a:hover{border-bottom:1px solid #404952}.massEditContent{border-top:3px solid #404952}.calendarSettingsContainer{width:700px}.calendarSettingsContainer .control-label{width:26%}#calendarSettings{margin:1px 0 3px}.calendarMassEdit{min-width:400px}.fc-state-default .fc-button-effect{top:100%!important}.fc-event-style1,.fc-event-style1 .fc-event-skin{background:#17309a;border-color:#17309a;font-weight:normal;text-shadow:none}.fc-event-style2,.fc-event-style2 .fc-event-skin{background:#3a87ad;border-color:#3a87ad;font-weight:normal;text-shadow:none}.fc-event-style3,.fc-event-style3 .fc-event-skin{background:#aa6705;border-color:#aa6705;font-weight:normal;text-shadow:none}.fc-event-style4,.fc-event-style4 .fc-event-skin{background:#953b39;border-color:#953b39;font-weight:normal;text-shadow:none}.fc-event-style5,.fc-event-style5 .fc-event-skin{background:#545252;border-color:#545252;font-weight:normal;text-shadow:none}.fc-event-style6,.fc-event-style6 .fc-event-skin{background:#87865d;border-color:#87865d;font-weight:normal;text-shadow:none}.fc-event-style7,.fc-event-style7 .fc-event-calendarMassEditskin{background:#c71585;border-color:#c71585;font-weight:normal;text-shadow:none}.fc-event-style8,.fc-event-style8 .fc-event-skin{background:#006400;border-color:#006400;font-weight:normal;text-shadow:none}#calendarview th{color:#000}.fc-agenda-divider+div{overflow-y:visible!important}.fc-button{display:inline-block;padding:6px .4em!important;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.fc-button:active .fc-button-inner{background:transparent}.fc-button:active .fc-button-inner .fc-button-content{color:#fff}.fc-button.fc-state-active .fc-button-inner .fc-button-content,.fc-button:active .fc-button-inner .fc-button-content{color:#000!important;background:transparent;background-image:none}.fc-header-title h2{font-size:15px;line-height:20px}.fc-widget-header th{padding:4px 0!important}.fc-widget-header{color:#666;background:#eee;border-color:#ccc}.fc-content{background:#fff;margin-top:15px}.fc-content td:hover{background:#f3f3f3}.btn:focus{outline:0}.reminderPostpone.btn-primary{background:#404952}.reminderPostpone.btn-primary:hover{background:#1e2327}.saveButton{margin-right:5px}.addCustomRule{float:right}.importMore{background:#fff}.lastImport{background:#fff}.undoImport{background:#da4f49}.close{border:0;background:none repeat scroll 0 0 transparent;border:0 none;cursor:pointer}.resetButton{margin-top:0!important}.vtGlyph{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("../images/vtGlyph.png");background-position:0 0;background-repeat:no-repeat;*margin-right:.3em}.vticon-pageJump{background-position:0 0}.vticon-call-inbound{background-position:-14px 0}.vticon-call-outbound{background-position:-28px 0}#massEdit .cancelLinkContainer{padding:5px 0;margin-left:.5em}.ui-pnotify{z-index:1000023}.feedback{z-index:10002}.feedback .handle{z-index:10003;display:block;position:fixed;bottom:50px;left:-30px;left:0\9;bottom:100px\9;background:#2c2c2c;color:white;padding:7px 15px;border:1px solid gray;text-decoration:none;outline:0;-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-o-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg);-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.00000000, M12=1.00000000, M21=-1.00000000, M22=0.00000000,sizingMethod='auto expand')";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0,M12=1,M21=-1,M22=0,sizingMethod='auto expand')}.feedback .handle:hover{text-decoration:none}.vtFooter{text-align:center}.vtFooter p{background:#404952;color:#fff;border-top:1px solid #ddd;padding:1px 0;font-size:.9em;margin-bottom:0}.vtFooter p a{color:#fff}.imageHolder{background:url('../images/loadback.png') repeat-y;background-position:center;padding:10px 0}.breadcrumbContainer{padding:2% 2% 0 2%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;height:auto}.breadcrumb{display:inline-block;height:auto;height:40px}.crumbs{height:40px;margin:0;padding:0 20px 0 0;display:inline-block;font-family:sans-serif}.crumbs li:after{content:'\0000a0';width:0;height:0;border-left:18px solid #ececec;border-top:20px solid transparent;border-bottom:20px solid transparent;display:inline-block;position:relative;top:-20px;left:18px;zoom:1}.crumbs li{height:0;border-top:20px solid #ececec;border-bottom:20px solid #ececec;border-left:20px solid transparent;display:inline-block;box-shadow:0 1px #ddd;margin-right:5px}.crumbs li a{display:inline-block;float:left;margin-top:-13px;font-size:14px;font-weight:bold;color:#666;text-decoration:none}.crumbs li.active{height:0;border-top:20px solid #404952;border-bottom:20px solid #404952;box-shadow:0 1px #404952}.crumbs li.active:after{border-left:18px solid #404952!important}.stepText{display:inline-block;white-space:nowrap;overflow:hidden;font-size:13px;vertical-align:bottom}.active .stepText,.active .stepNum{color:#fff}.stepNum{display:inline-block;padding:0 5px;overflow:hidden;font-size:20px;vertical-align:top;margin-top:5px}.greyStar{background-image:url("../images/stars.png");background-position:20px 20px;height:20px;width:20px;display:inline-block}.yellowStar{background-image:url('../images/stars.png');background-position:0 20px;width:20px;height:20px;display:inline-block}.blockUI{border-radius:2px!important;border:0!important}textarea.col-md-11{width:100%!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.popover .popover-inner{border-radius:2px;font-size:.8em;box-shadow:0}.popover .popover-inner .popover-title{color:#444;font-size:15px}.popover .popover-inner .close{color:#000!important;margin-top:3px;opacity:.5!important}.popover .popover-inner .close:hover{opacity:1!important}.popover .popover-inner td{padding:3px 5px;overflow-wrap:break-word}.popover .popover-inner .detailViewInfo{margin-top:0;box-shadow:0}.popover .popover-inner .detailViewInfo .fieldLabel label{font-size:1em}#findDuplicate>.control-group{margin-bottom:0;width:400px}#moveReports .modal-body{padding:20px 40px}#composeEmailContainer{padding:0 20px}#composeEmailContainer .MultiFile-wrap{display:inline-block}#composeEmailContainer .MultiFile-intercepted .ui-wrapper{min-height:400px}#transferOwnershipContainer .select2-container.select2-container-multi{max-width:220px}.fieldInfo.in{overflow:visible!important;height:auto!important}.moduleSelection{border-radius:2px 2px 0 0!important;border:1px solid #ddd!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);color:#444}.convertLeadModules{margin-bottom:2%;border:1px none}.moduleBlock{border-radius:0!important}.overflowVisible{overflow:visible!important}.convertLeadError{border:3px solid #999;background-color:#fff;width:55%;position:relative;z-index:10000000}.convertLeadError table td{border-bottom:1px solid #ccc;nowrap:nowrap;width:70%}.bootbox,.alert{z-index:1000023}.chzn-container{vertical-align:middle}.chzn-container .chzn-results li{margin-right:7px}.chzn-container .chzn-results .highlighted{background:#404952}.select2-results .select2-highlighted{background:#404952}.select2-result-label i{background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.ui-autocomplete-loading{background:url('../images/load.gif') no-repeat right center}.ui-autocomplete{height:auto!important;border-radius:1px!important}.dropdown-menu.pull-right:after,.dropdown-menu.pull-right:before{right:3px;left:auto;top:-5px;border-bottom-width:6px}span.wrapper a{color:#08c!important;font-size:15px!important;font-weight:bold}a{color:#353c44}a:hover{color:#1e2327;text-decoration:none;cursor:pointer}a:active,a:focus{outline:0}.well{border-radius:2px;padding:15px}.verticalBottomSpacing{margin-bottom:10px}.mergeTables{margin-bottom:0}.font-x-x-large{font-size:18px;line-height:28px}form{margin:0}.fc-state-default .fc-button-effect span{background:0}.dateField{width:183px}.form-horizontal [class^="icon-"],.form-horizontal [class*=" icon-"]{vertical-align:baseline}.timePicker{width:8.5em!important;z-index:1000029!important}.datepicker{z-index:1000029!important}.colorpicker{z-index:1029!important}.colorpicker input{width:30px!important}.colorpicker input[type="text"],.colorpicker input{color:#898989!important}.colorpicker_hex input{width:45px!important}.modal-body.accordion{margin-bottom:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}//.modal-open{// overflow:hidden;//}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.removeNoFileChosen{color:transparent!important}.modelContainer .modal-header{border-radius:2px 2px 0 0}.modelContainer form{border-radius:0 0 2px 2px}.hide{display:none}i{cursor:pointer;text-decoration:none!important}.marginbottomZero{margin-bottom:0!important}.marginLeftZero{margin-left:0!important}.marginRightZero{margin-right:0!important}.clearfix{clear:both!important}textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%}.textOverflowEllipsis{overflow:hidden;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;//width:9em}.margin0px{margin:0!important}.padding10{padding:10px;padding-bottom:0}.padding20{padding:20px}.pushDown{margin-top:5px}.boxSizingBorderBox{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.boxSizingContentBox{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.cursorPointer{cursor:pointer;text-decoration:none!important}.zeroOpacity{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.dullOpacity{opacity:.8;-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80)}.fullOpacity{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.redColor{color:red}.highlightBackgroundColor{background:#eeeff2}.contentsBackground{background:#fff;border:1px solid #ddd}.textAlignCenter{text-align:center}.textAlignRight{text-align:right}.alignMiddle{vertical-align:middle}.alignTop{vertical-align:top}.padding1per{padding:1%}.paddingTop20{padding-top:20px}.padding20px{padding:20px}.padding-bottom1per{padding-bottom:1%}.marginBottom10px{margin-bottom:10px}.displayInlineBlock{display:inline-block}.backgroundImageNone{background-image:none}.liStyleNone{list-style:none outside none}.fontBold{font-weight:bold!important}.livesupport_tab,#userfeedback{display:none!important}#reportDetails table tr td.summary{border-bottom:0;border-top:0}#portalDetailViewHttpError{padding-bottom:7px;margin-top:50px;color:red;text-align:center}.slidesjs-pagination{list-style:none}.slidesjs-pagination li a{display:block;width:13px;height:0;padding-top:13px;background-image:url('../images/pagination.png');background-position:0 0;float:left;overflow:hidden}.slidesjs-pagination li a.active,.slidesjs-pagination li a:hover.active{background-position:0 -13px}.extensionStorebtn{background:#f08c39;background-image:-webkit-linear-gradient(top,#f08c39,#e68b3c);background-image:-moz-linear-gradient(top,#f08c39,#e68b3c);background-image:-ms-linear-gradient(top,#f08c39,#e68b3c);background-image:-o-linear-gradient(top,#f08c39,#e68b3c);background-image:linear-gradient(to bottom,#f08c39,#e68b3c);-webkit-border-radius:2;-moz-border-radius:2;border-radius:2px;text-shadow:0 0 1px #595959;color:#fff;font-size:14px;font-weight:bold;padding:8px 20px 8px 20px;text-decoration:none;border:0}.extensionStorebtn:hover{background:#fc9f3c;background-image:-webkit-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-moz-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-ms-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-o-linear-gradient(top,#fc9f3c,#f08a3c);background-image:linear-gradient(to bottom,#fc9f3c,#f08a3c);text-decoration:none}.extensionSearch{padding:8px 12px 8px 30px!important;margin:6px 0 14px 0;box-shadow:inset 2px 2px 10px #ddd;border-radius:2px!important;background:url('../images/search.png') no-repeat;background-position:5px 6px}.banner-container{border-bottom:1px solid #fff;box-sizing:border-box}.banner{margin:0 90px}.bx-wrapper{margin:0 auto 35px!important;padding-top:17px!important}.bx-wrapper li a{display:block}.bx-wrapper a img{height:100px;width:auto;margin:0 auto}.wide,.table td.wide,.listViewEntries td.wide,td.listViewEntryValue.wide{padding:8px!important}.medium,.table td.medium,.listViewEntries td.medium,td.listViewEntryValue.medium{padding:5px 6px!important}.narrow,.table td.narrow,.listViewEntries td.narrow,td.listViewEntryValue.narrow{padding:2px 4px!important}.table thead th.narrow{vertical-align:middle}td.listViewEntryValue .row input{padding:0;margin-bottom:0}.listViewContentDiv{position:relative}.fieldLabel .pull-right{text-align:right}#tagRecordText{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;width:80%!important}#tagRecord{margin-left:5px!important}.tag{float:right!important}.cut-string{text-overflow:ellipsis;-o-text-overflow:ellipsis;-webkit-text-overflow:ellipsis;width:200px;white-space:nowrap;overflow:hidden}.paddingLRZero{padding-left:0;padding-right:0}.paddingRightZero{padding-right:0}.detailViewToolbar{margin-top:5px}.input-group.input-group-sm>.input-group-addon img{width:15px}table tr td .input-sm{min-width:50px}.modal-footer.backgroundColor{background-color:#f5f5f5}.panel-title{font-size:14px}.quickWidgetContainer .panel-body{padding-bottom:0;padding-top:0}tr.summaryViewEntries,#detailView table{font-size:13px}table.listViewEntriesTable{font-size:13px;margin-top:5px}.no-margin{margin:0}.companyLogo img{max-height:200px;max-width:250px}.navbar-inverse .navbar-nav>li>a{color:#fff;padding:15px 12px}.navbar-inverse .navbar-nav .dropdown-menu>li>a{padding:3px 15px;font-size:12px}.headerCalendar .month h3{font-size:18px;font-weight:bold;margin:5px 0 0 0}.columnsSelect{width:100%!important}.marginBottom5{margin-bottom:5px}.editViewContainer .recordEditView table.blockContainer tr td.fieldValue{width:30%}.recordEditView[name=QuickCreate] .quickCreateContent table tr td.fieldValue,#massEditContainer .massEditContent table tr td.fieldValue,#tab_accounts td.functionList{width:30%}.btn{white-space:normal}.valuesAssignedToRole{border:1px solid #adadad;overflow:hidden;text-overflow:ellipsis;padding:6px}table.dataTable .form-control{width:100%!important}#breadcrumb .stepNum{margin-top:0}#breadcrumb .stepText{position:relative;top:-4px}.fc button{height:auto!important}.fc-toolbar{margin-bottom:0!important}.fc-center,.fc-left,.fc-right{margin-bottom:1em}.calendarRightPanel{padding-left:5px;padding-right:5px}.calendarRightPanel ul li{margin-bottom:2px;margin-left:5px}.calendarRightPanel ul li:hover{background-color:#eee!important;border-radius:5px}.square9{width:12px;height:12px;margin:4px}.panel-dark{border-color:#737373}.panel-dark>.panel-heading{color:#fff;background-color:#737373;border-color:#737373}.panel-dark>.panel-heading+.panel-collapse>.panel-body{border-top-color:#737373}.panel-dark>.panel-heading .badge{color:#737373;background-color:#fff}.panel-dark>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#737373}.calendarRightPanel .widgetContainer ul{margin-top:5px;margin-bottom:5px}.paddingLeft5px{padding-left:5px}.marginBottom5px{margin-bottom:5px}.detailview-table .fieldValue .summaryViewEdit{display:none}.detailview-table .fieldValue:hover .summaryViewEdit{display:inherit}.icon-in-history-widget{font-size:17px;padding:4px}#prefPageHeader .logo img{height:70px;width:70px}#myPrefHeading h3{margin-top:12px}.list-user-img{width:50px;height:40px}span[name=existingImages] img{height:200px;width:300px}.narrow.fieldValue .chosen-container-single .chosen-single{height:26px;line-height:26px}.narrow.fieldValue input{height:26px}.narrow.fieldValue .input-group-addon{padding:4px 10px}.narrow.fieldValue .chosen-container-single .chosen-single div b{background-position-y:4px}.image-in-button{width:18px}.fc-time-grid .fc-time-grid-event.fc-event{min-height:27px;min-width:100px}.fc-time-grid-event.fc-short .fc-title{font-size:1em}.paddingTBZero{padding-top:0;padding-bottom:0}.dashboardWidgetContent a .glyphicon{top:-3px}.detailViewTitle .popover{min-width:130px;text-align:center}.cursorDefault{cursor:default!important}.remindersNoticeContainer{position:fixed;right:0;top:109px;z-index:1029;width:0;height:100%;bottom:30px;overflow-y:auto;background:rgba(0,0,0,0.4);border-left:1px solid #797979;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;overflow-y:auto}.remindersNoticeContainer.toggled{width:380px}.remindersContent{margin:5px 8px 0 8px}.activityTypeIcon{height:20px}.remindersNoticeContainer .panel{margin-bottom:10px}.remindersNoticeContainer .panel-body{padding:10px}.remindersNoticeContainer .actionRow a.btn{margin-right:3%}.remindersNotice{color:#fff;padding:15px 12px}.remindersNotice .glyphicon{font-size:20px}.cancelLink.btn[type='reset'],.cancel.btn[type='reset']{float:right;margin-left:5px;margin-bottom:0}.activityWidgetContainer .popover{min-width:240px}.filterActionImage{margin-left:8px}#tagRecord{line-height:25px}#tagsList .btn-info{margin-left:5px}#tagRecordInput{padding-left:15px;padding-right:15px}.clearReferenceSelection,.createReferenceRecord{padding:0 6px}.relatedPopup{padding:0 4px}.popupContainer .popupModuleName{margin-top:0}.mailRows hr{margin:0}.paddingLeftMd{padding-left:15px}.widget_header div:nth-child(2).btn-toolbar,.editViewContainer .contentHeader.row div:nth-child(2){margin-top:20px}.fieldLabel .referenceMandatory{margin-right:-12px}.ui-widget-content{padding:.8em}.ui-autocomplete .ui-autocomplete-category{font-weight:bold;line-height:1.5}.ui-autocomplete .ui-autocomplete-category:first-child{margin:.8em 0 .2em}.ui-autocomplete .ui-menu-item{padding:.2em .8em}.ui-autocomplete .ui-state-focus{border:0;background:#ebebeb}.widgetHr{margin-top:0}.headerLinksMails .btn-group{margin-top:11px}.finalDiscountUI,.finalTaxUI{bottom:5px}.sideBarTitle{font-size:20px}.globalSearchInput{width:300px}#groupsDetailContainer strong{line-height:21px}#addTaskContainer #taskStatus{margin-left:10px}.scanerMailActionsButtons{min-width:96px}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#404040}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active,.ui-menu .ui-menu-item a.ui-widget-content{font-weight:bold;margin:0;background-color:#428bca;border-color:#357ebd;color:#fff;display:block}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style:none} \ No newline at end of file +@media print{.noprint{display:none}}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}.hide-text{overflow:hidden;text-indent:100%;white-space:nowrap}.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot');src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.woff') format('woff'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.ttf') format('truetype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg')}body{width:100%;font-family:'Open Sans','Lucida Grande',Verdana,Tahoma,Arial,sans-serif!important;font-size:12px!important;background:#fff;color:#2b2b2b}hr{margin:8px 0;border-bottom:1px solid #ddd}.navbar.navbar-fixed-top .navbar-collapse{padding-right:15px!important}.navbar-nav.navbar-left .open ul{display:none}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background:0}.navbar-default .navbar-nav>li:hover{background:#e7e7e7}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background:0}.navbar-inverse .navbar-nav>li:hover{background:#080808}.navbar-nav .hovernav:hover>.dropdown-menu{display:block}#collapsedMenu{display:block;position:relative}#collapsedMenu a{color:#fff}#collapsedMenu .dropdown-menu .shortDropdown{max-height:300px;overflow-y:scroll;padding:10px;position:relative;z-index:10000;-webkit-overflow-scrolling:touch;-webkit-transform:translateZ(0)}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames{margin-bottom:2px}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a{font-size:.9em;padding:3%!important;color:#2b2b2b!important}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a:hover{text-decoration:none;background:#404952;color:#fff!important}.moreMenus{width:52em;padding:24%;left:0;border-radius:2px}.moreMenus.leftAligned:after,.moreMenus.leftAligned:before{left:21px!important}.moreMenus strong{font-size:1.1em;color:#2b2b2b}.moreMenus:after,.moreMenus:before{left:292px!important}.announcement{// display:none;background:#fafad2;// padding:2px 0;// border-bottom:1px solid #ccc;// max-height:24px;// width:100%}.announcement .marStyle{// width:100%}#headerLinks{padding:10px 0 7px;min-width:240px;float:right!important}#headerLinks .headerLinksContainer{margin-right:10px}#headerLinks .headerLinksContainer>[class*="span"]{float:left;margin-left:15px}#headerLinks .headerLinksContainer .dropdown.open .dropdown-toggle{background:transparent}#headerLinks .headerLinksContainer ul.dropdown-menu{top:30px}#headerLinks .headerLinksContainer ul.dropdown-menu:after,#headerLinks .headerLinksContainer ul.dropdown-menu:before{right:15px;left:auto}#headerLinks .headerLinksContainer>span a img,#headerLinks .headerLinksContainer>span a.userName{color:#fff;cursor:pointer;text-decoration:none!important}#headerLinks .headerLinksContainer>span a img .caret,#headerLinks .headerLinksContainer>span a.userName .caret{border-top:4px solid #fff}.dropdown-menu.pull-right{right:0;left:auto;cursor:pointer}.themeMenuContainer{min-width:110px;width:110px;left:-84px!important;padding:10px 0}.themeMenuContainer .themeMenu{padding:0 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement{cursor:pointer;margin:5px;height:20px;width:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement:hover{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}.themeMenuContainer .themeMenu .themeSelected{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}@media screen and (min-width:1161px){#mediumNav,#shortNav,#headerLinksCompact{display:none}#largeNav{margin-left:10px;margin-right:0}}@media screen and (max-width:1160px) and (min-width:960px){.companyLogo{width:100%}.customFilterMainSpan .select2-container{width:300px!important}*{zoom:1!important}}@media screen and (max-width:960px){.bodyContents{margin:0!important}#centerPanel{width:100%!important}.col-md-3#headerLinks{padding:5px 5px 0}.menuBar .col-md-9,.col-md-3#headerLinks{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-width:80px}.menuBar .col-md-9 .qCreate,.col-md-3#headerLinks .qCreate{display:inline-block;margin:0}.menuBar .col-md-9 .qCreate img,.col-md-3#headerLinks .qCreate img{margin-bottom:3px;margin-right:5px}.menuBar .col-md-9 .qCreate ul li.title,.col-md-3#headerLinks .qCreate ul li.title{padding:5px 0 0 15px}.menuBar .col-md-9 li.tabs:first-child>a,.col-md-3#headerLinks li.tabs:first-child>a{padding:10px 12px 9px}.customFilterMainSpan .select2-container{width:300px!important}#quickCreateModules{width:100%!important;padding:0!important}.CompactQC{max-height:300px;overflow-y:scroll;overflow-x:hidden}.CompactQC a:hover{text-decoration:none}}.commonActionsContainer .quickActions{height:3em}.commonActionsContainer .quickActions img{height:60%;margin:40% auto}.commonActionsContainer .quickActions #companyLogo-container img{height:98%;margin:0 auto}.commonActionsContainer .actionsContainer{background:#f3f3f3}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown{min-width:715px;top:28px;margin:0;padding-top:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a{padding:2px;border:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mainContainer{min-height:500px;margin-top:103px;background:#eeeff2;min-width:1200px}.mainContainer>.col-md-2{// padding:0 1.06383%;height:auto!important;// min-width:174px}.mainContainer .contentsDiv{min-height:500px;background:#fafafb;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;border-left:1px solid #e6e6e6;position:relative}.mainContainer #leftPanel{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.toggleButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;left:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-left:0;display:inline-block}.toggleButton .glyphicon-chevron-left{background-position:-434px -72px!important}.toggleButton .glyphicon-chevron-right{background-position:-460px -72px!important}.toggleRightPanelButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;right:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-right:0;display:inline-block}.quickLinksDiv{margin:10px 0}.quickLinksDiv p{font-size:1.2em;padding:3% 0 0 6%;height:40px;cursor:pointer;box-shadow:0 0 0 1px #ddd;border-top:1px solid #fff!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);position:relative;border-radius:2px}.quickLinksDiv p a{color:#2b2b2b}.quickLinksDiv p a:hover{text-decoration:none}.quickLinksDiv p.selectedQuickLink{background-color:#2a2f35;background-image:-moz-linear-gradient(top,#2a2f35,#2a2f35);background-image:-ms-linear-gradient(top,#2a2f35,#2a2f35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#2a2f35),to(#2a2f35));background-image:-webkit-linear-gradient(top,#2a2f35,#2a2f35);background-image:-o-linear-gradient(top,#2a2f35,#2a2f35);background-image:linear-gradient(top,#2a2f35,#2a2f35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2a2f35',endColorstr='#2a2f35',GradientType=0);border-color:#2a2f35 #2a2f35 #08090a;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);background-image:none;position:relative;border:1px solid #fff;box-shadow:4px 0 3px -4px #000 inset}.quickLinksDiv p.selectedQuickLink a{color:#fff}.quickLinksDiv p.selectedQuickLink a:after{border-bottom:19px solid rgba(0,0,0,0);border-left:10px solid #2a2f35;border-top:19px solid rgba(0,0,0,0);content:" ";display:inline-block;position:absolute;left:100%;top:0}.quickWidgetContainer li a{overflow:hidden;white-space:normal;padding:5px;margin:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.quickWidgetContainer .quickWidget{margin-bottom:10px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.sidebarTitleBlock{padding:12px 0}.sidebarTitleBlock a{color:#373737!important}.sidebarTitleBlock a:hover{text-decoration:none}#selectAllMsgDiv,#deSelectAllMsgDiv{display:none;background-color:#fafad2;padding:.01%;text-align:center}.blockUI form,#globalmodal form{margin:0}.dashboardHeading h2{padding-bottom:8px}.dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardHeading .dropdown-menu{left:-70px;right:0}.dashboardContainer{padding:0}.dashboardContainer .dashboardHeading{padding:10px 0 0;background:#f5f5f5}.dashboardContainer .dashboardHeading h2{padding:0 0 8px 20px}.dashboardContainer .dashboardHeading .btn-toolbar{padding:3px 20px 0 0}.dashboardContainer .dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardContainer .dashboardHeading .dropdown-menu{left:-82px}.widgetsList{max-height:400px;overflow-y:auto;overflow-x:hidden}.widgetsList li{display:block}.widgetsList li a{white-space:normal;word-wrap:break-word}.dashboard_notebookWidget_view .row{margin-bottom:5px}.gridster{margin-left:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.gridster ul{width:auto;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:460px}.gridster ul{list-style:none}.gridster ul li.dashboardWidget{background:#fff;border-radius:1px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.gridster ul li.dashboardWidget .dashboardWidgetHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd;color:#444;cursor:move;padding:5px}.gridster ul li.dashboardWidget .dashboardWidgetHeader table{height:28px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .dashboardTitle{text-align:left;padding-left:10px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .widgeticons{opacity:.5;padding-right:6px}.gridster ul li.dashboardWidget .filterContainer{position:absolute;border:1px solid #ddd;background:#fff;margin-left:-7px;margin-right:3px;margin-top:4px;padding:8px 0;border-radius:0 0 5px 5px;box-shadow:0 5px 8px -5px #888}.gridster ul li.dashboardWidget .filterContainer div span{margin-top:6px}.gridster ul li.dashboardWidget .filterContainer .col-md-5{margin-top:3px}.gridster ul li.dashboardWidget .dashboardWidgetContent{padding:10px 0;line-height:20px}.gridster ul li.dashboardWidget .dashboardWidgetContent .dashboard_notebookWidget_viewarea{height:200px}.gridster ul li.dashboardWidget .widgeticons{min-width:50px;height:30px;margin-right:30px}.gridster ul li.dashboardWidget .widgeticons a{cursor:pointer;text-decoration:none}.gridster ul .widgetChartContainer{margin-left:10px}.listViewPageDiv{margin:11px 0}.customFilterMainSpan{width:100%}.customFilterMainSpan .select2-container{width:95%!important}.select2-container .select2-choice{border-radius:2px;background:#fff;border-color:#ddd;font-size:14px;letter-spacing:.01em;color:#2b2b2b}.select2-container .select2-choice div{border-radius:0;border-left:0;background:#fff}.select2-drop{border-color:#ddd}.select2-dropdown ul.filterActions{list-style:none!important;padding-left:15px}.select2-dropdown ul.filterActions li{cursor:pointer}.ui-autocomplete .ui-menu-item #ui-active-menuitem{background:#404952;border-radius:0}li.ui-timepicker-selected,.ui-timepicker-list li:hover,.ui-timepicker-list:hover .ui-timepicker-selected:hover{background:#404952}#relatedTabOrder .select2-input{min-width:200px}.alphabetSorting .alphabetSearch a{vertical-align:middle;display:inline-block;margin-bottom:2px}.alphabetSorting .alphabetSearch:hover{background:#eeeff2}.listViewActions .settingsIcon{display:inline-block;margin-left:5px}.listViewActions>.btn-group{min-width:105px}#listViewPageJumpDropDown,#relatedListPageJumpDropDown{left:-60px}.pageNumbers{display:inline-block;margin-right:5px;margin-top:6px;vertical-align:top}.pageNumbers .totalNumberOfRecords{margin:0 5px}.contents-topscroll,#reportDetails{overflow-x:auto!important;overflow-y:visible}.contents-bottomscroll{overflow-x:auto!important}.bottomscroll-div,.topscroll-div{display:table;min-width:100%}.listViewLoadingImageBlock{background:0;border-radius:0;box-shadow:none;text-align:center}.detailViewContainer{padding:0 20px}.userPreferences .contents{padding-left:0!important}.userPreferences .details{border-right:0!important}.detailViewTitle{padding:1% 0 0 1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .recordLabel{font-size:16px;font-weight:bold}.detailViewTitle .detailViewButtoncontainer{margin-top:8px}.detailViewTitle .detailViewPagingButton{margin-top:8px;padding-right:10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .btn-toolbar{margin:0}.detailview-table th,.detailview-table td{vertical-align:middle}.detailview-table th label,.detailview-table td label{margin-bottom:3px}.detailViewInfo{box-shadow:0 -4px 4px -4px #959595;margin-top:5px}.detailViewInfo .details{// min-height:600px;padding-right:1.5%;border-right:4px solid #404952;padding-bottom:10px;padding-top:10px}.detailViewInfo .related .nav-pills .active>a,.detailViewInfo .related .nav-pills .active>a:hover{background:#404952;border-radius:1px;margin-top:0;margin-bottom:2px}.fieldLabel{width:20%;background:#f7f7f9}.fieldLabel label.marginRight10px{text-align:right}.summaryView{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.summaryView .summary-table tr.summaryViewEntries:last-child .fieldValue,.summaryView .summary-table tr.summaryViewEntries:last-child .fieldLabel{border-bottom:1px solid #ddd}.summaryView .summaryViewEntries .fieldLabel{vertical-align:top;padding:5px 0 5px 5%;border-top:1px solid #ddd;border-right:1px solid #ddd}.summaryView .summaryViewEntries .fieldValue{vertical-align:top;padding:5px 0 5px 5px;border-top:1px solid #ddd}.summaryView .summaryViewEntries:hover .summaryViewEdit{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryView .summaryViewEntries .summaryViewEdit{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryView .toggleViewByMode{margin:8px 0;padding-right:0}.summaryView .toggleViewByMode .changeDetailViewMode{white-space:normal!important}.summaryWidgetContainer{border-radius:2px;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border:1px solid #eaeaea;background:#fff;margin-bottom:10px;padding:15px}.commentContainer .commentTitle{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;margin-bottom:10px}.commentContainer .commentTitle textarea{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordDetails .squeezedWell{padding:3% 0;min-height:105px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordEditView .contentHeader{padding:.5% 0 1% 0}.recordEditView .table .fieldLabel,.recordEditView .table .fieldValue{vertical-align:middle}.recordEditView .table tbody tr:hover td,.recordEditView .table tbody tr:hover th{background:#f7f7f9}.commentContainer{border-radius:2px}.commentContainer hr{margin:0!important}.commentContainer .addCommentBlock .commentsControls{display:inline-block}.commentContainer .commentsList>.liStyleNone>.commentDetails .commentDiv{width:100%}.commentContainer .commentDetails{background:#fff;border:1px solid #ddd;margin-bottom:5px;border-radius:2px;padding:10px 10px 5px;display:inline-block;min-width:354px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentContainer .commentorInfo p{margin-bottom:0}.commentContainer .addCommentBlock{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border:1px solid #ddd;padding:12px 12px 5px;min-height:115px;margin-top:15px;display:block}.commentContainer .addCommentBlock .commentcontent{padding:8px!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;resize:none}.commentContainer .commentInfoContent{padding:1px 0;word-wrap:break-word}.commentTitle .col-md-1{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentTitle .col-md-1 img{width:32px;height:32px}.commentsList>ul{margin-left:0}.singleComment .editedStatus{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:5px 0 5px 32px}.singleComment .editedStatus p{margin-bottom:0}.singleComment .commentActionsDiv{display:none}.singleComment .commentActionsDiv p{margin-bottom:0}.singleComment:hover .commentActionsDiv{display:block;margin-bottom:3px}.recentComments{margin:0;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recentComments .commentDiv{min-width:100%}.recentComments .addCommentBlock{border:0;margin-top:0;display:block}.recentComments .commentDetails{display:block}.singleComment:hover .commentActions .replyComment{display:inline-block}.commentActionsContainer a:hover{text-decoration:none}.commentActionsContainer .editStatus{padding:5px 2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentActionsContainer .editStatus p{margin-bottom:0}.table{background:#fff}.table-bordered{border-radius:1px;margin-bottom:0}.table-bordered th{border-top:1px solid #fff!important}.table th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;color:#444}.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td,.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td{border-left:0;border-right:0}.listViewEntriesTable tbody tr td:first-child{border-left:0 none}.equalSplit td:nth-child(odd){width:20%}.equalSplit td:nth-child(even){width:30%}td.fieldValue input,td.fieldValue .input-group{margin-bottom:0}.actionImage,.actionImages{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.listViewHeaders a{color:#444}.listViewEntriesDiv .listViewHeaders th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd}.listViewEntriesDiv,.listViewEntriesDiv td{overflow:visible}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues{color:#444}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues:hover{text-decoration:none}.listViewEntriesTable td.listViewEntryValue,.listViewEntries td{vertical-align:middle;cursor:pointer;overflow:visible;padding:5px}.listViewEntriesTable td.listViewEntryValue:hover .actionImages,.listViewEntries td:hover .actionImages,.listViewEntriesTable td.listViewEntryValue:hover .actions,.listViewEntries td:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryViewEntries .summaryViewEdit,.activityStatus .editStatus,.activityDescription .editDescription,.addedCalendars .actionImage{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryViewEntries:hover .fieldValue .summaryViewEdit,.activityStatus:hover .editStatus,.activityDescription:hover .editDescription,.addedCalendars:hover .actionImage{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewEntriesTable tr:hover td .actions .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewBasicAction.dropdown-menu{width:100%}.listViewBasicAction.dropdown-menu input{border-radius:2px;height:24px;margin-bottom:0;margin-top:-2px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.emptyRecordsDiv{width:100%;border:1px solid #ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.emptyRecordsDiv td{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.CustomFilterViewTitle{padding-top:1%}#CustomView .filterActions{padding-bottom:20px;overflow:hidden}.filterConditionsDiv{padding-bottom:0}.conditionGroup .header{margin-bottom:20px;font-size:1.2em}.conditionGroup .contents .conditionRow{margin-bottom:10px}.conditionGroup .contents .conditionRow select,.conditionGroup .contents .conditionRow input{width:90%}.conditionGroup .contents .conditionRow .chzn-results li{line-height:20px}.conditionGroup .deleteCondition{vertical-align:bottom}.searchUIBasic{border-collapse:separate!important;border-spacing:10px!important;margin:0 10%}.searchUIBasic .importContents{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.searchUIBasic .listRow .listViewHeaders>td{color:#404952}.searchUIBasic .listRow .defaultInputTextContainer{max-width:87%!important;margin-bottom:0!important}#lineItemTab.table tr:first-child:hover th ~ td{background-color:#f3f3f4;background-image:-moz-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-ms-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f3f3f4),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-o-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:linear-gradient(top,#f3f3f4,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f4',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}#lineItemTab.table tr:nth-child(2):hover td{background:0}.lineItemTable tr td{width:0}.lineItemTable tr td div.finalDiscountUI,.lineItemTable tr td div.discountUI,.lineItemTable tr td div#shipping_handling_div,.lineItemTable tr td div.taxUI,.lineItemTable tr td div.finalTaxUI{border:2px solid #c4c4c4;border-radius:2px}.lineItemTable tr td div.finalDiscountUI table tr td,.lineItemTable tr td div.discountUI table tr td,.lineItemTable tr td div#shipping_handling_div table tr td,.lineItemTable tr td div.taxUI table tr td,.lineItemTable tr td div.finalTaxUI table tr td,.lineItemTable tr td div.finalDiscountUI table tr th,.lineItemTable tr td div.discountUI table tr th,.lineItemTable tr td div#shipping_handling_div table tr th,.lineItemTable tr td div.taxUI table tr th,.lineItemTable tr td div.finalTaxUI table tr th{border-left:0}.lineItemTable tr:hover td{width:0}.lineItemTable tr:hover td div.finalDiscountUI table tr td{background:none!important}.lineItemTable tr:hover td div.discountUI table tr td{background:none!important}.lineItemTable tr:hover td div#shipping_handling_div table tr td{background:none!important}.lineItemTable tr:hover td span.taxDivContainer div table tr td{background:none!important}.lineItemTable tr:hover td div.finalTaxUI table tr td{background:none!important}.lineItemResult{width:70.5%!important}.lineItemResult a:hover{color:#404952}.lineItemInputBox{width:45%;float:right;text-align:right}.discountUI,.taxUI,.finalDiscountUI,.finalTaxUI,#shipping_handling_div{position:absolute;left:46%;width:30%;z-index:500;box-shadow:1px 0 7px #ddd;border-radius:6px}.discountUI table.table,.taxUI table.table,.finalDiscountUI table.table,.finalTaxUI table.table,#shipping_handling_div table.table{margin-bottom:0}.discountUI .table tbody tr:first-child th:first-child,.taxUI .table tbody tr:first-child th:first-child,.finalDiscountUI .table tbody tr:first-child th:first-child,.finalTaxUI .table tbody tr:first-child th:first-child,#shipping_handling_div .table tbody tr:first-child th:first-child{border-radius:4px 0 0 0!important}.discountUI .table tbody tr:first-child th:last-child,.taxUI .table tbody tr:first-child th:last-child,.finalDiscountUI .table tbody tr:first-child th:last-child,.finalTaxUI .table tbody tr:first-child th:last-child,#shipping_handling_div .table tbody tr:first-child th:last-child{border-radius:0 4px 0 0!important}.LineItemDirectPriceReduction{width:65%!important}th.htColHeader,.handsontable thead th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd;padding:6px 2px}.contentHeader{padding:15px;padding-left:5px;line-height:20px}.contentsDiv>div{padding:0 20px}#settingsQuickWidgetContainer .widgetContainer.accordion-body{border-bottom:none!important;border-bottom:3px solid #ddd}#settingsQuickWidgetContainer .widgetContainer.accordion-body>div:hover{background:#eeeff2}#settingsShortCutsContainer{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:1% 3%}#settingsShortCutsContainer .moduleBlock{min-height:60px}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin{display:inline-block;opacity:.4}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin:hover{opacity:.8}.settingsIndexPage .settingsSummary{text-align:center;margin-top:10px}.settingsIndexPage .settingsSummary a{display:inline-block;background:#f3f3f4;color:#444;border-radius:2px;min-width:200px;padding:20px 0 10px;border:1px solid #ddd}.settingsIndexPage .settingsSummary a .summaryText{display:inline-block;margin-top:20px;font-size:15px}.settingsIndexPage .settingsSummary a:hover .summaryText,.settingsIndexPage .settingsSummary a:hover .summaryCount{color:#404952}.settingsIndexPage .moduleBlock h5{font-size:1.2em;margin-bottom:5px}.settingsIndexPage .moduleBlock:hover{background:#f3f3f4}#userPageHeader{padding:8px 0 0}#userPageHeader #userHeading h3{margin-top:10px}.treeView li{border-left:4px solid #ddd;list-style:none;padding-top:15px}.treeView li .toolbar-handle{margin-left:10px;position:relative}.treeView li .toolbar-handle .btn{margin:0}.treeView li .toolbar-handle a:before{background:none repeat scroll 0 0 #ddd;content:" ";display:inline-block;height:4px;left:-10px;position:absolute;top:12px;width:10px}.treeView .btn{margin-bottom:10px}.profilesEditView tr.blockHeader th{text-align:center}.profilesEditView tr.blockHeader th:first-child{text-align:left}.profilesEditView input{margin-right:5px}.profilesEditView tr td.row table.table{border-left:none;margin-bottom:20px}.profilesEditView tr:hover td.row{background:0}.profilesEditView tr:hover td.row table.table tr td{background:0}.profilesEditView tr:hover td.row table.table tr:hover td{background:0}.profilesEditView tr:hover td.row table.table td{background:#f3f3f4}#s2id_memberList li>div,.groupMembersColors li>div{margin-left:10px}#s2id_memberList .Users,.groupMembersColors .Users{background-color:#f99984!important;padding:5px;margin-bottom:2px;background-image:none}#s2id_memberList .Groups,.groupMembersColors .Groups{background-color:#acd5ff!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .Roles,.groupMembersColors .Roles{background-color:#ffec98!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .RoleAndSubordinates,.groupMembersColors .RoleAndSubordinates{background-color:#c4dea2!important;background-image:none;padding:5px;margin-bottom:2px}.collectiveGroupMembers{border:1px solid #ddd;border-top:0}.collectiveGroupMembers ul{padding:0;margin:0}.collectiveGroupMembers ul li{padding:4px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.collectiveGroupMembers ul li a{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;margin:0}.collectiveGroupMembers ul li.groupLabel{background-color:#f3f3f4;border-bottom:1px solid #ddd;border-top:1px solid #ddd;padding:10px 5px;margin:0;color:#444}.mini-slider-control{width:50px}.mini-slider-control+div{margin-left:15px}.mini-slider-control .ui-slider-handle{border:0;border-radius:50%;height:16px;top:-2px;width:16px;cursor:pointer}.mini-slider-control .ui-slider-handle:focus{outline:0}.ui-widget-content{border-radius:6px;border-color:#fff;box-shadow:0 0 3px -1px inset;margin-top:2px;margin-left:5px;height:12px}.ui-slider-disabled{opacity:.5;border-color:#ddd;box-shadow:none;cursor:not-allowed}.ui-slider-disabled .ui-slider-handle{cursor:not-allowed}.ui-slider-disabled+div{opacity:.5;cursor:not-allowed}.mini-slider-control[data-value="0"] .ui-slider-handle{background:#7d7e7d;background:-moz-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#7d7e7d),color-stop(100%,#0e0e0e));background:-webkit-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-o-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-ms-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:linear-gradient(to bottom,#7d7e7d 0,#0e0e0e 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7d7e7d',endColorstr='#0e0e0e',GradientType=0)}.mini-slider-control[data-value="1"] .ui-slider-handle{background:#ffb76b;background:-moz-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ffb76b),color-stop(0%,#ffa73d),color-stop(49%,#ff7c00),color-stop(100%,#ff7f04));background:-webkit-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-o-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-ms-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:linear-gradient(to bottom,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffb76b',endColorstr='#ff7f04',GradientType=0)}.mini-slider-control[data-value="2"] .ui-slider-handle{background:#bfd255;background:-moz-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#bfd255),color-stop(79%,#8eb92a),color-stop(100%,#72aa00),color-stop(100%,#9ecb2d));background:-webkit-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-o-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-ms-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:linear-gradient(to bottom,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bfd255',endColorstr='#9ecb2d',GradientType=0)}#moduleManagerContents{padding-bottom:10px}#moduleManagerContents .moduleManagerBlock .btn-group.open .dropdown-menu{left:-144%}#moduleManagerContents .modulesTable td{width:50%}#importModules .contents .row{margin-bottom:2.2%}.extensionWidgetContainer{background-color:#fff;border:1px solid #ddd;min-height:200px;padding:2%;background:#fafafa;box-shadow:0 0 10px -4px #777}.extensionWidgetContainer .extension_contents{margin-top:2%;background:#fff;padding:10px;box-sizing:border-box;max-height:160px}.extension_contents:hover{border-radius:4px}.thumbnailImage{height:130px;width:130px;float:right}.extensionWidgetContainer .extension_contents .slimScrollDiv{padding-right:10px}.extensionWidgetContainer .extension_header .font-x-x-large{font-size:1.5em;padding-left:3px;font-weight:bold;color:#404952}.extensionWidgetContainer .extensionDescription{line-height:20px}.extensionWidgetContainer .extensionInfo{padding-top:5px}.extensionWidgetContainer .extensionInfo .rating,.extensionDetails .rating{vertical-align:middle;margin-top:2px;display:inline-block}.extensionDetails .authorInfo{margin:3px 0}.extensionDetails .extensionDetailActions{padding:15px 0}.extensionWidgetContainer .tab-pane .bx-wrapper .imageSlider{margin:0}.sliderImage{width:90%;height:360px}.opacity .actions{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.opacity:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.sharingAccessDetails{margin-bottom:30px}.sharingAccessDetails td,.sharingAccessDetails th{text-align:center;vertical-align:middle!important}.sharingAccessDetails tr td:first-child,.sharingAccessDetails tr th:first-child{text-align:left}.sharingAccessDetails td.row>div{display:block}.sharingAccessDetails .customRuleContainer:hover{background:0}.sharingAccessDetails hr{border-bottom:1px solid #bcbcbc}.sharingAccessDetails .title{padding:1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.sharingAccessDetails .title .rulehead{padding-top:5px}.sharingAccessDetails .customRuleEntries:hover .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.layoutContent{border-top:4px solid #404952}.layoutContent #moduleBlocks .editFieldsTable{margin-bottom:20px}.layoutContent #moduleBlocks .editFieldsTable .fieldLabel{background:0}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockLabel{padding-top:13px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group{margin-top:5px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group .dropdown-menu{left:-100%}.layoutContent .relatedTabModulesList{padding:2% 1%}.fieldDetailsForm .search-choice-close{padding:0}.border1px{border:1px solid #ddd}.blockFieldsList .opacity{margin-left:.5%!important}.blockFieldsList .opacity .dropdown-menu a{padding:0!important}.blockFieldsList .opacity a.dropdown-toggle.editFieldDetails{box-shadow:none}.blockFieldsList .editFields .dropdown-menu{z-index:1000003;padding:0;left:-215px;position:absolute}.blockFieldsList .editFieldsWidget .dropdown-menu{z-index:1000003;padding:0;left:-315px;position:absolute}.blockFieldsList .editFields .dropdown-menu .modal-header{border-width:0;border-bottom-width:1px}.blockFieldsList .editFields .dropdown-menu .modal-header .cancel{padding-right:0;font-weight:bold}.blockFieldsList .editFields:hover{background:#f3f3f4!important}#modulePickListValuesContainer .layoutContent{padding-left:2%}#modulePickListValuesContainer .layoutContent .selectedCell,#modulePickListValuesContainer .layoutContent .selectedListItem{background:#a5afb9;white-space:nowrap}#modulePickListValuesContainer .layoutContent .pickListValue{cursor:pointer}.nonEditableValuesDiv .nonEditablePicklistValues{margin-left:0}.nonEditableValuesDiv .nonEditablePicklistValues li{padding:3px 15px;margin-bottom:2px;background:#e0f2ff}.popover{z-index:1000023!important}.popover-content .fieldLabel{width:35%;white-space:normal}#dependencyGraph .tableHeading{text-align:center;padding-top:30px;font-size:1.2em;font-weight:bold}#dependencyGraph .depandencyTable{border:1px solid #ddd;background:#f3f3f4}#dependencyGraph .depandencyTable .blockHeader{border-bottom:1px solid #ddd}#dependencyGraph .depandencyTable .picklistValueMapping{border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping{text-align:center;border-left:1px solid #ddd;border-right:1px solid #ddd;background:#fff}#dependencyGraph .dependencyMapping .mCSB_container{margin-bottom:16px!important}#dependencyGraph .dependencyMapping .pickListDependencyTable{border:0}#dependencyGraph .dependencyMapping .pickListDependencyTable .blockHeader th{background:#f3f3f4;border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping .pickListDependencyTable .selectedCell{background:#a5afb9}.webformFieldInfo{margin-bottom:250px}.targetFieldsTableContainer input[type="text"]{min-width:100px}#customRecordNumbering.table thead th{vertical-align:middle}.addMailBoxBlock{margin-left:83px;padding:0!important;font-size:12px}.addMailBoxStep{background:#fff;padding:30px 0;border:1px solid #ddd;border-radius:1px;min-height:170px}.mailConveterDesc{height:350px;width:96%;border:1.5px solid;border-radius:2px;border-color:#ddd;font-size:11pt;margin-top:55px;margin-left:20px;background:#fff}#mailBoxLabel{margin-top:15px;margin-left:-18px;font-size:12pt;width:75px}.mailBoxDropdownWrapper{height:49px;width:70%;background:url('../images/mailbox-icon.png') no-repeat 5px 5px;overflow:hidden;border:1px solid #ddd}.mailBoxDropdown{background:transparent url('../images/downArrowBlue.png') no-repeat 236px 13px;width:110%;height:50px;font-size:14pt;color:#0065a6;padding:10px 55px;padding-right:0}#mailConverterDragIcon{margin-top:12px}#mailConverterBody{padding-top:20px;margin-left:0}.ruleHead{padding:6px 0;background:#d8d8dc}.mailConverterRuleBlock{font-size:14px;line-height:30px;border:1.5px solid;border-color:#ddd}.mailConverterRuleLegend{font-size:14px;color:#0065a6;margin-bottom:10px;background:#f3f3f4}#mailConverterStats{font-size:10pt;margin-top:5px;margin-left:-10px}.addMailBoxBlock{border-color:#ddd;margin-left:83px;margin-top:20px;padding-top:30px;padding-left:200px;padding-bottom:20px;padding-right:30px;font-size:11pt}.taskTypeUi>.row{margin:10px 0}#taskListContainer .listViewEntriesTable tr td:last-child{border-left:1px solid #ddd}#workflow_step2>.row{padding:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:400px}#open_email_con .detailViewTitle{padding:0}#open_email_con .detailViewTitle .detailViewPagingButton{margin-top:0;padding-right:0}#foldersList .list-group{padding-right:0}.massEditTable th+th,.massEditTable td+td,.massEditTable th+td,.massEditTable td+th{border-left:0}.nav.massEditTabs{margin-bottom:0;border-bottom:0}.nav.massEditTabs li.active a{background:#404952;color:#fff;margin-left:10px}.nav.massEditTabs li a:hover{border-bottom:1px solid #404952}.massEditContent{border-top:3px solid #404952}.calendarSettingsContainer{width:700px}.calendarSettingsContainer .control-label{width:26%}#calendarSettings{margin:1px 0 3px}.calendarMassEdit{min-width:400px}.fc-state-default .fc-button-effect{top:100%!important}.fc-event-style1,.fc-event-style1 .fc-event-skin{background:#17309a;border-color:#17309a;font-weight:normal;text-shadow:none}.fc-event-style2,.fc-event-style2 .fc-event-skin{background:#3a87ad;border-color:#3a87ad;font-weight:normal;text-shadow:none}.fc-event-style3,.fc-event-style3 .fc-event-skin{background:#aa6705;border-color:#aa6705;font-weight:normal;text-shadow:none}.fc-event-style4,.fc-event-style4 .fc-event-skin{background:#953b39;border-color:#953b39;font-weight:normal;text-shadow:none}.fc-event-style5,.fc-event-style5 .fc-event-skin{background:#545252;border-color:#545252;font-weight:normal;text-shadow:none}.fc-event-style6,.fc-event-style6 .fc-event-skin{background:#87865d;border-color:#87865d;font-weight:normal;text-shadow:none}.fc-event-style7,.fc-event-style7 .fc-event-calendarMassEditskin{background:#c71585;border-color:#c71585;font-weight:normal;text-shadow:none}.fc-event-style8,.fc-event-style8 .fc-event-skin{background:#006400;border-color:#006400;font-weight:normal;text-shadow:none}#calendarview th{color:#000}.fc-agenda-divider+div{overflow-y:visible!important}.fc-button{display:inline-block;padding:6px .4em!important;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.fc-button:active .fc-button-inner{background:transparent}.fc-button:active .fc-button-inner .fc-button-content{color:#fff}.fc-button.fc-state-active .fc-button-inner .fc-button-content,.fc-button:active .fc-button-inner .fc-button-content{color:#000!important;background:transparent;background-image:none}.fc-header-title h2{font-size:15px;line-height:20px}.fc-widget-header th{padding:4px 0!important}.fc-widget-header{color:#666;background:#eee;border-color:#ccc}.fc-content{background:#fff;margin-top:15px}.fc-content td:hover{background:#f3f3f3}.btn:focus{outline:0}.reminderPostpone.btn-primary{background:#404952}.reminderPostpone.btn-primary:hover{background:#1e2327}.saveButton{margin-right:5px}.addCustomRule{float:right}.importMore{background:#fff}.lastImport{background:#fff}.undoImport{background:#da4f49}.close{border:0;background:none repeat scroll 0 0 transparent;border:0 none;cursor:pointer}.resetButton{margin-top:0!important}.vtGlyph{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("../images/vtGlyph.png");background-position:0 0;background-repeat:no-repeat;*margin-right:.3em}.vticon-pageJump{background-position:0 0}.vticon-call-inbound{background-position:-14px 0}.vticon-call-outbound{background-position:-28px 0}#massEdit .cancelLinkContainer{padding:5px 0;margin-left:.5em}.ui-pnotify{z-index:1000023}.feedback{z-index:10002}.feedback .handle{z-index:10003;display:block;position:fixed;bottom:50px;left:-30px;left:0\9;bottom:100px\9;background:#2c2c2c;color:white;padding:7px 15px;border:1px solid gray;text-decoration:none;outline:0;-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-o-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg);-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.00000000, M12=1.00000000, M21=-1.00000000, M22=0.00000000,sizingMethod='auto expand')";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0,M12=1,M21=-1,M22=0,sizingMethod='auto expand')}.feedback .handle:hover{text-decoration:none}.vtFooter{text-align:center}.vtFooter p{background:#404952;color:#fff;border-top:1px solid #ddd;padding:1px 0;font-size:.9em;margin-bottom:0}.vtFooter p a{color:#fff}.imageHolder{background:url('../images/loadback.png') repeat-y;background-position:center;padding:10px 0}.breadcrumbContainer{padding:2% 2% 0 2%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;height:auto}.breadcrumb{display:inline-block;height:auto;height:40px}.crumbs{height:40px;margin:0;padding:0 20px 0 0;display:inline-block;font-family:sans-serif}.crumbs li:after{content:'\0000a0';width:0;height:0;border-left:18px solid #ececec;border-top:20px solid transparent;border-bottom:20px solid transparent;display:inline-block;position:relative;top:-20px;left:18px;zoom:1}.crumbs li{height:0;border-top:20px solid #ececec;border-bottom:20px solid #ececec;border-left:20px solid transparent;display:inline-block;box-shadow:0 1px #ddd;margin-right:5px}.crumbs li a{display:inline-block;float:left;margin-top:-13px;font-size:14px;font-weight:bold;color:#666;text-decoration:none}.crumbs li.active{height:0;border-top:20px solid #404952;border-bottom:20px solid #404952;box-shadow:0 1px #404952}.crumbs li.active:after{border-left:18px solid #404952!important}.stepText{display:inline-block;white-space:nowrap;overflow:hidden;font-size:13px;vertical-align:bottom}.active .stepText,.active .stepNum{color:#fff}.stepNum{display:inline-block;padding:0 5px;overflow:hidden;font-size:20px;vertical-align:top;margin-top:5px}.greyStar{background-image:url("../images/stars.png");background-position:20px 20px;height:20px;width:20px;display:inline-block}.yellowStar{background-image:url('../images/stars.png');background-position:0 20px;width:20px;height:20px;display:inline-block}.blockUI{border-radius:2px!important;border:0!important}textarea.col-md-11{width:100%!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.popover .popover-inner{border-radius:2px;font-size:.8em;box-shadow:0}.popover .popover-inner .popover-title{color:#444;font-size:15px}.popover .popover-inner .close{color:#000!important;margin-top:3px;opacity:.5!important}.popover .popover-inner .close:hover{opacity:1!important}.popover .popover-inner td{padding:3px 5px;overflow-wrap:break-word}.popover .popover-inner .detailViewInfo{margin-top:0;box-shadow:0}.popover .popover-inner .detailViewInfo .fieldLabel label{font-size:1em}#findDuplicate>.control-group{margin-bottom:0;width:400px}#moveReports .modal-body{padding:20px 40px}#composeEmailContainer{padding:0 20px}#composeEmailContainer .MultiFile-wrap{display:inline-block}#composeEmailContainer .MultiFile-intercepted .ui-wrapper{min-height:400px}#transferOwnershipContainer .select2-container.select2-container-multi{max-width:220px}.fieldInfo.in{overflow:visible!important;height:auto!important}.moduleSelection{border-radius:2px 2px 0 0!important;border:1px solid #ddd!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);color:#444}.convertLeadModules{margin-bottom:2%;border:1px none}.moduleBlock{border-radius:0!important}.overflowVisible{overflow:visible!important}.convertLeadError{border:3px solid #999;background-color:#fff;width:55%;position:relative;z-index:10000000}.convertLeadError table td{border-bottom:1px solid #ccc;nowrap:nowrap;width:70%}.bootbox,.alert{z-index:1000023}.chzn-container{vertical-align:middle}.chzn-container .chzn-results li{margin-right:7px}.chzn-container .chzn-results .highlighted{background:#404952}.select2-results .select2-highlighted{background:#404952}.select2-result-label i{background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.ui-autocomplete-loading{background:url('../images/load.gif') no-repeat right center}.ui-autocomplete{height:auto!important;border-radius:1px!important}.dropdown-menu.pull-right:after,.dropdown-menu.pull-right:before{right:3px;left:auto;top:-5px;border-bottom-width:6px}span.wrapper a{color:#08c!important;font-size:15px!important;font-weight:bold}a{color:#353c44}a:hover{color:#1e2327;text-decoration:none;cursor:pointer}a:active,a:focus{outline:0}.well{border-radius:2px;padding:15px}.verticalBottomSpacing{margin-bottom:10px}.mergeTables{margin-bottom:0}.font-x-x-large{font-size:18px;line-height:28px}form{margin:0}.fc-state-default .fc-button-effect span{background:0}.dateField{width:183px}.form-horizontal [class^="icon-"],.form-horizontal [class*=" icon-"]{vertical-align:baseline}.timePicker{width:8.5em!important;z-index:1000029!important}.datepicker{z-index:1000029!important}.colorpicker{z-index:1029!important}.colorpicker input{width:30px!important}.colorpicker input[type="text"],.colorpicker input{color:#898989!important}.colorpicker_hex input{width:45px!important}.modal-body.accordion{margin-bottom:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}//.modal-open{// overflow:hidden;//}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.removeNoFileChosen{color:transparent!important}.modelContainer .modal-header{border-radius:2px 2px 0 0}.modelContainer form{border-radius:0 0 2px 2px}.hide{display:none}i{cursor:pointer;text-decoration:none!important}.marginbottomZero{margin-bottom:0!important}.marginLeftZero{margin-left:0!important}.marginRightZero{margin-right:0!important}.clearfix{clear:both!important}textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%}.textOverflowEllipsis{overflow:hidden;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;//width:9em}.margin0px{margin:0!important}.padding10{padding:10px;padding-bottom:0}.padding20{padding:20px}.pushDown{margin-top:5px}.boxSizingBorderBox{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.boxSizingContentBox{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.cursorPointer{cursor:pointer;text-decoration:none!important}.zeroOpacity{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.dullOpacity{opacity:.8;-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80)}.fullOpacity{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.redColor{color:red}.highlightBackgroundColor{background:#eeeff2}.contentsBackground{background:#fff;border:1px solid #ddd}.textAlignCenter{text-align:center}.textAlignRight{text-align:right}.alignMiddle{vertical-align:middle}.alignTop{vertical-align:top}.padding1per{padding:1%}.paddingTop20{padding-top:20px}.padding20px{padding:20px}.padding-bottom1per{padding-bottom:1%}.marginBottom10px{margin-bottom:10px}.displayInlineBlock{display:inline-block}.backgroundImageNone{background-image:none}.liStyleNone{list-style:none outside none}.fontBold{font-weight:bold!important}.livesupport_tab,#userfeedback{display:none!important}#reportDetails table tr td.summary{border-bottom:0;border-top:0}#portalDetailViewHttpError{padding-bottom:7px;margin-top:50px;color:red;text-align:center}.slidesjs-pagination{list-style:none}.slidesjs-pagination li a{display:block;width:13px;height:0;padding-top:13px;background-image:url('../images/pagination.png');background-position:0 0;float:left;overflow:hidden}.slidesjs-pagination li a.active,.slidesjs-pagination li a:hover.active{background-position:0 -13px}.extensionStorebtn{background:#f08c39;background-image:-webkit-linear-gradient(top,#f08c39,#e68b3c);background-image:-moz-linear-gradient(top,#f08c39,#e68b3c);background-image:-ms-linear-gradient(top,#f08c39,#e68b3c);background-image:-o-linear-gradient(top,#f08c39,#e68b3c);background-image:linear-gradient(to bottom,#f08c39,#e68b3c);-webkit-border-radius:2;-moz-border-radius:2;border-radius:2px;text-shadow:0 0 1px #595959;color:#fff;font-size:14px;font-weight:bold;padding:8px 20px 8px 20px;text-decoration:none;border:0}.extensionStorebtn:hover{background:#fc9f3c;background-image:-webkit-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-moz-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-ms-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-o-linear-gradient(top,#fc9f3c,#f08a3c);background-image:linear-gradient(to bottom,#fc9f3c,#f08a3c);text-decoration:none}.extensionSearch{padding:8px 12px 8px 30px!important;margin:6px 0 14px 0;box-shadow:inset 2px 2px 10px #ddd;border-radius:2px!important;background:url('../images/search.png') no-repeat;background-position:5px 6px}.banner-container{border-bottom:1px solid #fff;box-sizing:border-box}.banner{margin:0 90px}.bx-wrapper{margin:0 auto 35px!important;padding-top:17px!important}.bx-wrapper li a{display:block}.bx-wrapper a img{height:100px;width:auto;margin:0 auto}.wide,.table td.wide,.listViewEntries td.wide,td.listViewEntryValue.wide{padding:8px!important}.medium,.table td.medium,.listViewEntries td.medium,td.listViewEntryValue.medium{padding:5px 6px!important}.narrow,.table td.narrow,.listViewEntries td.narrow,td.listViewEntryValue.narrow{padding:2px 4px!important}.table thead th.narrow{vertical-align:middle}td.listViewEntryValue .row input{padding:0;margin-bottom:0}.listViewContentDiv{position:relative}.fieldLabel .pull-right{text-align:right}#tagRecordText{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;width:80%!important}#tagRecord{margin-left:5px!important}.tag{float:right!important}.cut-string{text-overflow:ellipsis;-o-text-overflow:ellipsis;-webkit-text-overflow:ellipsis;width:200px;white-space:nowrap;overflow:hidden}.paddingLRZero{padding-left:0;padding-right:0}.paddingRightZero{padding-right:0}.detailViewToolbar{margin-top:5px}.input-group.input-group-sm>.input-group-addon img{width:15px}table tr td .input-sm{min-width:50px}.modal-footer.backgroundColor{background-color:#f5f5f5}.panel-title{font-size:14px}.quickWidgetContainer .panel-body{padding-bottom:0;padding-top:0}tr.summaryViewEntries,#detailView table{font-size:13px}table.listViewEntriesTable{font-size:13px;margin-top:5px}.no-margin{margin:0}.companyLogo img{max-height:200px;max-width:250px}.navbar-inverse .navbar-nav>li>a{color:#fff;padding:15px 12px}.navbar-inverse .navbar-nav .dropdown-menu>li>a{padding:3px 15px;font-size:12px}.headerCalendar .month h3{font-size:18px;font-weight:bold;margin:5px 0 0 0}.columnsSelect{width:100%!important}.marginBottom5{margin-bottom:5px}.editViewContainer .recordEditView table.blockContainer tr td.fieldValue{width:30%}.recordEditView[name=QuickCreate] .quickCreateContent table tr td.fieldValue,#massEditContainer .massEditContent table tr td.fieldValue,#tab_accounts td.functionList{width:30%}.btn{white-space:normal}.valuesAssignedToRole{border:1px solid #adadad;overflow:hidden;text-overflow:ellipsis;padding:6px}table.dataTable .form-control{width:100%!important}#breadcrumb .stepNum{margin-top:0}#breadcrumb .stepText{position:relative;top:-4px}.fc button{height:auto!important}.fc-toolbar{margin-bottom:0!important}.fc-center,.fc-left,.fc-right{margin-bottom:1em}.calendarRightPanel{padding-left:5px;padding-right:5px}.calendarRightPanel ul li{margin-bottom:2px;margin-left:5px}.calendarRightPanel ul li:hover{background-color:#eee!important;border-radius:5px}.square9{width:12px;height:12px;margin:4px}.panel-dark{border-color:#737373}.panel-dark>.panel-heading{color:#fff;background-color:#737373;border-color:#737373}.panel-dark>.panel-heading+.panel-collapse>.panel-body{border-top-color:#737373}.panel-dark>.panel-heading .badge{color:#737373;background-color:#fff}.panel-dark>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#737373}.calendarRightPanel .widgetContainer ul{margin-top:5px;margin-bottom:5px}.paddingLeft5px{padding-left:5px}.marginBottom5px{margin-bottom:5px}.detailview-table .fieldValue .summaryViewEdit{display:none}.detailview-table .fieldValue:hover .summaryViewEdit{display:inherit}.icon-in-history-widget{font-size:17px;padding:4px}#prefPageHeader .logo img{height:70px;width:70px}#myPrefHeading h3{margin-top:12px}.list-user-img{width:50px;height:40px}span[name=existingImages] img{height:200px;width:300px}.narrow.fieldValue .chosen-container-single .chosen-single{height:26px;line-height:26px}.narrow.fieldValue input{height:26px}.narrow.fieldValue .input-group-addon{padding:4px 10px}.narrow.fieldValue .chosen-container-single .chosen-single div b{background-position-y:4px}.image-in-button{width:18px}.fc-time-grid .fc-time-grid-event.fc-event{min-height:27px;min-width:100px}.fc-time-grid-event.fc-short .fc-title{font-size:1em}.paddingTBZero{padding-top:0;padding-bottom:0}.dashboardWidgetContent a .glyphicon{top:-3px}.detailViewTitle .popover{min-width:130px;text-align:center}.cursorDefault{cursor:default!important}.remindersNoticeContainer{position:fixed;right:0;top:109px;z-index:1029;width:0;height:100%;bottom:30px;overflow-y:auto;background:rgba(0,0,0,0.4);border-left:1px solid #797979;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;overflow-y:auto}.remindersNoticeContainer.toggled{width:380px}.remindersContent{margin:5px 8px 0 8px}.activityTypeIcon{height:20px}.remindersNoticeContainer .panel{margin-bottom:10px}.remindersNoticeContainer .panel-body{padding:10px}.remindersNoticeContainer .actionRow a.btn{margin-right:3%}.remindersNotice{color:#fff;padding:15px 12px}.remindersNotice .glyphicon{font-size:20px}.cancelLink.btn[type='reset'],.cancel.btn[type='reset']{float:right;margin-left:5px;margin-bottom:0}.activityWidgetContainer .popover{min-width:240px}.filterActionImage{margin-left:8px}#tagRecord{line-height:25px}#tagsList .btn-info{margin-left:5px}#tagRecordInput{padding-left:15px;padding-right:15px}.clearReferenceSelection,.createReferenceRecord{padding:0 6px}.relatedPopup{padding:0 4px}.popupContainer .popupModuleName{margin-top:0}.mailRows hr{margin:0}.paddingLeftMd{padding-left:15px}.widget_header div:nth-child(2).btn-toolbar,.editViewContainer .contentHeader.row div:nth-child(2){margin-top:20px}.fieldLabel .referenceMandatory{margin-right:-12px}.ui-widget-content{padding:.8em}.ui-autocomplete .ui-autocomplete-category{font-weight:bold;line-height:1.5}.ui-autocomplete .ui-autocomplete-category:first-child{margin:.8em 0 .2em}.ui-autocomplete .ui-menu-item{padding:.2em .8em}.ui-autocomplete .ui-state-focus{border:0;background:#ebebeb}.widgetHr{margin-top:0}.headerLinksMails .btn-group{margin-top:11px}.finalDiscountUI,.finalTaxUI{bottom:5px}.sideBarTitle{font-size:20px}.globalSearchInput{width:300px}#groupsDetailContainer strong{line-height:21px}#addTaskContainer #taskStatus{margin-left:10px}.scanerMailActionsButtons{min-width:96px}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#404040}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active,.ui-menu .ui-menu-item a.ui-widget-content{font-weight:bold;margin:0;background-color:#428bca;border-color:#357ebd;color:#fff;display:block}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style:none}#layoutEditorButtons{margin-bottom:10px;margin-top:-10px}.individualTaxContainer{text-align:left!important}.input-group .autoComplete.form-control{min-width:100px}.rowName .input-group .autoComplete.form-control{min-width:200px} \ No newline at end of file diff --git a/modules/Settings/ModuleManager/models/Module.php b/modules/Settings/ModuleManager/models/Module.php index 3172f6142852..78d1351095c5 100644 --- a/modules/Settings/ModuleManager/models/Module.php +++ b/modules/Settings/ModuleManager/models/Module.php @@ -122,6 +122,7 @@ public static function createModule($moduleInformation) $module = new Vtiger_Module(); $module->name = ucfirst($moduleInformation['module_name']); $module->label = $moduleInformation['module_label']; + //$module->type = 'SupplieModule'; $module->save(); $module->initTables(); diff --git a/modules/Supplies/actions/GetDetails.php b/modules/Supplies/actions/GetDetails.php new file mode 100644 index 000000000000..d253fb92d0b2 --- /dev/null +++ b/modules/Supplies/actions/GetDetails.php @@ -0,0 +1,76 @@ + + */ +class Supplies_GetDetails_Action extends Vtiger_Action_Controller +{ + + function checkPermission(Vtiger_Request $request) + { + $moduleName = $request->getModule(); + $moduleModel = Vtiger_Module_Model::getInstance($moduleName); + $currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); + + if (!$currentUserPriviligesModel->hasModulePermission($moduleModel->getId())) { + throw new AppException(vtranslate($moduleName) . ' ' . vtranslate('LBL_NOT_ACCESSIBLE')); + } + } + + function process(Vtiger_Request $request) + { + $recordId = $request->get('record'); + $idList = $request->get('idlist'); + $currencyId = $request->get('currency_id'); + + $conversionRate = 1; + $response = new Vtiger_Response(); + $listPriceValues = $taxes = []; + $listPrice = false; + + if (empty($idList)) { + $info = $this->getRecordDetail($recordId, $currencyId); + } else { + foreach ($idList as $id) { + $info[] = $this->getRecordDetail($id, $currencyId); + } + } + $response->setResult($info); + $response->emit(); + } + + function getRecordDetail($recordId, $currencyId) + { + $conversionRate = 1; + $listPriceValues = $taxes = []; + $listPrice = false; + + $recordModel = Vtiger_Record_Model::getInstanceById($recordId); + $moduleName = $recordModel->getModuleName(); + if (in_array($moduleName, ['Products', 'Services'])) { + $taxes = $recordModel->getTaxes(); + $listPriceValues = $recordModel->getListPriceValues($recordModel->getId()); + $priceDetails = $recordModel->getPriceDetails(); + foreach ($priceDetails as $currencyDetails) { + if ($currencyId == $currencyDetails['curid']) { + $conversionRate = $currencyDetails['conversionrate']; + } + } + $listPrice = (float) $recordModel->get('unit_price') * (float) $conversionRate; + } + + $info = [ + $recordId => [ + 'id' => $recordId, + 'name' => decode_html($recordModel->getName()), + 'taxes' => $taxes, + 'price' => $listPrice, + 'listpricevalues' => $listPriceValues, + 'description' => decode_html($recordModel->get('description')), + ]]; + return $info; + } +} diff --git a/modules/Supplies/actions/MassSave.php b/modules/Supplies/actions/MassSave.php new file mode 100644 index 000000000000..587a3d75a8d4 --- /dev/null +++ b/modules/Supplies/actions/MassSave.php @@ -0,0 +1,11 @@ + + */ +class Supplies_MassSave_Action extends Vtiger_MassSave_Action +{ + +} diff --git a/modules/Supplies/actions/Save.php b/modules/Supplies/actions/Save.php new file mode 100644 index 000000000000..c3ce4d0d8632 --- /dev/null +++ b/modules/Supplies/actions/Save.php @@ -0,0 +1,23 @@ + + */ +class Supplies_Save_Action extends Vtiger_Save_Action +{ + + /** + * Function to save record + * @param $request - values of the record + * @return - record Model of saved record + */ + public function saveRecord($request) + { + $recordModel = parent::saveRecord($request); + $recordModel->saveSupplieData($request); + return $recordModel; + } +} diff --git a/modules/Supplies/fields/Basic.php b/modules/Supplies/fields/Basic.php new file mode 100644 index 000000000000..22da6b6ba3b3 --- /dev/null +++ b/modules/Supplies/fields/Basic.php @@ -0,0 +1,119 @@ + + */ +class Supplies_Basic_Field extends Vtiger_Base_Model +{ + + protected $name = ''; + protected $defaultLabel = 'LBL_CURRENCY'; + protected $defaultValue = ''; + protected $columnname = ''; + protected $dbType = 'varchar(100)'; + protected $customColumn = []; + + /** + * Geting database-type of field + * @return string dbType + */ + public function getDBType() + { + return $this->dbType; + } + + /** + * Geting template name + * @return string templateName + */ + public function getTemplateName($view) + { + return $view . $this->name . '.tpl'; + } + + /** + * Geting default label + * @return string defaultLabel + */ + public function getDefaultLabel() + { + return $this->defaultLabel; + } + + /** + * Geting field name + * @return string name + */ + public function getName() + { + return $this->name; + } + + /** + * Geting column name + * @return string columnname + */ + public function getColumnName() + { + return $this->columnname; + } + + /** + * Geting column name + * @return string columnname + */ + public function getCustomColumn() + { + return $this->customColumn; + } + + /** + * Data field instance initialization + * @param array $valueArray Array for initialization + */ + public function initialize($valueArray) + { + $this->setData($valueArray); + } + + /** + * Geting value to display + * @param type $value + * @return string + */ + public function getDisplayValue($value) + { + return $value; + } + + /** + * Geting value to display + * @param type $value + * @return string + */ + public function getEditValue($value) + { + return $this->getDisplayValue($value); + } + + /** + * Geting value + * @param type $value + * @return string + */ + public function getValue($value) + { + if ($value == '') { + return $this->get('defaultvalue'); + } + return $value; + } + + public function isMandatory() + { + return true; + } +} diff --git a/modules/Supplies/fields/Currency.php b/modules/Supplies/fields/Currency.php new file mode 100644 index 000000000000..79daa24be425 --- /dev/null +++ b/modules/Supplies/fields/Currency.php @@ -0,0 +1,16 @@ + + */ +class Supplies_Currency_Field extends Supplies_Basic_Field +{ + + protected $name = 'Currency'; + protected $defaultLabel = 'LBL_CURRENCY'; + protected $columnname = 'currency'; + protected $dbType = 'int(10)'; +} diff --git a/modules/Supplies/fields/Discount.php b/modules/Supplies/fields/Discount.php new file mode 100644 index 000000000000..8918e8ab007c --- /dev/null +++ b/modules/Supplies/fields/Discount.php @@ -0,0 +1,29 @@ + + */ +class Supplies_Discount_Field extends Supplies_Basic_Field +{ + + protected $name = 'Discount'; + protected $defaultLabel = 'LBL_DISCOUNT'; + protected $columnname = 'discount'; + protected $dbType = 'decimal(27,8) DEFAULT \'0\''; + protected $customColumn = [ + 'discountparam' => 'varchar(255)' + ]; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return CurrencyField::convertToUserFormat($value, null, true); + } +} diff --git a/modules/Supplies/fields/DiscountMode.php b/modules/Supplies/fields/DiscountMode.php new file mode 100644 index 000000000000..ed0fa34dcea8 --- /dev/null +++ b/modules/Supplies/fields/DiscountMode.php @@ -0,0 +1,28 @@ + + */ +class Supplies_DiscountMode_Field extends Supplies_Basic_Field +{ + + protected $name = 'DiscountMode'; + protected $defaultLabel = 'LBL_DISCOUNT_MODE'; + protected $defaultValue = '0'; + protected $columnname = 'discountmode'; + protected $dbType = "tinyint(1) NOT NULL DEFAULT '0'"; + protected $values = [0 => 'group', 1 => 'individual']; + + /** + * Geting value to display + * @param int $value + * @return string + */ + public function getDisplayValue($value) + { + return $this->values[$value]; + } +} diff --git a/modules/Supplies/fields/GrossPrice.php b/modules/Supplies/fields/GrossPrice.php new file mode 100644 index 000000000000..cab71085e557 --- /dev/null +++ b/modules/Supplies/fields/GrossPrice.php @@ -0,0 +1,26 @@ + + */ +class Supplies_GrossPrice_Field extends Supplies_Basic_Field +{ + + protected $name = 'GrossPrice'; + protected $defaultLabel = 'LBL_GROSS_PRICE'; + protected $columnname = 'gross'; + protected $dbType = 'decimal(27,8) DEFAULT \'0\''; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return CurrencyField::convertToUserFormat($value, null, true); + } +} diff --git a/modules/Supplies/fields/Margin.php b/modules/Supplies/fields/Margin.php new file mode 100644 index 000000000000..14ee697badc4 --- /dev/null +++ b/modules/Supplies/fields/Margin.php @@ -0,0 +1,26 @@ + + */ +class Supplies_Margin_Field extends Supplies_Basic_Field +{ + + protected $name = 'Margin'; + protected $defaultLabel = 'LBL_MARGIN'; + protected $columnname = 'margin'; + protected $dbType = 'decimal(27,8) DEFAULT \'0\''; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return CurrencyField::convertToUserFormat($value, null, true); + } +} diff --git a/modules/Supplies/fields/MarginP.php b/modules/Supplies/fields/MarginP.php new file mode 100644 index 000000000000..8b4c90aa9eee --- /dev/null +++ b/modules/Supplies/fields/MarginP.php @@ -0,0 +1,26 @@ + + */ +class Supplies_MarginP_Field extends Supplies_Basic_Field +{ + + protected $name = 'MarginP'; + protected $defaultLabel = 'LBL_MARGIN_PRECENT'; + protected $columnname = 'marginp'; + protected $dbType = 'decimal(27,8) DEFAULT \'0\''; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return CurrencyField::convertToUserFormat($value, null, true); + } +} diff --git a/modules/Supplies/fields/Name.php b/modules/Supplies/fields/Name.php new file mode 100644 index 000000000000..414b49516548 --- /dev/null +++ b/modules/Supplies/fields/Name.php @@ -0,0 +1,31 @@ + + */ +class Supplies_Name_Field extends Supplies_Basic_Field +{ + + protected $name = 'Name'; + protected $defaultLabel = 'LBL_ITEM_NAME'; + protected $columnname = 'name'; + protected $dbType = 'int(19) DEFAULT \'0\''; + protected $customColumn = [ + 'comment' => 'varchar(500)' + ]; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + if($value != 0) + return Vtiger_Functions::getCRMRecordLabel($value); + return ''; + } +} diff --git a/modules/Supplies/fields/NetPrice.php b/modules/Supplies/fields/NetPrice.php new file mode 100644 index 000000000000..a4e4aee46ebd --- /dev/null +++ b/modules/Supplies/fields/NetPrice.php @@ -0,0 +1,26 @@ + + */ +class Supplies_NetPrice_Field extends Supplies_Basic_Field +{ + + protected $name = 'NetPrice'; + protected $defaultLabel = 'LBL_NET_PRICE'; + protected $columnname = 'net'; + protected $dbType = 'decimal(27,8) DEFAULT \'0\''; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return CurrencyField::convertToUserFormat($value, null, true); + } +} diff --git a/modules/Supplies/fields/Price.php b/modules/Supplies/fields/Price.php new file mode 100644 index 000000000000..6002606ed5ec --- /dev/null +++ b/modules/Supplies/fields/Price.php @@ -0,0 +1,26 @@ + + */ +class Supplies_Price_Field extends Supplies_Basic_Field +{ + + protected $name = 'Price'; + protected $defaultLabel = 'LBL_PRICE'; + protected $columnname = 'price'; + protected $dbType = 'decimal(27,8)'; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return CurrencyField::convertToUserFormat($value, null, true); + } +} diff --git a/modules/Supplies/fields/Purchase.php b/modules/Supplies/fields/Purchase.php new file mode 100644 index 000000000000..3a7b8f05a156 --- /dev/null +++ b/modules/Supplies/fields/Purchase.php @@ -0,0 +1,26 @@ + + */ +class Supplies_Purchase_Field extends Supplies_Basic_Field +{ + + protected $name = 'Purchase'; + protected $defaultLabel = 'LBL_PURCHASE'; + protected $columnname = 'purchase'; + protected $dbType = 'decimal(27,8) DEFAULT \'0\''; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return CurrencyField::convertToUserFormat($value, null, true); + } +} diff --git a/modules/Supplies/fields/Quantity.php b/modules/Supplies/fields/Quantity.php new file mode 100644 index 000000000000..76c76aabc24b --- /dev/null +++ b/modules/Supplies/fields/Quantity.php @@ -0,0 +1,27 @@ + + */ +class Supplies_Quantity_Field extends Supplies_Basic_Field +{ + + protected $name = 'Quantity'; + protected $defaultLabel = 'LBL_QUANTITY'; + protected $defaultValue = '1'; + protected $columnname = 'qty'; + protected $dbType = 'decimal(25,3)'; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return Vtiger_Functions::formatDecimal($value); + } +} diff --git a/modules/Supplies/fields/Reference.php b/modules/Supplies/fields/Reference.php new file mode 100644 index 000000000000..deed1ebf1105 --- /dev/null +++ b/modules/Supplies/fields/Reference.php @@ -0,0 +1,28 @@ + + */ +class Supplies_Reference_Field extends Supplies_Basic_Field +{ + + protected $name = 'Reference'; + protected $defaultLabel = 'LBL_REFERENCE'; + protected $columnname = 'ref'; + protected $dbType = 'int(19)'; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + if($value != 0) + return Vtiger_Functions::getCRMRecordLabel($value); + return ''; + } +} diff --git a/modules/Supplies/fields/Tax.php b/modules/Supplies/fields/Tax.php new file mode 100644 index 000000000000..ca959bc9e346 --- /dev/null +++ b/modules/Supplies/fields/Tax.php @@ -0,0 +1,30 @@ + + */ +class Supplies_Tax_Field extends Supplies_Basic_Field +{ + + protected $name = 'Tax'; + protected $defaultLabel = 'LBL_TAX'; + protected $defaultValue = 'tax'; + protected $columnname = 'tax'; + protected $dbType = 'decimal(27,8)'; + protected $customColumn = [ + 'taxtype' => 'int(19)' + ]; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return CurrencyField::convertToUserFormat($value, null, true); + } +} diff --git a/modules/Supplies/fields/TaxMode.php b/modules/Supplies/fields/TaxMode.php new file mode 100644 index 000000000000..550d6a960d5a --- /dev/null +++ b/modules/Supplies/fields/TaxMode.php @@ -0,0 +1,28 @@ + + */ +class Supplies_TaxMode_Field extends Supplies_Basic_Field +{ + + protected $name = 'TaxMode'; + protected $defaultLabel = 'LBL_TAX_MODE'; + protected $defaultValue = '0'; + protected $columnname = 'taxmode'; + protected $dbType = "tinyint(1) NOT NULL DEFAULT '0'"; + protected $values = [0 => 'group', 1 => 'individual']; + + /** + * Geting value to display + * @param int $value + * @return string + */ + public function getDisplayValue($value) + { + return $this->values[$value]; + } +} diff --git a/modules/Supplies/fields/Value.php b/modules/Supplies/fields/Value.php new file mode 100644 index 000000000000..5fa4b6ef3c84 --- /dev/null +++ b/modules/Supplies/fields/Value.php @@ -0,0 +1,16 @@ + + */ +class Supplies_Value_Field extends Supplies_Basic_Field +{ + + protected $name = 'Value'; + protected $defaultLabel = 'LBL_VALUE'; + protected $columnname = 'value'; + protected $dbType = 'varchar(255)'; +} diff --git a/modules/Supplies/models/DetailView.php b/modules/Supplies/models/DetailView.php new file mode 100644 index 000000000000..fce876056035 --- /dev/null +++ b/modules/Supplies/models/DetailView.php @@ -0,0 +1,11 @@ + + */ +class Supplies_DetailView_Model extends Vtiger_DetailView_Model +{ + +} diff --git a/modules/Supplies/models/EditView.php b/modules/Supplies/models/EditView.php new file mode 100644 index 000000000000..d8d9fcc3331f --- /dev/null +++ b/modules/Supplies/models/EditView.php @@ -0,0 +1,11 @@ + + */ +class Supplies_DetailView_Model extends Vtiger_EditView_Model +{ + +} diff --git a/modules/Supplies/models/Module.php b/modules/Supplies/models/Module.php new file mode 100644 index 000000000000..3bbf57fa67ac --- /dev/null +++ b/modules/Supplies/models/Module.php @@ -0,0 +1,33 @@ + + */ +class Supplies_Module_Model extends Vtiger_Module_Model +{ + + protected static $modulesNameForTpl = []; + protected $moduleType = 'Supplies'; + + public static function getModuleNameForTpl($tpl, $moduleName) + { + if (isset(self::$modulesNameForTpl[$moduleName . '_' . $tpl])) { + return self::$modulesNameForTpl[$moduleName . '_' . $tpl]; + } + $filename = 'layouts' . DIRECTORY_SEPARATOR . 'vlayout' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . $moduleName . DIRECTORY_SEPARATOR . $tpl; + if (is_file($filename)){ + self::$modulesNameForTpl[$moduleName . '_' . $tpl] = $moduleName; + return $moduleName; + } + + $basicModuleName = 'Supplies'; + $filename = 'layouts' . DIRECTORY_SEPARATOR . 'vlayout' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . $basicModuleName . DIRECTORY_SEPARATOR . $tpl; + if (is_file($filename)){ + self::$modulesNameForTpl[$moduleName . '_' . $tpl] = $basicModuleName; + return $basicModuleName; + } + } +} diff --git a/modules/Supplies/models/Record.php b/modules/Supplies/models/Record.php new file mode 100644 index 000000000000..753e428180d9 --- /dev/null +++ b/modules/Supplies/models/Record.php @@ -0,0 +1,85 @@ + + */ +class Supplies_Record_Model extends Vtiger_Record_Model +{ + + protected $jsonFields = ['discountparam']; + + /** + * Save supplie data + * @param Vtiger_Request $request + */ + public function saveSupplieData(Vtiger_Request $request) + { + $db = PearDatabase::getInstance(); + $log = vglobal('log'); + $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__); + + $moduleName = $request->getModule(); + $SupFieldModel = Supplies_SupField_Model::getCleanInstance(); + $fields = $SupFieldModel->getColumns($moduleName); + $table = $SupFieldModel->getTableName($moduleName, 'data'); + $numRow = $request->get('suppliesRowNo'); + + $db->pquery("delete from $table where id = ? ", [$this->getId()]); + + for ($i = 1; $i <= $numRow; $i++) { + if (!$request->has(reset($fields) . $i)) { + continue; + } + $insertData = ['id' => $this->getId(), 'seq' => $request->get('seq' . $i)]; + foreach ($fields as $field) { + $insertData[$field] = $this->getValueForSave($request, $field, $i); + } + $db->insert($table, $insertData); + } + + $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); + } + + public function getValueForSave(Vtiger_Request $request, $field, $i) + { + $value = ''; + if (in_array($field, $this->jsonFields) && $request->get($field . $i) != '') { + $value = json_encode($request->get($field . $i)); + } else if ($request->has($field . $i)) { + $value = $request->get($field . $i); + } else if ($request->has($field)) { + $value = $request->get($field); + } + return $value; + } + + /** + * Loading the Supplies data for a record + * @return array Supplies data + */ + public function getSupplieData() + { + $log = vglobal('log'); + $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . '| module:' . $module . ' record:' . $record); + + $module = $this->getModuleName(); + $record = $this->getId(); + if (empty($record)) { + return []; + } + + $db = PearDatabase::getInstance(); + $sups = Supplies_SupField_Model::getTableName($module, 'data'); + $result = $db->pquery('SELECT * FROM ' . $sups . ' WHERE id = ? ORDER BY seq', [$record]); + $fields = []; + while ($row = $db->fetch_array($result)) { + $fields[] = $row; + } + + $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); + return $fields; + } +} diff --git a/modules/Supplies/models/SupField.php b/modules/Supplies/models/SupField.php new file mode 100644 index 000000000000..6d99da30bef8 --- /dev/null +++ b/modules/Supplies/models/SupField.php @@ -0,0 +1,186 @@ + + */ +class Supplies_SupField_Model +{ + + const DATA_PREFIX = '_sups'; + const FIELDS_PREFIX = '_supfield'; + + protected $columns = false; + + /** + * Create the name of the Supplies data table + * @param string $module Module name + * @param string $prefix Prefix table + * @return string Table name + */ + public function getTableName($module, $type = 'data') + { + switch ($type) { + case 'data': + $prefix = self::DATA_PREFIX; + break; + case 'fields': + $prefix = self::FIELDS_PREFIX; + break; + } + $moduleName = strtolower($module); + $basetable = 'vtiger_' . $moduleName; + $supfield = $basetable . $prefix; + return $supfield; + } + + /** + * Loading the Supplies data + * @param string $module Module name + * @param boolean $returnInBlock Should the result be divided into blocks + * @return array Supplies data + */ + public static function getFields($module, $returnInBlock = false) + { + $log = vglobal('log'); + $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . '| ' . $module); + + $db = PearDatabase::getInstance(); + $supfield = self::getTableName($module, 'fields'); + $result = $db->query("SHOW TABLES LIKE '$supfield'"); + if ($result->rowCount() == 0) { + return false; + } + $result = $db->pquery('SELECT * FROM ' . $supfield . ' WHERE presence = ? ORDER BY sequence', [0]); + $fields = []; + while ($row = $db->fetch_array($result)) { + if (!self::isActiveField($row)) { + continue; + } + if ($returnInBlock) { + $fields[$row['block']][$row['columnname']] = self::getInstanceFromArray($row); + } else { + $fields[$row['columnname']] = self::getInstanceFromArray($row); + } + } + + $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); + return $fields; + } + + public static function isActiveField($row) + { + if (in_array($row['suptype'], ['Discount', 'DiscountMode'])) { + $discountsConfig = Products_Record_Model::getDiscountsConfig(); + if ($discountsConfig['active'] == '0') { + return false; + } + } + + return true; + } + + /** + * Loading the Supplies data + * @param string $module Module name + * @param boolean $returnInBlock Should the result be divided into blocks + * @return array Supplies data + */ + public function getColumns($module) + { + $log = vglobal('log'); + $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . '| ' . $module); + if ($this->columns) { + return $this->columns; + } + + $columns = []; + foreach ($this->getFields($module) as $field) { + $column = $field->getColumnName(); + if ($column != '') + $columns[] = $column; + foreach ($field->getCustomColumn() as $name => $field) { + $columns[] = $name; + } + } + $this->columns = $columns; + $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); + return $columns; + } + + /** + * Creating installation of the field from the table + * @param string $valueArray Array of data + * @return \modelClassName Instance Supplies_Basic_Field + */ + public static function getInstanceFromArray($valueArray) + { + $log = vglobal('log'); + $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . '| '); + + $className = Vtiger_Loader::getComponentClassName('Field', $valueArray['suptype'], 'Supplies'); + $instance = new $className(); + $instance->initialize($valueArray); + + $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); + return $instance; + } + + /** + * Retrieve list of all fields + * @param string $module Module name + * @return array Fields instance Supplies_Basic_Field + */ + public static function getAllFields($module = false) + { + $log = vglobal('log'); + $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . '| ' . $module); + $fieldPaths = ['modules/Supplies/fields/']; + if ($module) { + $fieldPaths[] = "modules/$module/fields/"; + } + $fields = []; + foreach ($fieldPaths as $fieldPath) { + if (!is_dir($fieldPath)) + continue; + foreach (new DirectoryIterator($fieldPath) as $fileinfo) { + if ($fileinfo->isFile() && $fileinfo->getFilename() != 'Basic.php') { + $fieldName = str_replace('.php', '', $fileinfo->getFilename()); + $className = Vtiger_Loader::getComponentClassName('Field', $fieldName, 'Supplies'); + $fields[$fieldName] = new $className(); + } + } + } + $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); + return $fields; + } + + /** + * Retrieve list of parameters + * @param array $fields Array of instances fields (Supplies_Basic_Field) + * @return array Array of parameters + */ + public static function getMainParams($fields) + { + $log = vglobal('log'); + $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__); + + $params = false; + foreach ($fields as $field) { + if ($field->getName() == 'Name') { + $params = Zend_Json::decode($field->get('params')); + } + } + + $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); + return $params; + } + + public static function getCleanInstance() + { + $instance = new self(); + return $instance; + } +} diff --git a/modules/Supplies/views/Detail.php b/modules/Supplies/views/Detail.php new file mode 100644 index 000000000000..662efb2db59c --- /dev/null +++ b/modules/Supplies/views/Detail.php @@ -0,0 +1,32 @@ + + */ +class Supplies_Detail_View extends Vtiger_Detail_View +{ + + /** + * Function returns Inventory details + * @param Vtiger_Request $request + */ + function showModuleDetailView(Vtiger_Request $request) + { + echo parent::showModuleDetailView($request); + $this->showLineItemDetails($request); + } + + function showLineItemDetails(Vtiger_Request $request) + { + $record = $request->get('record'); + $moduleName = $request->getModule(); + + $viewer = $this->getViewer($request); + $viewer->assign('SUP_RECORD', $record); + $viewer->assign('SUP_MODULE', $moduleName); + echo $viewer->view('DetailViewSupplies.tpl', Supplies_Module_Model::getModuleNameForTpl('DetailViewSupplies.tpl', $moduleName), true); + } +} diff --git a/modules/Supplies/views/Edit.php b/modules/Supplies/views/Edit.php new file mode 100644 index 000000000000..97a8e4c7a243 --- /dev/null +++ b/modules/Supplies/views/Edit.php @@ -0,0 +1,140 @@ + + */ +class Supplies_Edit_View extends Vtiger_Edit_View +{ + public function preProcess (Vtiger_Request $request, $display=true) { + parent::preProcess($request, $display); + + $moduleName = $request->getModule(); + $viewer = $this->getViewer($request); + $viewer->assign('ACCOUNT_REFERENCE_FIELD', $this->getReferenceField($moduleName)); + $viewer->assign('DISCOUNTS_CONFIG', Products_Record_Model::getDiscountsConfig()); + $viewer->view('TopEditView.tpl', Supplies_Module_Model::getModuleNameForTpl('TopEditView.tpl', $moduleName)); + } + + public function process(Vtiger_Request $request) + { + $viewer = $this->getViewer($request); + $moduleName = $request->getModule(); + $record = $request->get('record'); + if (!empty($record) && $request->get('isDuplicate') == true) { + $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName); + $viewer->assign('MODE', ''); + $recordModel->set('id', ''); + //While Duplicating record, If the related record is deleted then we are removing related record info in record model + $mandatoryFieldModels = $recordModel->getModule()->getMandatoryFieldModels(); + foreach ($mandatoryFieldModels as $fieldModel) { + if ($fieldModel->isReferenceField()) { + $fieldName = $fieldModel->get('name'); + if (Vtiger_Util_Helper::checkRecordExistance($recordModel->get($fieldName))) { + $recordModel->set($fieldName, ''); + } + } + } + } else if (!empty($record)) { + $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName); + $viewer->assign('RECORD_ID', $record); + $viewer->assign('MODE', 'edit'); + } else { + $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName); + $referenceId = $request->get('reference_id'); + if ($referenceId) { + $parentRecordModel = Vtiger_Record_Model::getInstanceById($referenceId); + $recordModel->setRecordFieldValues($parentRecordModel); + } + $viewer->assign('MODE', ''); + } + if (!$this->record) { + $this->record = $recordModel; + } + + $moduleModel = $recordModel->getModule(); + $fieldList = $moduleModel->getFields(); + $requestFieldList = array_intersect_key($request->getAll(), $fieldList); + + foreach ($requestFieldList as $fieldName => $fieldValue) { + $fieldModel = $fieldList[$fieldName]; + $specialField = false; + if ($fieldModel->isEditable() || $specialField) { + $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue)); + } + } + $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT); + $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName); + + $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource)); + $mappingRelatedField = $moduleModel->getMappingRelatedField($moduleName); + $viewer->assign('MAPPING_RELATED_FIELD', Zend_Json::encode($mappingRelatedField)); + $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance); + $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure()); + $viewer->assign('MODULE', $moduleName); + $viewer->assign('RECORD', $recordModel); + $viewer->assign('BLOCK_LIST', $moduleModel->getBlocks()); + $viewer->assign('CURRENTDATE', date('Y-n-j')); + $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel()); + $viewer->assign('APIADDRESS', Settings_ApiAddress_Module_Model::getInstance('Settings:ApiAddress')->getConfig()); + + $isRelationOperation = $request->get('relationOperation'); + + //if it is relation edit + $viewer->assign('IS_RELATION_OPERATION', $isRelationOperation); + if ($isRelationOperation) { + $viewer->assign('SOURCE_MODULE', $request->get('sourceModule')); + $viewer->assign('SOURCE_RECORD', $request->get('sourceRecord')); + } + + $viewer->assign('MAX_UPLOAD_LIMIT_MB', Vtiger_Util_Helper::getMaxUploadSize()); + $viewer->assign('MAX_UPLOAD_LIMIT', vglobal('upload_maxsize')); + + $viewer->assign('SUPFIELD_MODEL', Supplies_SupField_Model::getCleanInstance()); + $viewer->view('EditView.tpl', $moduleModel->getModuleNameForTpl('EditView.tpl', $moduleName)); + } + + /** + * Function to get the list of Script models to be included + * @param Vtiger_Request $request + * @return - List of Vtiger_JsScript_Model instances + */ + function getFooterScripts(Vtiger_Request $request) + { + $headerScriptInstances = parent::getFooterScripts($request); + + $moduleName = $request->getModule(); + $moduleEditFile = 'modules.' . $moduleName . '.resources.Edit'; + unset($headerScriptInstances[$moduleEditFile]); + + $jsFileNames = array( + 'modules.Supplies.resources.Edit', + ); + $jsFileNames[] = $moduleEditFile; + $jsScriptInstances = $this->checkAndConvertJsScripts($jsFileNames); + $headerScriptInstances = array_merge($headerScriptInstances, $jsScriptInstances); + return $headerScriptInstances; + } + + public function getReferenceField($moduleName) + { + $mainModule = 'Accounts'; + + $moduleModel = Vtiger_Module_Model::getInstance($moduleName); + $modelFields = $moduleModel->getFields(); + $referenceField = ''; + foreach ($modelFields as $fieldName => $fieldModel) { + if ($fieldModel->getFieldDataType() == Vtiger_Field_Model::REFERENCE_TYPE) { + $referenceList = $fieldModel->getReferenceList(); + if (in_array($mainModule, $referenceList)) { + $referenceField = $fieldName; + break; + } + } + } + + return $referenceField; + } +} From 5c4959654f48b80105da7dd758aab15a584176f6 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Tue, 11 Aug 2015 13:30:25 +0200 Subject: [PATCH 007/489] Added new mechanisms used for handling discounts --- .../vlayout/modules/Products/Discounts.tpl | 38 ++ .../modules/Products/DiscountsType0.tpl | 19 + .../modules/Products/DiscountsType1.tpl | 26 ++ .../modules/Products/DiscountsType2.tpl | 38 ++ .../modules/Products/DiscountsType3.tpl | 3 + modules/Products/actions/SubProducts.php | 30 +- modules/Products/models/Record.php | 359 +++++++++++++----- modules/Products/views/Discounts.php | 49 +++ 8 files changed, 464 insertions(+), 98 deletions(-) create mode 100644 layouts/vlayout/modules/Products/Discounts.tpl create mode 100644 layouts/vlayout/modules/Products/DiscountsType0.tpl create mode 100644 layouts/vlayout/modules/Products/DiscountsType1.tpl create mode 100644 layouts/vlayout/modules/Products/DiscountsType2.tpl create mode 100644 layouts/vlayout/modules/Products/DiscountsType3.tpl create mode 100644 modules/Products/views/Discounts.php diff --git a/layouts/vlayout/modules/Products/Discounts.tpl b/layouts/vlayout/modules/Products/Discounts.tpl new file mode 100644 index 000000000000..42a594b73a3f --- /dev/null +++ b/layouts/vlayout/modules/Products/Discounts.tpl @@ -0,0 +1,38 @@ +{strip} + {assign var="SUPMODULE" value='Supplies'} + {assign var="AGGREGATION" value=$CONFIG['aggregation']} + +{/strip} diff --git a/layouts/vlayout/modules/Products/DiscountsType0.tpl b/layouts/vlayout/modules/Products/DiscountsType0.tpl new file mode 100644 index 000000000000..69751dff03b2 --- /dev/null +++ b/layouts/vlayout/modules/Products/DiscountsType0.tpl @@ -0,0 +1,19 @@ +{strip} +
    +
    + {vtranslate('LBL_GLOBAL_DISCOUNTS', $SUPMODULE)} +
    + +
    +
    + +
    +{/strip} diff --git a/layouts/vlayout/modules/Products/DiscountsType1.tpl b/layouts/vlayout/modules/Products/DiscountsType1.tpl new file mode 100644 index 000000000000..9fec0c5383e1 --- /dev/null +++ b/layouts/vlayout/modules/Products/DiscountsType1.tpl @@ -0,0 +1,26 @@ +{strip} + {if $GROUP_DISCOUNT != 0} +
    +
    + {vtranslate('LBL_GROUP_DISCOUNTS', $SUPMODULE)} +
    + +
    +
    + +
    + {/if} +{/strip} diff --git a/layouts/vlayout/modules/Products/DiscountsType2.tpl b/layouts/vlayout/modules/Products/DiscountsType2.tpl new file mode 100644 index 000000000000..cae76d39bcde --- /dev/null +++ b/layouts/vlayout/modules/Products/DiscountsType2.tpl @@ -0,0 +1,38 @@ +{strip} +
    +
    + {vtranslate('LBL_INDIVIDUAL_DISCOUNTS', $SUPMODULE)} +
    + +
    +
    + +
    +{/strip} diff --git a/layouts/vlayout/modules/Products/DiscountsType3.tpl b/layouts/vlayout/modules/Products/DiscountsType3.tpl new file mode 100644 index 000000000000..2c14003461da --- /dev/null +++ b/layouts/vlayout/modules/Products/DiscountsType3.tpl @@ -0,0 +1,3 @@ +{strip} + +{/strip} diff --git a/modules/Products/actions/SubProducts.php b/modules/Products/actions/SubProducts.php index 098b9d0901fc..20dddb24555a 100644 --- a/modules/Products/actions/SubProducts.php +++ b/modules/Products/actions/SubProducts.php @@ -1,32 +1,38 @@ getModule(); $moduleModel = Vtiger_Module_Model::getInstance($moduleName); $currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); - if(!$currentUserPriviligesModel->hasModulePermission($moduleModel->getId())) { - throw new AppException(vtranslate($moduleName).' '.vtranslate('LBL_NOT_ACCESSIBLE')); + if (!$currentUserPriviligesModel->hasModulePermission($moduleModel->getId())) { + throw new AppException(vtranslate($moduleName) . ' ' . vtranslate('LBL_NOT_ACCESSIBLE')); } } - function process(Vtiger_Request $request) { + function process(Vtiger_Request $request) + { $productId = $request->get('record'); - $productModel = Vtiger_Record_Model::getInstanceById($productId, 'Products'); - $subProducts = $productModel->getSubProducts(); - $values = array(); - foreach($subProducts as $subProduct) { - $values[$subProduct->getId()] = $subProduct->getName(); + $values = []; + if (isRecordExists($productId)) { + $productModel = Vtiger_Record_Model::getInstanceById($productId); + $subProducts = $productModel->getSubProducts(); + + foreach ($subProducts as $subProduct) { + $values[$subProduct->getId()] = $subProduct->getName(); + } } $response = new Vtiger_Response(); diff --git a/modules/Products/models/Record.php b/modules/Products/models/Record.php index 083b74fb1418..8a8fb7658a70 100644 --- a/modules/Products/models/Record.php +++ b/modules/Products/models/Record.php @@ -1,5 +1,5 @@ Url */ - function getTaxesURL() { - return 'index.php?module=Inventory&action=GetTaxes&record='. $this->getId(); + function getTaxesURL() + { + return 'index.php?module=Inventory&action=GetTaxes&record=' . $this->getId(); } /** * Function to get available taxes for this record * @return List of available taxes */ - function getTaxes() { + function getTaxes() + { $db = PearDatabase::getInstance(); $result = $db->pquery('SELECT * FROM vtiger_producttaxrel INNER JOIN vtiger_inventorytaxinfo ON vtiger_inventorytaxinfo.taxid = vtiger_producttaxrel.taxid INNER JOIN vtiger_crmentity ON vtiger_producttaxrel.productid = vtiger_crmentity.crmid AND vtiger_crmentity.deleted = 0 - WHERE vtiger_producttaxrel.productid = ? AND vtiger_inventorytaxinfo.deleted = 0', array($this->getId())); - $taxes = array(); - for($i=0; $i<$db->num_rows($result); $i++) { - $taxName = $db->query_result($result, $i, 'taxname'); - $tabLabel = $db->query_result($result, $i, 'taxlabel'); - $taxPercentage = $db->query_result($result, $i, 'taxpercentage'); - $taxes[$taxName] = array('percentage'=>$taxPercentage, 'label' => $tabLabel); + WHERE vtiger_producttaxrel.productid = ?', [$this->getId()]); + $taxes = []; + while ($row = $db->fetch_array($result)) { + $taxName = $row['taxname']; + $tabLabel = $row['taxlabel']; + $taxPercentage = $row['taxpercentage']; + $taxes[$taxName] = ['percentage' => $taxPercentage, 'label' => $tabLabel]; } return $taxes; } - - /** + + /** * Function to get values of more currencies listprice * @return of listprice values */ - static function getListPriceValues($id) { - $db = PearDatabase::getInstance(); - $listPrice = $db->pquery('SELECT * FROM vtiger_productcurrencyrel WHERE productid = ?', array($id)); - $listpriceValues = array(); - for($i=0; $i<$db->num_rows($listPrice); $i++) { - $listpriceValues[$db->query_result($listPrice, $i, 'currencyid')] = $db->query_result($listPrice, $i, 'actual_price'); - } - return $listpriceValues; + static function getListPriceValues($id) + { + $db = PearDatabase::getInstance(); + $listPrice = $db->pquery('SELECT * FROM vtiger_productcurrencyrel WHERE productid = ?', [$id]); + $listpriceValues = []; + while ($row = $db->fetch_array($listPrice)) { + $listpriceValues[$row['currencyid']] = $row['actual_price']; + } + return $listpriceValues; } /** * Function to get subproducts for this record * @return of subproducts */ - function getSubProducts() { + function getSubProducts() + { $db = PearDatabase::getInstance(); $result = $db->pquery("SELECT vtiger_products.productid FROM vtiger_products @@ -69,7 +74,7 @@ function getSubProducts() { WHERE vtiger_crmentity.deleted = 0 AND vtiger_seproductsrel.productid = ? ", array($this->getId())); $subProductList = array(); - for($i=0; $i<$db->num_rows($result); $i++) { + for ($i = 0; $i < $db->num_rows($result); $i++) { $subProductId = $db->query_result($result, $i, 'productid'); $subProductList[] = Vtiger_Record_Model::getInstanceById($subProductId, 'Products'); } @@ -81,44 +86,48 @@ function getSubProducts() { * Function to get Url to Create a new Quote from this record * @return Url to Create new Quote */ - function getCreateQuoteUrl() { + function getCreateQuoteUrl() + { $quotesModuleModel = Vtiger_Module_Model::getInstance('Quotes'); - return "index.php?module=".$quotesModuleModel->getName()."&view=".$quotesModuleModel->getEditViewName()."&product_id=".$this->getId(). - "&sourceModule=".$this->getModuleName()."&sourceRecord=".$this->getId()."&relationOperation=true"; + return "index.php?module=" . $quotesModuleModel->getName() . "&view=" . $quotesModuleModel->getEditViewName() . "&product_id=" . $this->getId() . + "&sourceModule=" . $this->getModuleName() . "&sourceRecord=" . $this->getId() . "&relationOperation=true"; } /** * Function to get Url to Create a new Invoice from this record * @return Url to Create new Invoice */ - function getCreateInvoiceUrl() { + function getCreateInvoiceUrl() + { $invoiceModuleModel = Vtiger_Module_Model::getInstance('Invoice'); - return "index.php?module=".$invoiceModuleModel->getName()."&view=".$invoiceModuleModel->getEditViewName()."&product_id=".$this->getId(). - "&sourceModule=".$this->getModuleName()."&sourceRecord=".$this->getId()."&relationOperation=true"; + return "index.php?module=" . $invoiceModuleModel->getName() . "&view=" . $invoiceModuleModel->getEditViewName() . "&product_id=" . $this->getId() . + "&sourceModule=" . $this->getModuleName() . "&sourceRecord=" . $this->getId() . "&relationOperation=true"; } /** * Function to get Url to Create a new PurchaseOrder from this record * @return Url to Create new PurchaseOrder */ - function getCreatePurchaseOrderUrl() { + function getCreatePurchaseOrderUrl() + { $purchaseOrderModuleModel = Vtiger_Module_Model::getInstance('PurchaseOrder'); - return "index.php?module=".$purchaseOrderModuleModel->getName()."&view=".$purchaseOrderModuleModel->getEditViewName()."&product_id=".$this->getId(). - "&sourceModule=".$this->getModuleName()."&sourceRecord=".$this->getId()."&relationOperation=true"; + return "index.php?module=" . $purchaseOrderModuleModel->getName() . "&view=" . $purchaseOrderModuleModel->getEditViewName() . "&product_id=" . $this->getId() . + "&sourceModule=" . $this->getModuleName() . "&sourceRecord=" . $this->getId() . "&relationOperation=true"; } /** * Function to get Url to Create a new SalesOrder from this record * @return Url to Create new SalesOrder */ - function getCreateSalesOrderUrl() { + function getCreateSalesOrderUrl() + { $salesOrderModuleModel = Vtiger_Module_Model::getInstance('SalesOrder'); - return "index.php?module=".$salesOrderModuleModel->getName()."&view=".$salesOrderModuleModel->getEditViewName()."&product_id=".$this->getId(). - "&sourceModule=".$this->getModuleName()."&sourceRecord=".$this->getId()."&relationOperation=true"; + return "index.php?module=" . $salesOrderModuleModel->getName() . "&view=" . $salesOrderModuleModel->getEditViewName() . "&product_id=" . $this->getId() . + "&sourceModule=" . $this->getModuleName() . "&sourceRecord=" . $this->getId() . "&relationOperation=true"; } /** @@ -127,22 +136,23 @@ function getCreateSalesOrderUrl() { * @param $focus * @return List of individual taxes */ - function getDetailsForInventoryModule($focus) { + function getDetailsForInventoryModule($focus) + { $productId = $this->getId(); $currentUser = Users_Record_Model::getCurrentUserModel(); $productDetails = getAssociatedProducts($this->getModuleName(), $focus, $productId); $currentUserModel = Users_Record_Model::getCurrentUserModel(); $convertedPriceDetails = $this->getModule()->getPricesForProducts($currentUserModel->get('currency_id'), array($productId)); - $productDetails[1]['listPrice1'] = number_format($convertedPriceDetails[$productId], $currentUserModel->get('no_of_currency_decimals'),'.',''); + $productDetails[1]['listPrice1'] = number_format($convertedPriceDetails[$productId], $currentUserModel->get('no_of_currency_decimals'), '.', ''); $totalAfterDiscount = $productDetails[1]['totalAfterDiscount1']; $productTaxes = $productDetails[1]['taxes']; - if (!empty ($productDetails)) { + if (!empty($productDetails)) { $taxCount = count($productTaxes); $taxTotal = '0'; - for($i=0; $i<$taxCount; $i++) { + for ($i = 0; $i < $taxCount; $i++) { $taxValue = $productTaxes[$i]['percentage']; $taxAmount = $totalAfterDiscount * $taxValue / 100; @@ -157,10 +167,10 @@ function getDetailsForInventoryModule($focus) { $productDetails[1]['final_details']['grandTotal'] = $netPrice; } - for ($i=1; $i<=count($productDetails); $i++) { - $productId = $productDetails[$i]['hdnProductId'.$i]; + for ($i = 1; $i <= count($productDetails); $i++) { + $productId = $productDetails[$i]['hdnProductId' . $i]; $productPrices = $this->getModule()->getPricesForProducts($currentUser->get('currency_id'), array($productId), $this->getModuleName()); - $productDetails[$i]['listPrice'.$i] = number_format($productPrices[$productId], $currentUser->get('no_of_currency_decimals'),'.',''); + $productDetails[$i]['listPrice' . $i] = number_format($productPrices[$productId], $currentUser->get('no_of_currency_decimals'), '.', ''); } return $productDetails; } @@ -169,27 +179,28 @@ function getDetailsForInventoryModule($focus) { * Function to get Tax Class Details for this record(Product) * @return List of Taxes */ - public function getTaxClassDetails() { + public function getTaxClassDetails() + { $taxClassDetails = $this->get('taxClassDetails'); if (!empty($taxClassDetails)) { return $taxClassDetails; } $record = $this->getId(); - if (empty ($record)) { + if (empty($record)) { return $this->getAllTaxes(); } $taxClassDetails = getTaxDetailsForProduct($record, 'available_associated'); $noOfTaxes = count($taxClassDetails); - for($i=0; $i<$noOfTaxes; $i++) { + for ($i = 0; $i < $noOfTaxes; $i++) { $taxValue = getProductTaxPercentage($taxClassDetails[$i]['taxname'], $this->getId()); $taxClassDetails[$i]['percentage'] = $taxValue; - $taxClassDetails[$i]['check_name'] = $taxClassDetails[$i]['taxname'].'_check'; + $taxClassDetails[$i]['check_name'] = $taxClassDetails[$i]['taxname'] . '_check'; $taxClassDetails[$i]['check_value'] = 1; //if the tax is not associated with the product then we should get the default value and unchecked - if($taxValue == '') { + if ($taxValue == '') { $taxClassDetails[$i]['check_value'] = 0; $taxClassDetails[$i]['percentage'] = getTaxPercentage($taxClassDetails[$i]['taxname']); } @@ -203,7 +214,8 @@ public function getTaxClassDetails() { * Function to get all taxes * @return List of taxes */ - public function getAllTaxes() { + public function getAllTaxes() + { $allTaxesList = $this->get('alltaxes'); if (!empty($allTaxesList)) { return $allTaxesList; @@ -212,8 +224,8 @@ public function getAllTaxes() { $allTaxesList = getAllTaxes('available'); $noOfTaxes = count($allTaxesList); - for($i=0; $i<$noOfTaxes; $i++) { - $allTaxesList[$i]['check_name'] = $allTaxesList[$i]['taxname'].'_check'; + for ($i = 0; $i < $noOfTaxes; $i++) { + $allTaxesList[$i]['check_name'] = $allTaxesList[$i]['taxname'] . '_check'; $allTaxesList[$i]['check_value'] = 0; } @@ -225,12 +237,13 @@ public function getAllTaxes() { * Function to get price details * @return List of prices */ - public function getPriceDetails() { + public function getPriceDetails() + { $priceDetails = $this->get('priceDetails'); if (!empty($priceDetails)) { return $priceDetails; } - $priceDetails = getPriceDetailsForProduct($this->getId(), $this->get('unit_price'), 'available', $this->getModuleName()); + $priceDetails = $this->getPriceDetailsForProduct($this->getId(), $this->get('unit_price'), 'available', $this->getModuleName()); $this->set('priceDetails', $priceDetails); return $priceDetails; } @@ -239,7 +252,8 @@ public function getPriceDetails() { * Function to get base currency details * @return */ - public function getBaseCurrencyDetails() { + public function getBaseCurrencyDetails() + { $baseCurrencyDetails = $this->get('baseCurrencyDetails'); if (!empty($baseCurrencyDetails)) { return $baseCurrencyDetails; @@ -247,7 +261,7 @@ public function getBaseCurrencyDetails() { $recordId = $this->getId(); if (!empty($recordId)) { - $baseCurrency = getProductBaseCurrency($recordId, $this->getModuleName()); + $baseCurrency = $this->getProductBaseCurrency($recordId, $this->getModuleName()); } else { $currentUserModel = Users_Record_Model::getCurrentUserModel(); $baseCurrency = fetchCurrency($currentUserModel->getId()); @@ -265,7 +279,8 @@ public function getBaseCurrencyDetails() { * Function to get Image Details * @return Image Details List */ - public function getImageDetails() { + public function getImageDetails() + { $db = PearDatabase::getInstance(); $imageDetails = array(); $recordId = $this->getId(); @@ -279,7 +294,7 @@ public function getImageDetails() { $result = $db->pquery($sql, array($recordId)); $count = $db->num_rows($result); - for($i=0; $i<$count; $i++) { + for ($i = 0; $i < $count; $i++) { $imageIdsList[] = $db->query_result($result, $i, 'attachmentsid'); $imagePathList[] = $db->query_result($result, $i, 'path'); $imageName = $db->query_result($result, $i, 'name'); @@ -291,39 +306,40 @@ public function getImageDetails() { $imageNamesList[] = $imageName; } - if(is_array($imageOriginalNamesList)) { + if (is_array($imageOriginalNamesList)) { $countOfImages = count($imageOriginalNamesList); - for($j=0; $j<$countOfImages; $j++) { + for ($j = 0; $j < $countOfImages; $j++) { $imageDetails[] = array( - 'id' => $imageIdsList[$j], - 'orgname' => $imageOriginalNamesList[$j], - 'path' => $imagePathList[$j].$imageIdsList[$j], - 'name' => $imageNamesList[$j] + 'id' => $imageIdsList[$j], + 'orgname' => $imageOriginalNamesList[$j], + 'path' => $imagePathList[$j] . $imageIdsList[$j], + 'name' => $imageNamesList[$j] ); } } } return $imageDetails; } - + /** * Static Function to get the list of records matching the search key * @param $searchKey * @return - List of Vtiger_Record_Model or Module Specific Record Model instances */ - public static function getSearchResult($searchKey, $module=false) { + public static function getSearchResult($searchKey, $module = false) + { $db = PearDatabase::getInstance(); $query = 'SELECT label, searchlabel, crmid, setype, createdtime FROM vtiger_crmentity WHERE searchlabel LIKE ? AND vtiger_crmentity.deleted = 0'; $params = array("%$searchKey%"); - if($module !== false) { + if ($module !== false) { $query .= ' AND setype = ?'; - if($module == 'Products'){ + if ($module == 'Products') { $query = 'SELECT label,searchlabel, crmid, setype, createdtime FROM vtiger_crmentity INNER JOIN vtiger_products ON vtiger_products.productid = vtiger_crmentity.crmid WHERE searchlabel LIKE ? AND vtiger_crmentity.deleted = 0 AND vtiger_products.discontinued = 1 AND setype = ?'; - }else if($module == 'Services'){ + } else if ($module == 'Services') { $query = 'SELECT label,searchlabel, crmid, setype, createdtime FROM vtiger_crmentity INNER JOIN vtiger_service ON vtiger_service.serviceid = vtiger_crmentity.crmid WHERE searchlabel LIKE ? AND vtiger_crmentity.deleted = 0 AND vtiger_service.discontinued = 1 AND setype = ?'; @@ -337,7 +353,7 @@ public static function getSearchResult($searchKey, $module=false) { $noOfRows = $db->num_rows($result); $moduleModels = $matchingRecords = $leadIdsList = array(); - for($i=0; $i<$noOfRows; ++$i) { + for ($i = 0; $i < $noOfRows; ++$i) { $row = $db->query_result_rowdata($result, $i); if ($row['setype'] === 'Leads') { $leadIdsList[] = $row['crmid']; @@ -345,15 +361,15 @@ public static function getSearchResult($searchKey, $module=false) { } $convertedInfo = Leads_Module_Model::getConvertedInfo($leadIdsList); - for($i=0, $recordsCount = 0; $i<$noOfRows && $recordsCount<100; ++$i) { + for ($i = 0, $recordsCount = 0; $i < $noOfRows && $recordsCount < 100; ++$i) { $row = $db->query_result_rowdata($result, $i); if ($row['setype'] === 'Leads' && $convertedInfo[$row['crmid']]) { continue; } - if(Users_Privileges_Model::isPermitted($row['setype'], 'DetailView', $row['crmid'])) { + if (Users_Privileges_Model::isPermitted($row['setype'], 'DetailView', $row['crmid'])) { $row['id'] = $row['crmid']; $moduleName = $row['setype']; - if(!array_key_exists($moduleName, $moduleModels)) { + if (!array_key_exists($moduleName, $moduleModels)) { $moduleModels[$moduleName] = Vtiger_Module_Model::getInstance($moduleName); } $moduleModel = $moduleModels[$moduleName]; @@ -365,39 +381,210 @@ public static function getSearchResult($searchKey, $module=false) { } return $matchingRecords; } - + /** * Function to get acive status of record */ - public function getActiveStatusOfRecord(){ + public function getActiveStatusOfRecord() + { $activeStatus = $this->get('discontinued'); - if($activeStatus){ + if ($activeStatus) { return $activeStatus; } $recordId = $this->getId(); $db = PearDatabase::getInstance(); - $result = $db->pquery('SELECT discontinued FROM vtiger_products WHERE productid = ?',array($recordId)); + $result = $db->pquery('SELECT discontinued FROM vtiger_products WHERE productid = ?', array($recordId)); $activeStatus = $db->query_result($result, 'discontinued'); return $activeStatus; } - + /** * Function updates ListPrice for Product/Service-PriceBook relation * @param $relatedRecordId - PriceBook Id * @param $price - listprice * @param $currencyId - currencyId */ - function updateListPrice($relatedRecordId, $price, $currencyId) { + function updateListPrice($relatedRecordId, $price, $currencyId) + { $db = PearDatabase::getInstance(); - $result = $db->pquery('SELECT * FROM vtiger_pricebookproductrel WHERE pricebookid = ? AND productid = ?', - array($relatedRecordId, $this->getId())); - if($db->num_rows($result)) { - $db->pquery('UPDATE vtiger_pricebookproductrel SET listprice = ? WHERE pricebookid = ? AND productid = ?', - array($price, $relatedRecordId, $this->getId())); + $result = $db->pquery('SELECT * FROM vtiger_pricebookproductrel WHERE pricebookid = ? AND productid = ?', array($relatedRecordId, $this->getId())); + if ($db->num_rows($result)) { + $db->pquery('UPDATE vtiger_pricebookproductrel SET listprice = ? WHERE pricebookid = ? AND productid = ?', array($price, $relatedRecordId, $this->getId())); + } else { + $db->pquery('INSERT INTO vtiger_pricebookproductrel (pricebookid,productid,listprice,usedcurrency) values(?,?,?,?)', array($relatedRecordId, $this->getId(), $price, $currencyId)); + } + } + + function getPriceDetailsForProduct($productid, $unit_price, $available = 'available', $itemtype = 'Products') + { + $adb = PearDatabase::getInstance(); + $log = vglobal('log'); + $log->debug("Entering into function getPriceDetailsForProduct($productid)"); + if ($productid != '') { + $product_currency_id = $this->getProductBaseCurrency($productid, $itemtype); + $product_base_conv_rate = $this->getBaseConversionRateForProduct($productid, 'edit', $itemtype); + // Detail View + if ($available == 'available_associated') { + $query = "select vtiger_currency_info.*, vtiger_productcurrencyrel.converted_price, vtiger_productcurrencyrel.actual_price + from vtiger_currency_info + inner join vtiger_productcurrencyrel on vtiger_currency_info.id = vtiger_productcurrencyrel.currencyid + where vtiger_currency_info.currency_status = 'Active' and vtiger_currency_info.deleted=0 + and vtiger_productcurrencyrel.productid = ? and vtiger_currency_info.id != ?"; + $params = array($productid, $product_currency_id); + } else { // Edit View + $query = "select vtiger_currency_info.*, vtiger_productcurrencyrel.converted_price, vtiger_productcurrencyrel.actual_price + from vtiger_currency_info + left join vtiger_productcurrencyrel + on vtiger_currency_info.id = vtiger_productcurrencyrel.currencyid and vtiger_productcurrencyrel.productid = ? + where vtiger_currency_info.currency_status = 'Active' and vtiger_currency_info.deleted=0"; + $params = array($productid); + } + + $res = $adb->pquery($query, $params); + for ($i = 0; $i < $adb->num_rows($res); $i++) { + $price_details[$i]['productid'] = $productid; + $price_details[$i]['currencylabel'] = $adb->query_result($res, $i, 'currency_name'); + $price_details[$i]['currencycode'] = $adb->query_result($res, $i, 'currency_code'); + $price_details[$i]['currencysymbol'] = $adb->query_result($res, $i, 'currency_symbol'); + $currency_id = $adb->query_result($res, $i, 'id'); + $price_details[$i]['curid'] = $currency_id; + $price_details[$i]['curname'] = 'curname' . $adb->query_result($res, $i, 'id'); + $cur_value = $adb->query_result($res, $i, 'actual_price'); + + // Get the conversion rate for the given currency, get the conversion rate of the product currency to base currency. + // Both together will be the actual conversion rate for the given currency. + $conversion_rate = $adb->query_result($res, $i, 'conversion_rate'); + $actual_conversion_rate = $product_base_conv_rate * $conversion_rate; + + $is_basecurrency = false; + if ($currency_id == $product_currency_id) { + $is_basecurrency = true; + } + if ($cur_value == null || $cur_value == '') { + $price_details[$i]['check_value'] = false; + if ($unit_price != null) { + $cur_value = CurrencyField::convertFromMasterCurrency($unit_price, $actual_conversion_rate); + } else { + $cur_value = '0'; + } + } else if ($is_basecurrency) { + $price_details[$i]['check_value'] = true; + } + $price_details[$i]['curvalue'] = CurrencyField::convertToUserFormat($cur_value, null, true); + $price_details[$i]['conversionrate'] = $actual_conversion_rate; + $price_details[$i]['is_basecurrency'] = $is_basecurrency; + } } else { - $db->pquery('INSERT INTO vtiger_pricebookproductrel (pricebookid,productid,listprice,usedcurrency) values(?,?,?,?)', - array($relatedRecordId, $this->getId(), $price, $currencyId)); + if ($available == 'available') { // Create View + $current_user = vglobal('current_user'); + + $user_currency_id = fetchCurrency($current_user->id); + + $query = "select vtiger_currency_info.* from vtiger_currency_info + where vtiger_currency_info.currency_status = 'Active' and vtiger_currency_info.deleted=0"; + $params = array(); + + $res = $adb->pquery($query, $params); + for ($i = 0; $i < $adb->num_rows($res); $i++) { + $price_details[$i]['currencylabel'] = $adb->query_result($res, $i, 'currency_name'); + $price_details[$i]['currencycode'] = $adb->query_result($res, $i, 'currency_code'); + $price_details[$i]['currencysymbol'] = $adb->query_result($res, $i, 'currency_symbol'); + $currency_id = $adb->query_result($res, $i, 'id'); + $price_details[$i]['curid'] = $currency_id; + $price_details[$i]['curname'] = 'curname' . $adb->query_result($res, $i, 'id'); + + // Get the conversion rate for the given currency, get the conversion rate of the product currency(logged in user's currency) to base currency. + // Both together will be the actual conversion rate for the given currency. + $conversion_rate = $adb->query_result($res, $i, 'conversion_rate'); + $user_cursym_convrate = getCurrencySymbolandCRate($user_currency_id); + $product_base_conv_rate = 1 / $user_cursym_convrate['rate']; + $actual_conversion_rate = $product_base_conv_rate * $conversion_rate; + + $price_details[$i]['check_value'] = false; + $price_details[$i]['curvalue'] = '0'; + $price_details[$i]['conversionrate'] = $actual_conversion_rate; + + $is_basecurrency = false; + if ($currency_id == $user_currency_id) { + $is_basecurrency = true; + } + $price_details[$i]['is_basecurrency'] = $is_basecurrency; + } + } else { + $log->debug("Product id is empty. we cannot retrieve the associated prices."); + } + } + + $log->debug("Exit from function getPriceDetailsForProduct($productid)"); + return $price_details; + } + + function getProductBaseCurrency($productid, $module = 'Products') + { + $adb = PearDatabase::getInstance(); + if ($module == 'Services') { + $sql = 'select currency_id from vtiger_service where serviceid=?'; + } else { + $sql = 'select currency_id from vtiger_products where productid=?'; + } + $res = $adb->pquery($sql, [$productid]); + $currencyid = $adb->query_result($res, 0, 'currency_id'); + return $currencyid; + } + + function getBaseConversionRateForProduct($productid, $mode = 'edit', $module = 'Products') + { + $adb = PearDatabase::getInstance(); + $current_user = vglobal('current_user'); + if ($mode == 'edit') { + if ($module == 'Services') { + $sql = 'select conversion_rate from vtiger_service inner join vtiger_currency_info + on vtiger_service.currency_id = vtiger_currency_info.id where vtiger_service.serviceid=?'; + } else { + $sql = 'select conversion_rate from vtiger_products inner join vtiger_currency_info + on vtiger_products.currency_id = vtiger_currency_info.id where vtiger_products.productid=?'; + } + $params = array($productid); + } else { + $sql = 'select conversion_rate from vtiger_currency_info where id=?'; + $params = array(fetchCurrency($current_user->id)); + } + + $res = $adb->pquery($sql, $params); + $conv_rate = $adb->query_result($res, 0, 'conversion_rate'); + + return 1 / $conv_rate; + } + + protected static $discountsConfig = false; + public static function getDiscountsConfig() + { + if (self::$discountsConfig != false) { + return self::$discountsConfig; + } + + $db = PearDatabase::getInstance(); + $config = []; + $result = $db->query('SELECT * FROM a_yf_discounts_config'); + while ($row = $db->fetch_array($result)) { + $value = $row['value']; + if(in_array($row['param'],['discounts'] )){ + $value = explode(',', $value); + } + $config[$row['param']] = $value; + } + self::$discountsConfig = $config; + return $config; + } + public function getGlobalDiscounts() + { + $db = PearDatabase::getInstance(); + $config = []; + $result = $db->pquery('SELECT * FROM a_yf_discounts_global WHERE status = ?',[1]); + while ($row = $db->fetch_array($result)) { + $config[$row['name']] = $row['value']; } + return $config; } } diff --git a/modules/Products/views/Discounts.php b/modules/Products/views/Discounts.php new file mode 100644 index 000000000000..0ea3fe67f9d3 --- /dev/null +++ b/modules/Products/views/Discounts.php @@ -0,0 +1,49 @@ +getModule(); + $record = $request->get('record'); + $currency = $request->get('currency'); + $sourceModule = $request->get('sourceModule'); + $sourceRecord = $request->get('sourceRecord'); + $isIndividual = $request->get('isIndividual'); + $totalPrice = $request->get('totalPrice'); + $accountField = $request->get('accountField'); + + $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName); + $config = $recordModel->getDiscountsConfig(); + $groupDiscount = $this->getGroupDiscount($sourceModule, $sourceRecord, $accountField); + + $viewer = $this->getViewer($request); + $viewer->assign('MODULE', $moduleName); + $viewer->assign('GLOBAL_DISCOUNTS', $recordModel->getGlobalDiscounts()); + $viewer->assign('TOTAL_PRICE', $totalPrice); + $viewer->assign('CONFIG', $config); + $viewer->assign('AGGREGATION_TYPE', $config['aggregation']); + $viewer->assign('AGGREGATION_INPUT_TYPE', $config['aggregation'] == 0 ? 'radio' : 'checkbox'); + $viewer->assign('GROUP_DISCOUNT', $groupDiscount['discount']); + $viewer->assign('ACCOUNT_ID', $groupDiscount['accountid']); + $viewer->view('Discounts.tpl', $moduleName); + } + + public function getGroupDiscount($moduleName, $record, $accountField) + { + $discount = 0; + $discountField = 'discount'; + + if ($accountField != '') { + $recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName); + $relationFieldValue = $recordModel->get($accountField); + if ($relationFieldValue != 0) { + $mainRecordModel = Vtiger_Record_Model::getInstanceById($relationFieldValue, $mainModule); + $discount = $mainRecordModel->get($discountField); + } + } + + return ['discount' => $discount, 'accountid' => $relationFieldValue]; + } +} From 1fef375c66604b6923e9b61d34db82f8a4bb9635 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Tue, 11 Aug 2015 15:37:59 +0200 Subject: [PATCH 008/489] Added new mechanisms used for handling taxs --- layouts/vlayout/modules/Products/Taxs.tpl | 38 ++++++ .../vlayout/modules/Products/TaxsType0.tpl | 19 +++ .../vlayout/modules/Products/TaxsType1.tpl | 26 ++++ .../vlayout/modules/Products/TaxsType2.tpl | 20 +++ .../Supplies/fields/EditViewDiscount.tpl | 2 +- .../modules/Supplies/fields/EditViewPrice.tpl | 2 +- .../modules/Supplies/fields/EditViewTax.tpl | 10 +- .../modules/Supplies/resources/Edit.js | 125 +++++++++++++++--- .../modules/Supplies/resources/Edit.min.js | 2 +- modules/Products/models/Record.php | 41 +++++- modules/Products/views/Discounts.php | 1 + modules/Products/views/Taxs.php | 45 +++++++ modules/Supplies/actions/GetDetails.php | 4 +- modules/Supplies/fields/Discount.php | 2 +- modules/Supplies/fields/Tax.php | 5 +- modules/Supplies/models/Record.php | 2 +- modules/Supplies/views/Edit.php | 1 + 17 files changed, 310 insertions(+), 35 deletions(-) create mode 100644 layouts/vlayout/modules/Products/Taxs.tpl create mode 100644 layouts/vlayout/modules/Products/TaxsType0.tpl create mode 100644 layouts/vlayout/modules/Products/TaxsType1.tpl create mode 100644 layouts/vlayout/modules/Products/TaxsType2.tpl create mode 100644 modules/Products/views/Taxs.php diff --git a/layouts/vlayout/modules/Products/Taxs.tpl b/layouts/vlayout/modules/Products/Taxs.tpl new file mode 100644 index 000000000000..d12f1a1c5c23 --- /dev/null +++ b/layouts/vlayout/modules/Products/Taxs.tpl @@ -0,0 +1,38 @@ +{strip} + {assign var="SUPMODULE" value='Supplies'} + {assign var="AGGREGATION" value=$CONFIG['aggregation']} + +{/strip} diff --git a/layouts/vlayout/modules/Products/TaxsType0.tpl b/layouts/vlayout/modules/Products/TaxsType0.tpl new file mode 100644 index 000000000000..bc6b754d95de --- /dev/null +++ b/layouts/vlayout/modules/Products/TaxsType0.tpl @@ -0,0 +1,19 @@ +{strip} +
    +
    + {vtranslate('LBL_GLOBAL_TAXS', $SUPMODULE)} +
    + +
    +
    + +
    +{/strip} diff --git a/layouts/vlayout/modules/Products/TaxsType1.tpl b/layouts/vlayout/modules/Products/TaxsType1.tpl new file mode 100644 index 000000000000..14c2688bb4a6 --- /dev/null +++ b/layouts/vlayout/modules/Products/TaxsType1.tpl @@ -0,0 +1,26 @@ +{strip} + {if $GROUP_TAX != 0} +
    +
    + {vtranslate('LBL_GROUP_TAXS', $SUPMODULE)} +
    + +
    +
    + +
    + {/if} +{/strip} diff --git a/layouts/vlayout/modules/Products/TaxsType2.tpl b/layouts/vlayout/modules/Products/TaxsType2.tpl new file mode 100644 index 000000000000..83a4a8902975 --- /dev/null +++ b/layouts/vlayout/modules/Products/TaxsType2.tpl @@ -0,0 +1,20 @@ +{strip} +
    +
    + {vtranslate('LBL_INDIVIDUAL_TAX', $SUPMODULE)} +
    + +
    +
    + +
    +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewDiscount.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewDiscount.tpl index 22b9d713113c..d327a3294d74 100644 --- a/layouts/vlayout/modules/Supplies/fields/EditViewDiscount.tpl +++ b/layouts/vlayout/modules/Supplies/fields/EditViewDiscount.tpl @@ -7,7 +7,7 @@ {if $DISCOUNTS_CONFIG['discounts'][0] != ''} - {vtranslate('LBL_DISCOUNT', $SUP_VALUE)} + {vtranslate('LBL_DISCOUNT', $SUPMODULE)} {/if} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewPrice.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewPrice.tpl index 405932db496a..4ae5a62e8499 100644 --- a/layouts/vlayout/modules/Supplies/fields/EditViewPrice.tpl +++ b/layouts/vlayout/modules/Supplies/fields/EditViewPrice.tpl @@ -12,7 +12,7 @@ class="listPrice smallInputBox form-control input-sm" list-info=""/> {assign var=PRICEBOOK_MODULE_MODEL value=Vtiger_Module_Model::getInstance('PriceBooks')} - {if $PRICEBOOK_MODULE_MODEL->isPermitted('DetailView')} + {if in_array('3',$DISCOUNTS_CONFIG['discounts']) && $PRICEBOOK_MODULE_MODEL->isPermitted('DetailView')} {vtranslate('PriceBooks',$SUPMODULE)} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewTax.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewTax.tpl index b8f8beaa551b..d5453dbccdaf 100644 --- a/layouts/vlayout/modules/Supplies/fields/EditViewTax.tpl +++ b/layouts/vlayout/modules/Supplies/fields/EditViewTax.tpl @@ -1,9 +1,13 @@ {**} {strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)}
    - - {vtranslate('LBL_TAX', $SUP_VALUE)} - + {if $TAXS_CONFIG['taxs'][0] != ''} + + + {vtranslate('LBL_TAX', $SUPMODULE)} + + {/if}
    {/strip} diff --git a/layouts/vlayout/modules/Supplies/resources/Edit.js b/layouts/vlayout/modules/Supplies/resources/Edit.js index dc23224ccfbd..a44bd2a84a2c 100644 --- a/layouts/vlayout/modules/Supplies/resources/Edit.js +++ b/layouts/vlayout/modules/Supplies/resources/Edit.js @@ -11,6 +11,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { lineItemContentsContainer: false, rowClass: 'tr.rowSup', discountMondalFields: ['aggregationType', 'globalDiscount', 'groupCheckbox', 'groupDiscount', 'individualDiscount', 'individualDiscountType'], + taxMondalFields: ['aggregationType', 'globalTax', 'groupCheckbox', 'groupTax', 'individualTax'], /** * Function that is used to get the line item container * @return : jQuery object @@ -279,6 +280,50 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { mondal.find('.valuePrices').text(this.parsePrice(valuePrices)); mondal.find('.valueDiscount').text(netPriceBeforeDiscount - this.parsePrice(valuePrices)); }, + calculateTax: function (row, mondal) { + var netPriceWithoutTax = this.getTotalPrice(row), + valuePrices = netPriceWithoutTax, + globalTax = 0, + groupTax = 0, + individualTax = 0, + valueTax = 0; + + var taxType = mondal.find('.taxsType').val(); + if (taxType == '0' || taxType == '1') { + if (mondal.find('.activepanel .globalTax').length > 0) { + var globalTax = mondal.find('.activepanel .globalTax').val(); + } + if (mondal.find('.activepanel .individualTaxValue').length > 0) { + var value = mondal.find('.activepanel .individualTaxValue').val(); + individualTax = (value / 100) * valuePrices; + } + if (mondal.find('.activepanel .groupCheckbox').length > 0 && mondal.find('.activepanel .groupCheckbox').prop("checked") == true) { + var groupTax = mondal.find('.groupValue').val(); + groupTax = netPriceWithoutTax * (parseFloat(groupTax) / 100); + } + + valuePrices = valuePrices * ((100 + parseFloat(globalTax)) / 100); + valuePrices = valuePrices + parseFloat(individualTax); + valuePrices = valuePrices + parseFloat(groupTax); + } else if (taxType == '2') { + mondal.find('.activepanel').each(function (index) { + var panel = $(this); + if (panel.find('.globalTax').length > 0) { + var globalTax = parseFloat(panel.find('.globalTax').val()); + valuePrices = valuePrices * ((100 + globalTax) / 100); + } else if (panel.find('.groupCheckbox').length > 0 && panel.find('.groupCheckbox').prop("checked") == true) { + var groupTax = parseFloat(panel.find('.groupValue').val()); + valuePrices = valuePrices * ((100 + groupTax) / 100); + } else if (panel.find('.individualTaxValue').length > 0) { + var value = parseFloat(panel.find('.individualTaxValue').val()); + valuePrices = ((value + 100) / 100) * valuePrices; + } + }); + } + + mondal.find('.valuePrices').text(this.parsePrice(valuePrices)); + mondal.find('.valueTax').text(this.parsePrice(valuePrices - netPriceWithoutTax)); + }, updateRowSequence: function () { var subTable = this.getSupTableContainer(); subTable.find(this.rowClass).each(function (index) { @@ -375,12 +420,10 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { var thisInstance = this; for (var id in responseData) { - var recordId = id; var recordData = responseData[id]; var description = recordData.description; var listPriceValues = recordData.listpricevalues; var listPriceValuesJson = JSON.stringify(listPriceValues); - var taxes = recordData.taxes; for (var field in recordData) { parentRow.find('input.' + field).val(recordData[field]); @@ -389,15 +432,10 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { var currencyId = thisInstance.getCurrency(); if (typeof listPriceValues[currencyId] !== 'undefined') { thisInstance.setListPriceValue(parentRow, listPriceValues[currencyId]); - }else{ - } - $('input.listPrice', parentRow).attr('list-info', listPriceValuesJson); $('textarea.commentTextarea', parentRow).val(description); - //var taxUI = thisInstance.getTaxDiv(taxes, parentRow); - //$('.taxDivContainer', parentRow).html(taxUI); thisInstance.showIndividualTax(parentRow); } if (referenceModule === 'Products') { @@ -425,6 +463,26 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { }); parentRow.find('.discountParam').val(JSON.stringify(info)); }, + saveTaxsParameters: function (parentRow, mondal) { + var thisInstance = this; + var info = {}; + var extend = ['aggregationType', 'groupCheckbox', 'individualTaxType']; + $.each(thisInstance.taxMondalFields, function (index, param) { + if ($.inArray(param, extend) >= 0) { + if (mondal.find('[name="' + param + '"]:checked').length > 1) { + info[param] = []; + mondal.find('[name="' + param + '"]:checked').each(function (index) { + info[param].push($(this).val()); + }); + } else { + info[param] = mondal.find('[name="' + param + '"]:checked').val(); + } + } else { + info[param] = mondal.find('[name="' + param + '"]').val(); + } + }); + parentRow.find('.taxParam').val(JSON.stringify(info)); + }, initDiscountsParameters: function (parentRow, mondal) { var thisInstance = this; var parameters = parentRow.find('.discountParam').val(); @@ -457,6 +515,38 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { thisInstance.calculateDiscount(parentRow, mondal); }, + initTaxParameters: function (parentRow, mondal) { + var thisInstance = this; + var parameters = parentRow.find('.taxParam').val(); + if (parameters == '') { + return; + } + var parameters = JSON.parse(parameters); + $.each(thisInstance.taxMondalFields, function (index, param) { + var parameter = parameters[param]; + var field = mondal.find('[name="' + param + '"]'); + + if (field.attr('type') == 'checkbox' || field.attr('type') == 'radio') { + var array = parameter; + if (!$.isArray(array)) { + array = [array]; + } + $.each(array, function (index, arrayValue) { + var value = field.filter('[value="' + arrayValue + '"]').prop('checked', true) + if (param == 'aggregationType') { + value.closest('.panel').find('.panel-body').show(); + value.closest('.panel').addClass('activepanel'); + } + }); + } else if (field.prop("tagName") == 'SELECT') { + field.find('option[value="' + parameter + '"]').prop('selected', 'selected').change(); + } else { + mondal.find('[name="' + param + '"]').val(parameter); + } + }); + + thisInstance.calculateTax(parentRow, mondal); + }, registerAddRow: function (container) { var thisInstance = this; var subTable = this.getSupTableContainer(); @@ -656,8 +746,8 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { AppConnector.request(params).then( function (data) { app.showModalWindow(data, function (data) { - //thisInstance.initTaxParameters(parentRow, $(data)); - //thisInstance.registerChangeTaxModal(data, parentRow, params); + thisInstance.initTaxParameters(parentRow, $(data)); + thisInstance.registerChangeTaxModal(data, parentRow, params); }); progressInstace.hide(); }, @@ -669,9 +759,9 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { }, registerChangeTaxModal: function (mondal, parentRow, params) { var thisInstance = this; - mondal.on('change', '.individualDiscountType', function (e) { + mondal.on('change', '.individualTaxType', function (e) { var element = $(e.currentTarget); - mondal.find('.individualDiscountContainer .input-group-addon').text(element.data('symbol')); + mondal.find('.individualTaxContainer .input-group-addon').text(element.data('symbol')); }); mondal.on('change', '.activeCheckbox[name="aggregationType"]', function (e) { var element = $(e.currentTarget); @@ -689,14 +779,14 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { element.closest('.panel').removeClass('activepanel'); } }); - mondal.on('change', '.activeCheckbox, .globalDiscount,.individualDiscountValue,.individualDiscountType,.groupCheckbox', function (e) { + mondal.on('change', '.activeCheckbox, .globalTax,.individualTaxValue,.groupCheckbox', function (e) { var element = $(e.currentTarget); - thisInstance.calculateDiscount(parentRow, mondal); + thisInstance.calculateTax(parentRow, mondal); }); - mondal.on('click', '.saveDiscount', function (e) { - parentRow.find('.discount').val(mondal.find('.valueDiscount').text()); + mondal.on('click', '.saveTaxs', function (e) { + parentRow.find('.tax').val(mondal.find('.valueTax').text()); thisInstance.quantityChangeActions(parentRow); - thisInstance.saveDiscountsParameters(parentRow, mondal); + thisInstance.saveTaxsParameters(parentRow, mondal); app.hideModalWindow(); }); }, @@ -715,10 +805,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { } } - var element = parentRow.find('.rowName .recordLabel'); var selectedModule = parentRow.find('.rowName [name="popupReferenceModule"]').val(); - var popupElement = parentRow.find('.rowName .relatedPopup'); - var dataUrl = "index.php?module=" + app.getModuleName() + "&action=GetDetails&record=" + record + "¤cy_id=" + thisInstance.getCurrency(); AppConnector.request(dataUrl).then( function (data) { diff --git a/layouts/vlayout/modules/Supplies/resources/Edit.min.js b/layouts/vlayout/modules/Supplies/resources/Edit.min.js index 32950c22dd4b..4a257d547b33 100644 --- a/layouts/vlayout/modules/Supplies/resources/Edit.min.js +++ b/layouts/vlayout/modules/Supplies/resources/Edit.min.js @@ -1,2 +1,2 @@ -Vtiger_Edit_Js("Supplies_Edit_Js",{},{lineItemContentsContainer:false,rowClass:"tr.rowSup",discountMondalFields:["aggregationType","globalDiscount","groupCheckbox","groupDiscount","individualDiscount","individualDiscountType"],getSupTableContainer:function(){if(this.lineItemContentsContainer==false){this.lineItemContentsContainer=$(".suppliesItemTable")}return this.lineItemContentsContainer},getNextLineItemRowNumber:function(){var a=$(this.rowClass,this.getSupTableContainer()).length;$("#suppliesRowNo").val(a+1);return ++a},checkDeleteIcon:function(){var a=this.getSupTableContainer();if(a.find(this.rowClass).length>1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackSuppliesTable tr").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},parsePrice:function(a){var b=parseInt($(".numberOfCurrencyDecimal").val());return parseFloat(a).toFixed(b)},getTaxModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(c){var b=this;var a=b.getSupTableContainer().find(".colTax");if(b.isIndividualTaxMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".tax").val("0");b.rowsCalculations()}},getDiscountModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(c){var b=this;var a=b.getSupTableContainer().find(".colDiscount");if(b.isIndividualDiscountMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".discount").val("0");b.rowsCalculations()}},getCurrency:function(){var a=$('[name="currency"]',this.getSupTableContainer());return a.find("option:selected").val()},getTax:function(a){return parseFloat($(".tax",a).val())},getQuantityValue:function(a){return parseFloat($(".qty",a).val())},getListPriceValue:function(a){return parseFloat($(".listPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return parseFloat(b)},getNetPrice:function(a){return parseFloat($(".netPrice",a).val())},getTotalPrice:function(a){return parseFloat($(".totalPriceText",a).text())},getPurchase:function(a){var b=this.getQuantityValue(a);return parseFloat($(".purchase",a).val())*b},setListPriceValue:function(b,a){a=this.parsePrice(a);b.find(".listPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=this.parsePrice(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=this.parsePrice(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=this.parsePrice(a);$(".totalPriceText",b).text(a)},setMargin:function(b,a){a=this.parsePrice(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=this.parsePrice(a);$(".marginp",b).val(a)},quantityChangeActions:function(a){this.rowCalculations(a);this.sumaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getSupTableContainer().find(this.rowClass).each(function(b){a.quantityChangeActions($(this))})},sumaryCalculations:function(a){},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getListPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,c){var e=this.getTotalPrice(j),b=e,k=0,f=0,g=0,a=0;var i=c.find(".discountsType").val();if(i=="0"||i=="1"){if(c.find(".activepanel .globalDiscount").length>0){var k=c.find(".activepanel .globalDiscount").val()}if(c.find(".activepanel .individualDiscountType").length>0){var d=c.find('.activepanel .individualDiscountType[name="individual"]:checked').val();var h=c.find(".activepanel .individualDiscountValue").val();if(d=="percentage"){g=(h/100)*e}else{g=h}}if(c.find(".activepanel .groupCheckbox").length>0&&c.find(".activepanel .groupCheckbox").prop("checked")==true){var f=c.find(".groupValue").val();f=e*(parseFloat(f)/100)}b=b*((100-parseFloat(k))/100);b=b-parseFloat(g);b=b-parseFloat(f)}else{if(i=="2"){c.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=parseFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=parseFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=parseFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}c.find(".valuePrices").text(this.parsePrice(b));c.find(".valueDiscount").text(e-this.parsePrice(b))},updateRowSequence:function(){var a=this.getSupTableContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerSuppliesSaveData:function(a){a.on(Vtiger_Edit_Js.recordPreSave,function(d,c){var b=a.find("#blackSuppliesTable");b.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductListPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setListPriceValue(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(f,a){var d=this;var c=jQuery("input.sourceField",f).val();d.removeSubProducts(f);if(c=="0"){return false}if(d.subProductsCashe[c]){d.addSubProducts(f,d.subProductsCashe[c]);return false}var e={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(e).then(function(h){var g=h.result;d.subProductsCashe[c]=g;d.addSubProducts(f,g);if(b){b.hide()}},function(g,h){if(b){b.hide()}})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(h,m,d){var k=this;for(var b in d){var f=b;var a=d[b];var l=a.description;var c=a.listpricevalues;var e=JSON.stringify(c);var g=a.taxes;for(var i in a){m.find("input."+i).val(a[i])}var j=k.getCurrency();if(typeof c[j]!=="undefined"){k.setListPriceValue(m,c[j])}else{}$("input.listPrice",m).attr("list-info",e);$("textarea.commentTextarea",m).val(l);k.showIndividualTax(m)}if(h==="Products"){k.loadSubProducts(m,true)}this.quantityChangeActions(m)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".discountParam").val(JSON.stringify(c))},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(l,j){var h=a.find("#blackSuppliesTable");var f=c.getBasicRow();var d=c.getNextLineItemRowNumber();var g=$(l.currentTarget).data("module");var k=$(l.currentTarget).data("field");var i=f.html().replace(/_NUM_/g,d);f.html(i);f=f.appendTo(b.find("tbody"));f.find('.rowName input[name="popupReferenceModule"]').val(g).data("field",k);c.initRow();c.registerAutoCompleteFields(f)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(d,e){var f=e.item.find("textarea").attr("id");if(typeof f!="undefined"){var c=CKEDITOR.instances[f];c.destroy()}},stop:function(e,f){var c={};var d=f.item.find("textarea");if(typeof d.attr("id")!="undefined"){b.loadCkEditorElement(d)}b.updateRowSequence()}})},registerPriceBookPopUp:function(a){var b=this;a.on("click",".priceBookPopup",function(f){var d=$(f.currentTarget);var c=b.isRecordSelected(d);if(c==true){return}b.pricebooksPopupHandler(d)})},registerRowChangeEvent:function(a){var b=this;a.on("focusout",".qty",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("focusout",".listPrice",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("focusout",".purchase",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("change",".taxMode",function(d){var c=$(d.currentTarget);b.showIndividualTax(b.getClosestRow(c))});a.on("change",".discountMode",function(d){var c=$(d.currentTarget);b.showIndividualDiscount(b.getClosestRow(c))})},registerSubProducts:function(a){var b=this;a.find(this.rowClass).each(function(c){b.loadSubProducts($(this),false)})},registerClearReferenceSelection:function(a){var b=this;a.on("click",".clearReferenceSelection",function(d){var c=$(d.currentTarget);var f=b.getClosestRow(c);b.removeSubProducts(f);f.find(".listPrice,.tax,.discount,.margin,.purchase").val("0");f.find("textarea").val("");b.quantityChangeActions(f)})},registerDeleteLineItemEvent:function(a){var b=this;a.on("click",".deleteRow",function(d){var c=$(d.currentTarget);b.getClosestRow(c).remove();b.checkDeleteIcon()})},registerChangeDiscount:function(a){var b=this;a.on("click",".changeDiscount",function(g){var d=$(g.currentTarget);var f=d.closest(b.rowClass);var h={module:"Products",view:"Discounts",record:f.find(".rowName .sourceField").val(),currency:b.getCurrency(),sourceModule:app.getModuleName(),sourceRecord:app.getRecordId(),totalPrice:b.getTotalPrice(f),accountField:a.find("#accountReferenceField").val(),};var c=jQuery.progressIndicator();AppConnector.request(h).then(function(e){app.showModalWindow(e,function(i){b.initDiscountsParameters(f,$(i));b.registerChangeDiscountModal(i,f,h)});c.hide()},function(e,i){c.hide()})})},registerChangeDiscountModal:function(a,c,d){var b=this;a.on("change",".individualDiscountType",function(g){var f=$(g.currentTarget);a.find(".individualDiscountContainer .input-group-addon").text(f.data("symbol"))});a.on("change",'.activeCheckbox[name="aggregationType"]',function(g){var f=$(g.currentTarget);if(f.attr("type")=="checkbox"&&this.checked){f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{if(f.attr("type")=="radio"){a.find(".panel").removeClass("activepanel");a.find(".panel .panel-body").hide();f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{f.closest(".panel").find(".panel-body").hide();f.closest(".panel").removeClass("activepanel")}}});a.on("change",".activeCheckbox, .globalDiscount,.individualDiscountValue,.individualDiscountType,.groupCheckbox",function(g){var f=$(g.currentTarget);b.calculateDiscount(c,a)});a.on("click",".saveDiscount",function(f){c.find(".discount").val(a.find(".valueDiscount").text());b.quantityChangeActions(c);b.saveDiscountsParameters(c,a);app.hideModalWindow()})},registerChangeTax:function(a){var b=this;a.on("click",".changeTax",function(g){var d=$(g.currentTarget);var f=d.closest(b.rowClass);var h={module:"Products",view:"Taxs",record:f.find(".rowName .sourceField").val(),currency:b.getCurrency(),sourceModule:app.getModuleName(),sourceRecord:app.getRecordId(),totalPrice:b.getTotalPrice(f),};var c=jQuery.progressIndicator();AppConnector.request(h).then(function(e){app.showModalWindow(e,function(i){});c.hide()},function(e,i){c.hide()})})},registerChangeTaxModal:function(a,c,d){var b=this;a.on("change",".individualDiscountType",function(g){var f=$(g.currentTarget);a.find(".individualDiscountContainer .input-group-addon").text(f.data("symbol"))});a.on("change",'.activeCheckbox[name="aggregationType"]',function(g){var f=$(g.currentTarget);if(f.attr("type")=="checkbox"&&this.checked){f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{if(f.attr("type")=="radio"){a.find(".panel").removeClass("activepanel");a.find(".panel .panel-body").hide();f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{f.closest(".panel").find(".panel-body").hide();f.closest(".panel").removeClass("activepanel")}}});a.on("change",".activeCheckbox, .globalDiscount,.individualDiscountValue,.individualDiscountType,.groupCheckbox",function(g){var f=$(g.currentTarget);b.calculateDiscount(c,a)});a.on("click",".saveDiscount",function(f){c.find(".discount").val(a.find(".valueDiscount").text());b.quantityChangeActions(c);b.saveDiscountsParameters(c,a);app.hideModalWindow()})},registerRowAutoComplete:function(a){var b=this;var c=a.find(".rowName .sourceField");c.on(Vtiger_Edit_Js.postReferenceSelectionEvent,function(j,g){var h=$(j.currentTarget);var m=h.closest(b.rowClass);if(g.data.label){var i=g.data.id}else{for(var f in g.data){var i=f}}var h=m.find(".rowName .recordLabel");var d=m.find('.rowName [name="popupReferenceModule"]').val();var l=m.find(".rowName .relatedPopup");var k="index.php?module="+app.getModuleName()+"&action=GetDetails&record="+i+"¤cy_id="+b.getCurrency();AppConnector.request(k).then(function(n){for(var o in n){if(typeof n[o]=="object"){var e=n[o];b.mapResultsToFields(d,m,e)}}},function(e,n){})})},initRow:function(a){var b=this;if(typeof a=="undefined"){a=b.getSupTableContainer()}b.registerDeleteLineItemEvent(a);b.registerPriceBookPopUp(a);b.registerRowChangeEvent(a);b.registerRowAutoComplete(a);b.checkDeleteIcon()},registerBasicEvents:function(a){this._super(a);this.registerSuppliesSaveData(a);this.registerAddRow(a);this.initRow();this.registerSortableRow();this.registerSubProducts(a);this.registerChangeDiscount(a);this.registerChangeTax(a);this.registerClearReferenceSelection(a)},}); \ No newline at end of file +Vtiger_Edit_Js("Supplies_Edit_Js",{},{lineItemContentsContainer:false,rowClass:"tr.rowSup",discountMondalFields:["aggregationType","globalDiscount","groupCheckbox","groupDiscount","individualDiscount","individualDiscountType"],taxMondalFields:["aggregationType","globalTax","groupCheckbox","groupTax","individualTax"],getSupTableContainer:function(){if(this.lineItemContentsContainer==false){this.lineItemContentsContainer=$(".suppliesItemTable")}return this.lineItemContentsContainer},getNextLineItemRowNumber:function(){var a=$(this.rowClass,this.getSupTableContainer()).length;$("#suppliesRowNo").val(a+1);return ++a},checkDeleteIcon:function(){var a=this.getSupTableContainer();if(a.find(this.rowClass).length>1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackSuppliesTable tr").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},parsePrice:function(a){var b=parseInt($(".numberOfCurrencyDecimal").val());return parseFloat(a).toFixed(b)},getTaxModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(c){var b=this;var a=b.getSupTableContainer().find(".colTax");if(b.isIndividualTaxMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".tax").val("0");b.rowsCalculations()}},getDiscountModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(c){var b=this;var a=b.getSupTableContainer().find(".colDiscount");if(b.isIndividualDiscountMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".discount").val("0");b.rowsCalculations()}},getCurrency:function(){var a=$('[name="currency"]',this.getSupTableContainer());return a.find("option:selected").val()},getTax:function(a){return parseFloat($(".tax",a).val())},getQuantityValue:function(a){return parseFloat($(".qty",a).val())},getListPriceValue:function(a){return parseFloat($(".listPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return parseFloat(b)},getNetPrice:function(a){return parseFloat($(".netPrice",a).val())},getTotalPrice:function(a){return parseFloat($(".totalPriceText",a).text())},getPurchase:function(a){var b=this.getQuantityValue(a);return parseFloat($(".purchase",a).val())*b},setListPriceValue:function(b,a){a=this.parsePrice(a);b.find(".listPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=this.parsePrice(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=this.parsePrice(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=this.parsePrice(a);$(".totalPriceText",b).text(a)},setMargin:function(b,a){a=this.parsePrice(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=this.parsePrice(a);$(".marginp",b).val(a)},quantityChangeActions:function(a){this.rowCalculations(a);this.sumaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getSupTableContainer().find(this.rowClass).each(function(b){a.quantityChangeActions($(this))})},sumaryCalculations:function(a){},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getListPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,c){var e=this.getTotalPrice(j),b=e,k=0,f=0,g=0,a=0;var i=c.find(".discountsType").val();if(i=="0"||i=="1"){if(c.find(".activepanel .globalDiscount").length>0){var k=c.find(".activepanel .globalDiscount").val()}if(c.find(".activepanel .individualDiscountType").length>0){var d=c.find('.activepanel .individualDiscountType[name="individual"]:checked').val();var h=c.find(".activepanel .individualDiscountValue").val();if(d=="percentage"){g=(h/100)*e}else{g=h}}if(c.find(".activepanel .groupCheckbox").length>0&&c.find(".activepanel .groupCheckbox").prop("checked")==true){var f=c.find(".groupValue").val();f=e*(parseFloat(f)/100)}b=b*((100-parseFloat(k))/100);b=b-parseFloat(g);b=b-parseFloat(f)}else{if(i=="2"){c.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=parseFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=parseFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=parseFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}c.find(".valuePrices").text(this.parsePrice(b));c.find(".valueDiscount").text(e-this.parsePrice(b))},calculateTax:function(j,f){var g=this.getTotalPrice(j),a=g,b=0,e=0,h=0,d=0;var c=f.find(".taxsType").val();if(c=="0"||c=="1"){if(f.find(".activepanel .globalTax").length>0){var b=f.find(".activepanel .globalTax").val()}if(f.find(".activepanel .individualTaxValue").length>0){var i=f.find(".activepanel .individualTaxValue").val();h=(i/100)*a}if(f.find(".activepanel .groupCheckbox").length>0&&f.find(".activepanel .groupCheckbox").prop("checked")==true){var e=f.find(".groupValue").val();e=g*(parseFloat(e)/100)}a=a*((100+parseFloat(b))/100);a=a+parseFloat(h);a=a+parseFloat(e)}else{if(c=="2"){f.find(".activepanel").each(function(n){var k=$(this);if(k.find(".globalTax").length>0){var m=parseFloat(k.find(".globalTax").val());a=a*((100+m)/100)}else{if(k.find(".groupCheckbox").length>0&&k.find(".groupCheckbox").prop("checked")==true){var l=parseFloat(k.find(".groupValue").val());a=a*((100+l)/100)}else{if(k.find(".individualTaxValue").length>0){var o=parseFloat(k.find(".individualTaxValue").val());a=((o+100)/100)*a}}}})}}f.find(".valuePrices").text(this.parsePrice(a));f.find(".valueTax").text(this.parsePrice(a-g))},updateRowSequence:function(){var a=this.getSupTableContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerSuppliesSaveData:function(a){a.on(Vtiger_Edit_Js.recordPreSave,function(d,c){var b=a.find("#blackSuppliesTable");b.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductListPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setListPriceValue(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(f,a){var d=this;var c=jQuery("input.sourceField",f).val();d.removeSubProducts(f);if(c=="0"){return false}if(d.subProductsCashe[c]){d.addSubProducts(f,d.subProductsCashe[c]);return false}var e={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(e).then(function(h){var g=h.result;d.subProductsCashe[c]=g;d.addSubProducts(f,g);if(b){b.hide()}},function(g,h){if(b){b.hide()}})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,d){var i=this;for(var b in d){var a=d[b];var j=a.description;var c=a.listpricevalues;var e=JSON.stringify(c);for(var g in a){k.find("input."+g).val(a[g])}var h=i.getCurrency();if(typeof c[h]!=="undefined"){i.setListPriceValue(k,c[h])}$("input.listPrice",k).attr("list-info",e);$("textarea.commentTextarea",k).val(j);i.showIndividualTax(k)}if(f==="Products"){i.loadSubProducts(k,true)}this.quantityChangeActions(k)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".discountParam").val(JSON.stringify(c))},saveTaxsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(b.taxMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".taxParam").val(JSON.stringify(c))},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},initTaxParameters:function(d,a){var c=this;var b=d.find(".taxParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.taxMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateTax(d,a)},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(l,j){var h=a.find("#blackSuppliesTable");var f=c.getBasicRow();var d=c.getNextLineItemRowNumber();var g=$(l.currentTarget).data("module");var k=$(l.currentTarget).data("field");var i=f.html().replace(/_NUM_/g,d);f.html(i);f=f.appendTo(b.find("tbody"));f.find('.rowName input[name="popupReferenceModule"]').val(g).data("field",k);c.initRow();c.registerAutoCompleteFields(f)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(d,e){var f=e.item.find("textarea").attr("id");if(typeof f!="undefined"){var c=CKEDITOR.instances[f];c.destroy()}},stop:function(e,f){var c={};var d=f.item.find("textarea");if(typeof d.attr("id")!="undefined"){b.loadCkEditorElement(d)}b.updateRowSequence()}})},registerPriceBookPopUp:function(a){var b=this;a.on("click",".priceBookPopup",function(f){var d=$(f.currentTarget);var c=b.isRecordSelected(d);if(c==true){return}b.pricebooksPopupHandler(d)})},registerRowChangeEvent:function(a){var b=this;a.on("focusout",".qty",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("focusout",".listPrice",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("focusout",".purchase",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("change",".taxMode",function(d){var c=$(d.currentTarget);b.showIndividualTax(b.getClosestRow(c))});a.on("change",".discountMode",function(d){var c=$(d.currentTarget);b.showIndividualDiscount(b.getClosestRow(c))})},registerSubProducts:function(a){var b=this;a.find(this.rowClass).each(function(c){b.loadSubProducts($(this),false)})},registerClearReferenceSelection:function(a){var b=this;a.on("click",".clearReferenceSelection",function(d){var c=$(d.currentTarget);var f=b.getClosestRow(c);b.removeSubProducts(f);f.find(".listPrice,.tax,.discount,.margin,.purchase").val("0");f.find("textarea").val("");b.quantityChangeActions(f)})},registerDeleteLineItemEvent:function(a){var b=this;a.on("click",".deleteRow",function(d){var c=$(d.currentTarget);b.getClosestRow(c).remove();b.checkDeleteIcon()})},registerChangeDiscount:function(a){var b=this;a.on("click",".changeDiscount",function(g){var d=$(g.currentTarget);var f=d.closest(b.rowClass);var h={module:"Products",view:"Discounts",record:f.find(".rowName .sourceField").val(),currency:b.getCurrency(),sourceModule:app.getModuleName(),sourceRecord:app.getRecordId(),totalPrice:b.getTotalPrice(f),accountField:a.find("#accountReferenceField").val(),};var c=jQuery.progressIndicator();AppConnector.request(h).then(function(e){app.showModalWindow(e,function(i){b.initDiscountsParameters(f,$(i));b.registerChangeDiscountModal(i,f,h)});c.hide()},function(e,i){c.hide()})})},registerChangeDiscountModal:function(a,c,d){var b=this;a.on("change",".individualDiscountType",function(g){var f=$(g.currentTarget);a.find(".individualDiscountContainer .input-group-addon").text(f.data("symbol"))});a.on("change",'.activeCheckbox[name="aggregationType"]',function(g){var f=$(g.currentTarget);if(f.attr("type")=="checkbox"&&this.checked){f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{if(f.attr("type")=="radio"){a.find(".panel").removeClass("activepanel");a.find(".panel .panel-body").hide();f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{f.closest(".panel").find(".panel-body").hide();f.closest(".panel").removeClass("activepanel")}}});a.on("change",".activeCheckbox, .globalDiscount,.individualDiscountValue,.individualDiscountType,.groupCheckbox",function(g){var f=$(g.currentTarget);b.calculateDiscount(c,a)});a.on("click",".saveDiscount",function(f){c.find(".discount").val(a.find(".valueDiscount").text());b.quantityChangeActions(c);b.saveDiscountsParameters(c,a);app.hideModalWindow()})},registerChangeTax:function(a){var b=this;a.on("click",".changeTax",function(g){var d=$(g.currentTarget);var f=d.closest(b.rowClass);var h={module:"Products",view:"Taxs",record:f.find(".rowName .sourceField").val(),currency:b.getCurrency(),sourceModule:app.getModuleName(),sourceRecord:app.getRecordId(),totalPrice:b.getTotalPrice(f),};var c=jQuery.progressIndicator();AppConnector.request(h).then(function(e){app.showModalWindow(e,function(i){b.initTaxParameters(f,$(i));b.registerChangeTaxModal(i,f,h)});c.hide()},function(e,i){c.hide()})})},registerChangeTaxModal:function(a,c,d){var b=this;a.on("change",".individualTaxType",function(g){var f=$(g.currentTarget);a.find(".individualTaxContainer .input-group-addon").text(f.data("symbol"))});a.on("change",'.activeCheckbox[name="aggregationType"]',function(g){var f=$(g.currentTarget);if(f.attr("type")=="checkbox"&&this.checked){f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{if(f.attr("type")=="radio"){a.find(".panel").removeClass("activepanel");a.find(".panel .panel-body").hide();f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{f.closest(".panel").find(".panel-body").hide();f.closest(".panel").removeClass("activepanel")}}});a.on("change",".activeCheckbox, .globalTax,.individualTaxValue,.groupCheckbox",function(g){var f=$(g.currentTarget);b.calculateTax(c,a)});a.on("click",".saveTaxs",function(f){c.find(".tax").val(a.find(".valueTax").text());b.quantityChangeActions(c);b.saveTaxsParameters(c,a);app.hideModalWindow()})},registerRowAutoComplete:function(a){var b=this;var c=a.find(".rowName .sourceField");c.on(Vtiger_Edit_Js.postReferenceSelectionEvent,function(k,h){var g=$(k.currentTarget);var j=g.closest(b.rowClass);if(h.data.label){var d=h.data.id}else{for(var l in h.data){var d=l}}var f=j.find('.rowName [name="popupReferenceModule"]').val();var i="index.php?module="+app.getModuleName()+"&action=GetDetails&record="+d+"¤cy_id="+b.getCurrency();AppConnector.request(i).then(function(m){for(var n in m){if(typeof m[n]=="object"){var e=m[n];b.mapResultsToFields(f,j,e)}}},function(e,m){})})},initRow:function(a){var b=this;if(typeof a=="undefined"){a=b.getSupTableContainer()}b.registerDeleteLineItemEvent(a);b.registerPriceBookPopUp(a);b.registerRowChangeEvent(a);b.registerRowAutoComplete(a);b.checkDeleteIcon()},registerBasicEvents:function(a){this._super(a);this.registerSuppliesSaveData(a);this.registerAddRow(a);this.initRow();this.registerSortableRow();this.registerSubProducts(a);this.registerChangeDiscount(a);this.registerChangeTax(a);this.registerClearReferenceSelection(a)},}); \ No newline at end of file diff --git a/modules/Products/models/Record.php b/modules/Products/models/Record.php index 8a8fb7658a70..621fe6a4aa5f 100644 --- a/modules/Products/models/Record.php +++ b/modules/Products/models/Record.php @@ -558,18 +558,19 @@ function getBaseConversionRateForProduct($productid, $mode = 'edit', $module = ' } protected static $discountsConfig = false; + public static function getDiscountsConfig() { if (self::$discountsConfig != false) { return self::$discountsConfig; } - + $db = PearDatabase::getInstance(); $config = []; $result = $db->query('SELECT * FROM a_yf_discounts_config'); while ($row = $db->fetch_array($result)) { $value = $row['value']; - if(in_array($row['param'],['discounts'] )){ + if (in_array($row['param'], ['discounts'])) { $value = explode(',', $value); } $config[$row['param']] = $value; @@ -577,11 +578,45 @@ public static function getDiscountsConfig() self::$discountsConfig = $config; return $config; } + public function getGlobalDiscounts() { $db = PearDatabase::getInstance(); $config = []; - $result = $db->pquery('SELECT * FROM a_yf_discounts_global WHERE status = ?',[1]); + $result = $db->pquery('SELECT * FROM a_yf_discounts_global WHERE status = ?', [1]); + while ($row = $db->fetch_array($result)) { + $config[$row['name']] = $row['value']; + } + return $config; + } + + protected static $taxsConfig = false; + + public static function getTaxsConfig() + { + if (self::$taxsConfig != false) { + return self::$taxsConfig; + } + + $db = PearDatabase::getInstance(); + $config = []; + $result = $db->query('SELECT * FROM a_yf_taxs_config'); + while ($row = $db->fetch_array($result)) { + $value = $row['value']; + if (in_array($row['param'], ['taxs'])) { + $value = explode(',', $value); + } + $config[$row['param']] = $value; + } + self::$taxsConfig = $config; + return $config; + } + + public function getGlobalTaxs() + { + $db = PearDatabase::getInstance(); + $config = []; + $result = $db->pquery('SELECT * FROM a_yf_taxs_global WHERE status = ?', [1]); while ($row = $db->fetch_array($result)) { $config[$row['name']] = $row['value']; } diff --git a/modules/Products/views/Discounts.php b/modules/Products/views/Discounts.php index 0ea3fe67f9d3..019d749cd7bd 100644 --- a/modules/Products/views/Discounts.php +++ b/modules/Products/views/Discounts.php @@ -21,6 +21,7 @@ public function process(Vtiger_Request $request) $viewer = $this->getViewer($request); $viewer->assign('MODULE', $moduleName); $viewer->assign('GLOBAL_DISCOUNTS', $recordModel->getGlobalDiscounts()); + $viewer->assign('CURRENCY_SYMBOL', Vtiger_Functions::getCurrencySymbolandRate($currency)['symbol']); $viewer->assign('TOTAL_PRICE', $totalPrice); $viewer->assign('CONFIG', $config); $viewer->assign('AGGREGATION_TYPE', $config['aggregation']); diff --git a/modules/Products/views/Taxs.php b/modules/Products/views/Taxs.php new file mode 100644 index 000000000000..b5526fbab23c --- /dev/null +++ b/modules/Products/views/Taxs.php @@ -0,0 +1,45 @@ +getModule(); + $record = $request->get('record'); + $currency = $request->get('currency'); + $sourceModule = $request->get('sourceModule'); + $sourceRecord = $request->get('sourceRecord'); + $isIndividual = $request->get('isIndividual'); + $totalPrice = $request->get('totalPrice'); + + $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName); + $config = $recordModel->getTaxsConfig(); + //$groupDiscount = $this->getGroupTaxs($sourceModule, $sourceRecord); + + $viewer = $this->getViewer($request); + $viewer->assign('MODULE', $moduleName); + $viewer->assign('GLOBAL_TAXS', $recordModel->getGlobalTaxs()); + $viewer->assign('CURRENCY_SYMBOL', Vtiger_Functions::getCurrencySymbolandRate($currency)['symbol']); + $viewer->assign('TOTAL_PRICE', $totalPrice); + $viewer->assign('CONFIG', $config); + $viewer->assign('AGGREGATION_TYPE', $config['aggregation']); + $viewer->assign('AGGREGATION_INPUT_TYPE', $config['aggregation'] == 0 ? 'radio' : 'checkbox'); + //$viewer->assign('GROUP_TAX', $groupDiscount['discount']); + $viewer->view('Taxs.tpl', $moduleName); + } + + public function getGroupTaxs($moduleName, $record) + { + $discount = 0; + $taxField = 'discount'; + + if ($record != '') { + $recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName); + $relationFieldValue = $recordModel->get($accountField); + + } + + return ['discount' => $discount, 'accountid' => $relationFieldValue]; + } +} diff --git a/modules/Supplies/actions/GetDetails.php b/modules/Supplies/actions/GetDetails.php index d253fb92d0b2..24ae6c503e77 100644 --- a/modules/Supplies/actions/GetDetails.php +++ b/modules/Supplies/actions/GetDetails.php @@ -51,7 +51,7 @@ function getRecordDetail($recordId, $currencyId) $recordModel = Vtiger_Record_Model::getInstanceById($recordId); $moduleName = $recordModel->getModuleName(); if (in_array($moduleName, ['Products', 'Services'])) { - $taxes = $recordModel->getTaxes(); + //$taxes = $recordModel->getTaxes(); $listPriceValues = $recordModel->getListPriceValues($recordModel->getId()); $priceDetails = $recordModel->getPriceDetails(); foreach ($priceDetails as $currencyDetails) { @@ -66,7 +66,7 @@ function getRecordDetail($recordId, $currencyId) $recordId => [ 'id' => $recordId, 'name' => decode_html($recordModel->getName()), - 'taxes' => $taxes, + //'taxes' => $taxes, 'price' => $listPrice, 'listpricevalues' => $listPriceValues, 'description' => decode_html($recordModel->get('description')), diff --git a/modules/Supplies/fields/Discount.php b/modules/Supplies/fields/Discount.php index 8918e8ab007c..71ea651c30b4 100644 --- a/modules/Supplies/fields/Discount.php +++ b/modules/Supplies/fields/Discount.php @@ -14,7 +14,7 @@ class Supplies_Discount_Field extends Supplies_Basic_Field protected $columnname = 'discount'; protected $dbType = 'decimal(27,8) DEFAULT \'0\''; protected $customColumn = [ - 'discountparam' => 'varchar(255)' + 'discountparam' => 'varchar(255) NOT NULL' ]; /** diff --git a/modules/Supplies/fields/Tax.php b/modules/Supplies/fields/Tax.php index ca959bc9e346..c4bcfd72ea0b 100644 --- a/modules/Supplies/fields/Tax.php +++ b/modules/Supplies/fields/Tax.php @@ -11,11 +11,10 @@ class Supplies_Tax_Field extends Supplies_Basic_Field protected $name = 'Tax'; protected $defaultLabel = 'LBL_TAX'; - protected $defaultValue = 'tax'; protected $columnname = 'tax'; - protected $dbType = 'decimal(27,8)'; + protected $dbType = 'decimal(27,8) DEFAULT \'0\''; protected $customColumn = [ - 'taxtype' => 'int(19)' + 'taxparam' => 'varchar(255) NOT NULL' ]; /** diff --git a/modules/Supplies/models/Record.php b/modules/Supplies/models/Record.php index 753e428180d9..a1071c617bad 100644 --- a/modules/Supplies/models/Record.php +++ b/modules/Supplies/models/Record.php @@ -9,7 +9,7 @@ class Supplies_Record_Model extends Vtiger_Record_Model { - protected $jsonFields = ['discountparam']; + protected $jsonFields = ['discountparam','taxparam']; /** * Save supplie data diff --git a/modules/Supplies/views/Edit.php b/modules/Supplies/views/Edit.php index 97a8e4c7a243..9979fd4e818b 100644 --- a/modules/Supplies/views/Edit.php +++ b/modules/Supplies/views/Edit.php @@ -15,6 +15,7 @@ public function preProcess (Vtiger_Request $request, $display=true) { $viewer = $this->getViewer($request); $viewer->assign('ACCOUNT_REFERENCE_FIELD', $this->getReferenceField($moduleName)); $viewer->assign('DISCOUNTS_CONFIG', Products_Record_Model::getDiscountsConfig()); + $viewer->assign('TAXS_CONFIG', Products_Record_Model::getTaxsConfig()); $viewer->view('TopEditView.tpl', Supplies_Module_Model::getModuleNameForTpl('TopEditView.tpl', $moduleName)); } From 816b7efcaa5c1494e5306980e42854ad8187de0d Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Tue, 11 Aug 2015 15:59:17 +0200 Subject: [PATCH 009/489] Fix cron --- cron/vtigercron.php | 1 + 1 file changed, 1 insertion(+) diff --git a/cron/vtigercron.php b/cron/vtigercron.php index 8a59108eb540..f7e5f8151988 100644 --- a/cron/vtigercron.php +++ b/cron/vtigercron.php @@ -14,6 +14,7 @@ require_once 'config/config.php'; require_once 'config/debug.php'; require_once 'config/performance.php'; +require_once('include/ConfigUtils.php'); include_once 'vtlib/Vtiger/Cron.php'; require_once('modules/Emails/mail.php'); // Extended inclusions From c1b1ca64850f78f78df7d17bf1252ceef37c916d Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Wed, 12 Aug 2015 13:26:28 +0200 Subject: [PATCH 010/489] Improved display of errors in PearDatabase --- include/database/PearDatabase.php | 9 ++++----- vtlib/Vtiger/Functions.php | 13 +++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/include/database/PearDatabase.php b/include/database/PearDatabase.php index 98fe5b436e97..0a98ae7381b6 100644 --- a/include/database/PearDatabase.php +++ b/include/database/PearDatabase.php @@ -166,8 +166,7 @@ function checkError($message, $dieOnError = false, $query = false, $params = fal } if ($this->dieOnError || $dieOnError) { if (SysDebug::get('DISPLAY_DEBUG_BACKTRACE')) { - ob_start(); - debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + $queryInfo = ''; if ($query !== false) { $queryInfo .= 'Query: ' . $query . PHP_EOL; @@ -175,10 +174,10 @@ function checkError($message, $dieOnError = false, $query = false, $params = fal if ($params !== false && $params != NULL) { $queryInfo .= 'Params: ' . implode(',', $params) . PHP_EOL; } - $trace = '
    ' . $queryInfo . ob_get_contents() . '
    '; - ob_end_clean(); + $backtrace = Vtiger_Functions::getBacktrace(); + $trace = '
    ' . $queryInfo . $backtrace . '
    '; } - die('Database ERROR: ' . $message . $trace); + throw new AppException('Database ERROR: ' . PHP_EOL . $message . PHP_EOL . $trace); } } diff --git a/vtlib/Vtiger/Functions.php b/vtlib/Vtiger/Functions.php index 2976ac9f755f..6f41cb99ee48 100644 --- a/vtlib/Vtiger/Functions.php +++ b/vtlib/Vtiger/Functions.php @@ -1314,4 +1314,17 @@ public static function getInitials($name) $initial .= strtoupper($word[0]); return $initial; } + + public function getBacktrace($ignore = 2) + { + $trace = ''; + foreach (debug_backtrace() as $k => $v) { + if ($k < $ignore) { + continue; + } + $trace .= '#' . ($k - $ignore) . ' ' . (isset($v['class']) ? $v['class'] . '->' : '') . $v['function'] . '() in ' . $v['file'] . '(' . $v['line'] . '): ' . PHP_EOL; + } + + return $trace; + } } From 3af108b9edd42b37fb9fe38d961d27cbb7d352f8 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Wed, 12 Aug 2015 13:31:27 +0200 Subject: [PATCH 011/489] Redesigned the CRON mechanism --- cron/vtigercron.php | 57 ++++++++++++++++++++++++++----------------- vtlib/Vtiger/Cron.php | 47 ++++++++++++----------------------- 2 files changed, 50 insertions(+), 54 deletions(-) diff --git a/cron/vtigercron.php b/cron/vtigercron.php index f7e5f8151988..a9e0d91b6d57 100644 --- a/cron/vtigercron.php +++ b/cron/vtigercron.php @@ -11,24 +11,23 @@ /** * Start the cron services configured. */ -require_once 'config/config.php'; -require_once 'config/debug.php'; -require_once 'config/performance.php'; +require_once('config/config.php'); +require_once('config/debug.php'); +require_once('config/performance.php'); require_once('include/ConfigUtils.php'); -include_once 'vtlib/Vtiger/Cron.php'; +require_once('vtlib/Vtiger/Cron.php'); require_once('modules/Emails/mail.php'); -// Extended inclusions -require_once 'include/Loader.php'; +require_once('include/Loader.php'); vimport('include.runtime.EntryPoint'); if (PHP_SAPI === "cli" || PHP_SAPI === "cgi-fcgi" || (isset($_SESSION["authenticated_user_id"]) && isset($_SESSION["app_unique_key"]) && $_SESSION["app_unique_key"] == $application_unique_key)) { $log = LoggerManager::getLogger('CRON'); vglobal('log', $log); - + $cronTasks = false; if (isset($_REQUEST['service'])) { // Run specific service - $cronTasks = array(Vtiger_Cron::getInstance($_REQUEST['service'])); + $cronTasks = [Vtiger_Cron::getInstance($_REQUEST['service'])]; } else { // Run all service $cronTasks = Vtiger_Cron::listAllActiveInstances(); @@ -40,40 +39,52 @@ $current_user = vglobal('current_user'); $current_user = Users::getActiveAdminUser(); - echo sprintf('%s | Start CRON', date('Y-m-d H:i:s')) . "\n"; + echo sprintf('--------------- %s | Start CRON ----------', date('Y-m-d H:i:s')) . PHP_EOL; foreach ($cronTasks as $cronTask) { try { - $cronTask->setBulkMode(true); + // Timeout could happen if intermediate cron-tasks fails + // and affect the next task. Which need to be handled in this cycle. + if ($cronTask->hadTimeout()) { + echo sprintf('%s | %s - Cron task had timedout as it was not completed last time it run' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName()); + } // Not ready to run yet? - if (!$cronTask->isRunnable()) { - echo sprintf("%s | %s - not ready to run as the time to run again is not completed\n", date('Y-m-d H:i:s'), $cronTask->getName()); + if ($cronTask->isRunning()) { + $log->fatal($cronTask->getName() . ' - Task omitted, it has not been finished during the last scanning'); + echo sprintf('%s | %s - Task omitted, it has not been finished during the last scanning' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName()); continue; } - // Timeout could happen if intermediate cron-tasks fails - // and affect the next task. Which need to be handled in this cycle. - if ($cronTask->hadTimedout()) { - echo sprintf("%s | %s - cron task had timedout as it is not completed last time it run- restarting\n", date('Y-m-d H:i:s'), $cronTask->getName()); + // Not ready to run yet? + if (!$cronTask->isRunnable()) { + $log->info($cronTask->getName() . ' - Not ready to run as the time to run again is not completed'); + echo sprintf('%s | %s - Not ready to run as the time to run again is not completed' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName()); + continue; } // Mark the status - running $cronTask->markRunning(); - echo sprintf('%s | %s (%s) - Start task', date('Y-m-d H:i:s'), $cronTask->getName(), date('Y-m-d H:i:s', $cronTask->getLastStart())) . "\n"; + echo sprintf('%s | %s - Start task' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName()); checkFileAccess($cronTask->getHandlerFile()); + ob_start(); require_once $cronTask->getHandlerFile(); + $taskResponse = ob_get_contents(); + ob_end_clean(); + if ($taskResponse != '') { + $log->warn($cronTask->getName() . ' - The task returned a message:' . PHP_EOL . $taskResponse); + echo 'Task response:' . PHP_EOL . $taskResponse . PHP_EOL; + } // Mark the status - finished $cronTask->markFinished(); - echo "\n" . sprintf('%s | %s (%s) - End task', date('Y-m-d H:i:s'), $cronTask->getName(), date('Y-m-d H:i:s', $cronTask->getLastStart()), date('Y-m-d H:i:s', $cronTask->getLastEnd())) . "\n"; - } catch (Exception $e) { - echo sprintf("%s | ERROR: %s - cron task execution throwed exception.\n", date('Y-m-d H:i:s'), $cronTask->getName()); - echo $e->getMessage(); - echo "\n"; + echo sprintf('%s | %s - End task', date('Y-m-d H:i:s'), $cronTask->getName()) . PHP_EOL; + } catch (AppException $e) { + echo sprintf('%s | ERROR: %s - Cron task execution throwed exception.' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName()); + echo $e->getMessage() . PHP_EOL; } } - echo sprintf('%s | End CRON', date('Y-m-d H:i:s')) . "\n"; + echo sprintf('=============== %s | End CRON ==========', date('Y-m-d H:i:s')) . PHP_EOL; } else { echo("Access denied!"); } diff --git a/vtlib/Vtiger/Cron.php b/vtlib/Vtiger/Cron.php index c8b0576c83e4..540aac7872f3 100644 --- a/vtlib/Vtiger/Cron.php +++ b/vtlib/Vtiger/Cron.php @@ -25,7 +25,6 @@ class Vtiger_Cron static $STATUS_RUNNING = 2; static $STATUS_COMPLETED = 3; protected $data; - protected $bulkMode = false; /** * Constructor @@ -170,16 +169,11 @@ function getDescription() */ function isRunnable() { - $runnable = false; - - if (!$this->isDisabled()) { - // Take care of last time (end - on success, start - if timedout) - // Take care to start the cron im - $lastTime = ($this->getLastStart() > 0) ? $this->getLastStart() : $this->getLastEnd(); - $elapsedTime = time() - $lastTime; - $runnable = ($elapsedTime >= ($this->getFrequency() - 60)); - } - return $runnable; + // Take care of last time (end - on success, start - if timedout) + // Take care to start the cron im + $lastTime = ($this->getLastStart() > 0) ? $this->getLastStart() : $this->getLastEnd(); + $elapsedTime = time() - $lastTime; + return ($elapsedTime >= ($this->getFrequency() - 60)); } /** @@ -245,7 +239,7 @@ function updateFrequency($frequency) function markRunning() { $time = time(); - self::querySilent('UPDATE vtiger_cron_task SET status=?, laststart=?, lastend=? WHERE id=?', array(self::$STATUS_RUNNING, $time, 0, $this->getId())); + self::querySilent('UPDATE vtiger_cron_task SET status=?, laststart=? WHERE id=?', array(self::$STATUS_RUNNING, $time, $this->getId())); return $this->set('laststart', $time); } @@ -259,29 +253,20 @@ function markFinished() return $this->set('lastend', $time); } - /** - * Set the bulkMode flag - */ - function setBulkMode($mode = null) - { - $this->bulkMode = $mode; - } - - /** - * Is task in bulk mode execution? - */ - function inBulkMode() - { - return $this->bulkMode; - } - /** * Detect if the task was started by never finished. */ - function hadTimedout() + function hadTimeout() { - if ($this->data['lastend'] === 0 && $this->data['laststart'] != 0) - return intval($this->data['lastend']); + if ($this->getLastEnd() === 0 && $this->getLastStart() != 0) { + return true; + } + + $maxExecutionTime = intval(ini_get('max_execution_time')); + if ($this->getTimeDiff() > $maxExecutionTime) { + return true; + } + return false; } /** From 2287fdc05e4ee40d25f7bd21e237f83afcde2854 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Wed, 12 Aug 2015 14:48:20 +0200 Subject: [PATCH 012/489] Order in Cron Adding a functionality to unblock stopped cron --- config/config.template.php | 5 ++- cron/vtigercron.php | 3 ++ vtlib/Vtiger/Cron.php | 78 ++++---------------------------------- 3 files changed, 14 insertions(+), 72 deletions(-) diff --git a/config/config.template.php b/config/config.template.php index 1315cc15c982..a50403ef3c34 100644 --- a/config/config.template.php +++ b/config/config.template.php @@ -242,4 +242,7 @@ $gsMinLength = 3; // autocomplete global search - Amount of returned results. -$gsAmountResponse = 10; \ No newline at end of file +$gsAmountResponse = 10; + +// Should the task in cron be unblocked if the script execution time was exceeded +$unblockedTimeoutCronTasks = true; diff --git a/cron/vtigercron.php b/cron/vtigercron.php index a9e0d91b6d57..606e02a25bcf 100644 --- a/cron/vtigercron.php +++ b/cron/vtigercron.php @@ -46,6 +46,9 @@ // and affect the next task. Which need to be handled in this cycle. if ($cronTask->hadTimeout()) { echo sprintf('%s | %s - Cron task had timedout as it was not completed last time it run' . PHP_EOL, date('Y-m-d H:i:s'), $cronTask->getName()); + if(vglobal('unblockedTimeoutCronTasks')){ + $cronTask->unlockTask(); + } } // Not ready to run yet? diff --git a/vtlib/Vtiger/Cron.php b/vtlib/Vtiger/Cron.php index 540aac7872f3..9b4396fe2624 100644 --- a/vtlib/Vtiger/Cron.php +++ b/vtlib/Vtiger/Cron.php @@ -258,12 +258,12 @@ function markFinished() */ function hadTimeout() { - if ($this->getLastEnd() === 0 && $this->getLastStart() != 0) { - return true; + if (!$this->isRunning()) { + return false; } - $maxExecutionTime = intval(ini_get('max_execution_time')); - if ($this->getTimeDiff() > $maxExecutionTime) { + $lastEnd = $this->getLastEnd(); + if (time() > ($lastEnd + $maxExecutionTime)) { return true; } return false; @@ -413,74 +413,10 @@ static function listAllInstancesByModule($module) } return $instances; } - /* - * Fuction uses to log the cron when it is in running - * for long time - * @Params Completed - flag when then the cron is completed after long time - */ - public function log($completed = false) + function unlockTask() { - $adb = PearDatabase::getInstance(); - $result = self::querySilent('SELECT id,iteration from vtiger_cron_log where start = ? AND name=?', array($this->getLastStart(), $this->getName())); - if ($result && $adb->num_rows($result) > 0) { - $row = $adb->fetch_array($result); - if ($completed) { - self::querySilent('UPDATE vtiger_cron_log set status = ?,end = ? where id = ?', array(self::$STATUS_COMPLETED, time(), $row['id'])); - } else { - - self::querySilent('UPDATE vtiger_cron_log set iteration = ? where id = ?', array($row['iteration'] + 1, $row['id'])); - } - } else { - self::querySilent('INSERT INTO vtiger_cron_log (name,start,iteration,status) VALUES(?,?,?,?)', array($this->getName(), $this->getLastStart(), 1, self::$STATUS_RUNNING)); - } - } - /* - * Function to verify where the log Mail is sent are not - */ - - public function isSentLogMail() - { - $adb = PearDatabase::getInstance(); - $result = self::querySilent('SELECT 1 from vtiger_cron_log where start = ? AND name=? AND iteration >= 4 ', array($this->getLastStart(), $this->getName())); - if ($result && $adb->num_rows($result)) { - return true; - } else { - return false; - } - } - /* - * Function to get number of times a Cron task was skipped due to running state - * @returns Iterations - */ - - public function getIterations() - { - $adb = PearDatabase::getInstance(); - $result = self::querySilent('SELECT iteration from vtiger_cron_log where start = ? AND name=?', array($this->getLastStart(), $this->getName())); - if ($result && $adb->num_rows($result)) { - $row = $adb->fetch_array($result); - return $row['iteration']; - } - } - /* - * Function to get time to Complete the cron when it take - * @returns competed time in hours and mins - */ - - public function getCompletedTime() - { - $adb = PearDatabase::getInstance(); - $result = self::querySilent('SELECT start,end from vtiger_cron_log where start = ? AND name=?', array($this->getLastStart(), $this->getName())); - if ($result && $adb->num_rows($result)) { - $row = $adb->fetch_array($result); - $duration = $row['end'] - $row['start']; - $hours = (int) ($duration / 60); - $minutes = $duration - ($hours * 60); - - return "$hours hours and $minutes minutes"; - } + $this->updateStatus(self::$STATUS_ENABLED); } + } - -?> From db2fb84cfc5f32227b6879829b7f020d7f070aee Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Wed, 12 Aug 2015 15:00:37 +0200 Subject: [PATCH 013/489] Added limit of scanned e-mails --- config/performance.php | 3 ++ modules/OSSMailScanner/models/Record.php | 40 ++++++++++++------------ 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/config/performance.php b/config/performance.php index cfbc2d64d542..a850275d9989 100644 --- a/config/performance.php +++ b/config/performance.php @@ -27,4 +27,7 @@ // Display administrators in the list of users (Assigned To) 'SHOW_ADMINISTRATORS_IN_USERS_LIST' => true, + + // The numbers of emails downloaded during one scanning + 'NUMBERS_EMAILS_DOWNLOADED_DURING_ONE_SCANNING' => 100, ); diff --git a/modules/OSSMailScanner/models/Record.php b/modules/OSSMailScanner/models/Record.php index fb7a2f3445ec..5d69a563e462 100644 --- a/modules/OSSMailScanner/models/Record.php +++ b/modules/OSSMailScanner/models/Record.php @@ -257,9 +257,8 @@ function manualScanMail($params) return $return; } - public static function mail_Scan($mbox, $account, $folder, $scan_id) + public static function mail_Scan($mbox, $account, $folder, $scan_id, $countEmails) { - $return = []; $last_user_uid = self::getUidFolder($account['user_id'], $folder); $msgno = imap_msgno($mbox, $last_user_uid); $num_msg = imap_num_msg($mbox); @@ -289,7 +288,6 @@ public static function mail_Scan($mbox, $account, $folder, $scan_id) } if ($get_emails) { - $return['count'] = 0; for ($i = $msgno; $i <= $num_msg; $i++) { $OSSMailModel = Vtiger_Record_Model::getCleanInstance('OSSMail'); self::checkFolderUid($account['user_id'], $folder); @@ -299,13 +297,16 @@ public static function mail_Scan($mbox, $account, $folder, $scan_id) $mail_detail['Account_user_id'] = $account['user_id']; self::executeActions($account, $mail_detail, $folder); $adb = PearDatabase::getInstance(); - $adb->pquery("update vtiger_ossmailscanner_folders_uid set uid=? where user_id=? AND folder = ?", array($uid, $account['user_id'], $folder)); - self::update_scan_history($scan_id, Array('status' => '1', 'count' => $return['count'], 'action' => 'Action_CronMailScanner')); - $return['count'] ++; + $adb->pquery('update vtiger_ossmailscanner_folders_uid set uid=? where user_id=? AND folder = ?', [$uid, $account['user_id'], $folder]); + $countEmails++; + self::update_scan_history($scan_id, ['status' => '1', 'count' => $countEmails, 'action' => 'Action_CronMailScanner']); + if ($countEmails >= PerformancePrefs::get('NUMBERS_EMAILS_DOWNLOADED_DURING_ONE_SCANNING')) { + return $countEmails; + } } } - return $return; + return $countEmails; } public static function getEmailSearch($module = false) @@ -505,14 +506,14 @@ public function executeCron($who_trigger) } $OSSMailModel = Vtiger_Record_Model::getCleanInstance('OSSMail'); $OSSMailScannerModel = Vtiger_Record_Model::getCleanInstance('OSSMailScanner'); - $count_emails = 0; - $scan_id = 0; + $countEmails = 0; + $scanId = 0; $accounts = $OSSMailModel->getAccountsList(); if (!$accounts) return false; self::setCronStatus('2'); - $scan_id = $OSSMailScannerModel->add_scan_history(Array('user' => $who_trigger)); - foreach ($OSSMailModel->getAccountsList() as $Account) { + $scanId = $OSSMailScannerModel->add_scan_history(Array('user' => $who_trigger)); + foreach ($OSSMailModel->getAccountsList() as $account) { foreach ($OSSMailScannerModel->getConfigFolderList() as $key => $folders) { if ($folders != null) { $folderArray = Array(); @@ -522,20 +523,19 @@ public function executeCron($who_trigger) $folderArray[0] = $folders; } foreach ($folderArray as $folder) { - //var_dump($Account['username'] , $Account['password'],$folder);echo '
    '; - $mbox = $OSSMailModel->imap_connect($Account['username'], $Account['password'], $folder); - //$msgno = imap_msgno($mbox,$last_user_uid ); - //imap_uid($mbox,$num_msg); - $mail_Scan_result = $OSSMailScannerModel->mail_Scan($mbox, $Account, $folder, $scan_id); - $count_emails += $mail_Scan_result['count']; - //var_dump($folder,imap_num_msg($mbox),imap_uid($mbox,imap_num_msg($mbox)) ); + $mbox = $OSSMailModel->imap_connect($account['username'], $account['password'], $folder); + $countEmails = $OSSMailScannerModel->mail_Scan($mbox, $account, $folder, $scanId, $countEmails); imap_close($mbox); - //echo '-

    '; + if ($countEmails >= PerformancePrefs::get('NUMBERS_EMAILS_DOWNLOADED_DURING_ONE_SCANNING')) { + $OSSMailScannerModel->update_scan_history($scanId, ['status' => '0', 'count' => $countEmails, 'action' => 'Action_CronMailScanner']); + self::setCronStatus('1'); + return 'ok'; + } } } } } - $OSSMailScannerModel->update_scan_history($scan_id, Array('status' => '0', 'count' => $count_emails, 'action' => 'Action_CronMailScanner')); + $OSSMailScannerModel->update_scan_history($scanId, ['status' => '0', 'count' => $countEmails, 'action' => 'Action_CronMailScanner']); self::setCronStatus('1'); return 'ok'; } From 69f83cb75ffa46faa0612b23178b21655a435c87 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Wed, 12 Aug 2015 15:25:20 +0200 Subject: [PATCH 014/489] Added validation of disk capacity --- languages/de_de/Settings/ConfReport.php | 4 ++++ languages/en_us/Settings/ConfReport.php | 4 ++++ languages/nl_nl/Settings/ConfReport.php | 4 ++++ languages/pl_pl/Settings/ConfReport.php | 4 ++++ languages/pt_br/Settings/ConfReport.php | 4 ++++ languages/ru_ru/Settings/ConfReport.php | 4 ++++ .../modules/Settings/ConfReport/Index.tpl | 21 +++++++++++++++++++ vtlib/Vtiger/Functions.php | 12 +++++++++++ 8 files changed, 57 insertions(+) diff --git a/languages/de_de/Settings/ConfReport.php b/languages/de_de/Settings/ConfReport.php index e08db5dbb320..5ca5bb1ce4c5 100644 --- a/languages/de_de/Settings/ConfReport.php +++ b/languages/de_de/Settings/ConfReport.php @@ -44,4 +44,8 @@ 'LBL_JSON_LIBRARY' => 'JSON', 'LBL_SESSION_LIBRARY' => 'SESSION', 'LBL_DOM_LIBRARY' => 'DOM', + 'LBL_SPACE'=>'__UNTRANSLATED__', + 'LBL_SPACE_TOTAL'=>'__UNTRANSLATED__', + 'LBL_SPACE_FREE'=>'__UNTRANSLATED__', + 'LBL_SPACE_USED'=>'__UNTRANSLATED__', ]; diff --git a/languages/en_us/Settings/ConfReport.php b/languages/en_us/Settings/ConfReport.php index 9fc465f0cecd..bacc869efb64 100644 --- a/languages/en_us/Settings/ConfReport.php +++ b/languages/en_us/Settings/ConfReport.php @@ -43,4 +43,8 @@ 'LBL_JSON_LIBRARY' => 'JSON', 'LBL_SESSION_LIBRARY' => 'SESSION', 'LBL_DOM_LIBRARY' => 'DOM', + 'LBL_SPACE'=>'__UNTRANSLATED__', + 'LBL_SPACE_TOTAL'=>'__UNTRANSLATED__', + 'LBL_SPACE_FREE'=>'__UNTRANSLATED__', + 'LBL_SPACE_USED'=>'__UNTRANSLATED__', ]; diff --git a/languages/nl_nl/Settings/ConfReport.php b/languages/nl_nl/Settings/ConfReport.php index 9fc465f0cecd..bacc869efb64 100644 --- a/languages/nl_nl/Settings/ConfReport.php +++ b/languages/nl_nl/Settings/ConfReport.php @@ -43,4 +43,8 @@ 'LBL_JSON_LIBRARY' => 'JSON', 'LBL_SESSION_LIBRARY' => 'SESSION', 'LBL_DOM_LIBRARY' => 'DOM', + 'LBL_SPACE'=>'__UNTRANSLATED__', + 'LBL_SPACE_TOTAL'=>'__UNTRANSLATED__', + 'LBL_SPACE_FREE'=>'__UNTRANSLATED__', + 'LBL_SPACE_USED'=>'__UNTRANSLATED__', ]; diff --git a/languages/pl_pl/Settings/ConfReport.php b/languages/pl_pl/Settings/ConfReport.php index 52a549b34721..371e949f9e1a 100644 --- a/languages/pl_pl/Settings/ConfReport.php +++ b/languages/pl_pl/Settings/ConfReport.php @@ -44,4 +44,8 @@ 'LBL_JSON_LIBRARY' => 'JSON', 'LBL_SESSION_LIBRARY' => 'SESSION', 'LBL_DOM_LIBRARY' => 'DOM', + 'LBL_SPACE'=>'Pojemność', + 'LBL_SPACE_TOTAL'=>'Całkowita', + 'LBL_SPACE_FREE'=>'Wolnych', + 'LBL_SPACE_USED'=>'Zajętych', ]; diff --git a/languages/pt_br/Settings/ConfReport.php b/languages/pt_br/Settings/ConfReport.php index 6a821f189d59..3d45ac676d1f 100644 --- a/languages/pt_br/Settings/ConfReport.php +++ b/languages/pt_br/Settings/ConfReport.php @@ -43,4 +43,8 @@ 'LBL_JSON_LIBRARY' => 'JSON', 'LBL_SESSION_LIBRARY' => 'SESSION', 'LBL_DOM_LIBRARY' => 'DOM', + 'LBL_SPACE'=>'__UNTRANSLATED__', + 'LBL_SPACE_TOTAL'=>'__UNTRANSLATED__', + 'LBL_SPACE_FREE'=>'__UNTRANSLATED__', + 'LBL_SPACE_USED'=>'__UNTRANSLATED__', ]; diff --git a/languages/ru_ru/Settings/ConfReport.php b/languages/ru_ru/Settings/ConfReport.php index 5bb34ed5923d..21551394bcbf 100644 --- a/languages/ru_ru/Settings/ConfReport.php +++ b/languages/ru_ru/Settings/ConfReport.php @@ -60,4 +60,8 @@ 'LBL_JSON_LIBRARY' => 'JSON', 'LBL_SESSION_LIBRARY' => 'SESSION', 'LBL_DOM_LIBRARY' => 'DOM', + 'LBL_SPACE'=>'__UNTRANSLATED__', + 'LBL_SPACE_TOTAL'=>'__UNTRANSLATED__', + 'LBL_SPACE_FREE'=>'__UNTRANSLATED__', + 'LBL_SPACE_USED'=>'__UNTRANSLATED__', ]; diff --git a/layouts/vlayout/modules/Settings/ConfReport/Index.tpl b/layouts/vlayout/modules/Settings/ConfReport/Index.tpl index b925a9e41e26..21c5cdbe479a 100644 --- a/layouts/vlayout/modules/Settings/ConfReport/Index.tpl +++ b/layouts/vlayout/modules/Settings/ConfReport/Index.tpl @@ -66,6 +66,27 @@
    + + + + + + + + + {foreach from=Vtiger_Functions::getDiskSpace() key=key item=item} + + + + + {/foreach} + +
    + {vtranslate('LBL_FILE', $MODULE)} + + {vtranslate('LBL_SPACE', $MODULE)} +
    {vtranslate('LBL_SPACE_'|cat:strtoupper($key), $MODULE)}{Vtiger_Functions::showBytes($item)}
    +
    diff --git a/vtlib/Vtiger/Functions.php b/vtlib/Vtiger/Functions.php index 6f41cb99ee48..d292032ad774 100644 --- a/vtlib/Vtiger/Functions.php +++ b/vtlib/Vtiger/Functions.php @@ -1327,4 +1327,16 @@ public function getBacktrace($ignore = 2) return $trace; } + + + public function getDiskSpace($dir = '') + { + if($dir == ''){ + $dir = vglobal('root_directory'); + } + $total = disk_total_space($dir); + $free = disk_free_space($dir); + $used = $total - $free; + return ['total' => $total,'free' => $free,'used' => $used]; + } } From 4b192a75b987f881371f583d3d5a27115f914586 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Wed, 12 Aug 2015 15:48:38 +0200 Subject: [PATCH 015/489] Added maximum execution time to set up a cron --- config/config.template.php | 5 +++-- vtlib/Vtiger/Cron.php | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/config.template.php b/config/config.template.php index a50403ef3c34..b7d40264da28 100644 --- a/config/config.template.php +++ b/config/config.template.php @@ -244,5 +244,6 @@ // autocomplete global search - Amount of returned results. $gsAmountResponse = 10; -// Should the task in cron be unblocked if the script execution time was exceeded -$unblockedTimeoutCronTasks = true; + +$maxExecutionCronTime = 3600; + diff --git a/vtlib/Vtiger/Cron.php b/vtlib/Vtiger/Cron.php index 9b4396fe2624..45998039fec2 100644 --- a/vtlib/Vtiger/Cron.php +++ b/vtlib/Vtiger/Cron.php @@ -262,6 +262,9 @@ function hadTimeout() return false; } $maxExecutionTime = intval(ini_get('max_execution_time')); + if($maxExecutionTime == 0){ + $maxExecutionTime = vglobal('maxExecutionCronTime'); + } $lastEnd = $this->getLastEnd(); if (time() > ($lastEnd + $maxExecutionTime)) { return true; From 298438649337e9c8374ca28b47365238b3f5729a Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Wed, 12 Aug 2015 15:59:41 +0200 Subject: [PATCH 016/489] Fix cron hadTimeout --- vtlib/Vtiger/Cron.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vtlib/Vtiger/Cron.php b/vtlib/Vtiger/Cron.php index 45998039fec2..7b88aba9520c 100644 --- a/vtlib/Vtiger/Cron.php +++ b/vtlib/Vtiger/Cron.php @@ -265,8 +265,11 @@ function hadTimeout() if($maxExecutionTime == 0){ $maxExecutionTime = vglobal('maxExecutionCronTime'); } - $lastEnd = $this->getLastEnd(); - if (time() > ($lastEnd + $maxExecutionTime)) { + $time = $this->getLastEnd(); + if($time == 0){ + $time = $this->getLastStart(); + } + if (time() > ($time + $maxExecutionTime)) { return true; } return false; From fc8850ef586a0003443041e3b59bd78ae66cdb0e Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Mon, 17 Aug 2015 11:20:17 +0200 Subject: [PATCH 017/489] Wysiwyg editor added to the modules Supplies --- .../modules/Supplies/EditViewSupplies.tpl | 2 +- .../modules/Supplies/fields/EditViewName.tpl | 4 ++-- .../vlayout/modules/Supplies/resources/Edit.js | 10 +++++++++- .../modules/Supplies/resources/Edit.min.js | 2 +- modules/Products/views/Taxs.php | 15 --------------- modules/Supplies/models/SupField.php | 16 ++++++++++++++++ modules/Supplies/views/Edit.php | 7 ++++--- 7 files changed, 33 insertions(+), 23 deletions(-) diff --git a/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl b/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl index f57530bc8f2d..cc3fb3de9421 100644 --- a/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl +++ b/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl @@ -59,7 +59,7 @@ {foreach item=MAIN_MODULE from=$MAIN_PARAMS['modules']} {assign var="CRMEntity" value=CRMEntity::getInstance($MAIN_MODULE)} - diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewName.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewName.tpl index 7a2980588a95..089878bf07b1 100644 --- a/layouts/vlayout/modules/Supplies/fields/EditViewName.tpl +++ b/layouts/vlayout/modules/Supplies/fields/EditViewName.tpl @@ -44,8 +44,8 @@
    -
    - +
    +
    {/strip} diff --git a/layouts/vlayout/modules/Supplies/resources/Edit.js b/layouts/vlayout/modules/Supplies/resources/Edit.js index a44bd2a84a2c..0184ff97b02f 100644 --- a/layouts/vlayout/modules/Supplies/resources/Edit.js +++ b/layouts/vlayout/modules/Supplies/resources/Edit.js @@ -547,6 +547,12 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { thisInstance.calculateTax(parentRow, mondal); }, + loadWysiwyg: function (row, wysiwyg) { + var thisInstance = this; + if(wysiwyg == '1'){ + thisInstance.loadCkEditorElement(row.find('.ckEditorSource')); + } + }, registerAddRow: function (container) { var thisInstance = this; var subTable = this.getSupTableContainer(); @@ -556,7 +562,8 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { var sequenceNumber = thisInstance.getNextLineItemRowNumber(); var module = $(e.currentTarget).data('module'); var field = $(e.currentTarget).data('field'); - + var wysiwyg = $(e.currentTarget).data('wysiwyg'); + var replaced = newRow.html().replace(/_NUM_/g, sequenceNumber); newRow.html(replaced); newRow = newRow.appendTo(subTable.find('tbody')); @@ -564,6 +571,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { newRow.find('.rowName input[name="popupReferenceModule"]').val(module).data('field', field); thisInstance.initRow(); thisInstance.registerAutoCompleteFields(newRow); + thisInstance.loadWysiwyg(newRow, wysiwyg); }); }, registerSortableRow: function () { diff --git a/layouts/vlayout/modules/Supplies/resources/Edit.min.js b/layouts/vlayout/modules/Supplies/resources/Edit.min.js index 4a257d547b33..3a8fac79342c 100644 --- a/layouts/vlayout/modules/Supplies/resources/Edit.min.js +++ b/layouts/vlayout/modules/Supplies/resources/Edit.min.js @@ -1,2 +1,2 @@ -Vtiger_Edit_Js("Supplies_Edit_Js",{},{lineItemContentsContainer:false,rowClass:"tr.rowSup",discountMondalFields:["aggregationType","globalDiscount","groupCheckbox","groupDiscount","individualDiscount","individualDiscountType"],taxMondalFields:["aggregationType","globalTax","groupCheckbox","groupTax","individualTax"],getSupTableContainer:function(){if(this.lineItemContentsContainer==false){this.lineItemContentsContainer=$(".suppliesItemTable")}return this.lineItemContentsContainer},getNextLineItemRowNumber:function(){var a=$(this.rowClass,this.getSupTableContainer()).length;$("#suppliesRowNo").val(a+1);return ++a},checkDeleteIcon:function(){var a=this.getSupTableContainer();if(a.find(this.rowClass).length>1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackSuppliesTable tr").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},parsePrice:function(a){var b=parseInt($(".numberOfCurrencyDecimal").val());return parseFloat(a).toFixed(b)},getTaxModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(c){var b=this;var a=b.getSupTableContainer().find(".colTax");if(b.isIndividualTaxMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".tax").val("0");b.rowsCalculations()}},getDiscountModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(c){var b=this;var a=b.getSupTableContainer().find(".colDiscount");if(b.isIndividualDiscountMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".discount").val("0");b.rowsCalculations()}},getCurrency:function(){var a=$('[name="currency"]',this.getSupTableContainer());return a.find("option:selected").val()},getTax:function(a){return parseFloat($(".tax",a).val())},getQuantityValue:function(a){return parseFloat($(".qty",a).val())},getListPriceValue:function(a){return parseFloat($(".listPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return parseFloat(b)},getNetPrice:function(a){return parseFloat($(".netPrice",a).val())},getTotalPrice:function(a){return parseFloat($(".totalPriceText",a).text())},getPurchase:function(a){var b=this.getQuantityValue(a);return parseFloat($(".purchase",a).val())*b},setListPriceValue:function(b,a){a=this.parsePrice(a);b.find(".listPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=this.parsePrice(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=this.parsePrice(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=this.parsePrice(a);$(".totalPriceText",b).text(a)},setMargin:function(b,a){a=this.parsePrice(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=this.parsePrice(a);$(".marginp",b).val(a)},quantityChangeActions:function(a){this.rowCalculations(a);this.sumaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getSupTableContainer().find(this.rowClass).each(function(b){a.quantityChangeActions($(this))})},sumaryCalculations:function(a){},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getListPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,c){var e=this.getTotalPrice(j),b=e,k=0,f=0,g=0,a=0;var i=c.find(".discountsType").val();if(i=="0"||i=="1"){if(c.find(".activepanel .globalDiscount").length>0){var k=c.find(".activepanel .globalDiscount").val()}if(c.find(".activepanel .individualDiscountType").length>0){var d=c.find('.activepanel .individualDiscountType[name="individual"]:checked').val();var h=c.find(".activepanel .individualDiscountValue").val();if(d=="percentage"){g=(h/100)*e}else{g=h}}if(c.find(".activepanel .groupCheckbox").length>0&&c.find(".activepanel .groupCheckbox").prop("checked")==true){var f=c.find(".groupValue").val();f=e*(parseFloat(f)/100)}b=b*((100-parseFloat(k))/100);b=b-parseFloat(g);b=b-parseFloat(f)}else{if(i=="2"){c.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=parseFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=parseFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=parseFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}c.find(".valuePrices").text(this.parsePrice(b));c.find(".valueDiscount").text(e-this.parsePrice(b))},calculateTax:function(j,f){var g=this.getTotalPrice(j),a=g,b=0,e=0,h=0,d=0;var c=f.find(".taxsType").val();if(c=="0"||c=="1"){if(f.find(".activepanel .globalTax").length>0){var b=f.find(".activepanel .globalTax").val()}if(f.find(".activepanel .individualTaxValue").length>0){var i=f.find(".activepanel .individualTaxValue").val();h=(i/100)*a}if(f.find(".activepanel .groupCheckbox").length>0&&f.find(".activepanel .groupCheckbox").prop("checked")==true){var e=f.find(".groupValue").val();e=g*(parseFloat(e)/100)}a=a*((100+parseFloat(b))/100);a=a+parseFloat(h);a=a+parseFloat(e)}else{if(c=="2"){f.find(".activepanel").each(function(n){var k=$(this);if(k.find(".globalTax").length>0){var m=parseFloat(k.find(".globalTax").val());a=a*((100+m)/100)}else{if(k.find(".groupCheckbox").length>0&&k.find(".groupCheckbox").prop("checked")==true){var l=parseFloat(k.find(".groupValue").val());a=a*((100+l)/100)}else{if(k.find(".individualTaxValue").length>0){var o=parseFloat(k.find(".individualTaxValue").val());a=((o+100)/100)*a}}}})}}f.find(".valuePrices").text(this.parsePrice(a));f.find(".valueTax").text(this.parsePrice(a-g))},updateRowSequence:function(){var a=this.getSupTableContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerSuppliesSaveData:function(a){a.on(Vtiger_Edit_Js.recordPreSave,function(d,c){var b=a.find("#blackSuppliesTable");b.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductListPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setListPriceValue(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(f,a){var d=this;var c=jQuery("input.sourceField",f).val();d.removeSubProducts(f);if(c=="0"){return false}if(d.subProductsCashe[c]){d.addSubProducts(f,d.subProductsCashe[c]);return false}var e={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(e).then(function(h){var g=h.result;d.subProductsCashe[c]=g;d.addSubProducts(f,g);if(b){b.hide()}},function(g,h){if(b){b.hide()}})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,d){var i=this;for(var b in d){var a=d[b];var j=a.description;var c=a.listpricevalues;var e=JSON.stringify(c);for(var g in a){k.find("input."+g).val(a[g])}var h=i.getCurrency();if(typeof c[h]!=="undefined"){i.setListPriceValue(k,c[h])}$("input.listPrice",k).attr("list-info",e);$("textarea.commentTextarea",k).val(j);i.showIndividualTax(k)}if(f==="Products"){i.loadSubProducts(k,true)}this.quantityChangeActions(k)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".discountParam").val(JSON.stringify(c))},saveTaxsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(b.taxMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".taxParam").val(JSON.stringify(c))},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},initTaxParameters:function(d,a){var c=this;var b=d.find(".taxParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.taxMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateTax(d,a)},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(l,j){var h=a.find("#blackSuppliesTable");var f=c.getBasicRow();var d=c.getNextLineItemRowNumber();var g=$(l.currentTarget).data("module");var k=$(l.currentTarget).data("field");var i=f.html().replace(/_NUM_/g,d);f.html(i);f=f.appendTo(b.find("tbody"));f.find('.rowName input[name="popupReferenceModule"]').val(g).data("field",k);c.initRow();c.registerAutoCompleteFields(f)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(d,e){var f=e.item.find("textarea").attr("id");if(typeof f!="undefined"){var c=CKEDITOR.instances[f];c.destroy()}},stop:function(e,f){var c={};var d=f.item.find("textarea");if(typeof d.attr("id")!="undefined"){b.loadCkEditorElement(d)}b.updateRowSequence()}})},registerPriceBookPopUp:function(a){var b=this;a.on("click",".priceBookPopup",function(f){var d=$(f.currentTarget);var c=b.isRecordSelected(d);if(c==true){return}b.pricebooksPopupHandler(d)})},registerRowChangeEvent:function(a){var b=this;a.on("focusout",".qty",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("focusout",".listPrice",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("focusout",".purchase",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("change",".taxMode",function(d){var c=$(d.currentTarget);b.showIndividualTax(b.getClosestRow(c))});a.on("change",".discountMode",function(d){var c=$(d.currentTarget);b.showIndividualDiscount(b.getClosestRow(c))})},registerSubProducts:function(a){var b=this;a.find(this.rowClass).each(function(c){b.loadSubProducts($(this),false)})},registerClearReferenceSelection:function(a){var b=this;a.on("click",".clearReferenceSelection",function(d){var c=$(d.currentTarget);var f=b.getClosestRow(c);b.removeSubProducts(f);f.find(".listPrice,.tax,.discount,.margin,.purchase").val("0");f.find("textarea").val("");b.quantityChangeActions(f)})},registerDeleteLineItemEvent:function(a){var b=this;a.on("click",".deleteRow",function(d){var c=$(d.currentTarget);b.getClosestRow(c).remove();b.checkDeleteIcon()})},registerChangeDiscount:function(a){var b=this;a.on("click",".changeDiscount",function(g){var d=$(g.currentTarget);var f=d.closest(b.rowClass);var h={module:"Products",view:"Discounts",record:f.find(".rowName .sourceField").val(),currency:b.getCurrency(),sourceModule:app.getModuleName(),sourceRecord:app.getRecordId(),totalPrice:b.getTotalPrice(f),accountField:a.find("#accountReferenceField").val(),};var c=jQuery.progressIndicator();AppConnector.request(h).then(function(e){app.showModalWindow(e,function(i){b.initDiscountsParameters(f,$(i));b.registerChangeDiscountModal(i,f,h)});c.hide()},function(e,i){c.hide()})})},registerChangeDiscountModal:function(a,c,d){var b=this;a.on("change",".individualDiscountType",function(g){var f=$(g.currentTarget);a.find(".individualDiscountContainer .input-group-addon").text(f.data("symbol"))});a.on("change",'.activeCheckbox[name="aggregationType"]',function(g){var f=$(g.currentTarget);if(f.attr("type")=="checkbox"&&this.checked){f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{if(f.attr("type")=="radio"){a.find(".panel").removeClass("activepanel");a.find(".panel .panel-body").hide();f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{f.closest(".panel").find(".panel-body").hide();f.closest(".panel").removeClass("activepanel")}}});a.on("change",".activeCheckbox, .globalDiscount,.individualDiscountValue,.individualDiscountType,.groupCheckbox",function(g){var f=$(g.currentTarget);b.calculateDiscount(c,a)});a.on("click",".saveDiscount",function(f){c.find(".discount").val(a.find(".valueDiscount").text());b.quantityChangeActions(c);b.saveDiscountsParameters(c,a);app.hideModalWindow()})},registerChangeTax:function(a){var b=this;a.on("click",".changeTax",function(g){var d=$(g.currentTarget);var f=d.closest(b.rowClass);var h={module:"Products",view:"Taxs",record:f.find(".rowName .sourceField").val(),currency:b.getCurrency(),sourceModule:app.getModuleName(),sourceRecord:app.getRecordId(),totalPrice:b.getTotalPrice(f),};var c=jQuery.progressIndicator();AppConnector.request(h).then(function(e){app.showModalWindow(e,function(i){b.initTaxParameters(f,$(i));b.registerChangeTaxModal(i,f,h)});c.hide()},function(e,i){c.hide()})})},registerChangeTaxModal:function(a,c,d){var b=this;a.on("change",".individualTaxType",function(g){var f=$(g.currentTarget);a.find(".individualTaxContainer .input-group-addon").text(f.data("symbol"))});a.on("change",'.activeCheckbox[name="aggregationType"]',function(g){var f=$(g.currentTarget);if(f.attr("type")=="checkbox"&&this.checked){f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{if(f.attr("type")=="radio"){a.find(".panel").removeClass("activepanel");a.find(".panel .panel-body").hide();f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{f.closest(".panel").find(".panel-body").hide();f.closest(".panel").removeClass("activepanel")}}});a.on("change",".activeCheckbox, .globalTax,.individualTaxValue,.groupCheckbox",function(g){var f=$(g.currentTarget);b.calculateTax(c,a)});a.on("click",".saveTaxs",function(f){c.find(".tax").val(a.find(".valueTax").text());b.quantityChangeActions(c);b.saveTaxsParameters(c,a);app.hideModalWindow()})},registerRowAutoComplete:function(a){var b=this;var c=a.find(".rowName .sourceField");c.on(Vtiger_Edit_Js.postReferenceSelectionEvent,function(k,h){var g=$(k.currentTarget);var j=g.closest(b.rowClass);if(h.data.label){var d=h.data.id}else{for(var l in h.data){var d=l}}var f=j.find('.rowName [name="popupReferenceModule"]').val();var i="index.php?module="+app.getModuleName()+"&action=GetDetails&record="+d+"¤cy_id="+b.getCurrency();AppConnector.request(i).then(function(m){for(var n in m){if(typeof m[n]=="object"){var e=m[n];b.mapResultsToFields(f,j,e)}}},function(e,m){})})},initRow:function(a){var b=this;if(typeof a=="undefined"){a=b.getSupTableContainer()}b.registerDeleteLineItemEvent(a);b.registerPriceBookPopUp(a);b.registerRowChangeEvent(a);b.registerRowAutoComplete(a);b.checkDeleteIcon()},registerBasicEvents:function(a){this._super(a);this.registerSuppliesSaveData(a);this.registerAddRow(a);this.initRow();this.registerSortableRow();this.registerSubProducts(a);this.registerChangeDiscount(a);this.registerChangeTax(a);this.registerClearReferenceSelection(a)},}); \ No newline at end of file +Vtiger_Edit_Js("Supplies_Edit_Js",{},{lineItemContentsContainer:false,rowClass:"tr.rowSup",discountMondalFields:["aggregationType","globalDiscount","groupCheckbox","groupDiscount","individualDiscount","individualDiscountType"],taxMondalFields:["aggregationType","globalTax","groupCheckbox","groupTax","individualTax"],getSupTableContainer:function(){if(this.lineItemContentsContainer==false){this.lineItemContentsContainer=$(".suppliesItemTable")}return this.lineItemContentsContainer},getNextLineItemRowNumber:function(){var a=$(this.rowClass,this.getSupTableContainer()).length;$("#suppliesRowNo").val(a+1);return ++a},checkDeleteIcon:function(){var a=this.getSupTableContainer();if(a.find(this.rowClass).length>1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackSuppliesTable tr").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},parsePrice:function(a){var b=parseInt($(".numberOfCurrencyDecimal").val());return parseFloat(a).toFixed(b)},getTaxModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(c){var b=this;var a=b.getSupTableContainer().find(".colTax");if(b.isIndividualTaxMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".tax").val("0");b.rowsCalculations()}},getDiscountModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(c){var b=this;var a=b.getSupTableContainer().find(".colDiscount");if(b.isIndividualDiscountMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".discount").val("0");b.rowsCalculations()}},getCurrency:function(){var a=$('[name="currency"]',this.getSupTableContainer());return a.find("option:selected").val()},getTax:function(a){return parseFloat($(".tax",a).val())},getQuantityValue:function(a){return parseFloat($(".qty",a).val())},getListPriceValue:function(a){return parseFloat($(".listPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return parseFloat(b)},getNetPrice:function(a){return parseFloat($(".netPrice",a).val())},getTotalPrice:function(a){return parseFloat($(".totalPriceText",a).text())},getPurchase:function(a){var b=this.getQuantityValue(a);return parseFloat($(".purchase",a).val())*b},setListPriceValue:function(b,a){a=this.parsePrice(a);b.find(".listPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=this.parsePrice(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=this.parsePrice(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=this.parsePrice(a);$(".totalPriceText",b).text(a)},setMargin:function(b,a){a=this.parsePrice(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=this.parsePrice(a);$(".marginp",b).val(a)},quantityChangeActions:function(a){this.rowCalculations(a);this.sumaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getSupTableContainer().find(this.rowClass).each(function(b){a.quantityChangeActions($(this))})},sumaryCalculations:function(a){},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getListPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,c){var e=this.getTotalPrice(j),b=e,k=0,f=0,g=0,a=0;var i=c.find(".discountsType").val();if(i=="0"||i=="1"){if(c.find(".activepanel .globalDiscount").length>0){var k=c.find(".activepanel .globalDiscount").val()}if(c.find(".activepanel .individualDiscountType").length>0){var d=c.find('.activepanel .individualDiscountType[name="individual"]:checked').val();var h=c.find(".activepanel .individualDiscountValue").val();if(d=="percentage"){g=(h/100)*e}else{g=h}}if(c.find(".activepanel .groupCheckbox").length>0&&c.find(".activepanel .groupCheckbox").prop("checked")==true){var f=c.find(".groupValue").val();f=e*(parseFloat(f)/100)}b=b*((100-parseFloat(k))/100);b=b-parseFloat(g);b=b-parseFloat(f)}else{if(i=="2"){c.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=parseFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=parseFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=parseFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}c.find(".valuePrices").text(this.parsePrice(b));c.find(".valueDiscount").text(e-this.parsePrice(b))},calculateTax:function(j,f){var g=this.getTotalPrice(j),a=g,b=0,e=0,h=0,d=0;var c=f.find(".taxsType").val();if(c=="0"||c=="1"){if(f.find(".activepanel .globalTax").length>0){var b=f.find(".activepanel .globalTax").val()}if(f.find(".activepanel .individualTaxValue").length>0){var i=f.find(".activepanel .individualTaxValue").val();h=(i/100)*a}if(f.find(".activepanel .groupCheckbox").length>0&&f.find(".activepanel .groupCheckbox").prop("checked")==true){var e=f.find(".groupValue").val();e=g*(parseFloat(e)/100)}a=a*((100+parseFloat(b))/100);a=a+parseFloat(h);a=a+parseFloat(e)}else{if(c=="2"){f.find(".activepanel").each(function(n){var k=$(this);if(k.find(".globalTax").length>0){var m=parseFloat(k.find(".globalTax").val());a=a*((100+m)/100)}else{if(k.find(".groupCheckbox").length>0&&k.find(".groupCheckbox").prop("checked")==true){var l=parseFloat(k.find(".groupValue").val());a=a*((100+l)/100)}else{if(k.find(".individualTaxValue").length>0){var o=parseFloat(k.find(".individualTaxValue").val());a=((o+100)/100)*a}}}})}}f.find(".valuePrices").text(this.parsePrice(a));f.find(".valueTax").text(this.parsePrice(a-g))},updateRowSequence:function(){var a=this.getSupTableContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerSuppliesSaveData:function(a){a.on(Vtiger_Edit_Js.recordPreSave,function(d,c){var b=a.find("#blackSuppliesTable");b.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductListPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setListPriceValue(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(f,a){var d=this;var c=jQuery("input.sourceField",f).val();d.removeSubProducts(f);if(c=="0"){return false}if(d.subProductsCashe[c]){d.addSubProducts(f,d.subProductsCashe[c]);return false}var e={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(e).then(function(h){var g=h.result;d.subProductsCashe[c]=g;d.addSubProducts(f,g);if(b){b.hide()}},function(g,h){if(b){b.hide()}})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,d){var i=this;for(var b in d){var a=d[b];var j=a.description;var c=a.listpricevalues;var e=JSON.stringify(c);for(var g in a){k.find("input."+g).val(a[g])}var h=i.getCurrency();if(typeof c[h]!=="undefined"){i.setListPriceValue(k,c[h])}$("input.listPrice",k).attr("list-info",e);$("textarea.commentTextarea",k).val(j);i.showIndividualTax(k)}if(f==="Products"){i.loadSubProducts(k,true)}this.quantityChangeActions(k)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".discountParam").val(JSON.stringify(c))},saveTaxsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(b.taxMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".taxParam").val(JSON.stringify(c))},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},initTaxParameters:function(d,a){var c=this;var b=d.find(".taxParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.taxMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateTax(d,a)},loadWysiwyg:function(c,a){var b=this;if(a=="1"){b.loadCkEditorElement(c.find(".ckEditorSource"))}},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackSuppliesTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.initRow();c.registerAutoCompleteFields(m);c.loadWysiwyg(m,g)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(d,e){var f=e.item.find("textarea").attr("id");if(typeof f!="undefined"){var c=CKEDITOR.instances[f];c.destroy()}},stop:function(e,f){var c={};var d=f.item.find("textarea");if(typeof d.attr("id")!="undefined"){b.loadCkEditorElement(d)}b.updateRowSequence()}})},registerPriceBookPopUp:function(a){var b=this;a.on("click",".priceBookPopup",function(f){var d=$(f.currentTarget);var c=b.isRecordSelected(d);if(c==true){return}b.pricebooksPopupHandler(d)})},registerRowChangeEvent:function(a){var b=this;a.on("focusout",".qty",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("focusout",".listPrice",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("focusout",".purchase",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("change",".taxMode",function(d){var c=$(d.currentTarget);b.showIndividualTax(b.getClosestRow(c))});a.on("change",".discountMode",function(d){var c=$(d.currentTarget);b.showIndividualDiscount(b.getClosestRow(c))})},registerSubProducts:function(a){var b=this;a.find(this.rowClass).each(function(c){b.loadSubProducts($(this),false)})},registerClearReferenceSelection:function(a){var b=this;a.on("click",".clearReferenceSelection",function(d){var c=$(d.currentTarget);var f=b.getClosestRow(c);b.removeSubProducts(f);f.find(".listPrice,.tax,.discount,.margin,.purchase").val("0");f.find("textarea").val("");b.quantityChangeActions(f)})},registerDeleteLineItemEvent:function(a){var b=this;a.on("click",".deleteRow",function(d){var c=$(d.currentTarget);b.getClosestRow(c).remove();b.checkDeleteIcon()})},registerChangeDiscount:function(a){var b=this;a.on("click",".changeDiscount",function(g){var d=$(g.currentTarget);var f=d.closest(b.rowClass);var h={module:"Products",view:"Discounts",record:f.find(".rowName .sourceField").val(),currency:b.getCurrency(),sourceModule:app.getModuleName(),sourceRecord:app.getRecordId(),totalPrice:b.getTotalPrice(f),accountField:a.find("#accountReferenceField").val(),};var c=jQuery.progressIndicator();AppConnector.request(h).then(function(e){app.showModalWindow(e,function(i){b.initDiscountsParameters(f,$(i));b.registerChangeDiscountModal(i,f,h)});c.hide()},function(e,i){c.hide()})})},registerChangeDiscountModal:function(a,c,d){var b=this;a.on("change",".individualDiscountType",function(g){var f=$(g.currentTarget);a.find(".individualDiscountContainer .input-group-addon").text(f.data("symbol"))});a.on("change",'.activeCheckbox[name="aggregationType"]',function(g){var f=$(g.currentTarget);if(f.attr("type")=="checkbox"&&this.checked){f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{if(f.attr("type")=="radio"){a.find(".panel").removeClass("activepanel");a.find(".panel .panel-body").hide();f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{f.closest(".panel").find(".panel-body").hide();f.closest(".panel").removeClass("activepanel")}}});a.on("change",".activeCheckbox, .globalDiscount,.individualDiscountValue,.individualDiscountType,.groupCheckbox",function(g){var f=$(g.currentTarget);b.calculateDiscount(c,a)});a.on("click",".saveDiscount",function(f){c.find(".discount").val(a.find(".valueDiscount").text());b.quantityChangeActions(c);b.saveDiscountsParameters(c,a);app.hideModalWindow()})},registerChangeTax:function(a){var b=this;a.on("click",".changeTax",function(g){var d=$(g.currentTarget);var f=d.closest(b.rowClass);var h={module:"Products",view:"Taxs",record:f.find(".rowName .sourceField").val(),currency:b.getCurrency(),sourceModule:app.getModuleName(),sourceRecord:app.getRecordId(),totalPrice:b.getTotalPrice(f),};var c=jQuery.progressIndicator();AppConnector.request(h).then(function(e){app.showModalWindow(e,function(i){b.initTaxParameters(f,$(i));b.registerChangeTaxModal(i,f,h)});c.hide()},function(e,i){c.hide()})})},registerChangeTaxModal:function(a,c,d){var b=this;a.on("change",".individualTaxType",function(g){var f=$(g.currentTarget);a.find(".individualTaxContainer .input-group-addon").text(f.data("symbol"))});a.on("change",'.activeCheckbox[name="aggregationType"]',function(g){var f=$(g.currentTarget);if(f.attr("type")=="checkbox"&&this.checked){f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{if(f.attr("type")=="radio"){a.find(".panel").removeClass("activepanel");a.find(".panel .panel-body").hide();f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{f.closest(".panel").find(".panel-body").hide();f.closest(".panel").removeClass("activepanel")}}});a.on("change",".activeCheckbox, .globalTax,.individualTaxValue,.groupCheckbox",function(g){var f=$(g.currentTarget);b.calculateTax(c,a)});a.on("click",".saveTaxs",function(f){c.find(".tax").val(a.find(".valueTax").text());b.quantityChangeActions(c);b.saveTaxsParameters(c,a);app.hideModalWindow()})},registerRowAutoComplete:function(a){var b=this;var c=a.find(".rowName .sourceField");c.on(Vtiger_Edit_Js.postReferenceSelectionEvent,function(k,h){var g=$(k.currentTarget);var j=g.closest(b.rowClass);if(h.data.label){var d=h.data.id}else{for(var l in h.data){var d=l}}var f=j.find('.rowName [name="popupReferenceModule"]').val();var i="index.php?module="+app.getModuleName()+"&action=GetDetails&record="+d+"¤cy_id="+b.getCurrency();AppConnector.request(i).then(function(m){for(var n in m){if(typeof m[n]=="object"){var e=m[n];b.mapResultsToFields(f,j,e)}}},function(e,m){})})},initRow:function(a){var b=this;if(typeof a=="undefined"){a=b.getSupTableContainer()}b.registerDeleteLineItemEvent(a);b.registerPriceBookPopUp(a);b.registerRowChangeEvent(a);b.registerRowAutoComplete(a);b.checkDeleteIcon()},registerBasicEvents:function(a){this._super(a);this.registerSuppliesSaveData(a);this.registerAddRow(a);this.initRow();this.registerSortableRow();this.registerSubProducts(a);this.registerChangeDiscount(a);this.registerChangeTax(a);this.registerClearReferenceSelection(a)},}); \ No newline at end of file diff --git a/modules/Products/views/Taxs.php b/modules/Products/views/Taxs.php index b5526fbab23c..8e69fe4fbb56 100644 --- a/modules/Products/views/Taxs.php +++ b/modules/Products/views/Taxs.php @@ -15,7 +15,6 @@ public function process(Vtiger_Request $request) $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName); $config = $recordModel->getTaxsConfig(); - //$groupDiscount = $this->getGroupTaxs($sourceModule, $sourceRecord); $viewer = $this->getViewer($request); $viewer->assign('MODULE', $moduleName); @@ -25,21 +24,7 @@ public function process(Vtiger_Request $request) $viewer->assign('CONFIG', $config); $viewer->assign('AGGREGATION_TYPE', $config['aggregation']); $viewer->assign('AGGREGATION_INPUT_TYPE', $config['aggregation'] == 0 ? 'radio' : 'checkbox'); - //$viewer->assign('GROUP_TAX', $groupDiscount['discount']); $viewer->view('Taxs.tpl', $moduleName); } - public function getGroupTaxs($moduleName, $record) - { - $discount = 0; - $taxField = 'discount'; - - if ($record != '') { - $recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName); - $relationFieldValue = $recordModel->get($accountField); - - } - - return ['discount' => $discount, 'accountid' => $relationFieldValue]; - } } diff --git a/modules/Supplies/models/SupField.php b/modules/Supplies/models/SupField.php index 6d99da30bef8..b2a5cbf8cd30 100644 --- a/modules/Supplies/models/SupField.php +++ b/modules/Supplies/models/SupField.php @@ -183,4 +183,20 @@ public static function getCleanInstance() $instance = new self(); return $instance; } + + public function isWysiwygType($moduleName) + { + $cache = Vtiger_Cache::get('SuppliesisWysiwygType', $moduleName); + if ($cache) { + return $cache; + } + $return = 0; + $moduleModel = Vtiger_Module_Model::getInstance($moduleName); + $fieldModel = Vtiger_Field_Model::getInstance('description', $moduleModel); + if ($fieldModel && $fieldModel->get('uitype') == '300') { + $return = 1; + } + Vtiger_Cache::set('SuppliesisWysiwygType', $moduleName, $return); + return $return; + } } diff --git a/modules/Supplies/views/Edit.php b/modules/Supplies/views/Edit.php index 9979fd4e818b..c96be77fb8c8 100644 --- a/modules/Supplies/views/Edit.php +++ b/modules/Supplies/views/Edit.php @@ -13,9 +13,6 @@ public function preProcess (Vtiger_Request $request, $display=true) { $moduleName = $request->getModule(); $viewer = $this->getViewer($request); - $viewer->assign('ACCOUNT_REFERENCE_FIELD', $this->getReferenceField($moduleName)); - $viewer->assign('DISCOUNTS_CONFIG', Products_Record_Model::getDiscountsConfig()); - $viewer->assign('TAXS_CONFIG', Products_Record_Model::getTaxsConfig()); $viewer->view('TopEditView.tpl', Supplies_Module_Model::getModuleNameForTpl('TopEditView.tpl', $moduleName)); } @@ -93,7 +90,11 @@ public function process(Vtiger_Request $request) $viewer->assign('MAX_UPLOAD_LIMIT_MB', Vtiger_Util_Helper::getMaxUploadSize()); $viewer->assign('MAX_UPLOAD_LIMIT', vglobal('upload_maxsize')); + // Supplies block $viewer->assign('SUPFIELD_MODEL', Supplies_SupField_Model::getCleanInstance()); + $viewer->assign('ACCOUNT_REFERENCE_FIELD', $this->getReferenceField($moduleName)); + $viewer->assign('DISCOUNTS_CONFIG', Products_Record_Model::getDiscountsConfig()); + $viewer->assign('TAXS_CONFIG', Products_Record_Model::getTaxsConfig()); $viewer->view('EditView.tpl', $moduleModel->getModuleNameForTpl('EditView.tpl', $moduleName)); } From a327faa4199048fb1b2d906461055bb97ac9b08f Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Mon, 17 Aug 2015 11:20:58 +0200 Subject: [PATCH 018/489] Improved loading wysiwyg --- layouts/vlayout/modules/Vtiger/resources/Edit.js | 2 +- layouts/vlayout/modules/Vtiger/resources/Edit.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/vlayout/modules/Vtiger/resources/Edit.js b/layouts/vlayout/modules/Vtiger/resources/Edit.js index 91dfe146b9c0..783344b52eb1 100644 --- a/layouts/vlayout/modules/Vtiger/resources/Edit.js +++ b/layouts/vlayout/modules/Vtiger/resources/Edit.js @@ -1091,7 +1091,7 @@ jQuery.Class("Vtiger_Edit_Js", { }, loadCkEditorElement: function (noteContentElement) { var customConfig = {}; - if (noteContentElement.css('display') != 'none') { + if (noteContentElement.is(':visible')) { noteContentElement.removeAttr('data-validation-engine'); if (noteContentElement.hasClass("ckEditorBasic")) { customConfig.toolbar = 'Basic'; diff --git a/layouts/vlayout/modules/Vtiger/resources/Edit.min.js b/layouts/vlayout/modules/Vtiger/resources/Edit.min.js index fd45ae3e1ea9..b24d17a59573 100644 --- a/layouts/vlayout/modules/Vtiger/resources/Edit.min.js +++ b/layouts/vlayout/modules/Vtiger/resources/Edit.min.js @@ -1,2 +1,2 @@ -jQuery.Class("Vtiger_Edit_Js",{referenceSelectionEvent:"Vtiger.Reference.Selection",referenceDeSelectionEvent:"Vtiger.Reference.DeSelection",recordPreSave:"Vtiger.Record.PreSave",refrenceMultiSelectionEvent:"Vtiger.MultiReference.Selection",preReferencePopUpOpenEvent:"Vtiger.Referece.Popup.Pre",editInstance:false,SaveResultInstance:false,postReferenceSelectionEvent:"Vtiger.PostReference.Selection",getInstanceByModuleName:function(b){if(typeof b=="undefined"){b=app.getModuleName()}var e=app.getParentModuleName();if(e=="Settings"){var c=e+"_"+b+"_Edit_Js";if(typeof window[c]=="undefined"){c=b+"_Edit_Js"}var d=e+"_Vtiger_Edit_Js";if(typeof window[d]=="undefined"){d="Vtiger_Edit_Js"}}else{c=b+"_Edit_Js";d="Vtiger_Edit_Js"}if(typeof window[c]!="undefined"){var a=new window[c]()}else{var a=new window[d]()}return a},getInstance:function(){if(Vtiger_Edit_Js.editInstance==false){var a=Vtiger_Edit_Js.getInstanceByModuleName();Vtiger_Edit_Js.editInstance=a;return a}return Vtiger_Edit_Js.editInstance}},{addressDataOG:[],addressDataGM:[],formElement:false,relationOperation:"",getForm:function(){if(this.formElement==false){this.setForm(jQuery("#EditView"))}return this.formElement},setForm:function(a){this.formElement=a;return this},getPopUpParams:function(b){var e={};var g=app.getModuleName();var h=jQuery('input[name="popupReferenceModule"]',b).val();var d=jQuery('input[class="sourceField"]',b);var i=d.attr("name");var c=jQuery('input[name="record"]');var a="";if(c.length>0){a=c.val()}var f=false;if(d.data("multiple")==true){f=true}var e={module:h,src_module:g,src_field:i,src_record:a};if(f){e.multi_select=true}return e},openPopUp:function(h){var c=this;var a=jQuery(h.target).closest("td");var i=this.getPopUpParams(a);var f=false;if(i.multi_select){f=true}var g=jQuery('input[class="sourceField"]',a);var b=jQuery.Event(Vtiger_Edit_Js.preReferencePopUpOpenEvent);g.trigger(b);if(b.isDefaultPrevented()){return}var d=Vtiger_Popup_Js.getInstance();d.show(i,function(k){var j=JSON.parse(k);var e=new Array();for(var l in j){var k={name:j[l].name,id:l};e.push(k);if(!f){c.setReferenceFieldValue(a,k)}}if(f){g.trigger(Vtiger_Edit_Js.refrenceMultiSelectionEvent,{data:e})}g.trigger(Vtiger_Edit_Js.postReferenceSelectionEvent,{data:j})})},setReferenceFieldValue:function(a,d){var l=this;var k=a.find("input.sourceField").attr("name");var c=a.find('input[name="'+k+'"]');var f=k+"_display";var m=a.find('input[name="'+f+'"]');var h=a.find('input[name="popupReferenceModule"]').val();var e=d.name;var b=d.id;c.val(b);m.val(e).attr("readonly",true);c.trigger(Vtiger_Edit_Js.referenceSelectionEvent,{source_module:h,record:b,selectedName:e});m.validationEngine("closePrompt",m);var j=a.closest("form");var i=this.getMappingRelatedField(k,h,j);if(typeof i!=undefined){var g={source_module:h,record:b};this.getRecordDetails(g).then(function(o){var n=o.result["data"];$.each(i,function(s,t){if(n[t[0]]!=0&&!l.getMappingValuesFromUrl(s)){var q=j.find('input[name="'+s+'"]');if(q.length>0){q.val(n[t[0]])}var r=j.find('input[name="'+s+'_display"]');if(r.length>0){r.val(n[t[0]+"_label"]).attr("readonly",true);var p=j.find("#"+app.getModuleName()+"_editView_fieldName_"+s+"_dropDown");if(p.length>0){p.val(t[1]).trigger("chosen:updated")}}}})})}},getRelationOperation:function(){if(this.relationOperation===""){var a=jQuery('[name="relationOperation"]');if(a.length){this.relationOperation=a.val()}else{this.relationOperation=false}}return this.relationOperation},getMappingValuesFromUrl:function(b){var a=this.getRelationOperation();if(a){return app.getUrlVar(b)}return false},proceedRegisterEvents:function(){if(jQuery(".recordEditView").length>0){return true}else{return false}},treePopupRegisterEvent:function(a){var b=this;a.on("click",".treePopup",function(c){b.openTreePopUp(c)})},registerClearTreeSelectionEvent:function(a){a.find(".clearTreeSelection").on("click",function(d){var c=jQuery(d.currentTarget);var b=c.closest("td");var g=b.find(".sourceField");var f=g.attr("name");g.val("");b.find("#"+f+"_display").removeAttr("readonly").val("");d.preventDefault()})},openTreePopUp:function(k){var l=this;var j=jQuery(k.target).closest("td");var d=jQuery(k.target).closest("form");var g={};var b=jQuery('input[name="module"]',d).val();var f=jQuery('input[class="sourceField"]',j);var h=f.attr("name")+"_display";var m=jQuery('input[name="'+h+'"]',j);var c=jQuery('input[name="record"]');var a="";if(c.length>0){a=c.val()}urlOrParams="module="+b+"&view=TreePopup&template="+f.data("treetemplate")+"&src_field="+f.attr("name")+"&src_record="+a;var i=Vtiger_Popup_Js.getInstance();i.show(urlOrParams,function(n){var e=JSON.parse(n);f.val("T"+e.id);m.val(e.name).attr("readonly",true)})},registerTreeAutoCompleteFields:function(a){var b=this;a.find("input.treeAutoComplete").autocomplete({delay:"600",minLength:"3",source:function(i,h){var m=jQuery(this.element[0]);var c=i.term;var j=m.closest("td");var g=jQuery('input[class="sourceField"]',j);var f=g.data("allvalues");var n=new Array();for(var e in f){var d=f[e][0];if(d.toLowerCase().indexOf(c)>=0){var l=f[e][1];var k="";if(l!=""){var k="("+f[l][0]+") "}k=k+d;n.push({label:k,value:d,id:e})}}if(n.length<=0){jQuery(m).val("");n.push({label:app.vtranslate("JS_NO_RESULTS_FOUND"),type:"no results"})}h(n)},select:function(i,j){var e=j.item;if(typeof e.type!="undefined"&&e.type=="no results"){return false}e.name=e.value;var f=jQuery(this);var h=f.closest("td");var g=h.find('input[class="sourceField"]');var c=g.attr("name")+"_display";var d=jQuery('input[name="'+c+'"]',h);g.val(e.id);d.val(e.label).attr("readonly",true)},change:function(d,e){var c=jQuery(this)},open:function(c,d){jQuery(this).data("autocomplete").menu.element.css("z-index","100001")}})},referenceModulePopupRegisterEvent:function(a){var b=this;a.on("click",".relatedPopup",function(c){b.openPopUp(c)});a.find(".referenceModulesList").chosen().change(function(g){var d=jQuery(g.currentTarget);var i=d.closest("td").next();var h=d.val();var f=jQuery('input[name="popupReferenceModule"]',i);var c=f.val();f.val(h);if(c!=h){i.find(".clearReferenceSelection").trigger("click")}})},getReferencedModuleName:function(a){return jQuery('input[name="popupReferenceModule"]',a).val()},searchModuleNames:function(b){var a=jQuery.Deferred();if(typeof b.module=="undefined"){b.module=app.getModuleName()}if(typeof b.action=="undefined"){b.action="BasicAjax"}if(b.search_module=="Products"||b.search_module=="Services"){b.potentialid=jQuery('[name="potentialid"]').val()}AppConnector.request(b).then(function(c){a.resolve(c)},function(c){a.reject()});return a.promise()},getReferenceSearchParams:function(b){var c=jQuery(b).closest("td");var d={};var a=this.getReferencedModuleName(c);d.search_module=a;return d},registerAutoCompleteFields:function(a){var b=this;a.find("input.autoComplete").autocomplete({delay:"600",minLength:"3",source:function(d,c){var f=jQuery(this.element[0]);var e=d.term;var g=b.getReferenceSearchParams(f);g.search_value=e;b.searchModuleNames(g).then(function(k){var i=new Array();var j=k.result;if(j.length<=0){jQuery(f).val("");j=new Array({label:app.vtranslate("JS_NO_RESULTS_FOUND"),type:"no results"})}for(var l in j){var h=j[l];i.push(h)}c(i)})},select:function(h,i){var c=i.item;if(typeof c.type!="undefined"&&c.type=="no results"){return false}c.name=c.value;var d=jQuery(this);var g=d.closest("td");b.setReferenceFieldValue(g,c);var f=g.find('input[class="sourceField"]').attr("name");var e=g.find('input[name="'+f+'"]');e.trigger(Vtiger_Edit_Js.postReferenceSelectionEvent,{data:c})},change:function(d,e){var c=jQuery(this);if(c.attr("readonly")==undefined){c.closest("td").find(".clearReferenceSelection").trigger("click")}},open:function(c,d){jQuery(this).data("ui-autocomplete").menu.element.css("z-index","100001")}})},registerClearReferenceSelectionEvent:function(a){a.find(".clearReferenceSelection").on("click",function(d){var c=jQuery(d.currentTarget);var b=c.closest("td");var g=b.find(".sourceField");var f=g.attr("name");g.val("");b.find('[name="'+f+'_display"]').removeAttr("readonly").val("");c.trigger(Vtiger_Edit_Js.referenceDeSelectionEvent);d.preventDefault()})},registerPreventingEnterSubmitEvent:function(a){a.on("keypress",function(c){var b=jQuery(c.target);if(c.which==13&&(!b.is("textarea"))){c.preventDefault()}})},getRecordDetails:function(c){var a=jQuery.Deferred();var b="index.php?module="+app.getModuleName()+"&action=GetData&record="+c.record+"&source_module="+c.source_module;AppConnector.request(b).then(function(d){if(d.success){a.resolve(d)}else{a.reject(d.message)}},function(d){a.reject()});return a.promise()},registerTimeFields:function(a){app.registerEventForTimeFields(a)},referenceCreateHandler:function(a){var c=this;var d=function(e){var f={};f.name=e.result._recordLabel;f.id=e.result._recordId;c.setReferenceFieldValue(a,f)};var b=this.getReferencedModuleName(a);Vtiger_Header_Js.getInstance().quickCreateModule(b,{callbackFunction:d})},registerReferenceCreate:function(a){var b=this;a.on("click",".createReferenceRecord",function(f){var d=jQuery(f.currentTarget);var c=d.closest("td");b.referenceCreateHandler(c)})},registerEventStatusChangeEvent:function(a){var b=a.find(".followUpContainer");var c=a.find('select[name="eventstatus"]').val();if(c=="Held"||c=="Not Held"){b.show()}a.find('select[name="eventstatus"]').on("change",function(f){var d=jQuery(f.currentTarget).val();if(d=="Held"||d=="Not Held"){b.show()}else{b.hide()}})},addressFieldsMapping:["buildingnumber","localnumber","addresslevel1","addresslevel2","addresslevel3","addresslevel4","addresslevel5","addresslevel6","addresslevel7","addresslevel8","pobox"],addressFieldsMappingBlockID:{LBL_ADDRESS_INFORMATION:"a",LBL_ADDRESS_MAILING_INFORMATION:"b",LBL_ADDRESS_DELIVERY_INFORMATION:"c"},addressFieldsData:false,registerEventForCopyAddress:function(){var d=this;var c=this.getForm();var b=false;var e=false;var f=false;var a=false;jQuery("#EditView table td").each(function(h){var g=false;var i=$(this).find('[name="popupReferenceModule"]').val();if(i=="Accounts"){b=$(this).find(".sourceField").attr("name")}if(i=="Contacts"){e=$(this).find(".sourceField").attr("name")}if(i=="Leads"){f=$(this).find(".sourceField").attr("name")}if(i=="Vendors"){a=$(this).find(".sourceField").attr("name")}g=$(this).find(".referenceModulesList");if(g.length>0){$.each(g.find("option"),function(j,k){if(k.value=="Accounts"){b=jQuery("#EditView table td").eq(h+1).find(".sourceField").attr("name")}if(k.value=="Contacts"){e=jQuery("#EditView table td").eq(h+1).find(".sourceField").attr("name")}if(k.value=="Leads"){f=jQuery("#EditView table td").eq(h+1).find(".sourceField").attr("name")}if(k.value=="Vendors"){a=jQuery("#EditView table td").eq(h+1).find(".sourceField").attr("name")}})}});if(b==false){jQuery(".copyAddressFromAccount").addClass("hide")}else{jQuery(".copyAddressFromAccount").on("click",function(j){var h=jQuery(this);var l=h.closest("table");var n=h.data("label");var m=l.data("label");var k=jQuery('[name="'+b+'"]').val();if(k==""||k=="0"){Vtiger_Helper_Js.showPnotify(app.vtranslate("JS_PLEASE_SELECT_AN_ACCOUNT_TO_COPY_ADDRESS"))}else{var g=jQuery("#"+b+"_display").val();var i={record:k,selectedName:g,source_module:"Accounts"};d.copyAddressDetails(n,m,i,h.closest("table"));h.attr("checked","checked")}})}if(e==false){jQuery(".copyAddressFromContact").addClass("hide")}else{jQuery(".copyAddressFromContact").on("click",function(j){var h=jQuery(this);var l=h.closest("table");var n=h.data("label");var m=l.data("label");var k=jQuery('[name="'+e+'"]').val();if(k==""||k=="0"){Vtiger_Helper_Js.showPnotify(app.vtranslate("JS_PLEASE_SELECT_AN_CONTACT_TO_COPY_ADDRESS"))}else{var g=jQuery("#"+e+"_display").val();var i={record:k,selectedName:g,source_module:"Contacts"};d.copyAddressDetails(n,m,i,h.closest("table"));h.attr("checked","checked")}})}if(f==false){jQuery(".copyAddressFromLead").addClass("hide")}else{jQuery(".copyAddressFromLead").on("click",function(j){var h=jQuery(this);var l=h.closest("table");var n=h.data("label");var m=l.data("label");var k=jQuery('[name="'+f+'"]').val();if(k==""||k=="0"){Vtiger_Helper_Js.showPnotify(app.vtranslate("JS_PLEASE_SELECT_AN_LEAD_TO_COPY_ADDRESS"))}else{var g=jQuery("#"+f+"_display").val();var i={record:k,selectedName:g,source_module:"Leads"};d.copyAddressDetails(n,m,i,h.closest("table"));h.attr("checked","checked")}})}if(a==false){jQuery(".copyAddressFromVendor").addClass("hide")}else{jQuery(".copyAddressFromVendor").on("click",function(j){var h=jQuery(this);var l=h.closest("table");var n=h.data("label");var m=l.data("label");var k=jQuery('[name="'+a+'"]').val();if(k==""||k=="0"){Vtiger_Helper_Js.showPnotify(app.vtranslate("JS_PLEASE_SELECT_AN_VENDOR_TO_COPY_ADDRESS"))}else{var g=jQuery("#"+a+"_display").val();var i={record:k,selectedName:g,source_module:"Vendors"};d.copyAddressDetails(n,m,i,h.closest("table"));h.attr("checked","checked")}})}if(e==false&&b==false&&f==false&&a==false){jQuery(".copyAddressLabel").addClass("hide")}jQuery(".copyAddressFromMain").on("click",function(h){var g=jQuery(this);var i=g.closest("table");var k=g.data("label");var j=i.data("label");d.copyAddress(k,j,false,false)});jQuery(".copyAddressFromMailing").on("click",function(h){var g=jQuery(this);var i=g.closest("table");var k=g.data("label");var j=i.data("label");d.copyAddress(k,j,false,false)});jQuery(".copyAddressFromDelivery").on("click",function(h){var g=jQuery(this);var i=g.closest("table");var k=g.data("label");var j=i.data("label");d.copyAddress(k,j,false,false)})},copyAddressDetails:function(h,g,f,b){var e=this;var a=f.source_module;var c=true;var d;e.getRecordDetails(f).then(function(j){var i=j.result;e.addressFieldsData=i.data;e.copyAddress(h,g,true,a)},function(i,j){})},copyAddress:function(p,f,o,e){var d=false;var i=this;var h=this.getForm();var a=this.addressFieldsMapping;var c=this.addressFieldsMappingBlockID;from=c[p];if(app.getModuleName()=="Quotes"||app.getModuleName()=="Invoice"){c={LBL_ADDRESS_INFORMATION:"a",LBL_ADDRESS_DELIVERY_INFORMATION:"b"}}if(o===false||e===false){from=c[p]}to=c[f];for(var k in a){var l=a[k]+from;var n=a[k]+to;if(o){var g=i.addressFieldsData[l];var m=i.addressFieldsData[l+"_label"]}else{var g=h.find('[name="'+l+'"]').val();var m=h.find('[name="'+l+'_display"]').val()}var b=h.find('[name="'+n+'"]');var j=h.find('[name="'+n+'_display"]');if(g!=""&&g!="0"&&g!=undefined){if(j.length>0){j.attr("readonly",true)}d=true;b.val(g);j.val(m)}else{b.attr("readonly",false)}}if(d==false){if(e=="Accounts"){errorMsg="JS_SELECTED_ACCOUNT_DOES_NOT_HAVE_AN_ADDRESS"}else{if(e=="Contacts"){errorMsg="JS_SELECTED_CONTACT_DOES_NOT_HAVE_AN_ADDRESS"}else{errorMsg="JS_DOES_NOT_HAVE_AN_ADDRESS"}}Vtiger_Helper_Js.showPnotify(app.vtranslate(errorMsg))}},registerReferenceSelectionEvent:function(a){var c=this;var b=a.find("input[name*='addresslevel']");b.on(Vtiger_Edit_Js.referenceSelectionEvent,function(g,f){var d=jQuery(g.currentTarget).closest(".blockContainer");c.copyAddressDetailsRef(f,d)})},copyAddressDetailsRef:function(c,a){var b=this;b.getRecordDetails(c).then(function(e){var d=e.result;b.mapAddressDetails(d.data,a)},function(d,e){})},mapAddressDetails:function(a,b){for(var c in a){if(c.indexOf("addresslevel")!=-1){if(b.find('[name="'+c+'"]').length!=0){b.find('[name="'+c+'"]').val(a[c]);b.find('[name="'+c+'"]').attr("readonly",true);b.find('[name="'+c+'_display"]').val(a[c+"_label"]);b.find('[name="'+c+'_display"]').attr("readonly",true)}if(b.find('[name="'+c+'a"]').length!=0&&b.find('[name="'+c+'a"]').val()==0&&a[c]!=0){b.find('[name="'+c+'a"]').val(a[c]);b.find('[name="'+c+'a"]').attr("readonly",true);b.find('[name="'+c+'a_display"]').val(a[c+"_label"]);b.find('[name="'+c+'a_display"]').attr("readonly",true)}if(b.find('[name="'+c+'b"]').length!=0&&b.find('[name="'+c+'b"]').val()==0&&a[c]!=0){b.find('[name="'+c+'b"]').val(a[c]);b.find('[name="'+c+'b"]').attr("readonly",true);b.find('[name="'+c+'b_display"]').val(a[c+"_label"]);b.find('[name="'+c+'b_display"]').attr("readonly",true)}if(b.find('[name="'+c+'c"]').length!=0&&b.find('[name="'+c+'c"]').val()==0&&a[c]!=0){b.find('[name="'+c+'c"]').val(a[c]);b.find('[name="'+c+'c"]').attr("readonly",true);b.find('[name="'+c+'c_display"]').val(a[c+"_label"]);b.find('[name="'+c+'c_display"]').attr("readonly",true)}}}},registerMaskFields:function(a){var b=this;a.find(":input").inputmask()},registerBasicEvents:function(a){this.treePopupRegisterEvent(a);this.registerClearTreeSelectionEvent(a);this.registerTreeAutoCompleteFields(a);this.referenceModulePopupRegisterEvent(a);this.registerAutoCompleteFields(a);this.registerClearReferenceSelectionEvent(a);this.registerPreventingEnterSubmitEvent(a);this.registerTimeFields(a);this.registerEventStatusChangeEvent(a);this.registerRecordAccessCheckEvent(a);this.registerEventForPicklistDependencySetup(a);this.registerRecordPreSaveEventEvent(a);this.registerReferenceSelectionEvent(a);this.registerMaskFields(a)},registerEventForImageDelete:function(){var b=this.getForm();var a=b.find('input[name="record"]').val();b.find(".imageDelete").on("click",function(k){var i=jQuery(k.currentTarget);var l=i.closest("td");var d=l.find('[name="imagename[]"]');var c=d.data("fieldinfo");var g=c.mandatory;var f=i.closest("div").find("img").data().imageId;i.closest("div").remove();var j=l.find('[name="existingImages"]');if(j.length<1&&g){b.validationEngine("detach");d.attr("data-validation-engine","validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]");b.validationEngine("attach")}if(b.find("[name=imageid]").length!=0){var m=JSON.parse(b.find("[name=imageid]").val());m.push(f);b.find("[name=imageid]").val(JSON.stringify(m))}else{var h=[];h.push(f);b.append('');b.append('')}})},triggerDisplayTypeEvent:function(){var a=app.cacheGet("widthType","narrowWidthType");if(a){var b=jQuery("#EditView").find("td");b.addClass(a)}},registerSubmitEvent:function(){var a=this.getForm();a.submit(function(d){if(typeof a.data("submit")!="undefined"){return false}else{document.progressLoader=jQuery.progressIndicator({message:app.vtranslate("JS_SAVE_LOADER_INFO"),position:"html",blockInfo:{enabled:true}});var b=jQuery(d.currentTarget).find('[name="module"]').val();if(a.validationEngine("validate")){a.data("submit","true");var c=jQuery.Event(Vtiger_Edit_Js.recordPreSave);a.trigger(c,{value:"edit"});if(c.isDefaultPrevented()){document.progressLoader.progressIndicator({mode:"hide"});a.removeData("submit");d.preventDefault()}}else{document.progressLoader.progressIndicator({mode:"hide"});a.removeData("submit");app.formAlignmentAfterValidation(a)}}})},registerRecordPreSaveEventEvent:function(b){if(Vtiger_Edit_Js.SaveResultInstance==false){Vtiger_Edit_Js.SaveResultInstance=new SaveResult()}var a=this.getForm();var c=a.serializeFormData();Vtiger_Edit_Js.SaveResultInstance.loadFormData(c);b.on(Vtiger_Edit_Js.recordPreSave,function(f,d){if(Vtiger_Edit_Js.SaveResultInstance.checkData(b.serializeFormData())==false){f.preventDefault()}})},registerRecordAccessCheckEvent:function(a){a.on(Vtiger_Edit_Js.recordPreSave,function(g,f){var d=jQuery('[name="assigned_user_id"]',a);if(d.data("recordaccessconfirmation")==true){return}else{if(d.data("recordaccessconfirmationprogress")!=true){var b=d.find("option:selected").data("recordaccess");if(b==false){var c=app.vtranslate("JS_NO_VIEW_PERMISSION_AFTER_SAVE");Vtiger_Helper_Js.showConfirmationBox({message:c}).then(function(h){d.data("recordaccessconfirmation",true);d.removeData("recordaccessconfirmationprogress");a.append('');a.submit()},function(e,h){d.removeData("recordaccessconfirmationprogress");g.preventDefault()});d.data("recordaccessconfirmationprogress",true)}else{return true}}}g.preventDefault()})},registerEventForPicklistDependencySetup:function(a){var c=jQuery('[name="picklistDependency"]',a);if(c.length<=0){return}var d=JSON.parse(c.val());var e=Object.keys(d);if(e.length<=0){return}var g=[];for(var b=0;b-1)){var e=a.split("/");f.house_number=e[0];f.local_number=e[1]}else{f.house_number=b[d]["long_name"]}}if("country"===c[0]&&"political"===c[1]){f.country=b[d]["long_name"]}if("administrative_area_level_1"===c[0]&&"political"===c[1]){f.state=b[d]["long_name"]}if("administrative_area_level_2"===c[0]&&"political"===c[1]){f.powiat=b[d]["long_name"]}if("sublocality_level_1"===c[0]&&"sublocality"===c[1]&&"political"===c[2]){f.region_city=b[d]["long_name"]}if("postal_code"===c[0]){f.postcode=b[d]["long_name"]}if("locality"===c[0]&&"political"===c[1]){f.city=b[d]["long_name"]}}return f},registerApiAddress:function(){var b=this;var c=jQuery('[name="apiAddress"]');var a=[];jQuery(c).each(function(e,f){var d=jQuery(f).data("api-name");var g={geoCodeURL:jQuery(f).data("url"),geoCodeKey:jQuery(f).val()};a[d]=g;a.minLookupLenght=jQuery(f).data("lenght");a.max_num=jQuery(f).data("max-num")});if(!a){return false}jQuery(".api_address_autocomplete").each(function(){jQuery(this).autocomplete({source:function(e,d){jQuery.when(b.getDataFromOG(e,a),b.getDataFromGM(e,a)).then(function(h,g){var f=b.addressDataOG.concat(b.addressDataGM);d(f.slice(0,a.max_num))}).fail(function(f){d([{label:app.vtranslate("An error has occurred. No results."),value:""}])})},minLength:a.minLookupLenght,select:function(f,g){for(var e in g.item.components){var d=b.addressFieldsMappingFromApi[e];jQuery(this).parents("table").find('[name^="'+d+'"]').val(g.item.components[e])}}}).data("ui-autocomplete")._renderItem=function(d,e){return jQuery("
  • ").data("item.autocomplete",e).append(''+e.source_label+''+e.label+"").appendTo(d)}})},addressFieldsMappingFromApi:{house_number:"buildingnumber",local_number:"localnumber",country:"addresslevel1",state:"addresslevel2",powiat:"addresslevel3",county:"addresslevel4",city:"addresslevel5",region_city:"addresslevel6",postcode:"addresslevel7",road:"addresslevel8",village:"addresslevel5"},registerEvents:function(){var c=this.getForm();var a=this.proceedRegisterEvents();if(!a){return}this.registerHelpInfo();this.registerBlockAnimationEvent();this.registerBlockStatusCheckOnLoad();this.registerEventForCkEditor();this.stretchCKEditor();this.registerBasicEvents(this.getForm());this.registerEventForCopyAddress();this.registerEventForImageDelete();this.registerSubmitEvent();this.registerLeavePageWithoutSubmit(c);app.registerEventForDatePickerFields("#EditView");var b=app.validationEngineOptionsForRecord;b.onValidationComplete=function(i,d){if(d){var g=c.find(".ckEditorSource");if(g.length>0){var h=g.attr("id");var e=g.data("fieldinfo");var k=e.mandatory;var j=CKEDITOR.instances[h];if(jQuery.type(j)!=="undefined"&&jQuery.type(j.document)==="object"){var f=jQuery.trim(j.document.getBody().getText());if(k&&(f.length===0)){var m="cke_"+h;var l=app.vtranslate("JS_REQUIRED_FIELD");jQuery("#"+m).validationEngine("showPrompt",l,"error","topLeft",true);return false}else{return d}}}return d}return d};c.validationEngine(b);this.registerReferenceCreate(c);this.registerApiAddress()},getMappingRelatedField:function(e,a,b){var c=b.find('input[name="mappingRelatedField"]').val();var d=JSON.parse(c);if(typeof d[e]!="undefined"&&typeof d[e][a]!="undefined"){return d[e][a]}return[]}}); \ No newline at end of file +jQuery.Class("Vtiger_Edit_Js",{referenceSelectionEvent:"Vtiger.Reference.Selection",referenceDeSelectionEvent:"Vtiger.Reference.DeSelection",recordPreSave:"Vtiger.Record.PreSave",refrenceMultiSelectionEvent:"Vtiger.MultiReference.Selection",preReferencePopUpOpenEvent:"Vtiger.Referece.Popup.Pre",editInstance:false,SaveResultInstance:false,postReferenceSelectionEvent:"Vtiger.PostReference.Selection",getInstanceByModuleName:function(b){if(typeof b=="undefined"){b=app.getModuleName()}var e=app.getParentModuleName();if(e=="Settings"){var c=e+"_"+b+"_Edit_Js";if(typeof window[c]=="undefined"){c=b+"_Edit_Js"}var d=e+"_Vtiger_Edit_Js";if(typeof window[d]=="undefined"){d="Vtiger_Edit_Js"}}else{c=b+"_Edit_Js";d="Vtiger_Edit_Js"}if(typeof window[c]!="undefined"){var a=new window[c]()}else{var a=new window[d]()}return a},getInstance:function(){if(Vtiger_Edit_Js.editInstance==false){var a=Vtiger_Edit_Js.getInstanceByModuleName();Vtiger_Edit_Js.editInstance=a;return a}return Vtiger_Edit_Js.editInstance}},{addressDataOG:[],addressDataGM:[],formElement:false,relationOperation:"",getForm:function(){if(this.formElement==false){this.setForm(jQuery("#EditView"))}return this.formElement},setForm:function(a){this.formElement=a;return this},getPopUpParams:function(b){var e={};var g=app.getModuleName();var h=jQuery('input[name="popupReferenceModule"]',b).val();var d=jQuery('input[class="sourceField"]',b);var i=d.attr("name");var c=jQuery('input[name="record"]');var a="";if(c.length>0){a=c.val()}var f=false;if(d.data("multiple")==true){f=true}var e={module:h,src_module:g,src_field:i,src_record:a};if(f){e.multi_select=true}return e},openPopUp:function(h){var c=this;var a=jQuery(h.target).closest("td");var i=this.getPopUpParams(a);var f=false;if(i.multi_select){f=true}var g=jQuery('input[class="sourceField"]',a);var b=jQuery.Event(Vtiger_Edit_Js.preReferencePopUpOpenEvent);g.trigger(b);if(b.isDefaultPrevented()){return}var d=Vtiger_Popup_Js.getInstance();d.show(i,function(k){var j=JSON.parse(k);var e=new Array();for(var l in j){var k={name:j[l].name,id:l};e.push(k);if(!f){c.setReferenceFieldValue(a,k)}}if(f){g.trigger(Vtiger_Edit_Js.refrenceMultiSelectionEvent,{data:e})}g.trigger(Vtiger_Edit_Js.postReferenceSelectionEvent,{data:j})})},setReferenceFieldValue:function(a,d){var l=this;var k=a.find("input.sourceField").attr("name");var c=a.find('input[name="'+k+'"]');var f=k+"_display";var m=a.find('input[name="'+f+'"]');var h=a.find('input[name="popupReferenceModule"]').val();var e=d.name;var b=d.id;c.val(b);m.val(e).attr("readonly",true);c.trigger(Vtiger_Edit_Js.referenceSelectionEvent,{source_module:h,record:b,selectedName:e});m.validationEngine("closePrompt",m);var j=a.closest("form");var i=this.getMappingRelatedField(k,h,j);if(typeof i!=undefined){var g={source_module:h,record:b};this.getRecordDetails(g).then(function(o){var n=o.result["data"];$.each(i,function(s,t){if(n[t[0]]!=0&&!l.getMappingValuesFromUrl(s)){var q=j.find('input[name="'+s+'"]');if(q.length>0){q.val(n[t[0]])}var r=j.find('input[name="'+s+'_display"]');if(r.length>0){r.val(n[t[0]+"_label"]).attr("readonly",true);var p=j.find("#"+app.getModuleName()+"_editView_fieldName_"+s+"_dropDown");if(p.length>0){p.val(t[1]).trigger("chosen:updated")}}}})})}},getRelationOperation:function(){if(this.relationOperation===""){var a=jQuery('[name="relationOperation"]');if(a.length){this.relationOperation=a.val()}else{this.relationOperation=false}}return this.relationOperation},getMappingValuesFromUrl:function(b){var a=this.getRelationOperation();if(a){return app.getUrlVar(b)}return false},proceedRegisterEvents:function(){if(jQuery(".recordEditView").length>0){return true}else{return false}},treePopupRegisterEvent:function(a){var b=this;a.on("click",".treePopup",function(c){b.openTreePopUp(c)})},registerClearTreeSelectionEvent:function(a){a.find(".clearTreeSelection").on("click",function(d){var c=jQuery(d.currentTarget);var b=c.closest("td");var g=b.find(".sourceField");var f=g.attr("name");g.val("");b.find("#"+f+"_display").removeAttr("readonly").val("");d.preventDefault()})},openTreePopUp:function(k){var l=this;var j=jQuery(k.target).closest("td");var d=jQuery(k.target).closest("form");var g={};var b=jQuery('input[name="module"]',d).val();var f=jQuery('input[class="sourceField"]',j);var h=f.attr("name")+"_display";var m=jQuery('input[name="'+h+'"]',j);var c=jQuery('input[name="record"]');var a="";if(c.length>0){a=c.val()}urlOrParams="module="+b+"&view=TreePopup&template="+f.data("treetemplate")+"&src_field="+f.attr("name")+"&src_record="+a;var i=Vtiger_Popup_Js.getInstance();i.show(urlOrParams,function(n){var e=JSON.parse(n);f.val("T"+e.id);m.val(e.name).attr("readonly",true)})},registerTreeAutoCompleteFields:function(a){var b=this;a.find("input.treeAutoComplete").autocomplete({delay:"600",minLength:"3",source:function(i,h){var m=jQuery(this.element[0]);var c=i.term;var j=m.closest("td");var g=jQuery('input[class="sourceField"]',j);var f=g.data("allvalues");var n=new Array();for(var e in f){var d=f[e][0];if(d.toLowerCase().indexOf(c)>=0){var l=f[e][1];var k="";if(l!=""){var k="("+f[l][0]+") "}k=k+d;n.push({label:k,value:d,id:e})}}if(n.length<=0){jQuery(m).val("");n.push({label:app.vtranslate("JS_NO_RESULTS_FOUND"),type:"no results"})}h(n)},select:function(i,j){var e=j.item;if(typeof e.type!="undefined"&&e.type=="no results"){return false}e.name=e.value;var f=jQuery(this);var h=f.closest("td");var g=h.find('input[class="sourceField"]');var c=g.attr("name")+"_display";var d=jQuery('input[name="'+c+'"]',h);g.val(e.id);d.val(e.label).attr("readonly",true)},change:function(d,e){var c=jQuery(this)},open:function(c,d){jQuery(this).data("autocomplete").menu.element.css("z-index","100001")}})},referenceModulePopupRegisterEvent:function(a){var b=this;a.on("click",".relatedPopup",function(c){b.openPopUp(c)});a.find(".referenceModulesList").chosen().change(function(g){var d=jQuery(g.currentTarget);var i=d.closest("td").next();var h=d.val();var f=jQuery('input[name="popupReferenceModule"]',i);var c=f.val();f.val(h);if(c!=h){i.find(".clearReferenceSelection").trigger("click")}})},getReferencedModuleName:function(a){return jQuery('input[name="popupReferenceModule"]',a).val()},searchModuleNames:function(b){var a=jQuery.Deferred();if(typeof b.module=="undefined"){b.module=app.getModuleName()}if(typeof b.action=="undefined"){b.action="BasicAjax"}if(b.search_module=="Products"||b.search_module=="Services"){b.potentialid=jQuery('[name="potentialid"]').val()}AppConnector.request(b).then(function(c){a.resolve(c)},function(c){a.reject()});return a.promise()},getReferenceSearchParams:function(b){var c=jQuery(b).closest("td");var d={};var a=this.getReferencedModuleName(c);d.search_module=a;return d},registerAutoCompleteFields:function(a){var b=this;a.find("input.autoComplete").autocomplete({delay:"600",minLength:"3",source:function(d,c){var f=jQuery(this.element[0]);var e=d.term;var g=b.getReferenceSearchParams(f);g.search_value=e;b.searchModuleNames(g).then(function(k){var i=new Array();var j=k.result;if(j.length<=0){jQuery(f).val("");j=new Array({label:app.vtranslate("JS_NO_RESULTS_FOUND"),type:"no results"})}for(var l in j){var h=j[l];i.push(h)}c(i)})},select:function(h,i){var c=i.item;if(typeof c.type!="undefined"&&c.type=="no results"){return false}c.name=c.value;var d=jQuery(this);var g=d.closest("td");b.setReferenceFieldValue(g,c);var f=g.find('input[class="sourceField"]').attr("name");var e=g.find('input[name="'+f+'"]');e.trigger(Vtiger_Edit_Js.postReferenceSelectionEvent,{data:c})},change:function(d,e){var c=jQuery(this);if(c.attr("readonly")==undefined){c.closest("td").find(".clearReferenceSelection").trigger("click")}},open:function(c,d){jQuery(this).data("ui-autocomplete").menu.element.css("z-index","100001")}})},registerClearReferenceSelectionEvent:function(a){a.find(".clearReferenceSelection").on("click",function(d){var c=jQuery(d.currentTarget);var b=c.closest("td");var g=b.find(".sourceField");var f=g.attr("name");g.val("");b.find('[name="'+f+'_display"]').removeAttr("readonly").val("");c.trigger(Vtiger_Edit_Js.referenceDeSelectionEvent);d.preventDefault()})},registerPreventingEnterSubmitEvent:function(a){a.on("keypress",function(c){var b=jQuery(c.target);if(c.which==13&&(!b.is("textarea"))){c.preventDefault()}})},getRecordDetails:function(c){var a=jQuery.Deferred();var b="index.php?module="+app.getModuleName()+"&action=GetData&record="+c.record+"&source_module="+c.source_module;AppConnector.request(b).then(function(d){if(d.success){a.resolve(d)}else{a.reject(d.message)}},function(d){a.reject()});return a.promise()},registerTimeFields:function(a){app.registerEventForTimeFields(a)},referenceCreateHandler:function(a){var c=this;var d=function(e){var f={};f.name=e.result._recordLabel;f.id=e.result._recordId;c.setReferenceFieldValue(a,f)};var b=this.getReferencedModuleName(a);Vtiger_Header_Js.getInstance().quickCreateModule(b,{callbackFunction:d})},registerReferenceCreate:function(a){var b=this;a.on("click",".createReferenceRecord",function(f){var d=jQuery(f.currentTarget);var c=d.closest("td");b.referenceCreateHandler(c)})},registerEventStatusChangeEvent:function(a){var b=a.find(".followUpContainer");var c=a.find('select[name="eventstatus"]').val();if(c=="Held"||c=="Not Held"){b.show()}a.find('select[name="eventstatus"]').on("change",function(f){var d=jQuery(f.currentTarget).val();if(d=="Held"||d=="Not Held"){b.show()}else{b.hide()}})},addressFieldsMapping:["buildingnumber","localnumber","addresslevel1","addresslevel2","addresslevel3","addresslevel4","addresslevel5","addresslevel6","addresslevel7","addresslevel8","pobox"],addressFieldsMappingBlockID:{LBL_ADDRESS_INFORMATION:"a",LBL_ADDRESS_MAILING_INFORMATION:"b",LBL_ADDRESS_DELIVERY_INFORMATION:"c"},addressFieldsData:false,registerEventForCopyAddress:function(){var d=this;var c=this.getForm();var b=false;var e=false;var f=false;var a=false;jQuery("#EditView table td").each(function(h){var g=false;var i=$(this).find('[name="popupReferenceModule"]').val();if(i=="Accounts"){b=$(this).find(".sourceField").attr("name")}if(i=="Contacts"){e=$(this).find(".sourceField").attr("name")}if(i=="Leads"){f=$(this).find(".sourceField").attr("name")}if(i=="Vendors"){a=$(this).find(".sourceField").attr("name")}g=$(this).find(".referenceModulesList");if(g.length>0){$.each(g.find("option"),function(j,k){if(k.value=="Accounts"){b=jQuery("#EditView table td").eq(h+1).find(".sourceField").attr("name")}if(k.value=="Contacts"){e=jQuery("#EditView table td").eq(h+1).find(".sourceField").attr("name")}if(k.value=="Leads"){f=jQuery("#EditView table td").eq(h+1).find(".sourceField").attr("name")}if(k.value=="Vendors"){a=jQuery("#EditView table td").eq(h+1).find(".sourceField").attr("name")}})}});if(b==false){jQuery(".copyAddressFromAccount").addClass("hide")}else{jQuery(".copyAddressFromAccount").on("click",function(j){var h=jQuery(this);var l=h.closest("table");var n=h.data("label");var m=l.data("label");var k=jQuery('[name="'+b+'"]').val();if(k==""||k=="0"){Vtiger_Helper_Js.showPnotify(app.vtranslate("JS_PLEASE_SELECT_AN_ACCOUNT_TO_COPY_ADDRESS"))}else{var g=jQuery("#"+b+"_display").val();var i={record:k,selectedName:g,source_module:"Accounts"};d.copyAddressDetails(n,m,i,h.closest("table"));h.attr("checked","checked")}})}if(e==false){jQuery(".copyAddressFromContact").addClass("hide")}else{jQuery(".copyAddressFromContact").on("click",function(j){var h=jQuery(this);var l=h.closest("table");var n=h.data("label");var m=l.data("label");var k=jQuery('[name="'+e+'"]').val();if(k==""||k=="0"){Vtiger_Helper_Js.showPnotify(app.vtranslate("JS_PLEASE_SELECT_AN_CONTACT_TO_COPY_ADDRESS"))}else{var g=jQuery("#"+e+"_display").val();var i={record:k,selectedName:g,source_module:"Contacts"};d.copyAddressDetails(n,m,i,h.closest("table"));h.attr("checked","checked")}})}if(f==false){jQuery(".copyAddressFromLead").addClass("hide")}else{jQuery(".copyAddressFromLead").on("click",function(j){var h=jQuery(this);var l=h.closest("table");var n=h.data("label");var m=l.data("label");var k=jQuery('[name="'+f+'"]').val();if(k==""||k=="0"){Vtiger_Helper_Js.showPnotify(app.vtranslate("JS_PLEASE_SELECT_AN_LEAD_TO_COPY_ADDRESS"))}else{var g=jQuery("#"+f+"_display").val();var i={record:k,selectedName:g,source_module:"Leads"};d.copyAddressDetails(n,m,i,h.closest("table"));h.attr("checked","checked")}})}if(a==false){jQuery(".copyAddressFromVendor").addClass("hide")}else{jQuery(".copyAddressFromVendor").on("click",function(j){var h=jQuery(this);var l=h.closest("table");var n=h.data("label");var m=l.data("label");var k=jQuery('[name="'+a+'"]').val();if(k==""||k=="0"){Vtiger_Helper_Js.showPnotify(app.vtranslate("JS_PLEASE_SELECT_AN_VENDOR_TO_COPY_ADDRESS"))}else{var g=jQuery("#"+a+"_display").val();var i={record:k,selectedName:g,source_module:"Vendors"};d.copyAddressDetails(n,m,i,h.closest("table"));h.attr("checked","checked")}})}if(e==false&&b==false&&f==false&&a==false){jQuery(".copyAddressLabel").addClass("hide")}jQuery(".copyAddressFromMain").on("click",function(h){var g=jQuery(this);var i=g.closest("table");var k=g.data("label");var j=i.data("label");d.copyAddress(k,j,false,false)});jQuery(".copyAddressFromMailing").on("click",function(h){var g=jQuery(this);var i=g.closest("table");var k=g.data("label");var j=i.data("label");d.copyAddress(k,j,false,false)});jQuery(".copyAddressFromDelivery").on("click",function(h){var g=jQuery(this);var i=g.closest("table");var k=g.data("label");var j=i.data("label");d.copyAddress(k,j,false,false)})},copyAddressDetails:function(h,g,f,b){var e=this;var a=f.source_module;var c=true;var d;e.getRecordDetails(f).then(function(j){var i=j.result;e.addressFieldsData=i.data;e.copyAddress(h,g,true,a)},function(i,j){})},copyAddress:function(p,f,o,e){var d=false;var i=this;var h=this.getForm();var a=this.addressFieldsMapping;var c=this.addressFieldsMappingBlockID;from=c[p];if(app.getModuleName()=="Quotes"||app.getModuleName()=="Invoice"){c={LBL_ADDRESS_INFORMATION:"a",LBL_ADDRESS_DELIVERY_INFORMATION:"b"}}if(o===false||e===false){from=c[p]}to=c[f];for(var k in a){var l=a[k]+from;var n=a[k]+to;if(o){var g=i.addressFieldsData[l];var m=i.addressFieldsData[l+"_label"]}else{var g=h.find('[name="'+l+'"]').val();var m=h.find('[name="'+l+'_display"]').val()}var b=h.find('[name="'+n+'"]');var j=h.find('[name="'+n+'_display"]');if(g!=""&&g!="0"&&g!=undefined){if(j.length>0){j.attr("readonly",true)}d=true;b.val(g);j.val(m)}else{b.attr("readonly",false)}}if(d==false){if(e=="Accounts"){errorMsg="JS_SELECTED_ACCOUNT_DOES_NOT_HAVE_AN_ADDRESS"}else{if(e=="Contacts"){errorMsg="JS_SELECTED_CONTACT_DOES_NOT_HAVE_AN_ADDRESS"}else{errorMsg="JS_DOES_NOT_HAVE_AN_ADDRESS"}}Vtiger_Helper_Js.showPnotify(app.vtranslate(errorMsg))}},registerReferenceSelectionEvent:function(a){var c=this;var b=a.find("input[name*='addresslevel']");b.on(Vtiger_Edit_Js.referenceSelectionEvent,function(g,f){var d=jQuery(g.currentTarget).closest(".blockContainer");c.copyAddressDetailsRef(f,d)})},copyAddressDetailsRef:function(c,a){var b=this;b.getRecordDetails(c).then(function(e){var d=e.result;b.mapAddressDetails(d.data,a)},function(d,e){})},mapAddressDetails:function(a,b){for(var c in a){if(c.indexOf("addresslevel")!=-1){if(b.find('[name="'+c+'"]').length!=0){b.find('[name="'+c+'"]').val(a[c]);b.find('[name="'+c+'"]').attr("readonly",true);b.find('[name="'+c+'_display"]').val(a[c+"_label"]);b.find('[name="'+c+'_display"]').attr("readonly",true)}if(b.find('[name="'+c+'a"]').length!=0&&b.find('[name="'+c+'a"]').val()==0&&a[c]!=0){b.find('[name="'+c+'a"]').val(a[c]);b.find('[name="'+c+'a"]').attr("readonly",true);b.find('[name="'+c+'a_display"]').val(a[c+"_label"]);b.find('[name="'+c+'a_display"]').attr("readonly",true)}if(b.find('[name="'+c+'b"]').length!=0&&b.find('[name="'+c+'b"]').val()==0&&a[c]!=0){b.find('[name="'+c+'b"]').val(a[c]);b.find('[name="'+c+'b"]').attr("readonly",true);b.find('[name="'+c+'b_display"]').val(a[c+"_label"]);b.find('[name="'+c+'b_display"]').attr("readonly",true)}if(b.find('[name="'+c+'c"]').length!=0&&b.find('[name="'+c+'c"]').val()==0&&a[c]!=0){b.find('[name="'+c+'c"]').val(a[c]);b.find('[name="'+c+'c"]').attr("readonly",true);b.find('[name="'+c+'c_display"]').val(a[c+"_label"]);b.find('[name="'+c+'c_display"]').attr("readonly",true)}}}},registerMaskFields:function(a){var b=this;a.find(":input").inputmask()},registerBasicEvents:function(a){this.treePopupRegisterEvent(a);this.registerClearTreeSelectionEvent(a);this.registerTreeAutoCompleteFields(a);this.referenceModulePopupRegisterEvent(a);this.registerAutoCompleteFields(a);this.registerClearReferenceSelectionEvent(a);this.registerPreventingEnterSubmitEvent(a);this.registerTimeFields(a);this.registerEventStatusChangeEvent(a);this.registerRecordAccessCheckEvent(a);this.registerEventForPicklistDependencySetup(a);this.registerRecordPreSaveEventEvent(a);this.registerReferenceSelectionEvent(a);this.registerMaskFields(a)},registerEventForImageDelete:function(){var b=this.getForm();var a=b.find('input[name="record"]').val();b.find(".imageDelete").on("click",function(k){var i=jQuery(k.currentTarget);var l=i.closest("td");var d=l.find('[name="imagename[]"]');var c=d.data("fieldinfo");var g=c.mandatory;var f=i.closest("div").find("img").data().imageId;i.closest("div").remove();var j=l.find('[name="existingImages"]');if(j.length<1&&g){b.validationEngine("detach");d.attr("data-validation-engine","validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]");b.validationEngine("attach")}if(b.find("[name=imageid]").length!=0){var m=JSON.parse(b.find("[name=imageid]").val());m.push(f);b.find("[name=imageid]").val(JSON.stringify(m))}else{var h=[];h.push(f);b.append('');b.append('')}})},triggerDisplayTypeEvent:function(){var a=app.cacheGet("widthType","narrowWidthType");if(a){var b=jQuery("#EditView").find("td");b.addClass(a)}},registerSubmitEvent:function(){var a=this.getForm();a.submit(function(d){if(typeof a.data("submit")!="undefined"){return false}else{document.progressLoader=jQuery.progressIndicator({message:app.vtranslate("JS_SAVE_LOADER_INFO"),position:"html",blockInfo:{enabled:true}});var b=jQuery(d.currentTarget).find('[name="module"]').val();if(a.validationEngine("validate")){a.data("submit","true");var c=jQuery.Event(Vtiger_Edit_Js.recordPreSave);a.trigger(c,{value:"edit"});if(c.isDefaultPrevented()){document.progressLoader.progressIndicator({mode:"hide"});a.removeData("submit");d.preventDefault()}}else{document.progressLoader.progressIndicator({mode:"hide"});a.removeData("submit");app.formAlignmentAfterValidation(a)}}})},registerRecordPreSaveEventEvent:function(b){if(Vtiger_Edit_Js.SaveResultInstance==false){Vtiger_Edit_Js.SaveResultInstance=new SaveResult()}var a=this.getForm();var c=a.serializeFormData();Vtiger_Edit_Js.SaveResultInstance.loadFormData(c);b.on(Vtiger_Edit_Js.recordPreSave,function(f,d){if(Vtiger_Edit_Js.SaveResultInstance.checkData(b.serializeFormData())==false){f.preventDefault()}})},registerRecordAccessCheckEvent:function(a){a.on(Vtiger_Edit_Js.recordPreSave,function(g,f){var d=jQuery('[name="assigned_user_id"]',a);if(d.data("recordaccessconfirmation")==true){return}else{if(d.data("recordaccessconfirmationprogress")!=true){var b=d.find("option:selected").data("recordaccess");if(b==false){var c=app.vtranslate("JS_NO_VIEW_PERMISSION_AFTER_SAVE");Vtiger_Helper_Js.showConfirmationBox({message:c}).then(function(h){d.data("recordaccessconfirmation",true);d.removeData("recordaccessconfirmationprogress");a.append('');a.submit()},function(e,h){d.removeData("recordaccessconfirmationprogress");g.preventDefault()});d.data("recordaccessconfirmationprogress",true)}else{return true}}}g.preventDefault()})},registerEventForPicklistDependencySetup:function(a){var c=jQuery('[name="picklistDependency"]',a);if(c.length<=0){return}var d=JSON.parse(c.val());var e=Object.keys(d);if(e.length<=0){return}var g=[];for(var b=0;b-1)){var e=a.split("/");f.house_number=e[0];f.local_number=e[1]}else{f.house_number=b[d]["long_name"]}}if("country"===c[0]&&"political"===c[1]){f.country=b[d]["long_name"]}if("administrative_area_level_1"===c[0]&&"political"===c[1]){f.state=b[d]["long_name"]}if("administrative_area_level_2"===c[0]&&"political"===c[1]){f.powiat=b[d]["long_name"]}if("sublocality_level_1"===c[0]&&"sublocality"===c[1]&&"political"===c[2]){f.region_city=b[d]["long_name"]}if("postal_code"===c[0]){f.postcode=b[d]["long_name"]}if("locality"===c[0]&&"political"===c[1]){f.city=b[d]["long_name"]}}return f},registerApiAddress:function(){var b=this;var c=jQuery('[name="apiAddress"]');var a=[];jQuery(c).each(function(e,f){var d=jQuery(f).data("api-name");var g={geoCodeURL:jQuery(f).data("url"),geoCodeKey:jQuery(f).val()};a[d]=g;a.minLookupLenght=jQuery(f).data("lenght");a.max_num=jQuery(f).data("max-num")});if(!a){return false}jQuery(".api_address_autocomplete").each(function(){jQuery(this).autocomplete({source:function(e,d){jQuery.when(b.getDataFromOG(e,a),b.getDataFromGM(e,a)).then(function(h,g){var f=b.addressDataOG.concat(b.addressDataGM);d(f.slice(0,a.max_num))}).fail(function(f){d([{label:app.vtranslate("An error has occurred. No results."),value:""}])})},minLength:a.minLookupLenght,select:function(f,g){for(var e in g.item.components){var d=b.addressFieldsMappingFromApi[e];jQuery(this).parents("table").find('[name^="'+d+'"]').val(g.item.components[e])}}}).data("ui-autocomplete")._renderItem=function(d,e){return jQuery("
  • ").data("item.autocomplete",e).append(''+e.source_label+''+e.label+"").appendTo(d)}})},addressFieldsMappingFromApi:{house_number:"buildingnumber",local_number:"localnumber",country:"addresslevel1",state:"addresslevel2",powiat:"addresslevel3",county:"addresslevel4",city:"addresslevel5",region_city:"addresslevel6",postcode:"addresslevel7",road:"addresslevel8",village:"addresslevel5"},registerEvents:function(){var c=this.getForm();var a=this.proceedRegisterEvents();if(!a){return}this.registerHelpInfo();this.registerBlockAnimationEvent();this.registerBlockStatusCheckOnLoad();this.registerEventForCkEditor();this.stretchCKEditor();this.registerBasicEvents(this.getForm());this.registerEventForCopyAddress();this.registerEventForImageDelete();this.registerSubmitEvent();this.registerLeavePageWithoutSubmit(c);app.registerEventForDatePickerFields("#EditView");var b=app.validationEngineOptionsForRecord;b.onValidationComplete=function(i,d){if(d){var g=c.find(".ckEditorSource");if(g.length>0){var h=g.attr("id");var e=g.data("fieldinfo");var k=e.mandatory;var j=CKEDITOR.instances[h];if(jQuery.type(j)!=="undefined"&&jQuery.type(j.document)==="object"){var f=jQuery.trim(j.document.getBody().getText());if(k&&(f.length===0)){var m="cke_"+h;var l=app.vtranslate("JS_REQUIRED_FIELD");jQuery("#"+m).validationEngine("showPrompt",l,"error","topLeft",true);return false}else{return d}}}return d}return d};c.validationEngine(b);this.registerReferenceCreate(c);this.registerApiAddress()},getMappingRelatedField:function(e,a,b){var c=b.find('input[name="mappingRelatedField"]').val();var d=JSON.parse(c);if(typeof d[e]!="undefined"&&typeof d[e][a]!="undefined"){return d[e][a]}return[]}}); \ No newline at end of file From 5536de96e4b88001faa27a605d5eba86b4a3fb69 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Mon, 17 Aug 2015 13:04:18 +0200 Subject: [PATCH 019/489] Added a new uitype with a list of taxes --- include/CRMEntity.php | 10 +++++++- include/ListView/ListViewController.php | 14 +++++++++++ .../vlayout/modules/Vtiger/uitypes/Taxs.tpl | 23 ++++++++++++++++++ .../Vtiger/uitypes/TaxsFieldSearchView.tpl | 24 +++++++++++++++++++ modules/Vtiger/models/Field.php | 2 ++ 5 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 layouts/vlayout/modules/Vtiger/uitypes/Taxs.tpl create mode 100644 layouts/vlayout/modules/Vtiger/uitypes/TaxsFieldSearchView.tpl diff --git a/include/CRMEntity.php b/include/CRMEntity.php index c8c7a229c191..3ddd4ea1dbc1 100644 --- a/include/CRMEntity.php +++ b/include/CRMEntity.php @@ -474,6 +474,13 @@ function insertIntoEntityTable($table_name, $module, $fileid = '') $field_list = $this->column_fields[$fieldname]; } $fldvalue = $field_list; + } elseif ($uitype == 303) { + if (is_array($this->column_fields[$fieldname])) { + $field_list = implode(',', $this->column_fields[$fieldname]); + } else { + $field_list = $this->column_fields[$fieldname]; + } + $fldvalue = $field_list; } elseif ($uitype == 5 || $uitype == 6 || $uitype == 23) { //Added to avoid function call getDBInsertDateValue in ajax save if (isset($current_user->date_format) && !$ajaxSave) { @@ -538,6 +545,7 @@ function insertIntoEntityTable($table_name, $module, $fileid = '') else { $fldvalue = ''; } + if ($fldvalue == '') { $fldvalue = $this->get_column_value($columname, $fldvalue, $fieldname, $uitype, $datatype); } @@ -552,7 +560,7 @@ function insertIntoEntityTable($table_name, $module, $fileid = '') array_push($value, $fldvalue); } } - + if ($insertion_mode == 'edit') { if ($module == 'Potentials') { $dbquery = 'select sales_stage from vtiger_potential where potentialid = ?'; diff --git a/include/ListView/ListViewController.php b/include/ListView/ListViewController.php index 36bf46ed7569..eafa31a6cc88 100644 --- a/include/ListView/ListViewController.php +++ b/include/ListView/ListViewController.php @@ -434,6 +434,20 @@ function getListViewRecords($focus, $module, $result) $json = new Zend_Json(); $value = vt_suppressHTMLTags(implode(',', $json->decode($temp_val))); } + } elseif ($field->getUIType() == 303) { + if (!empty($value)) { + $valueArray = ($value != "") ? explode(',', $value) : []; + $tmp = ''; + $tmpArray = []; + $taxs = Vtiger_Taxs_UIType::getTaxs(); + foreach ($valueArray as $index => $tax) { + if (isset($taxs[$tax])) { + $tmpArray[] = $taxs[$tax]['value'] . '% - ' . $taxs[$tax]['name']; + } + } + $value = implode(', ', $tmpArray); + $value = textlength_check($value); + } } elseif (in_array($uitype, array(7, 9, 90))) { $value = "" . textlength_check($value) . ""; } else { diff --git a/layouts/vlayout/modules/Vtiger/uitypes/Taxs.tpl b/layouts/vlayout/modules/Vtiger/uitypes/Taxs.tpl new file mode 100644 index 000000000000..35dfa3768a7d --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/uitypes/Taxs.tpl @@ -0,0 +1,23 @@ +{**} +{strip} +{assign var="FIELD_INFO" value=Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode($FIELD_MODEL->getFieldInfo()))} +{assign var=UITYPE_MODEL value=$FIELD_MODEL->getUITypeModel()} +{assign var=PICKLIST_VALUES value=$UITYPE_MODEL->getTaxs()} +{assign var="SPECIAL_VALIDATOR" value=$FIELD_MODEL->getValidator()} +{assign var="FIELD_VALUE_LIST" value=explode(',',$FIELD_MODEL->get('fieldvalue'))} + +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/uitypes/TaxsFieldSearchView.tpl b/layouts/vlayout/modules/Vtiger/uitypes/TaxsFieldSearchView.tpl new file mode 100644 index 000000000000..2acd0b9dfb70 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/uitypes/TaxsFieldSearchView.tpl @@ -0,0 +1,24 @@ +{**} +{strip} + {assign var="FIELD_INFO" value=Zend_Json::encode($FIELD_MODEL->getFieldInfo())} + {assign var=UITYPE_MODEL value=$FIELD_MODEL->getUITypeModel()} + {assign var=PICKLIST_VALUES value=$UITYPE_MODEL->getTaxs()} + {assign var=SEARCH_VALUES value=explode(',',$SEARCH_INFO['searchValue'])} +
    + +
    +{/strip} diff --git a/modules/Vtiger/models/Field.php b/modules/Vtiger/models/Field.php index 6d06bef01cb6..2aff2cf72f7c 100644 --- a/modules/Vtiger/models/Field.php +++ b/modules/Vtiger/models/Field.php @@ -187,6 +187,8 @@ public function getFieldDataType() $fieldDataType = 'modules'; } else if ($uiType == '302') { $fieldDataType = 'tree'; + } else if ($uiType == '303') { + $fieldDataType = 'taxs'; } else { $webserviceField = $this->getWebserviceFieldObject(); $fieldDataType = $webserviceField->getFieldDataType(); From e7d98e801419ac5d482d3d6f89a44aa875dc4126 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Tue, 18 Aug 2015 08:09:06 +0200 Subject: [PATCH 020/489] Added a new uitype with a list of taxes --- modules/Vtiger/models/Field.php | 9 ++++ modules/Vtiger/resources/Field.js | 3 ++ modules/Vtiger/resources/Field.min.js | 2 +- modules/Vtiger/uitypes/Taxs.php | 67 +++++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 modules/Vtiger/uitypes/Taxs.php diff --git a/modules/Vtiger/models/Field.php b/modules/Vtiger/models/Field.php index 2aff2cf72f7c..dac6beff00c8 100644 --- a/modules/Vtiger/models/Field.php +++ b/modules/Vtiger/models/Field.php @@ -592,6 +592,15 @@ public function getFieldInfo() } } + if ($fieldDataType == 'taxs') { + $taxs = $this->getUITypeModel()->getTaxs(); + if (!empty($taxs)) { + $this->fieldInfo['picklistvalues'] = $taxs; + } else { + $this->fieldInfo['picklistvalues'] = []; + } + } + if ($this->getFieldDataType() == 'date' || $this->getFieldDataType() == 'datetime') { $currentUser = Users_Record_Model::getCurrentUserModel(); $this->fieldInfo['date-format'] = $currentUser->get('date_format'); diff --git a/modules/Vtiger/resources/Field.js b/modules/Vtiger/resources/Field.js index a4adbabab6e0..9193df59ceac 100644 --- a/modules/Vtiger/resources/Field.js +++ b/modules/Vtiger/resources/Field.js @@ -318,6 +318,9 @@ Vtiger_Field_Js('Vtiger_Owner_Field_Js', {}, { Vtiger_Date_Field_Js('Vtiger_Datetime_Field_Js', {}, { }); +Vtiger_Picklist_Field_Js('Vtiger_Taxs_Field_Js', {}, { +}); + Vtiger_Field_Js('Vtiger_Time_Field_Js', {}, { /** * Function to get the user date format diff --git a/modules/Vtiger/resources/Field.min.js b/modules/Vtiger/resources/Field.min.js index 8647d451ff93..ab2f702b1aab 100644 --- a/modules/Vtiger/resources/Field.min.js +++ b/modules/Vtiger/resources/Field.min.js @@ -1,2 +1,2 @@ -jQuery.Class("Vtiger_Field_Js",{getInstance:function(f,c){if(typeof c=="undefined"){var c=app.getModuleName()}var a=c+"_Field_Js";var b=window[a];if(typeof b!="undefined"){var e=b}else{var e=Vtiger_Field_Js}var d=new e();if(typeof f=="undefined"){f={}}d.setData(f);return d}},{data:{},isMandatory:function(){return this.get("mandatory")},get:function(a){if(a in this.data){return this.data[a]}return""},getType:function(){return this.get("type")},getName:function(){return this.get("name")},getValue:function(){if("value" in this.getData()){return this.get("value")}else{if("defaultValue" in this.getData()){return this.get("defaultValue")}}return""},getData:function(){return this.data},setData:function(a){this.data=a;return this},getModuleName:function(){return app.getModuleName()},getUiTypeModel:function(){var d=this.getModuleName();var f=this.getType();var c=f.charAt(0).toUpperCase()+f.slice(1).toLowerCase();var b=window[d+"_"+c+"_Field_Js"];var e=window["Vtiger_"+c+"_Field_Js"];if(typeof b!="undefined"){var a=new b();return a.setData(this.getData())}else{if(typeof e!="undefined"){var a=new e();return a.setData(this.getData())}}return this},getUi:function(){var a='';a=jQuery(a).val(app.htmlDecode(this.getValue()));return this.addValidationToElement(a)},getUiTypeSpecificHtml:function(){var a=this.getUiTypeModel();return a.getUi()},addValidationToElement:function(d){var d=jQuery(d);var b=d;var a=d.find('[name="'+this.getName()+'"]');if(a.length>0){b=a}var c="validate[";if(this.isMandatory()){c+="required,"}c+="funcCall[Vtiger_Base_Validator_Js.invokeValidation]]";b.attr("data-validation-engine",c).attr("data-fieldinfo",JSON.stringify(this.getData())).attr("data-validator",JSON.stringify(this.getData().specialValidator));return d}});Vtiger_Field_Js("Vtiger_Picklist_Field_Js",{},{getPickListValues:function(){return this.get("picklistvalues")},getUi:function(){var a='";var d=jQuery(a);this.addValidationToElement(d);return d}});Vtiger_Field_Js("Vtiger_Multipicklist_Field_Js",{},{getPickListValues:function(){return this.get("picklistvalues")},getUi:function(){var a='";var e=jQuery(a);this.addValidationToElement(e);return e}}),Vtiger_Field_Js("Vtiger_Boolean_Field_Js",{},{isChecked:function(){var a=this.getValue();if(a==1||a=="1"||a.toLowerCase()=="on"){return true}return false},getUi:function(){var a='';var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Currency_Field_Js",{},{getCurrencySymbol:function(){return this.get("currency_symbol")},getUi:function(){var b='
    '+this.getCurrencySymbol()+'
    ';var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Owner_Field_Js",{},{getPickListValues:function(){return this.get("picklistvalues")},getUi:function(){var a='";var d=jQuery(a);this.addValidationToElement(d);return d}});Vtiger_Date_Field_Js("Vtiger_Datetime_Field_Js",{},{});Vtiger_Field_Js("Vtiger_Time_Field_Js",{},{getTimeFormat:function(){return this.get("time-format")},getUi:function(){var b='
    ';var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Text_Field_Js",{},{getUi:function(){var b='";var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Percentage_Field_Js",{},{getUi:function(){var b='
    %
    ';var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Recurrence_Field_Js",{},{getPickListValues:function(){return this.get("picklistvalues")},getUi:function(){var a='";var d=jQuery(a);this.addValidationToElement(d);return d}}); \ No newline at end of file +jQuery.Class("Vtiger_Field_Js",{getInstance:function(f,c){if(typeof c=="undefined"){var c=app.getModuleName()}var a=c+"_Field_Js";var b=window[a];if(typeof b!="undefined"){var e=b}else{var e=Vtiger_Field_Js}var d=new e();if(typeof f=="undefined"){f={}}d.setData(f);return d}},{data:{},isMandatory:function(){return this.get("mandatory")},get:function(a){if(a in this.data){return this.data[a]}return""},getType:function(){return this.get("type")},getName:function(){return this.get("name")},getValue:function(){if("value" in this.getData()){return this.get("value")}else{if("defaultValue" in this.getData()){return this.get("defaultValue")}}return""},getData:function(){return this.data},setData:function(a){this.data=a;return this},getModuleName:function(){return app.getModuleName()},getUiTypeModel:function(){var d=this.getModuleName();var f=this.getType();var c=f.charAt(0).toUpperCase()+f.slice(1).toLowerCase();var b=window[d+"_"+c+"_Field_Js"];var e=window["Vtiger_"+c+"_Field_Js"];if(typeof b!="undefined"){var a=new b();return a.setData(this.getData())}else{if(typeof e!="undefined"){var a=new e();return a.setData(this.getData())}}return this},getUi:function(){var a='';a=jQuery(a).val(app.htmlDecode(this.getValue()));return this.addValidationToElement(a)},getUiTypeSpecificHtml:function(){var a=this.getUiTypeModel();return a.getUi()},addValidationToElement:function(d){var d=jQuery(d);var b=d;var a=d.find('[name="'+this.getName()+'"]');if(a.length>0){b=a}var c="validate[";if(this.isMandatory()){c+="required,"}c+="funcCall[Vtiger_Base_Validator_Js.invokeValidation]]";b.attr("data-validation-engine",c).attr("data-fieldinfo",JSON.stringify(this.getData())).attr("data-validator",JSON.stringify(this.getData().specialValidator));return d}});Vtiger_Field_Js("Vtiger_Picklist_Field_Js",{},{getPickListValues:function(){return this.get("picklistvalues")},getUi:function(){var a='";var d=jQuery(a);this.addValidationToElement(d);return d}});Vtiger_Field_Js("Vtiger_Multipicklist_Field_Js",{},{getPickListValues:function(){return this.get("picklistvalues")},getUi:function(){var a='";var e=jQuery(a);this.addValidationToElement(e);return e}}),Vtiger_Field_Js("Vtiger_Boolean_Field_Js",{},{isChecked:function(){var a=this.getValue();if(a==1||a=="1"||a.toLowerCase()=="on"){return true}return false},getUi:function(){var a='';var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Currency_Field_Js",{},{getCurrencySymbol:function(){return this.get("currency_symbol")},getUi:function(){var b='
    '+this.getCurrencySymbol()+'
    ';var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Owner_Field_Js",{},{getPickListValues:function(){return this.get("picklistvalues")},getUi:function(){var a='";var d=jQuery(a);this.addValidationToElement(d);return d}});Vtiger_Date_Field_Js("Vtiger_Datetime_Field_Js",{},{});Vtiger_Picklist_Field_Js("Vtiger_Taxs_Field_Js",{},{});Vtiger_Field_Js("Vtiger_Time_Field_Js",{},{getTimeFormat:function(){return this.get("time-format")},getUi:function(){var b='
    ';var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Text_Field_Js",{},{getUi:function(){var b='";var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Percentage_Field_Js",{},{getUi:function(){var b='
    %
    ';var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Recurrence_Field_Js",{},{getPickListValues:function(){return this.get("picklistvalues")},getUi:function(){var a='";var d=jQuery(a);this.addValidationToElement(d);return d}}); \ No newline at end of file diff --git a/modules/Vtiger/uitypes/Taxs.php b/modules/Vtiger/uitypes/Taxs.php new file mode 100644 index 000000000000..322ef63cdcb3 --- /dev/null +++ b/modules/Vtiger/uitypes/Taxs.php @@ -0,0 +1,67 @@ + - Template Name + */ + public function getTemplateName() + { + return 'uitypes/Taxs.tpl'; + } + + /** + * Function to get the Display Value, for the current field type with given DB Insert Value + * @param $value + * @return + */ + public function getDisplayValue($value) + { + $values = explode(',', $value); + $taxs = $this->getTaxs(); + $display = []; + + foreach ($values as $tax) { + if (isset($taxs[$tax])) { + $display[] = $taxs[$tax]['value'] . '% - ' . $taxs[$tax]['name']; + } + } + + return implode(',', $display); + } + + public function getListSearchTemplateName() + { + return 'uitypes/TaxsFieldSearchView.tpl'; + } + + /** + * Function to get all the available picklist values for the current field + * @return List of picklist values if the field is of type picklist or multipicklist, null otherwise. + */ + public function getTaxs() + { + $taxs = Vtiger_Cache::get('taxs', 'global'); + if (!$taxs) { + $db = PearDatabase::getInstance(); + $taxs = []; + $result = $db->pquery('SELECT * FROM a_yf_taxs_global WHERE status = ?', [1]); + while ($row = $db->fetch_array($result)) { + $taxs[$row['id']] = $row; + } + Vtiger_Cache::set('taxs', 'global', $taxs); + } + + return $taxs; + } +} From 38af934f844114357ec25abf54d3d550407cbbc1 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Tue, 18 Aug 2015 11:22:12 +0200 Subject: [PATCH 021/489] Added support for regional tax and the tax group --- .../modules/Products/DiscountsType0.tpl | 2 +- .../modules/Products/DiscountsType1.tpl | 2 +- .../modules/Products/DiscountsType3.tpl | 3 -- .../vlayout/modules/Products/TaxsType0.tpl | 2 +- .../vlayout/modules/Products/TaxsType1.tpl | 21 +++++----- .../vlayout/modules/Products/TaxsType3.tpl | 24 ++++++++++++ .../modules/Supplies/EditViewSupplies.tpl | 3 +- .../modules/Supplies/fields/EditViewName.tpl | 5 ++- .../modules/Supplies/resources/Edit.js | 24 +++++++++--- .../modules/Supplies/resources/Edit.min.js | 2 +- layouts/vlayout/skins/twilight/style.css | 8 ++-- layouts/vlayout/skins/twilight/style.min.css | 2 +- modules/Products/views/Discounts.php | 15 +++---- modules/Products/views/Taxs.php | 27 ++++++++++++- modules/Supplies/models/EditView.php | 39 ++++++++++++++++++- modules/Supplies/models/SupField.php | 16 -------- modules/Vtiger/uitypes/Taxs.php | 15 +++++++ 17 files changed, 155 insertions(+), 55 deletions(-) delete mode 100644 layouts/vlayout/modules/Products/DiscountsType3.tpl create mode 100644 layouts/vlayout/modules/Products/TaxsType3.tpl diff --git a/layouts/vlayout/modules/Products/DiscountsType0.tpl b/layouts/vlayout/modules/Products/DiscountsType0.tpl index 69751dff03b2..636d937cb01c 100644 --- a/layouts/vlayout/modules/Products/DiscountsType0.tpl +++ b/layouts/vlayout/modules/Products/DiscountsType0.tpl @@ -10,7 +10,7 @@ diff --git a/layouts/vlayout/modules/Products/DiscountsType1.tpl b/layouts/vlayout/modules/Products/DiscountsType1.tpl index 9fec0c5383e1..7d69715f334a 100644 --- a/layouts/vlayout/modules/Products/DiscountsType1.tpl +++ b/layouts/vlayout/modules/Products/DiscountsType1.tpl @@ -10,7 +10,7 @@ ';var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Currency_Field_Js",{},{getCurrencySymbol:function(){return this.get("currency_symbol")},getUi:function(){var b='
    '+this.getCurrencySymbol()+'
    ';var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Owner_Field_Js",{},{getPickListValues:function(){return this.get("picklistvalues")},getUi:function(){var a='";var d=jQuery(a);this.addValidationToElement(d);return d}});Vtiger_Date_Field_Js("Vtiger_Datetime_Field_Js",{},{});Vtiger_Picklist_Field_Js("Vtiger_Taxs_Field_Js",{},{});Vtiger_Field_Js("Vtiger_Time_Field_Js",{},{getTimeFormat:function(){return this.get("time-format")},getUi:function(){var b='
    ';var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Text_Field_Js",{},{getUi:function(){var b='";var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Percentage_Field_Js",{},{getUi:function(){var b='
    %
    ';var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Recurrence_Field_Js",{},{getPickListValues:function(){return this.get("picklistvalues")},getUi:function(){var a='";var d=jQuery(a);this.addValidationToElement(d);return d}}); \ No newline at end of file +jQuery.Class("Vtiger_Field_Js",{getInstance:function(f,c){if(typeof c=="undefined"){var c=app.getModuleName()}var a=c+"_Field_Js";var b=window[a];if(typeof b!="undefined"){var e=b}else{var e=Vtiger_Field_Js}var d=new e();if(typeof f=="undefined"){f={}}d.setData(f);return d}},{data:{},isMandatory:function(){return this.get("mandatory")},get:function(a){if(a in this.data){return this.data[a]}return""},getType:function(){return this.get("type")},getName:function(){return this.get("name")},getValue:function(){if("value" in this.getData()){return this.get("value")}else{if("defaultValue" in this.getData()){return this.get("defaultValue")}}return""},getData:function(){return this.data},setData:function(a){this.data=a;return this},getModuleName:function(){return app.getModuleName()},getUiTypeModel:function(){var d=this.getModuleName();var f=this.getType();var c=f.charAt(0).toUpperCase()+f.slice(1).toLowerCase();var b=window[d+"_"+c+"_Field_Js"];var e=window["Vtiger_"+c+"_Field_Js"];if(typeof b!="undefined"){var a=new b();return a.setData(this.getData())}else{if(typeof e!="undefined"){var a=new e();return a.setData(this.getData())}}return this},getUi:function(){var a='';a=jQuery(a).val(app.htmlDecode(this.getValue()));return this.addValidationToElement(a)},getUiTypeSpecificHtml:function(){var a=this.getUiTypeModel();return a.getUi()},addValidationToElement:function(d){var d=jQuery(d);var b=d;var a=d.find('[name="'+this.getName()+'"]');if(a.length>0){b=a}var c="validate[";if(this.isMandatory()){c+="required,"}c+="funcCall[Vtiger_Base_Validator_Js.invokeValidation]]";b.attr("data-validation-engine",c).attr("data-fieldinfo",JSON.stringify(this.getData())).attr("data-validator",JSON.stringify(this.getData().specialValidator));return d}});Vtiger_Field_Js("Vtiger_Picklist_Field_Js",{},{getPickListValues:function(){return this.get("picklistvalues")},getUi:function(){var a='";var d=jQuery(a);this.addValidationToElement(d);return d}});Vtiger_Field_Js("Vtiger_Multipicklist_Field_Js",{},{getPickListValues:function(){return this.get("picklistvalues")},getUi:function(){var a='";var e=jQuery(a);this.addValidationToElement(e);return e}}),Vtiger_Field_Js("Vtiger_Boolean_Field_Js",{},{isChecked:function(){var a=this.getValue();if(a==1||a=="1"||a.toLowerCase()=="on"){return true}return false},getUi:function(){var a='';var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Currency_Field_Js",{},{getCurrencySymbol:function(){return this.get("currency_symbol")},getUi:function(){var b='
    '+this.getCurrencySymbol()+'
    ';var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Owner_Field_Js",{},{getPickListValues:function(){return this.get("picklistvalues")},getUi:function(){var a='";var d=jQuery(a);this.addValidationToElement(d);return d}});Vtiger_Date_Field_Js("Vtiger_Datetime_Field_Js",{},{});Vtiger_Picklist_Field_Js("Vtiger_Taxs_Field_Js",{},{});Vtiger_Picklist_Field_Js("Vtiger_SuppliesLimit_Field_Js",{},{});Vtiger_Field_Js("Vtiger_Time_Field_Js",{},{getTimeFormat:function(){return this.get("time-format")},getUi:function(){var b='
    ';var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Text_Field_Js",{},{getUi:function(){var b='";var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Percentage_Field_Js",{},{getUi:function(){var b='
    %
    ';var a=jQuery(b);return this.addValidationToElement(a)}});Vtiger_Field_Js("Vtiger_Recurrence_Field_Js",{},{getPickListValues:function(){return this.get("picklistvalues")},getUi:function(){var a='";var d=jQuery(a);this.addValidationToElement(d);return d}}); \ No newline at end of file diff --git a/modules/Vtiger/uitypes/SuppliesLimit.php b/modules/Vtiger/uitypes/SuppliesLimit.php new file mode 100644 index 000000000000..da44c20c0a9e --- /dev/null +++ b/modules/Vtiger/uitypes/SuppliesLimit.php @@ -0,0 +1,82 @@ + - Template Name + */ + public function getTemplateName() + { + return 'uitypes/SuppliesLimit.tpl'; + } + + /** + * Function to get the Display Value, for the current field type with given DB Insert Value + * @param $value + * @return + */ + public function getDisplayValue($value) + { + $values = explode(',', $value); + $limits = $this->getLimits(); + $display = []; + + foreach ($values as $limit) { + if (isset($limits[$limit])) { + $display[] = $limits[$limit]['value'] . ' - ' . $limits[$limit]['name']; + } + } + + return implode(',', $display); + } + + public static function getValues($value) + { + $values = explode(',', $value); + $limits = self::getLimits(); + $display = []; + + foreach ($values as $limit) { + if (isset($limits[$limit])) { + $display[$limit] = $limits[$limit]; + } + } + + return $display; + } + + public function getListSearchTemplateName() + { + return 'uitypes/SuppliesLimitSearchView.tpl'; + } + + /** + * Function to get all the available picklist values for the current field + * @return List of picklist values if the field is of type picklist or multipicklist, null otherwise. + */ + public function getLimits() + { + $limits = Vtiger_Cache::get('Supplies', 'limits'); + if (!$limits) { + $db = PearDatabase::getInstance(); + $limits = []; + $result = $db->pquery('SELECT * FROM a_yf_supplies_limits WHERE status = ?', [1]); + while ($row = $db->fetch_array($result)) { + $limits[$row['id']] = $row; + } + Vtiger_Cache::set('Supplies', 'limits', $limits); + } + + return $limits; + } +} From 2cedc67b8c270ca439619aeb23f2652c33649619 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Tue, 18 Aug 2015 15:24:25 +0200 Subject: [PATCH 023/489] Added limits to the supplies modules --- languages/pl_pl/Supplies.php | 53 ++++++++++++ .../modules/Supplies/EditViewSupplies.tpl | 1 + .../vlayout/modules/Supplies/LimitAlert.tpl | 42 ++++++++++ .../modules/Supplies/resources/Edit.js | 81 +++++++++++++++++-- .../modules/Supplies/resources/Edit.min.js | 2 +- .../modules/Vtiger/uitypes/SuppliesLimit.tpl | 5 +- modules/Supplies/actions/CheckLimits.php | 73 +++++++++++++++++ modules/Supplies/actions/GetDetails.php | 2 - 8 files changed, 245 insertions(+), 14 deletions(-) create mode 100644 languages/pl_pl/Supplies.php create mode 100644 layouts/vlayout/modules/Supplies/LimitAlert.tpl create mode 100644 modules/Supplies/actions/CheckLimits.php diff --git a/languages/pl_pl/Supplies.php b/languages/pl_pl/Supplies.php new file mode 100644 index 000000000000..273f9cfff4ce --- /dev/null +++ b/languages/pl_pl/Supplies.php @@ -0,0 +1,53 @@ + 'Rabat', + 'LBL_TAX' => 'Podatek', + 'LBL_TOTAL_PRICE' => 'Cena całkowita', + 'LBL_ROW_COMMENT' => 'Opis', + 'LBL_SELECT_DISCOUNT' => 'Wybierz rabat', + 'LBL_GLOBAL_DISCOUNTS' => 'Globalny', + 'LBL_GROUP_DISCOUNTS' => 'Grupowy', + 'LBL_INDIVIDUAL_DISCOUNTS' => 'Indywidualny', + 'LBL_PERCENTAGE_DISCOUNTS' => 'Procentowy', + 'LBL_AMOUNT_DISCOUNTS' => 'Wartościowy', + 'LBL_DISCOUNT_FOR_ACCOUNT' => 'Rabat ustawiony na kontrahencie', + 'LBL_PRICE_BEFORE_DISCOUNT' => 'Cena przed rabatem', + 'LBL_DISCOUNT_IN_TOTAL' => 'Łączna wartość rabatu', + 'LBL_PRICE_AFTER_DISCOUNT' => 'Cena po rabacie', + 'LBL_DISCOUNT_MODE' => 'Typ rabatu', + 'LBL_VALUE' => 'Wartość', + 'LBL_QUANTITY' => 'Ilość', + 'LBL_REFERENCE' => 'Powiązanie', + 'LBL_PRICE' => 'Cena sprzedażowa', + 'LBL_MARGIN_PRECENT' => 'Marża (%)', + 'LBL_GROSS_PRICE' => 'Cena brutto', + 'LBL_NET_PRICE' => 'Cena netto', + 'LBL_SELECT_TAX' => 'Wybierz podatek', + 'LBL_PRICE_BEFORE_TAX' => 'Cena bez podatku', + 'LBL_TAX_IN_TOTAL' => 'Łączna wartość podatku', + 'LBL_PRICE_AFTER_TAX' => 'Cena z podatkiem', + 'LBL_GLOBAL_TAXS' => 'Globalny', + 'LBL_INDIVIDUAL_TAX' => 'Indywidualny', + 'LBL_GROUP_TAXS' => 'Grupowy', + 'LBL_TAX_FOR_MODULE' => 'Podatego ustawiony w module', + 'LBL_REGIONAL_TAX' => 'Podatek regionalny', + 'LBL_TAX_FOR_ACCOUNT' => 'Podatek ustawiony na kontrahencie', + 'LBL_LIMIT_TITLE' => 'Limit kredytowy został przekroczony', + 'LBL_CREDIT_LIMIT' => 'Limit kredytowy', + 'LBL_BALANCE_LIMIT' => 'Saldo kontrahenta', + 'LBL_CURRENT_VALUE' => 'Wartość dokumentu', + 'LBL_TOTALS_LIMIT' => 'Wartość całkowita', + 'LBL_LIMIT_ALERT' => 'Nie można zapisać rekordu', + + 'LBL_GROUP_TAXS' => 'Grupowy', + 'LBL_GROUP_TAXS' => 'Grupowy', +]; diff --git a/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl b/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl index 8a6a754afe57..458abc3aa06b 100644 --- a/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl +++ b/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl @@ -10,6 +10,7 @@ + {if count($FIELDS[0]) neq 0}
  • diff --git a/layouts/vlayout/modules/Supplies/LimitAlert.tpl b/layouts/vlayout/modules/Supplies/LimitAlert.tpl new file mode 100644 index 000000000000..e572fbb8a396 --- /dev/null +++ b/layouts/vlayout/modules/Supplies/LimitAlert.tpl @@ -0,0 +1,42 @@ +{**} +{strip} + {assign var="SUPMODULE" value='Supplies'} + +{/strip} diff --git a/layouts/vlayout/modules/Supplies/resources/Edit.js b/layouts/vlayout/modules/Supplies/resources/Edit.js index 3623356a9847..69b45703802f 100644 --- a/layouts/vlayout/modules/Supplies/resources/Edit.js +++ b/layouts/vlayout/modules/Supplies/resources/Edit.js @@ -27,6 +27,13 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { $('#suppliesRowNo').val(rowNumber + 1); return ++rowNumber; }, + getAccountId: function () { + var accountReferenceField = $('#accountReferenceField').val(); + if (accountReferenceField != '') { + return $('[name="' + accountReferenceField + '"]').val(); + } + return ''; + }, checkDeleteIcon: function () { var subTable = this.getSupTableContainer(); if (subTable.find(this.rowClass).length > 1) { @@ -148,10 +155,21 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { getTotalPrice: function (row) { return parseFloat($('.totalPriceText', row).text()); }, + getGrossPrice: function (row) { + return parseFloat($('.grossPrice', row).val()); + }, getPurchase: function (row) { var qty = this.getQuantityValue(row); return parseFloat($('.purchase', row).val()) * qty; }, + getSummaryGrossPrice: function () { + var thisInstance = this; + var price = 0; + this.getSupTableContainer().find(this.rowClass).each(function (index) { + price += thisInstance.getGrossPrice($(this)); + }); + return parseFloat(price); + }, setListPriceValue: function (row, val) { val = this.parsePrice(val); row.find('.listPrice').val(val).attr('title', val); @@ -181,7 +199,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { }, quantityChangeActions: function (row) { this.rowCalculations(row); - this.sumaryCalculations(); + this.summaryCalculations(); }, rowCalculations: function (row) { this.calculateTotalPrice(row); @@ -195,7 +213,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { thisInstance.quantityChangeActions($(this)); }); }, - sumaryCalculations: function (row) { + summaryCalculations: function (row) { }, calculateNetPrice: function (row) { @@ -340,7 +358,11 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { }); }, registerSuppliesSaveData: function (container) { + var thisInstance = this; container.on(Vtiger_Edit_Js.recordPreSave, function (e, data) { + if (!thisInstance.checkLimits(container)) { + return false; + } var table = container.find('#blackSuppliesTable'); table.find('[name]').removeAttr('name'); }); @@ -383,7 +405,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { var recordId = jQuery('input.sourceField', parentRow).val(); var recordModule = parentRow.find('.rowName input[name="popupReferenceModule"]').val(); thisInstance.removeSubProducts(parentRow); - if (recordId == '0' || $.inArray(recordModule, ['Products','Services']) < 0) { + if (recordId == '0' || $.inArray(recordModule, ['Products', 'Services']) < 0) { return false; } if (thisInstance.subProductsCashe[recordId]) { @@ -391,9 +413,9 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { return false; } var subProrductParams = { - 'module': "Products", - 'action': "SubProducts", - 'record': recordId + module: "Products", + action: "SubProducts", + record: recordId } if (indicator) { var progressInstace = jQuery.progressIndicator(); @@ -559,10 +581,53 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { }, loadWysiwyg: function (row, wysiwyg) { var thisInstance = this; - if(wysiwyg == '1'){ + if (wysiwyg == '1') { thisInstance.loadCkEditorElement(row.find('.ckEditorSource')); } }, + limitEnableSave: false, + checkLimits: function () { + var thisInstance = this; + var account = thisInstance.getAccountId(); + var response = true; + + if (account == '' || $('#suppliesLimit').val() == '0' || thisInstance.limitEnableSave) { + return true; + } + + var params = {} + params.data = { + module: app.getModuleName(), + action: 'CheckLimits', + record: account, + currency: thisInstance.getCurrency(), + price: thisInstance.getSummaryGrossPrice(), + limitConfig: $('#suppliesLimit').val(), + } + params.async = false; + params.dataType = 'json'; + var progressInstace = jQuery.progressIndicator(); + AppConnector.request(params).then( + function (data) { + progressInstace.hide(); + var editViewForm = thisInstance.getForm(); + if (data.result.status == false) { + app.showModalWindow(data.result.html, function (data) { + data.find('.enableSave').on('click', function (e, data) { + thisInstance.limitEnableSave = true; + editViewForm.submit(); + app.hideModalWindow(); + }); + }); + response = false; + } + }, + function (error, err) { + progressInstace.hide(); + } + ); + return response; + }, registerAddRow: function (container) { var thisInstance = this; var subTable = this.getSupTableContainer(); @@ -573,7 +638,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { var module = $(e.currentTarget).data('module'); var field = $(e.currentTarget).data('field'); var wysiwyg = $(e.currentTarget).data('wysiwyg'); - + var replaced = newRow.html().replace(/_NUM_/g, sequenceNumber); newRow.html(replaced); newRow = newRow.appendTo(subTable.find('tbody')); diff --git a/layouts/vlayout/modules/Supplies/resources/Edit.min.js b/layouts/vlayout/modules/Supplies/resources/Edit.min.js index 1da39fb8f299..50bedb770b3c 100644 --- a/layouts/vlayout/modules/Supplies/resources/Edit.min.js +++ b/layouts/vlayout/modules/Supplies/resources/Edit.min.js @@ -1,2 +1,2 @@ -Vtiger_Edit_Js("Supplies_Edit_Js",{},{lineItemContentsContainer:false,rowClass:"tr.rowSup",discountMondalFields:["aggregationType","globalDiscount","groupCheckbox","groupDiscount","individualDiscount","individualDiscountType"],taxMondalFields:["aggregationType","globalTax","groupCheckbox","groupTax","individualTax"],getSupTableContainer:function(){if(this.lineItemContentsContainer==false){this.lineItemContentsContainer=$(".suppliesItemTable")}return this.lineItemContentsContainer},getNextLineItemRowNumber:function(){var a=$(this.rowClass,this.getSupTableContainer()).length;$("#suppliesRowNo").val(a+1);return ++a},checkDeleteIcon:function(){var a=this.getSupTableContainer();if(a.find(this.rowClass).length>1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackSuppliesTable tr").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},parsePrice:function(a){var b=parseInt($(".numberOfCurrencyDecimal").val());return parseFloat(a).toFixed(b)},getTaxModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(c){var b=this;var a=b.getSupTableContainer().find(".colTax");if(b.isIndividualTaxMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".tax").val("0");b.rowsCalculations()}},getDiscountModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(c){var b=this;var a=b.getSupTableContainer().find(".colDiscount");if(b.isIndividualDiscountMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".discount").val("0");b.rowsCalculations()}},getCurrency:function(){var a=$('[name="currency"]',this.getSupTableContainer());return a.find("option:selected").val()},getTax:function(a){return parseFloat($(".tax",a).val())},getQuantityValue:function(a){return parseFloat($(".qty",a).val())},getListPriceValue:function(a){return parseFloat($(".listPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return parseFloat(b)},getNetPrice:function(a){return parseFloat($(".netPrice",a).val())},getTotalPrice:function(a){return parseFloat($(".totalPriceText",a).text())},getPurchase:function(a){var b=this.getQuantityValue(a);return parseFloat($(".purchase",a).val())*b},setListPriceValue:function(b,a){a=this.parsePrice(a);b.find(".listPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=this.parsePrice(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=this.parsePrice(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=this.parsePrice(a);$(".totalPriceText",b).text(a)},setMargin:function(b,a){a=this.parsePrice(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=this.parsePrice(a);$(".marginp",b).val(a)},quantityChangeActions:function(a){this.rowCalculations(a);this.sumaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getSupTableContainer().find(this.rowClass).each(function(b){a.quantityChangeActions($(this))})},sumaryCalculations:function(a){},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getListPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,c){var e=this.getTotalPrice(j),b=e,k=0,f=0,g=0,a=0;var i=c.find(".discountsType").val();if(i=="0"||i=="1"){if(c.find(".activepanel .globalDiscount").length>0){var k=c.find(".activepanel .globalDiscount").val()}if(c.find(".activepanel .individualDiscountType").length>0){var d=c.find('.activepanel .individualDiscountType[name="individual"]:checked').val();var h=c.find(".activepanel .individualDiscountValue").val();if(d=="percentage"){g=(h/100)*e}else{g=h}}if(c.find(".activepanel .groupCheckbox").length>0&&c.find(".activepanel .groupCheckbox").prop("checked")==true){var f=c.find(".groupValue").val();f=e*(parseFloat(f)/100)}b=b*((100-parseFloat(k))/100);b=b-parseFloat(g);b=b-parseFloat(f)}else{if(i=="2"){c.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=parseFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=parseFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=parseFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}c.find(".valuePrices").text(this.parsePrice(b));c.find(".valueDiscount").text(e-this.parsePrice(b))},calculateTax:function(k,g){var h=this.getTotalPrice(k),b=h,c=0,f=0,a=0,i=0,e=0;var d=g.find(".taxsType").val();if(d=="0"||d=="1"){if(g.find(".activepanel .globalTax").length>0){var c=g.find(".activepanel .globalTax").val()}if(g.find(".activepanel .individualTaxValue").length>0){var j=g.find(".activepanel .individualTaxValue").val();i=(j/100)*b}if(g.find(".activepanel .groupTax").length>0){var f=g.find(".groupTax").val();f=h*(parseFloat(f)/100)}if(g.find(".activepanel .regionalTax").length>0){var a=g.find(".regionalTax").val();a=h*(parseFloat(a)/100)}b=b*((100+parseFloat(c))/100);b=b+parseFloat(i);b=b+parseFloat(f);b=b+parseFloat(a)}else{if(d=="2"){g.find(".activepanel").each(function(p){var l=$(this);if(l.find(".globalTax").length>0){var o=parseFloat(l.find(".globalTax").val());b=b*((100+o)/100)}else{if(l.find(".groupTax").length>0){var n=parseFloat(l.find(".groupTax").val());b=b*((100+n)/100)}else{if(l.find(".regionalTax").length>0){var m=parseFloat(l.find(".regionalTax").val());b=b*((100+m)/100)}else{if(l.find(".individualTaxValue").length>0){var q=parseFloat(l.find(".individualTaxValue").val());b=((q+100)/100)*b}}}}})}}g.find(".valuePrices").text(this.parsePrice(b));g.find(".valueTax").text(this.parsePrice(b-h))},updateRowSequence:function(){var a=this.getSupTableContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerSuppliesSaveData:function(a){a.on(Vtiger_Edit_Js.recordPreSave,function(d,c){var b=a.find("#blackSuppliesTable");b.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductListPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setListPriceValue(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(g,a){var d=this;var c=jQuery("input.sourceField",g).val();var e=g.find('.rowName input[name="popupReferenceModule"]').val();d.removeSubProducts(g);if(c=="0"||$.inArray(e,["Products","Services"])<0){return false}if(d.subProductsCashe[c]){d.addSubProducts(g,d.subProductsCashe[c]);return false}var f={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(f).then(function(i){var h=i.result;d.subProductsCashe[c]=h;d.addSubProducts(g,h);if(b){b.hide()}},function(h,i){if(b){b.hide()}})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,d){var i=this;for(var b in d){var a=d[b];var j=a.description;var c=a.listpricevalues;var e=JSON.stringify(c);for(var g in a){k.find("input."+g).val(a[g])}var h=i.getCurrency();if(typeof c[h]!=="undefined"){i.setListPriceValue(k,c[h])}$("input.listPrice",k).attr("list-info",e);$("textarea.commentTextarea",k).val(j);i.showIndividualTax(k)}if(f==="Products"){i.loadSubProducts(k,true)}this.quantityChangeActions(k)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".discountParam").val(JSON.stringify(c))},saveTaxsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(b.taxMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".taxParam").val(JSON.stringify(c))},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},initTaxParameters:function(d,a){var c=this;var b=d.find(".taxParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.taxMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateTax(d,a)},loadWysiwyg:function(c,a){var b=this;if(a=="1"){b.loadCkEditorElement(c.find(".ckEditorSource"))}},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackSuppliesTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.initRow();c.registerAutoCompleteFields(m);c.loadWysiwyg(m,g)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(d,e){var f=e.item.find("textarea").attr("id");if(typeof f!="undefined"){var c=CKEDITOR.instances[f];c.destroy()}},stop:function(e,f){var c={};var d=f.item.find("textarea");if(typeof d.attr("id")!="undefined"){b.loadCkEditorElement(d)}b.updateRowSequence()}})},registerPriceBookPopUp:function(a){var b=this;a.on("click",".priceBookPopup",function(f){var d=$(f.currentTarget);var c=b.isRecordSelected(d);if(c==true){return}b.pricebooksPopupHandler(d)})},registerRowChangeEvent:function(a){var b=this;a.on("focusout",".qty",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("focusout",".listPrice",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("focusout",".purchase",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("change",".taxMode",function(d){var c=$(d.currentTarget);b.showIndividualTax(b.getClosestRow(c))});a.on("change",".discountMode",function(d){var c=$(d.currentTarget);b.showIndividualDiscount(b.getClosestRow(c))})},registerSubProducts:function(a){var b=this;a.find(this.rowClass).each(function(c){b.loadSubProducts($(this),false)})},registerClearReferenceSelection:function(a){var b=this;a.on("click",".clearReferenceSelection",function(d){var c=$(d.currentTarget);var f=b.getClosestRow(c);b.removeSubProducts(f);f.find(".listPrice,.tax,.discount,.margin,.purchase").val("0");f.find("textarea").val("");b.quantityChangeActions(f)})},registerDeleteLineItemEvent:function(a){var b=this;a.on("click",".deleteRow",function(d){var c=$(d.currentTarget);b.getClosestRow(c).remove();b.checkDeleteIcon()})},registerChangeDiscount:function(a){var b=this;a.on("click",".changeDiscount",function(g){var d=$(g.currentTarget);var f=d.closest(b.rowClass);var h={module:"Products",view:"Discounts",record:f.find(".rowName .sourceField").val(),currency:b.getCurrency(),sourceModule:app.getModuleName(),sourceRecord:app.getRecordId(),totalPrice:b.getTotalPrice(f),accountField:a.find("#accountReferenceField").val(),};var c=jQuery.progressIndicator();AppConnector.request(h).then(function(e){app.showModalWindow(e,function(i){b.initDiscountsParameters(f,$(i));b.registerChangeDiscountModal(i,f,h)});c.hide()},function(e,i){c.hide()})})},registerChangeDiscountModal:function(a,c,d){var b=this;a.on("change",".individualDiscountType",function(g){var f=$(g.currentTarget);a.find(".individualDiscountContainer .input-group-addon").text(f.data("symbol"))});a.on("change",'.activeCheckbox[name="aggregationType"]',function(g){var f=$(g.currentTarget);if(f.attr("type")=="checkbox"&&this.checked){f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{if(f.attr("type")=="radio"){a.find(".panel").removeClass("activepanel");a.find(".panel .panel-body").hide();f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{f.closest(".panel").find(".panel-body").hide();f.closest(".panel").removeClass("activepanel")}}});a.on("change",".activeCheckbox, .globalDiscount,.individualDiscountValue,.individualDiscountType,.groupCheckbox",function(g){var f=$(g.currentTarget);b.calculateDiscount(c,a)});a.on("click",".saveDiscount",function(f){c.find(".discount").val(a.find(".valueDiscount").text());b.quantityChangeActions(c);b.saveDiscountsParameters(c,a);app.hideModalWindow()})},registerChangeTax:function(a){var b=this;a.on("click",".changeTax",function(g){var d=$(g.currentTarget);var f=d.closest(b.rowClass);var h={module:"Products",view:"Taxs",record:f.find(".rowName .sourceField").val(),recordModule:f.find('.rowName [name="popupReferenceModule"]').val(),currency:b.getCurrency(),sourceModule:app.getModuleName(),sourceRecord:app.getRecordId(),totalPrice:b.getTotalPrice(f),accountField:a.find("#accountReferenceField").val(),};var c=jQuery.progressIndicator();AppConnector.request(h).then(function(e){app.showModalWindow(e,function(i){b.initTaxParameters(f,$(i));b.registerChangeTaxModal(i,f,h)});c.hide()},function(e,i){c.hide()})})},registerChangeTaxModal:function(a,c,d){var b=this;a.on("change",".individualTaxType",function(g){var f=$(g.currentTarget);a.find(".individualTaxContainer .input-group-addon").text(f.data("symbol"))});a.on("change",'.activeCheckbox[name="aggregationType"]',function(g){var f=$(g.currentTarget);if(f.attr("type")=="checkbox"&&this.checked){f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{if(f.attr("type")=="radio"){a.find(".panel").removeClass("activepanel");a.find(".panel .panel-body").hide();f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{f.closest(".panel").find(".panel-body").hide();f.closest(".panel").removeClass("activepanel")}}});a.on("change",".activeCheckbox, .globalTax, .individualTaxValue, .groupTax, .regionalTax",function(g){var f=$(g.currentTarget);b.calculateTax(c,a)});a.on("click",".saveTaxs",function(f){c.find(".tax").val(a.find(".valueTax").text());b.quantityChangeActions(c);b.saveTaxsParameters(c,a);app.hideModalWindow()})},registerRowAutoComplete:function(a){var b=this;var c=a.find(".rowName .sourceField");c.on(Vtiger_Edit_Js.postReferenceSelectionEvent,function(k,h){var g=$(k.currentTarget);var j=g.closest(b.rowClass);if(h.data.label){var d=h.data.id}else{for(var l in h.data){var d=l}}var f=j.find('.rowName [name="popupReferenceModule"]').val();var i="index.php?module="+app.getModuleName()+"&action=GetDetails&record="+d+"¤cy_id="+b.getCurrency();AppConnector.request(i).then(function(m){for(var n in m){if(typeof m[n]=="object"){var e=m[n];b.mapResultsToFields(f,j,e)}}},function(e,m){})})},initRow:function(a){var b=this;if(typeof a=="undefined"){a=b.getSupTableContainer()}b.registerDeleteLineItemEvent(a);b.registerPriceBookPopUp(a);b.registerRowChangeEvent(a);b.registerRowAutoComplete(a);b.checkDeleteIcon()},registerBasicEvents:function(a){this._super(a);this.registerSuppliesSaveData(a);this.registerAddRow(a);this.initRow();this.registerSortableRow();this.registerSubProducts(a);this.registerChangeDiscount(a);this.registerChangeTax(a);this.registerClearReferenceSelection(a)},}); \ No newline at end of file +Vtiger_Edit_Js("Supplies_Edit_Js",{},{lineItemContentsContainer:false,rowClass:"tr.rowSup",discountMondalFields:["aggregationType","globalDiscount","groupCheckbox","groupDiscount","individualDiscount","individualDiscountType"],taxMondalFields:["aggregationType","globalTax","groupCheckbox","groupTax","individualTax"],getSupTableContainer:function(){if(this.lineItemContentsContainer==false){this.lineItemContentsContainer=$(".suppliesItemTable")}return this.lineItemContentsContainer},getNextLineItemRowNumber:function(){var a=$(this.rowClass,this.getSupTableContainer()).length;$("#suppliesRowNo").val(a+1);return ++a},getAccountId:function(){var a=$("#accountReferenceField").val();if(a!=""){return $('[name="'+a+'"]').val()}return""},checkDeleteIcon:function(){var a=this.getSupTableContainer();if(a.find(this.rowClass).length>1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackSuppliesTable tr").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},parsePrice:function(a){var b=parseInt($(".numberOfCurrencyDecimal").val());return parseFloat(a).toFixed(b)},getTaxModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(c){var b=this;var a=b.getSupTableContainer().find(".colTax");if(b.isIndividualTaxMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".tax").val("0");b.rowsCalculations()}},getDiscountModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(c){var b=this;var a=b.getSupTableContainer().find(".colDiscount");if(b.isIndividualDiscountMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".discount").val("0");b.rowsCalculations()}},getCurrency:function(){var a=$('[name="currency"]',this.getSupTableContainer());return a.find("option:selected").val()},getTax:function(a){return parseFloat($(".tax",a).val())},getQuantityValue:function(a){return parseFloat($(".qty",a).val())},getListPriceValue:function(a){return parseFloat($(".listPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return parseFloat(b)},getNetPrice:function(a){return parseFloat($(".netPrice",a).val())},getTotalPrice:function(a){return parseFloat($(".totalPriceText",a).text())},getGrossPrice:function(a){return parseFloat($(".grossPrice",a).val())},getPurchase:function(a){var b=this.getQuantityValue(a);return parseFloat($(".purchase",a).val())*b},getSummaryGrossPrice:function(){var b=this;var a=0;this.getSupTableContainer().find(this.rowClass).each(function(c){a+=b.getGrossPrice($(this))});return parseFloat(a)},setListPriceValue:function(b,a){a=this.parsePrice(a);b.find(".listPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=this.parsePrice(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=this.parsePrice(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=this.parsePrice(a);$(".totalPriceText",b).text(a)},setMargin:function(b,a){a=this.parsePrice(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=this.parsePrice(a);$(".marginp",b).val(a)},quantityChangeActions:function(a){this.rowCalculations(a);this.summaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getSupTableContainer().find(this.rowClass).each(function(b){a.quantityChangeActions($(this))})},summaryCalculations:function(a){},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getListPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,c){var e=this.getTotalPrice(j),b=e,k=0,f=0,g=0,a=0;var i=c.find(".discountsType").val();if(i=="0"||i=="1"){if(c.find(".activepanel .globalDiscount").length>0){var k=c.find(".activepanel .globalDiscount").val()}if(c.find(".activepanel .individualDiscountType").length>0){var d=c.find('.activepanel .individualDiscountType[name="individual"]:checked').val();var h=c.find(".activepanel .individualDiscountValue").val();if(d=="percentage"){g=(h/100)*e}else{g=h}}if(c.find(".activepanel .groupCheckbox").length>0&&c.find(".activepanel .groupCheckbox").prop("checked")==true){var f=c.find(".groupValue").val();f=e*(parseFloat(f)/100)}b=b*((100-parseFloat(k))/100);b=b-parseFloat(g);b=b-parseFloat(f)}else{if(i=="2"){c.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=parseFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=parseFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=parseFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}c.find(".valuePrices").text(this.parsePrice(b));c.find(".valueDiscount").text(e-this.parsePrice(b))},calculateTax:function(k,g){var h=this.getTotalPrice(k),b=h,c=0,f=0,a=0,i=0,e=0;var d=g.find(".taxsType").val();if(d=="0"||d=="1"){if(g.find(".activepanel .globalTax").length>0){var c=g.find(".activepanel .globalTax").val()}if(g.find(".activepanel .individualTaxValue").length>0){var j=g.find(".activepanel .individualTaxValue").val();i=(j/100)*b}if(g.find(".activepanel .groupTax").length>0){var f=g.find(".groupTax").val();f=h*(parseFloat(f)/100)}if(g.find(".activepanel .regionalTax").length>0){var a=g.find(".regionalTax").val();a=h*(parseFloat(a)/100)}b=b*((100+parseFloat(c))/100);b=b+parseFloat(i);b=b+parseFloat(f);b=b+parseFloat(a)}else{if(d=="2"){g.find(".activepanel").each(function(p){var l=$(this);if(l.find(".globalTax").length>0){var o=parseFloat(l.find(".globalTax").val());b=b*((100+o)/100)}else{if(l.find(".groupTax").length>0){var n=parseFloat(l.find(".groupTax").val());b=b*((100+n)/100)}else{if(l.find(".regionalTax").length>0){var m=parseFloat(l.find(".regionalTax").val());b=b*((100+m)/100)}else{if(l.find(".individualTaxValue").length>0){var q=parseFloat(l.find(".individualTaxValue").val());b=((q+100)/100)*b}}}}})}}g.find(".valuePrices").text(this.parsePrice(b));g.find(".valueTax").text(this.parsePrice(b-h))},updateRowSequence:function(){var a=this.getSupTableContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerSuppliesSaveData:function(a){var b=this;a.on(Vtiger_Edit_Js.recordPreSave,function(f,d){if(!b.checkLimits(a)){return false}var c=a.find("#blackSuppliesTable");c.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductListPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setListPriceValue(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(g,a){var d=this;var c=jQuery("input.sourceField",g).val();var e=g.find('.rowName input[name="popupReferenceModule"]').val();d.removeSubProducts(g);if(c=="0"||$.inArray(e,["Products","Services"])<0){return false}if(d.subProductsCashe[c]){d.addSubProducts(g,d.subProductsCashe[c]);return false}var f={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(f).then(function(i){var h=i.result;d.subProductsCashe[c]=h;d.addSubProducts(g,h);if(b){b.hide()}},function(h,i){if(b){b.hide()}})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,d){var i=this;for(var b in d){var a=d[b];var j=a.description;var c=a.listpricevalues;var e=JSON.stringify(c);for(var g in a){k.find("input."+g).val(a[g])}var h=i.getCurrency();if(typeof c[h]!=="undefined"){i.setListPriceValue(k,c[h])}$("input.listPrice",k).attr("list-info",e);$("textarea.commentTextarea",k).val(j);i.showIndividualTax(k)}if(f==="Products"){i.loadSubProducts(k,true)}this.quantityChangeActions(k)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".discountParam").val(JSON.stringify(c))},saveTaxsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(b.taxMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".taxParam").val(JSON.stringify(c))},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},initTaxParameters:function(d,a){var c=this;var b=d.find(".taxParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.taxMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateTax(d,a)},loadWysiwyg:function(c,a){var b=this;if(a=="1"){b.loadCkEditorElement(c.find(".ckEditorSource"))}},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#suppliesLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"CheckLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#suppliesLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide()});return a},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackSuppliesTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.initRow();c.registerAutoCompleteFields(m);c.loadWysiwyg(m,g)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(d,e){var f=e.item.find("textarea").attr("id");if(typeof f!="undefined"){var c=CKEDITOR.instances[f];c.destroy()}},stop:function(e,f){var c={};var d=f.item.find("textarea");if(typeof d.attr("id")!="undefined"){b.loadCkEditorElement(d)}b.updateRowSequence()}})},registerPriceBookPopUp:function(a){var b=this;a.on("click",".priceBookPopup",function(f){var d=$(f.currentTarget);var c=b.isRecordSelected(d);if(c==true){return}b.pricebooksPopupHandler(d)})},registerRowChangeEvent:function(a){var b=this;a.on("focusout",".qty",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("focusout",".listPrice",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("focusout",".purchase",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("change",".taxMode",function(d){var c=$(d.currentTarget);b.showIndividualTax(b.getClosestRow(c))});a.on("change",".discountMode",function(d){var c=$(d.currentTarget);b.showIndividualDiscount(b.getClosestRow(c))})},registerSubProducts:function(a){var b=this;a.find(this.rowClass).each(function(c){b.loadSubProducts($(this),false)})},registerClearReferenceSelection:function(a){var b=this;a.on("click",".clearReferenceSelection",function(d){var c=$(d.currentTarget);var f=b.getClosestRow(c);b.removeSubProducts(f);f.find(".listPrice,.tax,.discount,.margin,.purchase").val("0");f.find("textarea").val("");b.quantityChangeActions(f)})},registerDeleteLineItemEvent:function(a){var b=this;a.on("click",".deleteRow",function(d){var c=$(d.currentTarget);b.getClosestRow(c).remove();b.checkDeleteIcon()})},registerChangeDiscount:function(a){var b=this;a.on("click",".changeDiscount",function(g){var d=$(g.currentTarget);var f=d.closest(b.rowClass);var h={module:"Products",view:"Discounts",record:f.find(".rowName .sourceField").val(),currency:b.getCurrency(),sourceModule:app.getModuleName(),sourceRecord:app.getRecordId(),totalPrice:b.getTotalPrice(f),accountField:a.find("#accountReferenceField").val(),};var c=jQuery.progressIndicator();AppConnector.request(h).then(function(e){app.showModalWindow(e,function(i){b.initDiscountsParameters(f,$(i));b.registerChangeDiscountModal(i,f,h)});c.hide()},function(e,i){c.hide()})})},registerChangeDiscountModal:function(a,c,d){var b=this;a.on("change",".individualDiscountType",function(g){var f=$(g.currentTarget);a.find(".individualDiscountContainer .input-group-addon").text(f.data("symbol"))});a.on("change",'.activeCheckbox[name="aggregationType"]',function(g){var f=$(g.currentTarget);if(f.attr("type")=="checkbox"&&this.checked){f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{if(f.attr("type")=="radio"){a.find(".panel").removeClass("activepanel");a.find(".panel .panel-body").hide();f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{f.closest(".panel").find(".panel-body").hide();f.closest(".panel").removeClass("activepanel")}}});a.on("change",".activeCheckbox, .globalDiscount,.individualDiscountValue,.individualDiscountType,.groupCheckbox",function(g){var f=$(g.currentTarget);b.calculateDiscount(c,a)});a.on("click",".saveDiscount",function(f){c.find(".discount").val(a.find(".valueDiscount").text());b.quantityChangeActions(c);b.saveDiscountsParameters(c,a);app.hideModalWindow()})},registerChangeTax:function(a){var b=this;a.on("click",".changeTax",function(g){var d=$(g.currentTarget);var f=d.closest(b.rowClass);var h={module:"Products",view:"Taxs",record:f.find(".rowName .sourceField").val(),recordModule:f.find('.rowName [name="popupReferenceModule"]').val(),currency:b.getCurrency(),sourceModule:app.getModuleName(),sourceRecord:app.getRecordId(),totalPrice:b.getTotalPrice(f),accountField:a.find("#accountReferenceField").val(),};var c=jQuery.progressIndicator();AppConnector.request(h).then(function(e){app.showModalWindow(e,function(i){b.initTaxParameters(f,$(i));b.registerChangeTaxModal(i,f,h)});c.hide()},function(e,i){c.hide()})})},registerChangeTaxModal:function(a,c,d){var b=this;a.on("change",".individualTaxType",function(g){var f=$(g.currentTarget);a.find(".individualTaxContainer .input-group-addon").text(f.data("symbol"))});a.on("change",'.activeCheckbox[name="aggregationType"]',function(g){var f=$(g.currentTarget);if(f.attr("type")=="checkbox"&&this.checked){f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{if(f.attr("type")=="radio"){a.find(".panel").removeClass("activepanel");a.find(".panel .panel-body").hide();f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{f.closest(".panel").find(".panel-body").hide();f.closest(".panel").removeClass("activepanel")}}});a.on("change",".activeCheckbox, .globalTax, .individualTaxValue, .groupTax, .regionalTax",function(g){var f=$(g.currentTarget);b.calculateTax(c,a)});a.on("click",".saveTaxs",function(f){c.find(".tax").val(a.find(".valueTax").text());b.quantityChangeActions(c);b.saveTaxsParameters(c,a);app.hideModalWindow()})},registerRowAutoComplete:function(a){var b=this;var c=a.find(".rowName .sourceField");c.on(Vtiger_Edit_Js.postReferenceSelectionEvent,function(k,h){var g=$(k.currentTarget);var j=g.closest(b.rowClass);if(h.data.label){var d=h.data.id}else{for(var l in h.data){var d=l}}var f=j.find('.rowName [name="popupReferenceModule"]').val();var i="index.php?module="+app.getModuleName()+"&action=GetDetails&record="+d+"¤cy_id="+b.getCurrency();AppConnector.request(i).then(function(m){for(var n in m){if(typeof m[n]=="object"){var e=m[n];b.mapResultsToFields(f,j,e)}}},function(e,m){})})},initRow:function(a){var b=this;if(typeof a=="undefined"){a=b.getSupTableContainer()}b.registerDeleteLineItemEvent(a);b.registerPriceBookPopUp(a);b.registerRowChangeEvent(a);b.registerRowAutoComplete(a);b.checkDeleteIcon()},registerBasicEvents:function(a){this._super(a);this.registerSuppliesSaveData(a);this.registerAddRow(a);this.initRow();this.registerSortableRow();this.registerSubProducts(a);this.registerChangeDiscount(a);this.registerChangeTax(a);this.registerClearReferenceSelection(a)},}); \ No newline at end of file diff --git a/layouts/vlayout/modules/Vtiger/uitypes/SuppliesLimit.tpl b/layouts/vlayout/modules/Vtiger/uitypes/SuppliesLimit.tpl index 057b41fa2f24..0a04c8ba57fd 100644 --- a/layouts/vlayout/modules/Vtiger/uitypes/SuppliesLimit.tpl +++ b/layouts/vlayout/modules/Vtiger/uitypes/SuppliesLimit.tpl @@ -14,10 +14,9 @@ {assign var=UITYPE_MODEL value=$FIELD_MODEL->getUITypeModel()} {assign var=PICKLIST_VALUES value=$UITYPE_MODEL->getLimits()} {assign var="SPECIAL_VALIDATOR" value=$FIELD_MODEL->getValidator()} -{assign var="FIELD_VALUE_LIST" value=explode(',',$FIELD_MODEL->get('fieldvalue'))} -isMandatory() eq true} data-validation-engine="validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" {if !empty($SPECIAL_VALIDATOR)}data-validator='{Zend_Json::encode($SPECIAL_VALIDATOR)}'{/if} {/if} {if $FIELD_MODEL->get('displaytype') == 10}readonly="readonly"{/if}> {foreach item=VALUE key=KEY from=$PICKLIST_VALUES} - + {/foreach} {/strip} diff --git a/modules/Supplies/actions/CheckLimits.php b/modules/Supplies/actions/CheckLimits.php new file mode 100644 index 000000000000..73b7b3b18562 --- /dev/null +++ b/modules/Supplies/actions/CheckLimits.php @@ -0,0 +1,73 @@ + + */ +class Supplies_CheckLimits_Action extends Vtiger_Action_Controller +{ + + function checkPermission(Vtiger_Request $request) + { + $moduleName = $request->getModule(); + $moduleModel = Vtiger_Module_Model::getInstance($moduleName); + $currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); + + if (!$currentUserPriviligesModel->hasModulePermission($moduleModel->getId())) { + throw new AppException(vtranslate($moduleName) . ' ' . vtranslate('LBL_NOT_ACCESSIBLE')); + } + } + + function process(Vtiger_Request $request) + { + $record = $request->get('record'); + $currency = $request->get('currency'); + $price = $request->get('price'); + $limitConfig = $request->get('limitConfig'); + + $response = new Vtiger_Response(); + $response->setResult($this->checkLimits($record, $currency, $price, $limitConfig)); + $response->emit(); + } + + function checkLimits($record, $currency, $price, $limitConfig) + { + $limitFieldName = 'xxx'; + $balanceFieldName = 'limit'; + $moduleInstance = Vtiger_Module_Model::getInstance('Accounts'); + $limitField = Vtiger_Field_Model::getInstance($limitFieldName, $moduleInstance); + $balanceField = Vtiger_Field_Model::getInstance($limitFieldName, $moduleInstance); + if (!$limitField->isActiveField() || !$balanceField->isActiveField()) { + return ['status' => true]; + } + $recordModel = Vtiger_Record_Model::getInstanceById($record, 'Accounts'); + $limitID = $recordModel->get($limitFieldName); + $balance = $recordModel->get($balanceFieldName); + $limit = reset(Vtiger_SuppliesLimit_UIType::getValues($limitID))['value']; + + $baseCurrency = Vtiger_Util_Helper::getBaseCurrency(); + $symbol = $baseCurrency['currency_symbol']; + if ($baseCurrency['id'] != $currency) { + $selectedCurrency = Vtiger_Functions::getCurrencySymbolandRate($currency); + $price = floatval($price) * $selectedCurrency['rate']; + $symbol = $selectedCurrency['symbol']; + } + $totalPrice = $price + $balance; + + $status = $totalPrice > $limit ? false : true; + if (!$status) { + $viewer = new Vtiger_Viewer(); + $viewer->assign('PRICE', $price); + $viewer->assign('BALANCE', $balance); + $viewer->assign('SYMBOL', $symbol); + $viewer->assign('LIMIT', $limit); + $viewer->assign('TOTALS', $totalPrice); + $viewer->assign('LIMIT_CONFIG', $limitConfig); + $html = $viewer->view('LimitAlert.tpl', 'Supplies', true); + } + return ['status' => $status, 'html' => $html]; + } + +} diff --git a/modules/Supplies/actions/GetDetails.php b/modules/Supplies/actions/GetDetails.php index 24ae6c503e77..a77599e4551d 100644 --- a/modules/Supplies/actions/GetDetails.php +++ b/modules/Supplies/actions/GetDetails.php @@ -51,7 +51,6 @@ function getRecordDetail($recordId, $currencyId) $recordModel = Vtiger_Record_Model::getInstanceById($recordId); $moduleName = $recordModel->getModuleName(); if (in_array($moduleName, ['Products', 'Services'])) { - //$taxes = $recordModel->getTaxes(); $listPriceValues = $recordModel->getListPriceValues($recordModel->getId()); $priceDetails = $recordModel->getPriceDetails(); foreach ($priceDetails as $currencyDetails) { @@ -66,7 +65,6 @@ function getRecordDetail($recordId, $currencyId) $recordId => [ 'id' => $recordId, 'name' => decode_html($recordModel->getName()), - //'taxes' => $taxes, 'price' => $listPrice, 'listpricevalues' => $listPriceValues, 'description' => decode_html($recordModel->get('description')), From 7f2d499f82be5a44d32b7e58ebd39d20d637f064 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Thu, 20 Aug 2015 13:42:28 +0200 Subject: [PATCH 024/489] Redesigned the display of comments in Wysiwig --- .../modules/Supplies/EditViewSupplies.tpl | 44 +++-------- .../modules/Supplies/EditViewSuppliesRow.tpl | 42 ++++++++++ .../Supplies/fields/EditViewComment.tpl | 8 ++ .../modules/Supplies/fields/EditViewName.tpl | 15 +--- .../modules/Supplies/fields/EditViewPrice.tpl | 7 +- .../modules/Supplies/resources/Edit.js | 77 +++++++++++++------ .../modules/Supplies/resources/Edit.min.js | 2 +- modules/Supplies/fields/Comment.php | 17 ++++ modules/Supplies/fields/Name.php | 3 - modules/Supplies/models/EditView.php | 3 + 10 files changed, 138 insertions(+), 80 deletions(-) create mode 100644 layouts/vlayout/modules/Supplies/EditViewSuppliesRow.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewComment.tpl create mode 100644 modules/Supplies/fields/Comment.php diff --git a/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl b/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl index 458abc3aa06b..c3268e798dc4 100644 --- a/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl +++ b/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl @@ -7,12 +7,15 @@ {assign var="SUP_RECORD_DATA" value=$RECORD->getSupplieData()} {assign var="MAIN_PARAMS" value=$SUPFIELD_MODEL->getMainParams($FIELDS[1])} {assign var="BLACK_SUP_DATA" value=[]} + {assign var="COUNT_FIELDS0" value=count($FIELDS[0])} + {assign var="COUNT_FIELDS1" value=count($FIELDS[1])} + {assign var="COUNT_FIELDS2" value=count($FIELDS[2])} - {if count($FIELDS[0]) neq 0} -
  • + {if $COUNT_FIELDS0 neq 0} +
    {foreach item=FIELD from=$FIELDS[0]} @@ -23,40 +26,27 @@ {/foreach} -
    {/if} - - {foreach item=FIELD from=$FIELDS[1]} + + {foreach item=FIELD from=$FIELDS[1]} - {/foreach} + {/foreach} {foreach key=KEY item=SUP_DATA from=$SUP_RECORD_DATA} {assign var="ROW_NO" value=$KEY+1} - - - {foreach item=FIELD from=$FIELDS[1]} - - {/foreach} - + {include file='EditViewSuppliesRow.tpl'|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl('EditViewSuppliesRow.tpl',$MODULE)} {/foreach} - + + {foreach item=FIELD from=$FIELDS[1]} + + {/foreach} + + {if $FIELDS[2] neq 0} + + {foreach item=FIELD from=$FIELDS[2]} + {if $FIELD->get('colspan') eq 0} + {assign var="COLSPAN" value=$COUNT_FIELDS1+1} + {else} + {assign var="COLSPAN" value=$FIELD->get('colspan')} + {/if} + + {/foreach} + + {/if} +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewComment.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewComment.tpl new file mode 100644 index 000000000000..7ab2ce6ad4e5 --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/EditViewComment.tpl @@ -0,0 +1,8 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} + +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewName.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewName.tpl index 572b6754b408..97b1a332843c 100644 --- a/layouts/vlayout/modules/Supplies/fields/EditViewName.tpl +++ b/layouts/vlayout/modules/Supplies/fields/EditViewName.tpl @@ -1,20 +1,13 @@ {**} {strip}
    - {if $SUP_VALUE == '0'} - {assign var="REFERENCE_MODULE" value=reset($MAIN_PARAMS['modules'])} - {else} - {assign var="REFERENCE_MODULE" value=Vtiger_Functions::getCRMRecordType($SUP_VALUE)} - {/if} - {assign var="FIELD_NAME" value={$FIELD->getColumnName()}|cat:$ROW_NO} {assign var="FIELD_INFO" value=Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode(['mandatory'=>true]))} {assign var="CRMEntity" value=CRMEntity::getInstance($REFERENCE_MODULE)} -
    get('displaytype') == 10}readonly="readonly"{/if} /> - + {assign var="displayId" value=$SUP_VALUE} {if $FIELD->get('displaytype') != 10} @@ -44,11 +37,5 @@
    -
    - -
    {/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewPrice.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewPrice.tpl index 4ae5a62e8499..0e5296227a40 100644 --- a/layouts/vlayout/modules/Supplies/fields/EditViewPrice.tpl +++ b/layouts/vlayout/modules/Supplies/fields/EditViewPrice.tpl @@ -1,12 +1,7 @@ {**} {strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)}
    - {if $SUP_VALUE == ''} - {assign var="VALUE" value=$FIELD->get('defaultvalue')} - {else} - {assign var="VALUE" value=$SUP_VALUE} - {/if} - diff --git a/layouts/vlayout/modules/Supplies/resources/Edit.js b/layouts/vlayout/modules/Supplies/resources/Edit.js index 69b45703802f..24977e6a8b6c 100644 --- a/layouts/vlayout/modules/Supplies/resources/Edit.js +++ b/layouts/vlayout/modules/Supplies/resources/Edit.js @@ -56,7 +56,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { * @return jQuery object which you can use to */ getBasicRow: function () { - var newRow = $('#blackSuppliesTable tr').clone(true, true); + var newRow = $('#blackSuppliesTable tbody').clone(true, true); return newRow; }, isRecordSelected: function (element) { @@ -515,6 +515,31 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { }); parentRow.find('.taxParam').val(JSON.stringify(info)); }, + showExpandedRow: function (row) { + var thisInstance = this; + var subTable = thisInstance.getSupTableContainer(); + var rowSupExpanded = subTable.find('[numrowex="' + row.attr('numrow') + '"]'); + var element = row.find('.toggleVisibility'); + element.data('status', '1'); + element.find('.glyphicon').removeClass('glyphicon-menu-down'); + element.find('.glyphicon').addClass('glyphicon-menu-up'); + rowSupExpanded.removeClass('hide'); + thisInstance.loadCkEditorElement(rowSupExpanded.find('.ckEditorSource')); + }, + hideExpandedRow: function (row) { + var thisInstance = this; + var subTable = thisInstance.getSupTableContainer(); + var rowSupExpanded = subTable.find('[numrowex="' + row.attr('numrow') + '"]'); + var element = row.find('.toggleVisibility'); + element.data('status', '0'); + element.find('.glyphicon').removeClass('glyphicon-menu-up'); + element.find('.glyphicon').addClass('glyphicon-menu-down'); + rowSupExpanded.addClass('hide'); + var editorInstance = CKEDITOR.instances[rowSupExpanded.find('.ckEditorSource').attr('id')]; + if (editorInstance) { + editorInstance.destroy(); + } + }, initDiscountsParameters: function (parentRow, mondal) { var thisInstance = this; var parameters = parentRow.find('.discountParam').val(); @@ -579,12 +604,6 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { thisInstance.calculateTax(parentRow, mondal); }, - loadWysiwyg: function (row, wysiwyg) { - var thisInstance = this; - if (wysiwyg == '1') { - thisInstance.loadCkEditorElement(row.find('.ckEditorSource')); - } - }, limitEnableSave: false, checkLimits: function () { var thisInstance = this; @@ -633,7 +652,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { var subTable = this.getSupTableContainer(); container.find('.btn-toolbar .addButton').on('click', function (e, data) { var table = container.find('#blackSuppliesTable'); - var newRow = thisInstance.getBasicRow() + var newRow = thisInstance.getBasicRow(); var sequenceNumber = thisInstance.getNextLineItemRowNumber(); var module = $(e.currentTarget).data('module'); var field = $(e.currentTarget).data('field'); @@ -641,12 +660,11 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { var replaced = newRow.html().replace(/_NUM_/g, sequenceNumber); newRow.html(replaced); - newRow = newRow.appendTo(subTable.find('tbody')); + newRow = newRow.find('tr').appendTo(subTable.find('tbody')); newRow.find('.rowName input[name="popupReferenceModule"]').val(module).data('field', field); - thisInstance.initRow(); thisInstance.registerAutoCompleteFields(newRow); - thisInstance.loadWysiwyg(newRow, wysiwyg); + thisInstance.initRow(newRow); }); }, registerSortableRow: function () { @@ -666,25 +684,37 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { return ui; }, start: function (event, ui) { - var textareaId = ui.item.find('textarea').attr('id'); - if (typeof textareaId != 'undefined') { - var editorInstance = CKEDITOR.instances[textareaId]; - editorInstance.destroy(); - } + subTable.find(thisInstance.rowClass).each(function (index, element) { + var row = $(element); + thisInstance.hideExpandedRow(row); + }) + ui.item.startPos = ui.item.index(); }, stop: function (event, ui) { - var customConfig = {}; - var textarea = ui.item.find('textarea'); - if (typeof textarea.attr('id') != 'undefined') { - thisInstance.loadCkEditorElement(textarea); + var numrow = $(ui.item.context).attr('numrow'); + var child = subTable.find('.numRow' + numrow).remove().clone(); + subTable.find('[numrow="' + numrow + '"]').after(child); + if (ui.item.startPos < ui.item.index()) { + var child = subTable.find('.numRow' + numrow).next().remove().clone(); + subTable.find('[numrow="' + numrow + '"]').before(child); } thisInstance.updateRowSequence(); } }); + subTable.disableSelection(); + }, + registerShowHideExpanded: function (container) { + var thisInstance = this; + container.on('click', '.toggleVisibility', function (e) { + var element = $(e.currentTarget); + var row = thisInstance.getClosestRow(element); + if (element.data('status') == '0') { + thisInstance.showExpandedRow(row); + } else { + thisInstance.hideExpandedRow(row); + } + }); }, - /** - * Function which will regisrer price book popup - */ registerPriceBookPopUp: function (container) { var thisInstance = this; container.on('click', '.priceBookPopup', function (e) { @@ -931,6 +961,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { this.registerChangeDiscount(container); this.registerChangeTax(container); this.registerClearReferenceSelection(container); + this.registerShowHideExpanded(container); }, }); diff --git a/layouts/vlayout/modules/Supplies/resources/Edit.min.js b/layouts/vlayout/modules/Supplies/resources/Edit.min.js index 50bedb770b3c..f6cb54f72dcd 100644 --- a/layouts/vlayout/modules/Supplies/resources/Edit.min.js +++ b/layouts/vlayout/modules/Supplies/resources/Edit.min.js @@ -1,2 +1,2 @@ -Vtiger_Edit_Js("Supplies_Edit_Js",{},{lineItemContentsContainer:false,rowClass:"tr.rowSup",discountMondalFields:["aggregationType","globalDiscount","groupCheckbox","groupDiscount","individualDiscount","individualDiscountType"],taxMondalFields:["aggregationType","globalTax","groupCheckbox","groupTax","individualTax"],getSupTableContainer:function(){if(this.lineItemContentsContainer==false){this.lineItemContentsContainer=$(".suppliesItemTable")}return this.lineItemContentsContainer},getNextLineItemRowNumber:function(){var a=$(this.rowClass,this.getSupTableContainer()).length;$("#suppliesRowNo").val(a+1);return ++a},getAccountId:function(){var a=$("#accountReferenceField").val();if(a!=""){return $('[name="'+a+'"]').val()}return""},checkDeleteIcon:function(){var a=this.getSupTableContainer();if(a.find(this.rowClass).length>1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackSuppliesTable tr").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},parsePrice:function(a){var b=parseInt($(".numberOfCurrencyDecimal").val());return parseFloat(a).toFixed(b)},getTaxModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(c){var b=this;var a=b.getSupTableContainer().find(".colTax");if(b.isIndividualTaxMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".tax").val("0");b.rowsCalculations()}},getDiscountModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(c){var b=this;var a=b.getSupTableContainer().find(".colDiscount");if(b.isIndividualDiscountMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".discount").val("0");b.rowsCalculations()}},getCurrency:function(){var a=$('[name="currency"]',this.getSupTableContainer());return a.find("option:selected").val()},getTax:function(a){return parseFloat($(".tax",a).val())},getQuantityValue:function(a){return parseFloat($(".qty",a).val())},getListPriceValue:function(a){return parseFloat($(".listPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return parseFloat(b)},getNetPrice:function(a){return parseFloat($(".netPrice",a).val())},getTotalPrice:function(a){return parseFloat($(".totalPriceText",a).text())},getGrossPrice:function(a){return parseFloat($(".grossPrice",a).val())},getPurchase:function(a){var b=this.getQuantityValue(a);return parseFloat($(".purchase",a).val())*b},getSummaryGrossPrice:function(){var b=this;var a=0;this.getSupTableContainer().find(this.rowClass).each(function(c){a+=b.getGrossPrice($(this))});return parseFloat(a)},setListPriceValue:function(b,a){a=this.parsePrice(a);b.find(".listPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=this.parsePrice(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=this.parsePrice(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=this.parsePrice(a);$(".totalPriceText",b).text(a)},setMargin:function(b,a){a=this.parsePrice(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=this.parsePrice(a);$(".marginp",b).val(a)},quantityChangeActions:function(a){this.rowCalculations(a);this.summaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getSupTableContainer().find(this.rowClass).each(function(b){a.quantityChangeActions($(this))})},summaryCalculations:function(a){},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getListPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,c){var e=this.getTotalPrice(j),b=e,k=0,f=0,g=0,a=0;var i=c.find(".discountsType").val();if(i=="0"||i=="1"){if(c.find(".activepanel .globalDiscount").length>0){var k=c.find(".activepanel .globalDiscount").val()}if(c.find(".activepanel .individualDiscountType").length>0){var d=c.find('.activepanel .individualDiscountType[name="individual"]:checked').val();var h=c.find(".activepanel .individualDiscountValue").val();if(d=="percentage"){g=(h/100)*e}else{g=h}}if(c.find(".activepanel .groupCheckbox").length>0&&c.find(".activepanel .groupCheckbox").prop("checked")==true){var f=c.find(".groupValue").val();f=e*(parseFloat(f)/100)}b=b*((100-parseFloat(k))/100);b=b-parseFloat(g);b=b-parseFloat(f)}else{if(i=="2"){c.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=parseFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=parseFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=parseFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}c.find(".valuePrices").text(this.parsePrice(b));c.find(".valueDiscount").text(e-this.parsePrice(b))},calculateTax:function(k,g){var h=this.getTotalPrice(k),b=h,c=0,f=0,a=0,i=0,e=0;var d=g.find(".taxsType").val();if(d=="0"||d=="1"){if(g.find(".activepanel .globalTax").length>0){var c=g.find(".activepanel .globalTax").val()}if(g.find(".activepanel .individualTaxValue").length>0){var j=g.find(".activepanel .individualTaxValue").val();i=(j/100)*b}if(g.find(".activepanel .groupTax").length>0){var f=g.find(".groupTax").val();f=h*(parseFloat(f)/100)}if(g.find(".activepanel .regionalTax").length>0){var a=g.find(".regionalTax").val();a=h*(parseFloat(a)/100)}b=b*((100+parseFloat(c))/100);b=b+parseFloat(i);b=b+parseFloat(f);b=b+parseFloat(a)}else{if(d=="2"){g.find(".activepanel").each(function(p){var l=$(this);if(l.find(".globalTax").length>0){var o=parseFloat(l.find(".globalTax").val());b=b*((100+o)/100)}else{if(l.find(".groupTax").length>0){var n=parseFloat(l.find(".groupTax").val());b=b*((100+n)/100)}else{if(l.find(".regionalTax").length>0){var m=parseFloat(l.find(".regionalTax").val());b=b*((100+m)/100)}else{if(l.find(".individualTaxValue").length>0){var q=parseFloat(l.find(".individualTaxValue").val());b=((q+100)/100)*b}}}}})}}g.find(".valuePrices").text(this.parsePrice(b));g.find(".valueTax").text(this.parsePrice(b-h))},updateRowSequence:function(){var a=this.getSupTableContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerSuppliesSaveData:function(a){var b=this;a.on(Vtiger_Edit_Js.recordPreSave,function(f,d){if(!b.checkLimits(a)){return false}var c=a.find("#blackSuppliesTable");c.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductListPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setListPriceValue(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(g,a){var d=this;var c=jQuery("input.sourceField",g).val();var e=g.find('.rowName input[name="popupReferenceModule"]').val();d.removeSubProducts(g);if(c=="0"||$.inArray(e,["Products","Services"])<0){return false}if(d.subProductsCashe[c]){d.addSubProducts(g,d.subProductsCashe[c]);return false}var f={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(f).then(function(i){var h=i.result;d.subProductsCashe[c]=h;d.addSubProducts(g,h);if(b){b.hide()}},function(h,i){if(b){b.hide()}})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,d){var i=this;for(var b in d){var a=d[b];var j=a.description;var c=a.listpricevalues;var e=JSON.stringify(c);for(var g in a){k.find("input."+g).val(a[g])}var h=i.getCurrency();if(typeof c[h]!=="undefined"){i.setListPriceValue(k,c[h])}$("input.listPrice",k).attr("list-info",e);$("textarea.commentTextarea",k).val(j);i.showIndividualTax(k)}if(f==="Products"){i.loadSubProducts(k,true)}this.quantityChangeActions(k)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".discountParam").val(JSON.stringify(c))},saveTaxsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(b.taxMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".taxParam").val(JSON.stringify(c))},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},initTaxParameters:function(d,a){var c=this;var b=d.find(".taxParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.taxMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateTax(d,a)},loadWysiwyg:function(c,a){var b=this;if(a=="1"){b.loadCkEditorElement(c.find(".ckEditorSource"))}},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#suppliesLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"CheckLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#suppliesLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide()});return a},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackSuppliesTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.initRow();c.registerAutoCompleteFields(m);c.loadWysiwyg(m,g)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(d,e){var f=e.item.find("textarea").attr("id");if(typeof f!="undefined"){var c=CKEDITOR.instances[f];c.destroy()}},stop:function(e,f){var c={};var d=f.item.find("textarea");if(typeof d.attr("id")!="undefined"){b.loadCkEditorElement(d)}b.updateRowSequence()}})},registerPriceBookPopUp:function(a){var b=this;a.on("click",".priceBookPopup",function(f){var d=$(f.currentTarget);var c=b.isRecordSelected(d);if(c==true){return}b.pricebooksPopupHandler(d)})},registerRowChangeEvent:function(a){var b=this;a.on("focusout",".qty",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("focusout",".listPrice",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("focusout",".purchase",function(d){var c=$(d.currentTarget);b.quantityChangeActions(b.getClosestRow(c))});a.on("change",".taxMode",function(d){var c=$(d.currentTarget);b.showIndividualTax(b.getClosestRow(c))});a.on("change",".discountMode",function(d){var c=$(d.currentTarget);b.showIndividualDiscount(b.getClosestRow(c))})},registerSubProducts:function(a){var b=this;a.find(this.rowClass).each(function(c){b.loadSubProducts($(this),false)})},registerClearReferenceSelection:function(a){var b=this;a.on("click",".clearReferenceSelection",function(d){var c=$(d.currentTarget);var f=b.getClosestRow(c);b.removeSubProducts(f);f.find(".listPrice,.tax,.discount,.margin,.purchase").val("0");f.find("textarea").val("");b.quantityChangeActions(f)})},registerDeleteLineItemEvent:function(a){var b=this;a.on("click",".deleteRow",function(d){var c=$(d.currentTarget);b.getClosestRow(c).remove();b.checkDeleteIcon()})},registerChangeDiscount:function(a){var b=this;a.on("click",".changeDiscount",function(g){var d=$(g.currentTarget);var f=d.closest(b.rowClass);var h={module:"Products",view:"Discounts",record:f.find(".rowName .sourceField").val(),currency:b.getCurrency(),sourceModule:app.getModuleName(),sourceRecord:app.getRecordId(),totalPrice:b.getTotalPrice(f),accountField:a.find("#accountReferenceField").val(),};var c=jQuery.progressIndicator();AppConnector.request(h).then(function(e){app.showModalWindow(e,function(i){b.initDiscountsParameters(f,$(i));b.registerChangeDiscountModal(i,f,h)});c.hide()},function(e,i){c.hide()})})},registerChangeDiscountModal:function(a,c,d){var b=this;a.on("change",".individualDiscountType",function(g){var f=$(g.currentTarget);a.find(".individualDiscountContainer .input-group-addon").text(f.data("symbol"))});a.on("change",'.activeCheckbox[name="aggregationType"]',function(g){var f=$(g.currentTarget);if(f.attr("type")=="checkbox"&&this.checked){f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{if(f.attr("type")=="radio"){a.find(".panel").removeClass("activepanel");a.find(".panel .panel-body").hide();f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{f.closest(".panel").find(".panel-body").hide();f.closest(".panel").removeClass("activepanel")}}});a.on("change",".activeCheckbox, .globalDiscount,.individualDiscountValue,.individualDiscountType,.groupCheckbox",function(g){var f=$(g.currentTarget);b.calculateDiscount(c,a)});a.on("click",".saveDiscount",function(f){c.find(".discount").val(a.find(".valueDiscount").text());b.quantityChangeActions(c);b.saveDiscountsParameters(c,a);app.hideModalWindow()})},registerChangeTax:function(a){var b=this;a.on("click",".changeTax",function(g){var d=$(g.currentTarget);var f=d.closest(b.rowClass);var h={module:"Products",view:"Taxs",record:f.find(".rowName .sourceField").val(),recordModule:f.find('.rowName [name="popupReferenceModule"]').val(),currency:b.getCurrency(),sourceModule:app.getModuleName(),sourceRecord:app.getRecordId(),totalPrice:b.getTotalPrice(f),accountField:a.find("#accountReferenceField").val(),};var c=jQuery.progressIndicator();AppConnector.request(h).then(function(e){app.showModalWindow(e,function(i){b.initTaxParameters(f,$(i));b.registerChangeTaxModal(i,f,h)});c.hide()},function(e,i){c.hide()})})},registerChangeTaxModal:function(a,c,d){var b=this;a.on("change",".individualTaxType",function(g){var f=$(g.currentTarget);a.find(".individualTaxContainer .input-group-addon").text(f.data("symbol"))});a.on("change",'.activeCheckbox[name="aggregationType"]',function(g){var f=$(g.currentTarget);if(f.attr("type")=="checkbox"&&this.checked){f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{if(f.attr("type")=="radio"){a.find(".panel").removeClass("activepanel");a.find(".panel .panel-body").hide();f.closest(".panel").find(".panel-body").show();f.closest(".panel").addClass("activepanel")}else{f.closest(".panel").find(".panel-body").hide();f.closest(".panel").removeClass("activepanel")}}});a.on("change",".activeCheckbox, .globalTax, .individualTaxValue, .groupTax, .regionalTax",function(g){var f=$(g.currentTarget);b.calculateTax(c,a)});a.on("click",".saveTaxs",function(f){c.find(".tax").val(a.find(".valueTax").text());b.quantityChangeActions(c);b.saveTaxsParameters(c,a);app.hideModalWindow()})},registerRowAutoComplete:function(a){var b=this;var c=a.find(".rowName .sourceField");c.on(Vtiger_Edit_Js.postReferenceSelectionEvent,function(k,h){var g=$(k.currentTarget);var j=g.closest(b.rowClass);if(h.data.label){var d=h.data.id}else{for(var l in h.data){var d=l}}var f=j.find('.rowName [name="popupReferenceModule"]').val();var i="index.php?module="+app.getModuleName()+"&action=GetDetails&record="+d+"¤cy_id="+b.getCurrency();AppConnector.request(i).then(function(m){for(var n in m){if(typeof m[n]=="object"){var e=m[n];b.mapResultsToFields(f,j,e)}}},function(e,m){})})},initRow:function(a){var b=this;if(typeof a=="undefined"){a=b.getSupTableContainer()}b.registerDeleteLineItemEvent(a);b.registerPriceBookPopUp(a);b.registerRowChangeEvent(a);b.registerRowAutoComplete(a);b.checkDeleteIcon()},registerBasicEvents:function(a){this._super(a);this.registerSuppliesSaveData(a);this.registerAddRow(a);this.initRow();this.registerSortableRow();this.registerSubProducts(a);this.registerChangeDiscount(a);this.registerChangeTax(a);this.registerClearReferenceSelection(a)},}); \ No newline at end of file +Vtiger_Edit_Js("Supplies_Edit_Js",{},{lineItemContentsContainer:false,rowClass:"tr.rowSup",discountMondalFields:["aggregationType","globalDiscount","groupCheckbox","groupDiscount","individualDiscount","individualDiscountType"],taxMondalFields:["aggregationType","globalTax","groupCheckbox","groupTax","individualTax"],getSupTableContainer:function(){if(this.lineItemContentsContainer==false){this.lineItemContentsContainer=$(".suppliesItemTable")}return this.lineItemContentsContainer},getNextLineItemRowNumber:function(){var a=$(this.rowClass,this.getSupTableContainer()).length;$("#suppliesRowNo").val(a+1);return ++a},getAccountId:function(){var a=$("#accountReferenceField").val();if(a!=""){return $('[name="'+a+'"]').val()}return""},checkDeleteIcon:function(){var a=this.getSupTableContainer();if(a.find(this.rowClass).length>1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackSuppliesTable tbody").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},parsePrice:function(a){var b=parseInt($(".numberOfCurrencyDecimal").val());return parseFloat(a).toFixed(b)},getTaxModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(c){var b=this;var a=b.getSupTableContainer().find(".colTax");if(b.isIndividualTaxMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".tax").val("0");b.rowsCalculations()}},getDiscountModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(c){var b=this;var a=b.getSupTableContainer().find(".colDiscount");if(b.isIndividualDiscountMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".discount").val("0");b.rowsCalculations()}},getCurrency:function(){var a=$('[name="currency"]',this.getSupTableContainer());return a.find("option:selected").val()},getTax:function(a){return parseFloat($(".tax",a).val())},getQuantityValue:function(a){return parseFloat($(".qty",a).val())},getListPriceValue:function(a){return parseFloat($(".listPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return parseFloat(b)},getNetPrice:function(a){return parseFloat($(".netPrice",a).val())},getTotalPrice:function(a){return parseFloat($(".totalPriceText",a).text())},getGrossPrice:function(a){return parseFloat($(".grossPrice",a).val())},getPurchase:function(a){var b=this.getQuantityValue(a);return parseFloat($(".purchase",a).val())*b},getSummaryGrossPrice:function(){var b=this;var a=0;this.getSupTableContainer().find(this.rowClass).each(function(c){a+=b.getGrossPrice($(this))});return parseFloat(a)},setListPriceValue:function(b,a){a=this.parsePrice(a);b.find(".listPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=this.parsePrice(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=this.parsePrice(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=this.parsePrice(a);$(".totalPriceText",b).text(a)},setMargin:function(b,a){a=this.parsePrice(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=this.parsePrice(a);$(".marginp",b).val(a)},quantityChangeActions:function(a){this.rowCalculations(a);this.summaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getSupTableContainer().find(this.rowClass).each(function(b){a.quantityChangeActions($(this))})},summaryCalculations:function(a){},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getListPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,c){var e=this.getTotalPrice(j),b=e,k=0,f=0,g=0,a=0;var i=c.find(".discountsType").val();if(i=="0"||i=="1"){if(c.find(".activepanel .globalDiscount").length>0){var k=c.find(".activepanel .globalDiscount").val()}if(c.find(".activepanel .individualDiscountType").length>0){var d=c.find('.activepanel .individualDiscountType[name="individual"]:checked').val();var h=c.find(".activepanel .individualDiscountValue").val();if(d=="percentage"){g=(h/100)*e}else{g=h}}if(c.find(".activepanel .groupCheckbox").length>0&&c.find(".activepanel .groupCheckbox").prop("checked")==true){var f=c.find(".groupValue").val();f=e*(parseFloat(f)/100)}b=b*((100-parseFloat(k))/100);b=b-parseFloat(g);b=b-parseFloat(f)}else{if(i=="2"){c.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=parseFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=parseFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=parseFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}c.find(".valuePrices").text(this.parsePrice(b));c.find(".valueDiscount").text(e-this.parsePrice(b))},calculateTax:function(k,g){var h=this.getTotalPrice(k),b=h,c=0,f=0,a=0,i=0,e=0;var d=g.find(".taxsType").val();if(d=="0"||d=="1"){if(g.find(".activepanel .globalTax").length>0){var c=g.find(".activepanel .globalTax").val()}if(g.find(".activepanel .individualTaxValue").length>0){var j=g.find(".activepanel .individualTaxValue").val();i=(j/100)*b}if(g.find(".activepanel .groupTax").length>0){var f=g.find(".groupTax").val();f=h*(parseFloat(f)/100)}if(g.find(".activepanel .regionalTax").length>0){var a=g.find(".regionalTax").val();a=h*(parseFloat(a)/100)}b=b*((100+parseFloat(c))/100);b=b+parseFloat(i);b=b+parseFloat(f);b=b+parseFloat(a)}else{if(d=="2"){g.find(".activepanel").each(function(p){var l=$(this);if(l.find(".globalTax").length>0){var o=parseFloat(l.find(".globalTax").val());b=b*((100+o)/100)}else{if(l.find(".groupTax").length>0){var n=parseFloat(l.find(".groupTax").val());b=b*((100+n)/100)}else{if(l.find(".regionalTax").length>0){var m=parseFloat(l.find(".regionalTax").val());b=b*((100+m)/100)}else{if(l.find(".individualTaxValue").length>0){var q=parseFloat(l.find(".individualTaxValue").val());b=((q+100)/100)*b}}}}})}}g.find(".valuePrices").text(this.parsePrice(b));g.find(".valueTax").text(this.parsePrice(b-h))},updateRowSequence:function(){var a=this.getSupTableContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerSuppliesSaveData:function(a){var b=this;a.on(Vtiger_Edit_Js.recordPreSave,function(f,d){if(!b.checkLimits(a)){return false}var c=a.find("#blackSuppliesTable");c.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductListPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setListPriceValue(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(g,a){var d=this;var c=jQuery("input.sourceField",g).val();var e=g.find('.rowName input[name="popupReferenceModule"]').val();d.removeSubProducts(g);if(c=="0"||$.inArray(e,["Products","Services"])<0){return false}if(d.subProductsCashe[c]){d.addSubProducts(g,d.subProductsCashe[c]);return false}var f={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(f).then(function(i){var h=i.result;d.subProductsCashe[c]=h;d.addSubProducts(g,h);if(b){b.hide()}},function(h,i){if(b){b.hide()}})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,d){var i=this;for(var b in d){var a=d[b];var j=a.description;var c=a.listpricevalues;var e=JSON.stringify(c);for(var g in a){k.find("input."+g).val(a[g])}var h=i.getCurrency();if(typeof c[h]!=="undefined"){i.setListPriceValue(k,c[h])}$("input.listPrice",k).attr("list-info",e);$("textarea.commentTextarea",k).val(j);i.showIndividualTax(k)}if(f==="Products"){i.loadSubProducts(k,true)}this.quantityChangeActions(k)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".discountParam").val(JSON.stringify(c))},saveTaxsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(b.taxMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".taxParam").val(JSON.stringify(c))},showExpandedRow:function(e){var d=this;var c=d.getSupTableContainer();var b=c.find('[numrowex="'+e.attr("numrow")+'"]');var a=e.find(".toggleVisibility");a.data("status","1");a.find(".glyphicon").removeClass("glyphicon-menu-down");a.find(".glyphicon").addClass("glyphicon-menu-up");b.removeClass("hide");d.loadCkEditorElement(b.find(".ckEditorSource"))},hideExpandedRow:function(f){var e=this;var d=e.getSupTableContainer();var c=d.find('[numrowex="'+f.attr("numrow")+'"]');var b=f.find(".toggleVisibility");b.data("status","0");b.find(".glyphicon").removeClass("glyphicon-menu-up");b.find(".glyphicon").addClass("glyphicon-menu-down");c.addClass("hide");var a=CKEDITOR.instances[c.find(".ckEditorSource").attr("id")];if(a){a.destroy()}},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},initTaxParameters:function(d,a){var c=this;var b=d.find(".taxParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.taxMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateTax(d,a)},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#suppliesLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"CheckLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#suppliesLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide()});return a},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackSuppliesTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.find("tr").appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.registerAutoCompleteFields(m);c.initRow(m)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(c,d){a.find(b.rowClass).each(function(e,f){var g=$(f);b.hideExpandedRow(g)});d.item.startPos=d.item.index()},stop:function(d,e){var c=$(e.item.context).attr("numrow");var f=a.find(".numRow"+c).remove().clone();a.find('[numrow="'+c+'"]').after(f);if(e.item.startPos + */ +class Supplies_Comment_Field extends Supplies_Basic_Field +{ + + protected $name = 'Comment'; + protected $defaultLabel = 'LBL_COMMENT'; + protected $columnname = 'comment'; + protected $dbType = 'varchar(500)'; + +} diff --git a/modules/Supplies/fields/Name.php b/modules/Supplies/fields/Name.php index 414b49516548..62f67108f5cb 100644 --- a/modules/Supplies/fields/Name.php +++ b/modules/Supplies/fields/Name.php @@ -13,9 +13,6 @@ class Supplies_Name_Field extends Supplies_Basic_Field protected $defaultLabel = 'LBL_ITEM_NAME'; protected $columnname = 'name'; protected $dbType = 'int(19) DEFAULT \'0\''; - protected $customColumn = [ - 'comment' => 'varchar(500)' - ]; /** * Geting value to display diff --git a/modules/Supplies/models/EditView.php b/modules/Supplies/models/EditView.php index d5786145b1c7..8e177f3684e8 100644 --- a/modules/Supplies/models/EditView.php +++ b/modules/Supplies/models/EditView.php @@ -11,6 +11,9 @@ class Supplies_EditView_Model extends Vtiger_EditView_Model public function isWysiwygType($moduleName) { + if (!$moduleName) { + return false; + } $cache = Vtiger_Cache::get('SuppliesisWysiwygType', $moduleName); if ($cache) { return $cache; From a8b5a50a78628958ec8af56643b206d9a5d865dc Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Fri, 21 Aug 2015 14:15:24 +0200 Subject: [PATCH 025/489] Added summary to the modules Supplies --- languages/pl_pl/Supplies.php | 12 ++- .../modules/Supplies/EditViewSupplies.tpl | 92 ++++++++----------- .../modules/Supplies/EditViewSuppliesRow.tpl | 4 +- .../Supplies/EditViewSuppliesSummary.tpl | 53 +++++++++++ .../Supplies/fields/EditViewTotalPrice.tpl | 6 ++ ...ditViewPrice.tpl => EditViewUnitPrice.tpl} | 9 +- .../modules/Supplies/resources/Edit.js | 83 +++++++++-------- .../modules/Supplies/resources/Edit.min.js | 2 +- layouts/vlayout/skins/twilight/style.css | 8 ++ layouts/vlayout/skins/twilight/style.min.css | 2 +- modules/PriceBooks/models/Record.php | 2 +- modules/PriceBooks/views/Popup.php | 2 +- modules/Supplies/actions/GetDetails.php | 16 ++-- modules/Supplies/fields/Basic.php | 6 ++ modules/Supplies/fields/Discount.php | 1 + modules/Supplies/fields/GrossPrice.php | 1 + modules/Supplies/fields/NetPrice.php | 3 +- modules/Supplies/fields/Tax.php | 1 + modules/Supplies/fields/TotalPrice.php | 27 ++++++ .../fields/{Price.php => UnitPrice.php} | 9 +- modules/Supplies/models/Record.php | 6 +- 21 files changed, 222 insertions(+), 123 deletions(-) create mode 100644 layouts/vlayout/modules/Supplies/EditViewSuppliesSummary.tpl create mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewTotalPrice.tpl rename layouts/vlayout/modules/Supplies/fields/{EditViewPrice.tpl => EditViewUnitPrice.tpl} (74%) create mode 100644 modules/Supplies/fields/TotalPrice.php rename modules/Supplies/fields/{Price.php => UnitPrice.php} (66%) diff --git a/languages/pl_pl/Supplies.php b/languages/pl_pl/Supplies.php index 273f9cfff4ce..9d26b149a98e 100644 --- a/languages/pl_pl/Supplies.php +++ b/languages/pl_pl/Supplies.php @@ -11,7 +11,7 @@ $languageStrings = [ 'LBL_DISCOUNT' => 'Rabat', 'LBL_TAX' => 'Podatek', - 'LBL_TOTAL_PRICE' => 'Cena całkowita', + 'LBL_TOTAL_PRICE' => 'Cena przed rabatem', 'LBL_ROW_COMMENT' => 'Opis', 'LBL_SELECT_DISCOUNT' => 'Wybierz rabat', 'LBL_GLOBAL_DISCOUNTS' => 'Globalny', @@ -27,10 +27,10 @@ 'LBL_VALUE' => 'Wartość', 'LBL_QUANTITY' => 'Ilość', 'LBL_REFERENCE' => 'Powiązanie', - 'LBL_PRICE' => 'Cena sprzedażowa', + 'LBL_UNIT_PRICE' => 'Cena jednostkowa', 'LBL_MARGIN_PRECENT' => 'Marża (%)', 'LBL_GROSS_PRICE' => 'Cena brutto', - 'LBL_NET_PRICE' => 'Cena netto', + 'LBL_DISCOUNT_PRICE' => 'Cena po rabacie', 'LBL_SELECT_TAX' => 'Wybierz podatek', 'LBL_PRICE_BEFORE_TAX' => 'Cena bez podatku', 'LBL_TAX_IN_TOTAL' => 'Łączna wartość podatku', @@ -47,7 +47,9 @@ 'LBL_CURRENT_VALUE' => 'Wartość dokumentu', 'LBL_TOTALS_LIMIT' => 'Wartość całkowita', 'LBL_LIMIT_ALERT' => 'Nie można zapisać rekordu', + 'LBL_IMAGE' => 'Zdjęcie', - 'LBL_GROUP_TAXS' => 'Grupowy', - 'LBL_GROUP_TAXS' => 'Grupowy', + 'LBL_GROUP_TsAXS' => 'Grupowy', + 'LBL_GROUP_TsAXS' => 'Grupowy', + 'LBL_GROUP_TsAXS' => 'Grupowy', ]; diff --git a/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl b/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl index c3268e798dc4..ff257e33306a 100644 --- a/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl +++ b/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl @@ -14,28 +14,37 @@ - {if $COUNT_FIELDS0 neq 0} -
  •     {vtranslate($FIELD->get('label'), $SUPMODULE)}
    - -   {vtranslate('LBL_DRAG',$SUPMODULE)} - - - {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('EditView')} - {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$MODULE) SUP_VALUE=$SUP_DATA[$FIELD->get('columnname')]} -
    + {foreach item=MAIN_MODULE from=$MAIN_PARAMS['modules']} {assign var="CRMEntity" value=CRMEntity::getInstance($MAIN_MODULE)} @@ -97,19 +87,7 @@ {assign var="ROW_NO" value='_NUM_'} - - - {foreach item=FIELD from=$FIELDS[1]} - - {/foreach} - + {include file='EditViewSuppliesRow.tpl'|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl('EditViewSuppliesRow.tpl',$MODULE)}
    diff --git a/layouts/vlayout/modules/Supplies/EditViewSuppliesRow.tpl b/layouts/vlayout/modules/Supplies/EditViewSuppliesRow.tpl new file mode 100644 index 000000000000..aad468a5c2a1 --- /dev/null +++ b/layouts/vlayout/modules/Supplies/EditViewSuppliesRow.tpl @@ -0,0 +1,42 @@ +{**} +{strip} + {if isset($SUP_DATA['name'])} + {assign var="REFERENCE_MODULE" value=Vtiger_Functions::getCRMRecordType($SUP_DATA['name'])} + {elseif $MAIN_PARAMS} + {assign var="REFERENCE_MODULE" value=reset($MAIN_PARAMS['modules'])} + {/if} +
    + +   {vtranslate('LBL_DRAG',$SUPMODULE)} + + {if $COUNT_FIELDS2 > 0} +

    + + + + {/if} +
    + {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('EditView')} + {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$MODULE) SUP_VALUE=$SUP_DATA[$FIELD->get('columnname')]} +
    + {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('EditView')} + {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$MODULE) SUP_VALUE=$SUP_DATA[$FIELD->get('columnname')]} +
    - - - {foreach item=FIELD from=$FIELDS[0]} - +
    - {vtranslate($FIELD->get('label'), $SUPMODULE)}   - {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('EditView')} - {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$MODULE) SUP_VALUE=$SUP_RECORD_DATA[0][$FIELD->get('columnname')]} -
    + + + - -
    + {foreach item=MAIN_MODULE from=$MAIN_PARAMS['modules']} + {assign var="CRMEntity" value=CRMEntity::getInstance($MAIN_MODULE)} + + + {/foreach} -
    - {/if} - + + {foreach item=FIELD from=$FIELDS[0]} + + {/foreach} + + +
    + {vtranslate($FIELD->get('label'), $SUPMODULE)}   + {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('EditView')} + {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$MODULE) SUP_VALUE=$SUP_RECORD_DATA[0][$FIELD->get('columnname')]} +
    + - {foreach item=FIELD from=$FIELDS[1]} - - {/foreach} + {foreach item=FIELD from=$FIELDS[1]} + + {/foreach} @@ -46,43 +55,22 @@ - + + {foreach item=FIELD from=$FIELDS[1]} + + {/foreach}
      {vtranslate($FIELD->get('label'), $SUPMODULE)}{vtranslate($FIELD->get('label'), $SUPMODULE)}
    - {foreach item=MAIN_MODULE from=$MAIN_PARAMS['modules']} - {assign var="CRMEntity" value=CRMEntity::getInstance($MAIN_MODULE)} - - - - {/foreach} -    + {if $FIELD->isSummary()} + {assign var="SUM" value=0} + {foreach key=KEY item=SUP_DATA from=$SUP_RECORD_DATA} + {assign var="SUM" value=($SUM + $SUP_DATA[$FIELD->get('columnname')])} + {/foreach} + {CurrencyField::convertToUserFormat($SUM, null, true)} + {/if} +
    -
    -
    -
    - -
    -
    - - - {foreach item=FIELD from=$FIELDS[2]} - - - - - {/foreach} - -
    - xx - - vv -
    -
    -
    -
    + {include file='EditViewSuppliesSummary.tpl'|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl('EditViewSuppliesRow.tpl',$MODULE)} {assign var="SUP_DATA" value=[]} diff --git a/layouts/vlayout/modules/Supplies/EditViewSuppliesRow.tpl b/layouts/vlayout/modules/Supplies/EditViewSuppliesRow.tpl index aad468a5c2a1..fbe740f8fbf6 100644 --- a/layouts/vlayout/modules/Supplies/EditViewSuppliesRow.tpl +++ b/layouts/vlayout/modules/Supplies/EditViewSuppliesRow.tpl @@ -12,13 +12,13 @@ {if $COUNT_FIELDS2 > 0}

    - + {/if} {foreach item=FIELD from=$FIELDS[1]} - diff --git a/layouts/vlayout/modules/Supplies/EditViewSuppliesSummary.tpl b/layouts/vlayout/modules/Supplies/EditViewSuppliesSummary.tpl new file mode 100644 index 000000000000..a7c78d4f7f7c --- /dev/null +++ b/layouts/vlayout/modules/Supplies/EditViewSuppliesSummary.tpl @@ -0,0 +1,53 @@ +{**} +{strip} +
    +
    +
    + + {foreach item=FIELD from=$FIELDS[2]} + + + + + {/foreach} + +
    + xx + + vv +
    +
    +
    + + + {foreach item=FIELD from=$FIELDS[2]} + + + + + {/foreach} + +
    + xx + + vv +
    +
    +
    + + + {foreach item=FIELD from=$FIELDS[2]} + + + + + {/foreach} + +
    + xx + + vv +
    +
    + +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewTotalPrice.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewTotalPrice.tpl new file mode 100644 index 000000000000..37c50e4c0320 --- /dev/null +++ b/layouts/vlayout/modules/Supplies/fields/EditViewTotalPrice.tpl @@ -0,0 +1,6 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} + + {$FIELD->getEditValue($VALUE)} +{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewPrice.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewUnitPrice.tpl similarity index 74% rename from layouts/vlayout/modules/Supplies/fields/EditViewPrice.tpl rename to layouts/vlayout/modules/Supplies/fields/EditViewUnitPrice.tpl index 0e5296227a40..eae8cc666a1d 100644 --- a/layouts/vlayout/modules/Supplies/fields/EditViewPrice.tpl +++ b/layouts/vlayout/modules/Supplies/fields/EditViewUnitPrice.tpl @@ -3,8 +3,8 @@ {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)}
    + data-validation-engine="validate[required,funcCall[Vtiger_NumberUserFormat_Validator_Js.invokeValidation]]" + class="unitPrice smallInputBox form-control input-sm" list-info=""/> {assign var=PRICEBOOK_MODULE_MODEL value=Vtiger_Module_Model::getInstance('PriceBooks')} {if in_array('3',$DISCOUNTS_CONFIG['discounts']) && $PRICEBOOK_MODULE_MODEL->isPermitted('DetailView')} @@ -13,9 +13,4 @@ {/if}
    -
    - {assign var="TOTAL_PRICE" value=floatval($SUP_DATA['qty']) * floatval($SUP_DATA['price'])} - {vtranslate('LBL_TOTAL_PRICE',$SUPMODULE)}:   - {$TOTAL_PRICE} -
    {/strip} diff --git a/layouts/vlayout/modules/Supplies/resources/Edit.js b/layouts/vlayout/modules/Supplies/resources/Edit.js index 24977e6a8b6c..2ba573d3f856 100644 --- a/layouts/vlayout/modules/Supplies/resources/Edit.js +++ b/layouts/vlayout/modules/Supplies/resources/Edit.js @@ -65,10 +65,6 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { var response = productField.validationEngine('validate'); return response; }, - parsePrice: function (val) { - var numberOfDecimal = parseInt($('.numberOfCurrencyDecimal').val()); - return parseFloat(val).toFixed(numberOfDecimal); - }, getTaxModeSelectElement: function (row) { var subTable = this.getSupTableContainer(); if (subTable.find('thead .taxMode').length > 0) { @@ -134,33 +130,33 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { return currency.find('option:selected').val(); }, getTax: function (row) { - return parseFloat($('.tax', row).val()); + return app.parseNumberToFloat($('.tax', row).val()); }, getQuantityValue: function (row) { - return parseFloat($('.qty', row).val()); + return app.parseNumberToFloat($('.qty', row).val()); }, - getListPriceValue: function (row) { - return parseFloat($('.listPrice', row).val()); + getUnitPriceValue: function (row) { + return app.parseNumberToFloat($('.unitPrice', row).val()); }, getDiscount: function (row) { var discount = $('.discount', row).val(); if (discount == undefined) { discount = 0; } - return parseFloat(discount); + return app.parseNumberToFloat(discount); }, getNetPrice: function (row) { - return parseFloat($('.netPrice', row).val()); + return app.parseNumberToFloat($('.netPrice', row).val()); }, getTotalPrice: function (row) { - return parseFloat($('.totalPriceText', row).text()); + return app.parseNumberToFloat($('.totalPrice', row).val()); }, getGrossPrice: function (row) { - return parseFloat($('.grossPrice', row).val()); + return app.parseNumberToFloat($('.grossPrice', row).val()); }, getPurchase: function (row) { var qty = this.getQuantityValue(row); - return parseFloat($('.purchase', row).val()) * qty; + return app.parseNumberToFloat($('.purchase', row).val()) * qty; }, getSummaryGrossPrice: function () { var thisInstance = this; @@ -168,33 +164,33 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { this.getSupTableContainer().find(this.rowClass).each(function (index) { price += thisInstance.getGrossPrice($(this)); }); - return parseFloat(price); + return app.parseNumberToFloat(price); }, - setListPriceValue: function (row, val) { - val = this.parsePrice(val); - row.find('.listPrice').val(val).attr('title', val); + setUnitPriceValue: function (row, val) { + row.find('.unitPrice').val(val).attr('title', val); return this; }, setNetPrice: function (row, val) { - val = this.parsePrice(val); + val = app.parseNumberToShow(val); $('.netPriceText', row).text(val); $('.netPrice', row).val(val); }, setGrossPrice: function (row, val) { - val = this.parsePrice(val); + val = app.parseNumberToShow(val); $('.grossPriceText', row).text(val); $('.grossPrice', row).val(val); }, setTotalPrice: function (row, val) { - val = this.parsePrice(val); + val = app.parseNumberToShow(val); $('.totalPriceText', row).text(val); + $('.totalPrice', row).val(val); }, setMargin: function (row, val) { - val = this.parsePrice(val); + val = app.parseNumberToShow(val); $('.margin', row).val(val); }, setMarginP: function (row, val) { - val = this.parsePrice(val); + val = app.parseNumberToShow(val); $('.marginp', row).val(val); }, quantityChangeActions: function (row) { @@ -213,8 +209,19 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { thisInstance.quantityChangeActions($(this)); }); }, - summaryCalculations: function (row) { - + summaryCalculations: function () { + var thisInstance = this; + this.getSupTableContainer().find('tfoot .wisableTd').each(function (index) { + thisInstance.calculatSummary($(this), $(this).data('sumfield')); + }); + }, + calculatSummary: function (element, field) { + var thisInstance = this; + var sum = 0; + this.getSupTableContainer().find(this.rowClass).each(function (index) { + sum += app.parseNumberToFloat($(this).find('.' + field).val()); + }); + element.text(app.parseNumberToShow(sum)); }, calculateNetPrice: function (row) { var netPrice = this.getTotalPrice(row) - this.getDiscount(row); @@ -229,7 +236,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { this.setGrossPrice(row, netPrice); }, calculateTotalPrice: function (row) { - var netPriceBeforeDiscount = this.getQuantityValue(row) * this.getListPriceValue(row); + var netPriceBeforeDiscount = this.getQuantityValue(row) * this.getUnitPriceValue(row); this.setTotalPrice(row, netPriceBeforeDiscount); }, calculateMargin: function (row) { @@ -295,8 +302,8 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { }); } - mondal.find('.valuePrices').text(this.parsePrice(valuePrices)); - mondal.find('.valueDiscount').text(netPriceBeforeDiscount - this.parsePrice(valuePrices)); + mondal.find('.valuePrices').text(app.parseNumberToFloat(valuePrices)); + mondal.find('.valueDiscount').text(netPriceBeforeDiscount - app.parseNumberToFloat(valuePrices)); }, calculateTax: function (row, mondal) { var netPriceWithoutTax = this.getTotalPrice(row), @@ -348,8 +355,8 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { }); } - mondal.find('.valuePrices').text(this.parsePrice(valuePrices)); - mondal.find('.valueTax').text(this.parsePrice(valuePrices - netPriceWithoutTax)); + mondal.find('.valuePrices').text(app.parseNumberToFloat(valuePrices)); + mondal.find('.valueTax').text(app.parseNumberToFloat(valuePrices - netPriceWithoutTax)); }, updateRowSequence: function () { var subTable = this.getSupTableContainer(); @@ -380,13 +387,13 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { params.src_module = $('[name="popupReferenceModule"]', rowName).val(); params.src_record = $('.sourceField', rowName).val(); params.src_field = $('[name="popupReferenceModule"]', rowName).data('field'); - params.get_url = 'getProductListPriceURL'; + params.get_url = 'getProductUnitPriceURL'; params.currency_id = thisInstance.getCurrency(); this.showPopup(params).then(function (data) { var responseData = JSON.parse(data); for (var id in responseData) { - thisInstance.setListPriceValue(lineItemRow, responseData[id]); + thisInstance.setUnitPriceValue(lineItemRow, responseData[id]); } thisInstance.quantityChangeActions(thisInstance.getClosestRow(rowName)); }); @@ -454,18 +461,18 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { for (var id in responseData) { var recordData = responseData[id]; var description = recordData.description; - var listPriceValues = recordData.listpricevalues; - var listPriceValuesJson = JSON.stringify(listPriceValues); + var unitPriceValues = recordData.unitPriceValues; + var unitPriceValuesJson = JSON.stringify(unitPriceValues); for (var field in recordData) { parentRow.find('input.' + field).val(recordData[field]); } var currencyId = thisInstance.getCurrency(); - if (typeof listPriceValues[currencyId] !== 'undefined') { - thisInstance.setListPriceValue(parentRow, listPriceValues[currencyId]); + if (typeof unitPriceValues[currencyId] !== 'undefined') { + thisInstance.setUnitPriceValue(parentRow, unitPriceValues[currencyId]); } - $('input.listPrice', parentRow).attr('list-info', listPriceValuesJson); + $('input.unitPrice', parentRow).attr('list-info', unitPriceValuesJson); $('textarea.commentTextarea', parentRow).val(description); thisInstance.showIndividualTax(parentRow); @@ -732,7 +739,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { var element = $(e.currentTarget); thisInstance.quantityChangeActions(thisInstance.getClosestRow(element)); }); - container.on('focusout', '.listPrice', function (e) { + container.on('focusout', '.unitPrice', function (e) { var element = $(e.currentTarget); thisInstance.quantityChangeActions(thisInstance.getClosestRow(element)); }); @@ -761,7 +768,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { var element = $(e.currentTarget); var row = thisInstance.getClosestRow(element) thisInstance.removeSubProducts(row); - row.find('.listPrice,.tax,.discount,.margin,.purchase').val('0'); + row.find('.unitPrice,.tax,.discount,.margin,.purchase').val('0'); row.find('textarea').val(''); thisInstance.quantityChangeActions(row); }); diff --git a/layouts/vlayout/modules/Supplies/resources/Edit.min.js b/layouts/vlayout/modules/Supplies/resources/Edit.min.js index f6cb54f72dcd..84140171aa43 100644 --- a/layouts/vlayout/modules/Supplies/resources/Edit.min.js +++ b/layouts/vlayout/modules/Supplies/resources/Edit.min.js @@ -1,2 +1,2 @@ -Vtiger_Edit_Js("Supplies_Edit_Js",{},{lineItemContentsContainer:false,rowClass:"tr.rowSup",discountMondalFields:["aggregationType","globalDiscount","groupCheckbox","groupDiscount","individualDiscount","individualDiscountType"],taxMondalFields:["aggregationType","globalTax","groupCheckbox","groupTax","individualTax"],getSupTableContainer:function(){if(this.lineItemContentsContainer==false){this.lineItemContentsContainer=$(".suppliesItemTable")}return this.lineItemContentsContainer},getNextLineItemRowNumber:function(){var a=$(this.rowClass,this.getSupTableContainer()).length;$("#suppliesRowNo").val(a+1);return ++a},getAccountId:function(){var a=$("#accountReferenceField").val();if(a!=""){return $('[name="'+a+'"]').val()}return""},checkDeleteIcon:function(){var a=this.getSupTableContainer();if(a.find(this.rowClass).length>1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackSuppliesTable tbody").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},parsePrice:function(a){var b=parseInt($(".numberOfCurrencyDecimal").val());return parseFloat(a).toFixed(b)},getTaxModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(c){var b=this;var a=b.getSupTableContainer().find(".colTax");if(b.isIndividualTaxMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".tax").val("0");b.rowsCalculations()}},getDiscountModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(c){var b=this;var a=b.getSupTableContainer().find(".colDiscount");if(b.isIndividualDiscountMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".discount").val("0");b.rowsCalculations()}},getCurrency:function(){var a=$('[name="currency"]',this.getSupTableContainer());return a.find("option:selected").val()},getTax:function(a){return parseFloat($(".tax",a).val())},getQuantityValue:function(a){return parseFloat($(".qty",a).val())},getListPriceValue:function(a){return parseFloat($(".listPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return parseFloat(b)},getNetPrice:function(a){return parseFloat($(".netPrice",a).val())},getTotalPrice:function(a){return parseFloat($(".totalPriceText",a).text())},getGrossPrice:function(a){return parseFloat($(".grossPrice",a).val())},getPurchase:function(a){var b=this.getQuantityValue(a);return parseFloat($(".purchase",a).val())*b},getSummaryGrossPrice:function(){var b=this;var a=0;this.getSupTableContainer().find(this.rowClass).each(function(c){a+=b.getGrossPrice($(this))});return parseFloat(a)},setListPriceValue:function(b,a){a=this.parsePrice(a);b.find(".listPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=this.parsePrice(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=this.parsePrice(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=this.parsePrice(a);$(".totalPriceText",b).text(a)},setMargin:function(b,a){a=this.parsePrice(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=this.parsePrice(a);$(".marginp",b).val(a)},quantityChangeActions:function(a){this.rowCalculations(a);this.summaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getSupTableContainer().find(this.rowClass).each(function(b){a.quantityChangeActions($(this))})},summaryCalculations:function(a){},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getListPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,c){var e=this.getTotalPrice(j),b=e,k=0,f=0,g=0,a=0;var i=c.find(".discountsType").val();if(i=="0"||i=="1"){if(c.find(".activepanel .globalDiscount").length>0){var k=c.find(".activepanel .globalDiscount").val()}if(c.find(".activepanel .individualDiscountType").length>0){var d=c.find('.activepanel .individualDiscountType[name="individual"]:checked').val();var h=c.find(".activepanel .individualDiscountValue").val();if(d=="percentage"){g=(h/100)*e}else{g=h}}if(c.find(".activepanel .groupCheckbox").length>0&&c.find(".activepanel .groupCheckbox").prop("checked")==true){var f=c.find(".groupValue").val();f=e*(parseFloat(f)/100)}b=b*((100-parseFloat(k))/100);b=b-parseFloat(g);b=b-parseFloat(f)}else{if(i=="2"){c.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=parseFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=parseFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=parseFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}c.find(".valuePrices").text(this.parsePrice(b));c.find(".valueDiscount").text(e-this.parsePrice(b))},calculateTax:function(k,g){var h=this.getTotalPrice(k),b=h,c=0,f=0,a=0,i=0,e=0;var d=g.find(".taxsType").val();if(d=="0"||d=="1"){if(g.find(".activepanel .globalTax").length>0){var c=g.find(".activepanel .globalTax").val()}if(g.find(".activepanel .individualTaxValue").length>0){var j=g.find(".activepanel .individualTaxValue").val();i=(j/100)*b}if(g.find(".activepanel .groupTax").length>0){var f=g.find(".groupTax").val();f=h*(parseFloat(f)/100)}if(g.find(".activepanel .regionalTax").length>0){var a=g.find(".regionalTax").val();a=h*(parseFloat(a)/100)}b=b*((100+parseFloat(c))/100);b=b+parseFloat(i);b=b+parseFloat(f);b=b+parseFloat(a)}else{if(d=="2"){g.find(".activepanel").each(function(p){var l=$(this);if(l.find(".globalTax").length>0){var o=parseFloat(l.find(".globalTax").val());b=b*((100+o)/100)}else{if(l.find(".groupTax").length>0){var n=parseFloat(l.find(".groupTax").val());b=b*((100+n)/100)}else{if(l.find(".regionalTax").length>0){var m=parseFloat(l.find(".regionalTax").val());b=b*((100+m)/100)}else{if(l.find(".individualTaxValue").length>0){var q=parseFloat(l.find(".individualTaxValue").val());b=((q+100)/100)*b}}}}})}}g.find(".valuePrices").text(this.parsePrice(b));g.find(".valueTax").text(this.parsePrice(b-h))},updateRowSequence:function(){var a=this.getSupTableContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerSuppliesSaveData:function(a){var b=this;a.on(Vtiger_Edit_Js.recordPreSave,function(f,d){if(!b.checkLimits(a)){return false}var c=a.find("#blackSuppliesTable");c.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductListPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setListPriceValue(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(g,a){var d=this;var c=jQuery("input.sourceField",g).val();var e=g.find('.rowName input[name="popupReferenceModule"]').val();d.removeSubProducts(g);if(c=="0"||$.inArray(e,["Products","Services"])<0){return false}if(d.subProductsCashe[c]){d.addSubProducts(g,d.subProductsCashe[c]);return false}var f={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(f).then(function(i){var h=i.result;d.subProductsCashe[c]=h;d.addSubProducts(g,h);if(b){b.hide()}},function(h,i){if(b){b.hide()}})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,d){var i=this;for(var b in d){var a=d[b];var j=a.description;var c=a.listpricevalues;var e=JSON.stringify(c);for(var g in a){k.find("input."+g).val(a[g])}var h=i.getCurrency();if(typeof c[h]!=="undefined"){i.setListPriceValue(k,c[h])}$("input.listPrice",k).attr("list-info",e);$("textarea.commentTextarea",k).val(j);i.showIndividualTax(k)}if(f==="Products"){i.loadSubProducts(k,true)}this.quantityChangeActions(k)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".discountParam").val(JSON.stringify(c))},saveTaxsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(b.taxMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".taxParam").val(JSON.stringify(c))},showExpandedRow:function(e){var d=this;var c=d.getSupTableContainer();var b=c.find('[numrowex="'+e.attr("numrow")+'"]');var a=e.find(".toggleVisibility");a.data("status","1");a.find(".glyphicon").removeClass("glyphicon-menu-down");a.find(".glyphicon").addClass("glyphicon-menu-up");b.removeClass("hide");d.loadCkEditorElement(b.find(".ckEditorSource"))},hideExpandedRow:function(f){var e=this;var d=e.getSupTableContainer();var c=d.find('[numrowex="'+f.attr("numrow")+'"]');var b=f.find(".toggleVisibility");b.data("status","0");b.find(".glyphicon").removeClass("glyphicon-menu-up");b.find(".glyphicon").addClass("glyphicon-menu-down");c.addClass("hide");var a=CKEDITOR.instances[c.find(".ckEditorSource").attr("id")];if(a){a.destroy()}},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},initTaxParameters:function(d,a){var c=this;var b=d.find(".taxParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.taxMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateTax(d,a)},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#suppliesLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"CheckLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#suppliesLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide()});return a},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackSuppliesTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.find("tr").appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.registerAutoCompleteFields(m);c.initRow(m)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(c,d){a.find(b.rowClass).each(function(e,f){var g=$(f);b.hideExpandedRow(g)});d.item.startPos=d.item.index()},stop:function(d,e){var c=$(e.item.context).attr("numrow");var f=a.find(".numRow"+c).remove().clone();a.find('[numrow="'+c+'"]').after(f);if(e.item.startPos1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackSuppliesTable tbody").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},getTaxModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(c){var b=this;var a=b.getSupTableContainer().find(".colTax");if(b.isIndividualTaxMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".tax").val("0");b.rowsCalculations()}},getDiscountModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(c){var b=this;var a=b.getSupTableContainer().find(".colDiscount");if(b.isIndividualDiscountMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".discount").val("0");b.rowsCalculations()}},getCurrency:function(){var a=$('[name="currency"]',this.getSupTableContainer());return a.find("option:selected").val()},getTax:function(a){return app.parseNumberToFloat($(".tax",a).val())},getQuantityValue:function(a){return app.parseNumberToFloat($(".qty",a).val())},getUnitPriceValue:function(a){return app.parseNumberToFloat($(".unitPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return app.parseNumberToFloat(b)},getNetPrice:function(a){return app.parseNumberToFloat($(".netPrice",a).val())},getTotalPrice:function(a){return app.parseNumberToFloat($(".totalPrice",a).val())},getGrossPrice:function(a){return app.parseNumberToFloat($(".grossPrice",a).val())},getPurchase:function(a){var b=this.getQuantityValue(a);return app.parseNumberToFloat($(".purchase",a).val())*b},getSummaryGrossPrice:function(){var b=this;var a=0;this.getSupTableContainer().find(this.rowClass).each(function(c){a+=b.getGrossPrice($(this))});return app.parseNumberToFloat(a)},setUnitPriceValue:function(b,a){b.find(".unitPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=app.parseNumberToShow(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=app.parseNumberToShow(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=app.parseNumberToShow(a);$(".totalPriceText",b).text(a);$(".totalPrice",b).val(a)},setMargin:function(b,a){a=app.parseNumberToShow(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=app.parseNumberToShow(a);$(".marginp",b).val(a)},quantityChangeActions:function(a){this.rowCalculations(a);this.summaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getSupTableContainer().find(this.rowClass).each(function(b){a.quantityChangeActions($(this))})},summaryCalculations:function(){var a=this;this.getSupTableContainer().find("tfoot .wisableTd").each(function(b){a.calculatSummary($(this),$(this).data("sumfield"))})},calculatSummary:function(a,d){var c=this;var b=0;this.getSupTableContainer().find(this.rowClass).each(function(e){b+=app.parseNumberToFloat($(this).find("."+d).val())});a.text(app.parseNumberToShow(b))},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getUnitPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,c){var e=this.getTotalPrice(j),b=e,k=0,f=0,g=0,a=0;var i=c.find(".discountsType").val();if(i=="0"||i=="1"){if(c.find(".activepanel .globalDiscount").length>0){var k=c.find(".activepanel .globalDiscount").val()}if(c.find(".activepanel .individualDiscountType").length>0){var d=c.find('.activepanel .individualDiscountType[name="individual"]:checked').val();var h=c.find(".activepanel .individualDiscountValue").val();if(d=="percentage"){g=(h/100)*e}else{g=h}}if(c.find(".activepanel .groupCheckbox").length>0&&c.find(".activepanel .groupCheckbox").prop("checked")==true){var f=c.find(".groupValue").val();f=e*(parseFloat(f)/100)}b=b*((100-parseFloat(k))/100);b=b-parseFloat(g);b=b-parseFloat(f)}else{if(i=="2"){c.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=parseFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=parseFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=parseFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}c.find(".valuePrices").text(app.parseNumberToFloat(b));c.find(".valueDiscount").text(e-app.parseNumberToFloat(b))},calculateTax:function(k,g){var h=this.getTotalPrice(k),b=h,c=0,f=0,a=0,i=0,e=0;var d=g.find(".taxsType").val();if(d=="0"||d=="1"){if(g.find(".activepanel .globalTax").length>0){var c=g.find(".activepanel .globalTax").val()}if(g.find(".activepanel .individualTaxValue").length>0){var j=g.find(".activepanel .individualTaxValue").val();i=(j/100)*b}if(g.find(".activepanel .groupTax").length>0){var f=g.find(".groupTax").val();f=h*(parseFloat(f)/100)}if(g.find(".activepanel .regionalTax").length>0){var a=g.find(".regionalTax").val();a=h*(parseFloat(a)/100)}b=b*((100+parseFloat(c))/100);b=b+parseFloat(i);b=b+parseFloat(f);b=b+parseFloat(a)}else{if(d=="2"){g.find(".activepanel").each(function(p){var l=$(this);if(l.find(".globalTax").length>0){var o=parseFloat(l.find(".globalTax").val());b=b*((100+o)/100)}else{if(l.find(".groupTax").length>0){var n=parseFloat(l.find(".groupTax").val());b=b*((100+n)/100)}else{if(l.find(".regionalTax").length>0){var m=parseFloat(l.find(".regionalTax").val());b=b*((100+m)/100)}else{if(l.find(".individualTaxValue").length>0){var q=parseFloat(l.find(".individualTaxValue").val());b=((q+100)/100)*b}}}}})}}g.find(".valuePrices").text(app.parseNumberToFloat(b));g.find(".valueTax").text(app.parseNumberToFloat(b-h))},updateRowSequence:function(){var a=this.getSupTableContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerSuppliesSaveData:function(a){var b=this;a.on(Vtiger_Edit_Js.recordPreSave,function(f,d){if(!b.checkLimits(a)){return false}var c=a.find("#blackSuppliesTable");c.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductUnitPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setUnitPriceValue(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(g,a){var d=this;var c=jQuery("input.sourceField",g).val();var e=g.find('.rowName input[name="popupReferenceModule"]').val();d.removeSubProducts(g);if(c=="0"||$.inArray(e,["Products","Services"])<0){return false}if(d.subProductsCashe[c]){d.addSubProducts(g,d.subProductsCashe[c]);return false}var f={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(f).then(function(i){var h=i.result;d.subProductsCashe[c]=h;d.addSubProducts(g,h);if(b){b.hide()}},function(h,i){if(b){b.hide()}})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,c){var i=this;for(var b in c){var a=c[b];var j=a.description;var e=a.unitPriceValues;var d=JSON.stringify(e);for(var g in a){k.find("input."+g).val(a[g])}var h=i.getCurrency();if(typeof e[h]!=="undefined"){i.setUnitPriceValue(k,e[h])}$("input.unitPrice",k).attr("list-info",d);$("textarea.commentTextarea",k).val(j);i.showIndividualTax(k)}if(f==="Products"){i.loadSubProducts(k,true)}this.quantityChangeActions(k)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".discountParam").val(JSON.stringify(c))},saveTaxsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(b.taxMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".taxParam").val(JSON.stringify(c))},showExpandedRow:function(e){var d=this;var c=d.getSupTableContainer();var b=c.find('[numrowex="'+e.attr("numrow")+'"]');var a=e.find(".toggleVisibility");a.data("status","1");a.find(".glyphicon").removeClass("glyphicon-menu-down");a.find(".glyphicon").addClass("glyphicon-menu-up");b.removeClass("hide");d.loadCkEditorElement(b.find(".ckEditorSource"))},hideExpandedRow:function(f){var e=this;var d=e.getSupTableContainer();var c=d.find('[numrowex="'+f.attr("numrow")+'"]');var b=f.find(".toggleVisibility");b.data("status","0");b.find(".glyphicon").removeClass("glyphicon-menu-up");b.find(".glyphicon").addClass("glyphicon-menu-down");c.addClass("hide");var a=CKEDITOR.instances[c.find(".ckEditorSource").attr("id")];if(a){a.destroy()}},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},initTaxParameters:function(d,a){var c=this;var b=d.find(".taxParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.taxMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateTax(d,a)},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#suppliesLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"CheckLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#suppliesLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide()});return a},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackSuppliesTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.find("tr").appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.registerAutoCompleteFields(m);c.initRow(m)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(c,d){a.find(b.rowClass).each(function(e,f){var g=$(f);b.hideExpandedRow(g)});d.item.startPos=d.item.index()},stop:function(d,e){var c=$(e.item.context).attr("numrow");var f=a.find(".numRow"+c).remove().clone();a.find('[numrow="'+c+'"]').after(f);if(e.item.startPos.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background:0}.navbar-default .navbar-nav>li:hover{background:#e7e7e7}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background:0}.navbar-inverse .navbar-nav>li:hover{background:#080808}.navbar-nav .hovernav:hover>.dropdown-menu{display:block}#collapsedMenu{display:block;position:relative}#collapsedMenu a{color:#fff}#collapsedMenu .dropdown-menu .shortDropdown{max-height:300px;overflow-y:scroll;padding:10px;position:relative;z-index:10000;-webkit-overflow-scrolling:touch;-webkit-transform:translateZ(0)}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames{margin-bottom:2px}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a{font-size:.9em;padding:3%!important;color:#2b2b2b!important}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a:hover{text-decoration:none;background:#404952;color:#fff!important}.moreMenus{width:52em;padding:24%;left:0;border-radius:2px}.moreMenus.leftAligned:after,.moreMenus.leftAligned:before{left:21px!important}.moreMenus strong{font-size:1.1em;color:#2b2b2b}.moreMenus:after,.moreMenus:before{left:292px!important}.announcement{// display:none;background:#fafad2;// padding:2px 0;// border-bottom:1px solid #ccc;// max-height:24px;// width:100%}.announcement .marStyle{// width:100%}#headerLinks{padding:10px 0 7px;min-width:240px;float:right!important}#headerLinks .headerLinksContainer{margin-right:10px}#headerLinks .headerLinksContainer>[class*="span"]{float:left;margin-left:15px}#headerLinks .headerLinksContainer .dropdown.open .dropdown-toggle{background:transparent}#headerLinks .headerLinksContainer ul.dropdown-menu{top:30px}#headerLinks .headerLinksContainer ul.dropdown-menu:after,#headerLinks .headerLinksContainer ul.dropdown-menu:before{right:15px;left:auto}#headerLinks .headerLinksContainer>span a img,#headerLinks .headerLinksContainer>span a.userName{color:#fff;cursor:pointer;text-decoration:none!important}#headerLinks .headerLinksContainer>span a img .caret,#headerLinks .headerLinksContainer>span a.userName .caret{border-top:4px solid #fff}.dropdown-menu.pull-right{right:0;left:auto;cursor:pointer}.themeMenuContainer{min-width:110px;width:110px;left:-84px!important;padding:10px 0}.themeMenuContainer .themeMenu{padding:0 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement{cursor:pointer;margin:5px;height:20px;width:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement:hover{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}.themeMenuContainer .themeMenu .themeSelected{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}@media screen and (min-width:1161px){#mediumNav,#shortNav,#headerLinksCompact{display:none}#largeNav{margin-left:10px;margin-right:0}}@media screen and (max-width:1160px) and (min-width:960px){.companyLogo{width:100%}.customFilterMainSpan .select2-container{width:300px!important}*{zoom:1!important}}@media screen and (max-width:960px){.bodyContents{margin:0!important}#centerPanel{width:100%!important}.col-md-3#headerLinks{padding:5px 5px 0}.menuBar .col-md-9,.col-md-3#headerLinks{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-width:80px}.menuBar .col-md-9 .qCreate,.col-md-3#headerLinks .qCreate{display:inline-block;margin:0}.menuBar .col-md-9 .qCreate img,.col-md-3#headerLinks .qCreate img{margin-bottom:3px;margin-right:5px}.menuBar .col-md-9 .qCreate ul li.title,.col-md-3#headerLinks .qCreate ul li.title{padding:5px 0 0 15px}.menuBar .col-md-9 li.tabs:first-child>a,.col-md-3#headerLinks li.tabs:first-child>a{padding:10px 12px 9px}.customFilterMainSpan .select2-container{width:300px!important}#quickCreateModules{width:100%!important;padding:0!important}.CompactQC{max-height:300px;overflow-y:scroll;overflow-x:hidden}.CompactQC a:hover{text-decoration:none}}.commonActionsContainer .quickActions{height:3em}.commonActionsContainer .quickActions img{height:60%;margin:40% auto}.commonActionsContainer .quickActions #companyLogo-container img{height:98%;margin:0 auto}.commonActionsContainer .actionsContainer{background:#f3f3f3}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown{min-width:715px;top:28px;margin:0;padding-top:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a{padding:2px;border:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mainContainer{min-height:500px;margin-top:103px;background:#eeeff2;min-width:1200px}.mainContainer>.col-md-2{// padding:0 1.06383%;height:auto!important;// min-width:174px}.mainContainer .contentsDiv{min-height:500px;background:#fafafb;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;border-left:1px solid #e6e6e6;position:relative}.mainContainer #leftPanel{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.toggleButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;left:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-left:0;display:inline-block}.toggleButton .glyphicon-chevron-left{background-position:-434px -72px!important}.toggleButton .glyphicon-chevron-right{background-position:-460px -72px!important}.toggleRightPanelButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;right:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-right:0;display:inline-block}.quickLinksDiv{margin:10px 0}.quickLinksDiv p{font-size:1.2em;padding:3% 0 0 6%;height:40px;cursor:pointer;box-shadow:0 0 0 1px #ddd;border-top:1px solid #fff!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);position:relative;border-radius:2px}.quickLinksDiv p a{color:#2b2b2b}.quickLinksDiv p a:hover{text-decoration:none}.quickLinksDiv p.selectedQuickLink{background-color:#2a2f35;background-image:-moz-linear-gradient(top,#2a2f35,#2a2f35);background-image:-ms-linear-gradient(top,#2a2f35,#2a2f35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#2a2f35),to(#2a2f35));background-image:-webkit-linear-gradient(top,#2a2f35,#2a2f35);background-image:-o-linear-gradient(top,#2a2f35,#2a2f35);background-image:linear-gradient(top,#2a2f35,#2a2f35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2a2f35',endColorstr='#2a2f35',GradientType=0);border-color:#2a2f35 #2a2f35 #08090a;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);background-image:none;position:relative;border:1px solid #fff;box-shadow:4px 0 3px -4px #000 inset}.quickLinksDiv p.selectedQuickLink a{color:#fff}.quickLinksDiv p.selectedQuickLink a:after{border-bottom:19px solid rgba(0,0,0,0);border-left:10px solid #2a2f35;border-top:19px solid rgba(0,0,0,0);content:" ";display:inline-block;position:absolute;left:100%;top:0}.quickWidgetContainer li a{overflow:hidden;white-space:normal;padding:5px;margin:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.quickWidgetContainer .quickWidget{margin-bottom:10px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.sidebarTitleBlock{padding:12px 0}.sidebarTitleBlock a{color:#373737!important}.sidebarTitleBlock a:hover{text-decoration:none}#selectAllMsgDiv,#deSelectAllMsgDiv{display:none;background-color:#fafad2;padding:.01%;text-align:center}.blockUI form,#globalmodal form{margin:0}.dashboardHeading h2{padding-bottom:8px}.dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardHeading .dropdown-menu{left:-70px;right:0}.dashboardContainer{padding:0}.dashboardContainer .dashboardHeading{padding:10px 0 0;background:#f5f5f5}.dashboardContainer .dashboardHeading h2{padding:0 0 8px 20px}.dashboardContainer .dashboardHeading .btn-toolbar{padding:3px 20px 0 0}.dashboardContainer .dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardContainer .dashboardHeading .dropdown-menu{left:-82px}.widgetsList{max-height:400px;overflow-y:auto;overflow-x:hidden}.widgetsList li{display:block}.widgetsList li a{white-space:normal;word-wrap:break-word}.dashboard_notebookWidget_view .row{margin-bottom:5px}.gridster{margin-left:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.gridster ul{width:auto;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:460px}.gridster ul{list-style:none}.gridster ul li.dashboardWidget{background:#fff;border-radius:1px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.gridster ul li.dashboardWidget .dashboardWidgetHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd;color:#444;cursor:move;padding:5px}.gridster ul li.dashboardWidget .dashboardWidgetHeader table{height:28px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .dashboardTitle{text-align:left;padding-left:10px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .widgeticons{opacity:.5;padding-right:6px}.gridster ul li.dashboardWidget .filterContainer{position:absolute;border:1px solid #ddd;background:#fff;margin-left:-7px;margin-right:3px;margin-top:4px;padding:8px 0;border-radius:0 0 5px 5px;box-shadow:0 5px 8px -5px #888}.gridster ul li.dashboardWidget .filterContainer div span{margin-top:6px}.gridster ul li.dashboardWidget .filterContainer .col-md-5{margin-top:3px}.gridster ul li.dashboardWidget .dashboardWidgetContent{padding:10px 0;line-height:20px}.gridster ul li.dashboardWidget .dashboardWidgetContent .dashboard_notebookWidget_viewarea{height:200px}.gridster ul li.dashboardWidget .widgeticons{min-width:50px;height:30px;margin-right:30px}.gridster ul li.dashboardWidget .widgeticons a{cursor:pointer;text-decoration:none}.gridster ul .widgetChartContainer{margin-left:10px}.listViewPageDiv{margin:11px 0}.customFilterMainSpan{width:100%}.customFilterMainSpan .select2-container{width:95%!important}.select2-container .select2-choice{border-radius:2px;background:#fff;border-color:#ddd;font-size:14px;letter-spacing:.01em;color:#2b2b2b}.select2-container .select2-choice div{border-radius:0;border-left:0;background:#fff}.select2-drop{border-color:#ddd}.select2-dropdown ul.filterActions{list-style:none!important;padding-left:15px}.select2-dropdown ul.filterActions li{cursor:pointer}.ui-autocomplete .ui-menu-item #ui-active-menuitem{background:#404952;border-radius:0}li.ui-timepicker-selected,.ui-timepicker-list li:hover,.ui-timepicker-list:hover .ui-timepicker-selected:hover{background:#404952}#relatedTabOrder .select2-input{min-width:200px}.alphabetSorting .alphabetSearch a{vertical-align:middle;display:inline-block;margin-bottom:2px}.alphabetSorting .alphabetSearch:hover{background:#eeeff2}.listViewActions .settingsIcon{display:inline-block;margin-left:5px}.listViewActions>.btn-group{min-width:105px}#listViewPageJumpDropDown,#relatedListPageJumpDropDown{left:-60px}.pageNumbers{display:inline-block;margin-right:5px;margin-top:6px;vertical-align:top}.pageNumbers .totalNumberOfRecords{margin:0 5px}.contents-topscroll,#reportDetails{overflow-x:auto!important;overflow-y:visible}.contents-bottomscroll{overflow-x:auto!important}.bottomscroll-div,.topscroll-div{display:table;min-width:100%}.listViewLoadingImageBlock{background:0;border-radius:0;box-shadow:none;text-align:center}.detailViewContainer{padding:0 20px}.userPreferences .contents{padding-left:0!important}.userPreferences .details{border-right:0!important}.detailViewTitle{padding:1% 0 0 1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .recordLabel{font-size:16px;font-weight:bold}.detailViewTitle .detailViewButtoncontainer{margin-top:8px}.detailViewTitle .detailViewPagingButton{margin-top:8px;padding-right:10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .btn-toolbar{margin:0}.detailview-table th,.detailview-table td{vertical-align:middle}.detailview-table th label,.detailview-table td label{margin-bottom:3px}.detailViewInfo{box-shadow:0 -4px 4px -4px #959595;margin-top:5px}.detailViewInfo .details{// min-height:600px;padding-right:1.5%;border-right:4px solid #404952;padding-bottom:10px;padding-top:10px}.detailViewInfo .related .nav-pills .active>a,.detailViewInfo .related .nav-pills .active>a:hover{background:#404952;border-radius:1px;margin-top:0;margin-bottom:2px}.fieldLabel{width:20%;background:#f7f7f9}.fieldLabel label.marginRight10px{text-align:right}.summaryView{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.summaryView .summary-table tr.summaryViewEntries:last-child .fieldValue,.summaryView .summary-table tr.summaryViewEntries:last-child .fieldLabel{border-bottom:1px solid #ddd}.summaryView .summaryViewEntries .fieldLabel{vertical-align:top;padding:5px 0 5px 5%;border-top:1px solid #ddd;border-right:1px solid #ddd}.summaryView .summaryViewEntries .fieldValue{vertical-align:top;padding:5px 0 5px 5px;border-top:1px solid #ddd}.summaryView .summaryViewEntries:hover .summaryViewEdit{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryView .summaryViewEntries .summaryViewEdit{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryView .toggleViewByMode{margin:8px 0;padding-right:0}.summaryView .toggleViewByMode .changeDetailViewMode{white-space:normal!important}.summaryWidgetContainer{border-radius:2px;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border:1px solid #eaeaea;background:#fff;margin-bottom:10px;padding:15px}.commentContainer .commentTitle{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;margin-bottom:10px}.commentContainer .commentTitle textarea{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordDetails .squeezedWell{padding:3% 0;min-height:105px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordEditView .contentHeader{padding:.5% 0 1% 0}.recordEditView .table .fieldLabel,.recordEditView .table .fieldValue{vertical-align:middle}.recordEditView .table tbody tr:hover td,.recordEditView .table tbody tr:hover th{background:#f7f7f9}.commentContainer{border-radius:2px}.commentContainer hr{margin:0!important}.commentContainer .addCommentBlock .commentsControls{display:inline-block}.commentContainer .commentsList>.liStyleNone>.commentDetails .commentDiv{width:100%}.commentContainer .commentDetails{background:#fff;border:1px solid #ddd;margin-bottom:5px;border-radius:2px;padding:10px 10px 5px;display:inline-block;min-width:354px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentContainer .commentorInfo p{margin-bottom:0}.commentContainer .addCommentBlock{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border:1px solid #ddd;padding:12px 12px 5px;min-height:115px;margin-top:15px;display:block}.commentContainer .addCommentBlock .commentcontent{padding:8px!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;resize:none}.commentContainer .commentInfoContent{padding:1px 0;word-wrap:break-word}.commentTitle .col-md-1{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentTitle .col-md-1 img{width:32px;height:32px}.commentsList>ul{margin-left:0}.singleComment .editedStatus{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:5px 0 5px 32px}.singleComment .editedStatus p{margin-bottom:0}.singleComment .commentActionsDiv{display:none}.singleComment .commentActionsDiv p{margin-bottom:0}.singleComment:hover .commentActionsDiv{display:block;margin-bottom:3px}.recentComments{margin:0;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recentComments .commentDiv{min-width:100%}.recentComments .addCommentBlock{border:0;margin-top:0;display:block}.recentComments .commentDetails{display:block}.singleComment:hover .commentActions .replyComment{display:inline-block}.commentActionsContainer a:hover{text-decoration:none}.commentActionsContainer .editStatus{padding:5px 2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentActionsContainer .editStatus p{margin-bottom:0}.table{background:#fff}.table-bordered{border-radius:1px;margin-bottom:0}.table-bordered th{border-top:1px solid #fff!important}.table th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;color:#444}.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td,.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td{border-left:0;border-right:0}.listViewEntriesTable tbody tr td:first-child{border-left:0 none}.equalSplit td:nth-child(odd){width:20%}.equalSplit td:nth-child(even){width:30%}td.fieldValue input,td.fieldValue .input-group{margin-bottom:0}.actionImage,.actionImages{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.listViewHeaders a{color:#444}.listViewEntriesDiv .listViewHeaders th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd}.listViewEntriesDiv,.listViewEntriesDiv td{overflow:visible}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues{color:#444}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues:hover{text-decoration:none}.listViewEntriesTable td.listViewEntryValue,.listViewEntries td{vertical-align:middle;cursor:pointer;overflow:visible;padding:5px}.listViewEntriesTable td.listViewEntryValue:hover .actionImages,.listViewEntries td:hover .actionImages,.listViewEntriesTable td.listViewEntryValue:hover .actions,.listViewEntries td:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryViewEntries .summaryViewEdit,.activityStatus .editStatus,.activityDescription .editDescription,.addedCalendars .actionImage{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryViewEntries:hover .fieldValue .summaryViewEdit,.activityStatus:hover .editStatus,.activityDescription:hover .editDescription,.addedCalendars:hover .actionImage{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewEntriesTable tr:hover td .actions .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewBasicAction.dropdown-menu{width:100%}.listViewBasicAction.dropdown-menu input{border-radius:2px;height:24px;margin-bottom:0;margin-top:-2px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.emptyRecordsDiv{width:100%;border:1px solid #ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.emptyRecordsDiv td{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.CustomFilterViewTitle{padding-top:1%}#CustomView .filterActions{padding-bottom:20px;overflow:hidden}.filterConditionsDiv{padding-bottom:0}.conditionGroup .header{margin-bottom:20px;font-size:1.2em}.conditionGroup .contents .conditionRow{margin-bottom:10px}.conditionGroup .contents .conditionRow select,.conditionGroup .contents .conditionRow input{width:90%}.conditionGroup .contents .conditionRow .chzn-results li{line-height:20px}.conditionGroup .deleteCondition{vertical-align:bottom}.searchUIBasic{border-collapse:separate!important;border-spacing:10px!important;margin:0 10%}.searchUIBasic .importContents{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.searchUIBasic .listRow .listViewHeaders>td{color:#404952}.searchUIBasic .listRow .defaultInputTextContainer{max-width:87%!important;margin-bottom:0!important}#lineItemTab.table tr:first-child:hover th ~ td{background-color:#f3f3f4;background-image:-moz-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-ms-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f3f3f4),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-o-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:linear-gradient(top,#f3f3f4,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f4',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}#lineItemTab.table tr:nth-child(2):hover td{background:0}.lineItemTable tr td{width:0}.lineItemTable tr td div.finalDiscountUI,.lineItemTable tr td div.discountUI,.lineItemTable tr td div#shipping_handling_div,.lineItemTable tr td div.taxUI,.lineItemTable tr td div.finalTaxUI{border:2px solid #c4c4c4;border-radius:2px}.lineItemTable tr td div.finalDiscountUI table tr td,.lineItemTable tr td div.discountUI table tr td,.lineItemTable tr td div#shipping_handling_div table tr td,.lineItemTable tr td div.taxUI table tr td,.lineItemTable tr td div.finalTaxUI table tr td,.lineItemTable tr td div.finalDiscountUI table tr th,.lineItemTable tr td div.discountUI table tr th,.lineItemTable tr td div#shipping_handling_div table tr th,.lineItemTable tr td div.taxUI table tr th,.lineItemTable tr td div.finalTaxUI table tr th{border-left:0}.lineItemTable tr:hover td{width:0}.lineItemTable tr:hover td div.finalDiscountUI table tr td{background:none!important}.lineItemTable tr:hover td div.discountUI table tr td{background:none!important}.lineItemTable tr:hover td div#shipping_handling_div table tr td{background:none!important}.lineItemTable tr:hover td span.taxDivContainer div table tr td{background:none!important}.lineItemTable tr:hover td div.finalTaxUI table tr td{background:none!important}.lineItemResult{width:70.5%!important}.lineItemResult a:hover{color:#404952}.lineItemInputBox{width:45%;float:right;text-align:right}.discountUI,.taxUI,.finalDiscountUI,.finalTaxUI,#shipping_handling_div{position:absolute;left:46%;width:30%;z-index:500;box-shadow:1px 0 7px #ddd;border-radius:6px}.discountUI table.table,.taxUI table.table,.finalDiscountUI table.table,.finalTaxUI table.table,#shipping_handling_div table.table{margin-bottom:0}.discountUI .table tbody tr:first-child th:first-child,.taxUI .table tbody tr:first-child th:first-child,.finalDiscountUI .table tbody tr:first-child th:first-child,.finalTaxUI .table tbody tr:first-child th:first-child,#shipping_handling_div .table tbody tr:first-child th:first-child{border-radius:4px 0 0 0!important}.discountUI .table tbody tr:first-child th:last-child,.taxUI .table tbody tr:first-child th:last-child,.finalDiscountUI .table tbody tr:first-child th:last-child,.finalTaxUI .table tbody tr:first-child th:last-child,#shipping_handling_div .table tbody tr:first-child th:last-child{border-radius:0 4px 0 0!important}.LineItemDirectPriceReduction{width:65%!important}th.htColHeader,.handsontable thead th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd;padding:6px 2px}.contentHeader{padding:15px;padding-left:5px;line-height:20px}.contentsDiv>div{padding:0 20px}#settingsQuickWidgetContainer .widgetContainer.accordion-body{border-bottom:none!important;border-bottom:3px solid #ddd}#settingsQuickWidgetContainer .widgetContainer.accordion-body>div:hover{background:#eeeff2}#settingsShortCutsContainer{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:1% 3%}#settingsShortCutsContainer .moduleBlock{min-height:60px}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin{display:inline-block;opacity:.4}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin:hover{opacity:.8}.settingsIndexPage .settingsSummary{text-align:center;margin-top:10px}.settingsIndexPage .settingsSummary a{display:inline-block;background:#f3f3f4;color:#444;border-radius:2px;min-width:200px;padding:20px 0 10px;border:1px solid #ddd}.settingsIndexPage .settingsSummary a .summaryText{display:inline-block;margin-top:20px;font-size:15px}.settingsIndexPage .settingsSummary a:hover .summaryText,.settingsIndexPage .settingsSummary a:hover .summaryCount{color:#404952}.settingsIndexPage .moduleBlock h5{font-size:1.2em;margin-bottom:5px}.settingsIndexPage .moduleBlock:hover{background:#f3f3f4}#userPageHeader{padding:8px 0 0}#userPageHeader #userHeading h3{margin-top:10px}.treeView li{border-left:4px solid #ddd;list-style:none;padding-top:15px}.treeView li .toolbar-handle{margin-left:10px;position:relative}.treeView li .toolbar-handle .btn{margin:0}.treeView li .toolbar-handle a:before{background:none repeat scroll 0 0 #ddd;content:" ";display:inline-block;height:4px;left:-10px;position:absolute;top:12px;width:10px}.treeView .btn{margin-bottom:10px}.profilesEditView tr.blockHeader th{text-align:center}.profilesEditView tr.blockHeader th:first-child{text-align:left}.profilesEditView input{margin-right:5px}.profilesEditView tr td.row table.table{border-left:none;margin-bottom:20px}.profilesEditView tr:hover td.row{background:0}.profilesEditView tr:hover td.row table.table tr td{background:0}.profilesEditView tr:hover td.row table.table tr:hover td{background:0}.profilesEditView tr:hover td.row table.table td{background:#f3f3f4}#s2id_memberList li>div,.groupMembersColors li>div{margin-left:10px}#s2id_memberList .Users,.groupMembersColors .Users{background-color:#f99984!important;padding:5px;margin-bottom:2px;background-image:none}#s2id_memberList .Groups,.groupMembersColors .Groups{background-color:#acd5ff!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .Roles,.groupMembersColors .Roles{background-color:#ffec98!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .RoleAndSubordinates,.groupMembersColors .RoleAndSubordinates{background-color:#c4dea2!important;background-image:none;padding:5px;margin-bottom:2px}.collectiveGroupMembers{border:1px solid #ddd;border-top:0}.collectiveGroupMembers ul{padding:0;margin:0}.collectiveGroupMembers ul li{padding:4px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.collectiveGroupMembers ul li a{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;margin:0}.collectiveGroupMembers ul li.groupLabel{background-color:#f3f3f4;border-bottom:1px solid #ddd;border-top:1px solid #ddd;padding:10px 5px;margin:0;color:#444}.mini-slider-control{width:50px}.mini-slider-control+div{margin-left:15px}.mini-slider-control .ui-slider-handle{border:0;border-radius:50%;height:16px;top:-2px;width:16px;cursor:pointer}.mini-slider-control .ui-slider-handle:focus{outline:0}.ui-widget-content{border-radius:6px;border-color:#fff;box-shadow:0 0 3px -1px inset;margin-top:2px;margin-left:5px;height:12px}.ui-slider-disabled{opacity:.5;border-color:#ddd;box-shadow:none;cursor:not-allowed}.ui-slider-disabled .ui-slider-handle{cursor:not-allowed}.ui-slider-disabled+div{opacity:.5;cursor:not-allowed}.mini-slider-control[data-value="0"] .ui-slider-handle{background:#7d7e7d;background:-moz-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#7d7e7d),color-stop(100%,#0e0e0e));background:-webkit-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-o-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-ms-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:linear-gradient(to bottom,#7d7e7d 0,#0e0e0e 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7d7e7d',endColorstr='#0e0e0e',GradientType=0)}.mini-slider-control[data-value="1"] .ui-slider-handle{background:#ffb76b;background:-moz-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ffb76b),color-stop(0%,#ffa73d),color-stop(49%,#ff7c00),color-stop(100%,#ff7f04));background:-webkit-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-o-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-ms-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:linear-gradient(to bottom,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffb76b',endColorstr='#ff7f04',GradientType=0)}.mini-slider-control[data-value="2"] .ui-slider-handle{background:#bfd255;background:-moz-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#bfd255),color-stop(79%,#8eb92a),color-stop(100%,#72aa00),color-stop(100%,#9ecb2d));background:-webkit-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-o-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-ms-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:linear-gradient(to bottom,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bfd255',endColorstr='#9ecb2d',GradientType=0)}#moduleManagerContents{padding-bottom:10px}#moduleManagerContents .moduleManagerBlock .btn-group.open .dropdown-menu{left:-144%}#moduleManagerContents .modulesTable td{width:50%}#importModules .contents .row{margin-bottom:2.2%}.extensionWidgetContainer{background-color:#fff;border:1px solid #ddd;min-height:200px;padding:2%;background:#fafafa;box-shadow:0 0 10px -4px #777}.extensionWidgetContainer .extension_contents{margin-top:2%;background:#fff;padding:10px;box-sizing:border-box;max-height:160px}.extension_contents:hover{border-radius:4px}.thumbnailImage{height:130px;width:130px;float:right}.extensionWidgetContainer .extension_contents .slimScrollDiv{padding-right:10px}.extensionWidgetContainer .extension_header .font-x-x-large{font-size:1.5em;padding-left:3px;font-weight:bold;color:#404952}.extensionWidgetContainer .extensionDescription{line-height:20px}.extensionWidgetContainer .extensionInfo{padding-top:5px}.extensionWidgetContainer .extensionInfo .rating,.extensionDetails .rating{vertical-align:middle;margin-top:2px;display:inline-block}.extensionDetails .authorInfo{margin:3px 0}.extensionDetails .extensionDetailActions{padding:15px 0}.extensionWidgetContainer .tab-pane .bx-wrapper .imageSlider{margin:0}.sliderImage{width:90%;height:360px}.opacity .actions{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.opacity:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.sharingAccessDetails{margin-bottom:30px}.sharingAccessDetails td,.sharingAccessDetails th{text-align:center;vertical-align:middle!important}.sharingAccessDetails tr td:first-child,.sharingAccessDetails tr th:first-child{text-align:left}.sharingAccessDetails td.row>div{display:block}.sharingAccessDetails .customRuleContainer:hover{background:0}.sharingAccessDetails hr{border-bottom:1px solid #bcbcbc}.sharingAccessDetails .title{padding:1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.sharingAccessDetails .title .rulehead{padding-top:5px}.sharingAccessDetails .customRuleEntries:hover .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.layoutContent{border-top:4px solid #404952}.layoutContent #moduleBlocks .editFieldsTable{margin-bottom:20px}.layoutContent #moduleBlocks .editFieldsTable .fieldLabel{background:0}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockLabel{padding-top:13px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group{margin-top:5px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group .dropdown-menu{left:-100%}.layoutContent .relatedTabModulesList{padding:2% 1%}.fieldDetailsForm .search-choice-close{padding:0}.border1px{border:1px solid #ddd}.blockFieldsList .opacity{margin-left:.5%!important}.blockFieldsList .opacity .dropdown-menu a{padding:0!important}.blockFieldsList .opacity a.dropdown-toggle.editFieldDetails{box-shadow:none}.blockFieldsList .editFields .dropdown-menu{z-index:1000003;padding:0;left:-215px;position:absolute}.blockFieldsList .editFieldsWidget .dropdown-menu{z-index:1000003;padding:0;left:-315px;position:absolute}.blockFieldsList .editFields .dropdown-menu .modal-header{border-width:0;border-bottom-width:1px}.blockFieldsList .editFields .dropdown-menu .modal-header .cancel{padding-right:0;font-weight:bold}.blockFieldsList .editFields:hover{background:#f3f3f4!important}#modulePickListValuesContainer .layoutContent{padding-left:2%}#modulePickListValuesContainer .layoutContent .selectedCell,#modulePickListValuesContainer .layoutContent .selectedListItem{background:#a5afb9;white-space:nowrap}#modulePickListValuesContainer .layoutContent .pickListValue{cursor:pointer}.nonEditableValuesDiv .nonEditablePicklistValues{margin-left:0}.nonEditableValuesDiv .nonEditablePicklistValues li{padding:3px 15px;margin-bottom:2px;background:#e0f2ff}.popover{z-index:1000023!important}.popover-content .fieldLabel{width:35%;white-space:normal}#dependencyGraph .tableHeading{text-align:center;padding-top:30px;font-size:1.2em;font-weight:bold}#dependencyGraph .depandencyTable{border:1px solid #ddd;background:#f3f3f4}#dependencyGraph .depandencyTable .blockHeader{border-bottom:1px solid #ddd}#dependencyGraph .depandencyTable .picklistValueMapping{border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping{text-align:center;border-left:1px solid #ddd;border-right:1px solid #ddd;background:#fff}#dependencyGraph .dependencyMapping .mCSB_container{margin-bottom:16px!important}#dependencyGraph .dependencyMapping .pickListDependencyTable{border:0}#dependencyGraph .dependencyMapping .pickListDependencyTable .blockHeader th{background:#f3f3f4;border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping .pickListDependencyTable .selectedCell{background:#a5afb9}.webformFieldInfo{margin-bottom:250px}.targetFieldsTableContainer input[type="text"]{min-width:100px}#customRecordNumbering.table thead th{vertical-align:middle}.addMailBoxBlock{margin-left:83px;padding:0!important;font-size:12px}.addMailBoxStep{background:#fff;padding:30px 0;border:1px solid #ddd;border-radius:1px;min-height:170px}.mailConveterDesc{height:350px;width:96%;border:1.5px solid;border-radius:2px;border-color:#ddd;font-size:11pt;margin-top:55px;margin-left:20px;background:#fff}#mailBoxLabel{margin-top:15px;margin-left:-18px;font-size:12pt;width:75px}.mailBoxDropdownWrapper{height:49px;width:70%;background:url('../images/mailbox-icon.png') no-repeat 5px 5px;overflow:hidden;border:1px solid #ddd}.mailBoxDropdown{background:transparent url('../images/downArrowBlue.png') no-repeat 236px 13px;width:110%;height:50px;font-size:14pt;color:#0065a6;padding:10px 55px;padding-right:0}#mailConverterDragIcon{margin-top:12px}#mailConverterBody{padding-top:20px;margin-left:0}.ruleHead{padding:6px 0;background:#d8d8dc}.mailConverterRuleBlock{font-size:14px;line-height:30px;border:1.5px solid;border-color:#ddd}.mailConverterRuleLegend{font-size:14px;color:#0065a6;margin-bottom:10px;background:#f3f3f4}#mailConverterStats{font-size:10pt;margin-top:5px;margin-left:-10px}.addMailBoxBlock{border-color:#ddd;margin-left:83px;margin-top:20px;padding-top:30px;padding-left:200px;padding-bottom:20px;padding-right:30px;font-size:11pt}.taskTypeUi>.row{margin:10px 0}#taskListContainer .listViewEntriesTable tr td:last-child{border-left:1px solid #ddd}#workflow_step2>.row{padding:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:400px}#open_email_con .detailViewTitle{padding:0}#open_email_con .detailViewTitle .detailViewPagingButton{margin-top:0;padding-right:0}#foldersList .list-group{padding-right:0}.massEditTable th+th,.massEditTable td+td,.massEditTable th+td,.massEditTable td+th{border-left:0}.nav.massEditTabs{margin-bottom:0;border-bottom:0}.nav.massEditTabs li.active a{background:#404952;color:#fff;margin-left:10px}.nav.massEditTabs li a:hover{border-bottom:1px solid #404952}.massEditContent{border-top:3px solid #404952}.calendarSettingsContainer{width:700px}.calendarSettingsContainer .control-label{width:26%}#calendarSettings{margin:1px 0 3px}.calendarMassEdit{min-width:400px}.fc-state-default .fc-button-effect{top:100%!important}.fc-event-style1,.fc-event-style1 .fc-event-skin{background:#17309a;border-color:#17309a;font-weight:normal;text-shadow:none}.fc-event-style2,.fc-event-style2 .fc-event-skin{background:#3a87ad;border-color:#3a87ad;font-weight:normal;text-shadow:none}.fc-event-style3,.fc-event-style3 .fc-event-skin{background:#aa6705;border-color:#aa6705;font-weight:normal;text-shadow:none}.fc-event-style4,.fc-event-style4 .fc-event-skin{background:#953b39;border-color:#953b39;font-weight:normal;text-shadow:none}.fc-event-style5,.fc-event-style5 .fc-event-skin{background:#545252;border-color:#545252;font-weight:normal;text-shadow:none}.fc-event-style6,.fc-event-style6 .fc-event-skin{background:#87865d;border-color:#87865d;font-weight:normal;text-shadow:none}.fc-event-style7,.fc-event-style7 .fc-event-calendarMassEditskin{background:#c71585;border-color:#c71585;font-weight:normal;text-shadow:none}.fc-event-style8,.fc-event-style8 .fc-event-skin{background:#006400;border-color:#006400;font-weight:normal;text-shadow:none}#calendarview th{color:#000}.fc-agenda-divider+div{overflow-y:visible!important}.fc-button{display:inline-block;padding:6px .4em!important;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.fc-button:active .fc-button-inner{background:transparent}.fc-button:active .fc-button-inner .fc-button-content{color:#fff}.fc-button.fc-state-active .fc-button-inner .fc-button-content,.fc-button:active .fc-button-inner .fc-button-content{color:#000!important;background:transparent;background-image:none}.fc-header-title h2{font-size:15px;line-height:20px}.fc-widget-header th{padding:4px 0!important}.fc-widget-header{color:#666;background:#eee;border-color:#ccc}.fc-content{background:#fff;margin-top:15px}.fc-content td:hover{background:#f3f3f3}.btn:focus{outline:0}.reminderPostpone.btn-primary{background:#404952}.reminderPostpone.btn-primary:hover{background:#1e2327}.saveButton{margin-right:5px}.addCustomRule{float:right}.importMore{background:#fff}.lastImport{background:#fff}.undoImport{background:#da4f49}.close{border:0;background:none repeat scroll 0 0 transparent;border:0 none;cursor:pointer}.resetButton{margin-top:0!important}.vtGlyph{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("../images/vtGlyph.png");background-position:0 0;background-repeat:no-repeat;*margin-right:.3em}.vticon-pageJump{background-position:0 0}.vticon-call-inbound{background-position:-14px 0}.vticon-call-outbound{background-position:-28px 0}#massEdit .cancelLinkContainer{padding:5px 0;margin-left:.5em}.ui-pnotify{z-index:1000023}.feedback{z-index:10002}.feedback .handle{z-index:10003;display:block;position:fixed;bottom:50px;left:-30px;left:0\9;bottom:100px\9;background:#2c2c2c;color:white;padding:7px 15px;border:1px solid gray;text-decoration:none;outline:0;-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-o-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg);-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.00000000, M12=1.00000000, M21=-1.00000000, M22=0.00000000,sizingMethod='auto expand')";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0,M12=1,M21=-1,M22=0,sizingMethod='auto expand')}.feedback .handle:hover{text-decoration:none}.vtFooter{text-align:center}.vtFooter p{background:#404952;color:#fff;border-top:1px solid #ddd;padding:1px 0;font-size:.9em;margin-bottom:0}.vtFooter p a{color:#fff}.imageHolder{background:url('../images/loadback.png') repeat-y;background-position:center;padding:10px 0}.breadcrumbContainer{padding:2% 2% 0 2%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;height:auto}.breadcrumb{display:inline-block;height:auto;height:40px}.crumbs{height:40px;margin:0;padding:0 20px 0 0;display:inline-block;font-family:sans-serif}.crumbs li:after{content:'\0000a0';width:0;height:0;border-left:18px solid #ececec;border-top:20px solid transparent;border-bottom:20px solid transparent;display:inline-block;position:relative;top:-20px;left:18px;zoom:1}.crumbs li{height:0;border-top:20px solid #ececec;border-bottom:20px solid #ececec;border-left:20px solid transparent;display:inline-block;box-shadow:0 1px #ddd;margin-right:5px}.crumbs li a{display:inline-block;float:left;margin-top:-13px;font-size:14px;font-weight:bold;color:#666;text-decoration:none}.crumbs li.active{height:0;border-top:20px solid #404952;border-bottom:20px solid #404952;box-shadow:0 1px #404952}.crumbs li.active:after{border-left:18px solid #404952!important}.stepText{display:inline-block;white-space:nowrap;overflow:hidden;font-size:13px;vertical-align:bottom}.active .stepText,.active .stepNum{color:#fff}.stepNum{display:inline-block;padding:0 5px;overflow:hidden;font-size:20px;vertical-align:top;margin-top:5px}.greyStar{background-image:url("../images/stars.png");background-position:20px 20px;height:20px;width:20px;display:inline-block}.yellowStar{background-image:url('../images/stars.png');background-position:0 20px;width:20px;height:20px;display:inline-block}.blockUI{border-radius:2px!important;border:0!important}textarea.col-md-11{width:100%!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.popover .popover-inner{border-radius:2px;font-size:.8em;box-shadow:0}.popover .popover-inner .popover-title{color:#444;font-size:15px}.popover .popover-inner .close{color:#000!important;margin-top:3px;opacity:.5!important}.popover .popover-inner .close:hover{opacity:1!important}.popover .popover-inner td{padding:3px 5px;overflow-wrap:break-word}.popover .popover-inner .detailViewInfo{margin-top:0;box-shadow:0}.popover .popover-inner .detailViewInfo .fieldLabel label{font-size:1em}#findDuplicate>.control-group{margin-bottom:0;width:400px}#moveReports .modal-body{padding:20px 40px}#composeEmailContainer{padding:0 20px}#composeEmailContainer .MultiFile-wrap{display:inline-block}#composeEmailContainer .MultiFile-intercepted .ui-wrapper{min-height:400px}#transferOwnershipContainer .select2-container.select2-container-multi{max-width:220px}.fieldInfo.in{overflow:visible!important;height:auto!important}.moduleSelection{border-radius:2px 2px 0 0!important;border:1px solid #ddd!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);color:#444}.convertLeadModules{margin-bottom:2%;border:1px none}.moduleBlock{border-radius:0!important}.overflowVisible{overflow:visible!important}.convertLeadError{border:3px solid #999;background-color:#fff;width:55%;position:relative;z-index:10000000}.convertLeadError table td{border-bottom:1px solid #ccc;nowrap:nowrap;width:70%}.bootbox,.alert{z-index:1000023}.chzn-container{vertical-align:middle}.chzn-container .chzn-results li{margin-right:7px}.chzn-container .chzn-results .highlighted{background:#404952}.select2-results .select2-highlighted{background:#404952}.select2-result-label i{background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.ui-autocomplete-loading{background:url('../images/load.gif') no-repeat right center}.ui-autocomplete{height:auto!important;border-radius:1px!important}.dropdown-menu.pull-right:after,.dropdown-menu.pull-right:before{right:3px;left:auto;top:-5px;border-bottom-width:6px}span.wrapper a{color:#08c!important;font-size:15px!important;font-weight:bold}a{color:#353c44}a:hover{color:#1e2327;text-decoration:none;cursor:pointer}a:active,a:focus{outline:0}.well{border-radius:2px;padding:15px}.verticalBottomSpacing{margin-bottom:10px}.mergeTables{margin-bottom:0}.font-x-x-large{font-size:18px;line-height:28px}form{margin:0}.fc-state-default .fc-button-effect span{background:0}.dateField{width:183px}.form-horizontal [class^="icon-"],.form-horizontal [class*=" icon-"]{vertical-align:baseline}.timePicker{width:8.5em!important;z-index:1000029!important}.datepicker{z-index:1000029!important}.colorpicker{z-index:1029!important}.colorpicker input{width:30px!important}.colorpicker input[type="text"],.colorpicker input{color:#898989!important}.colorpicker_hex input{width:45px!important}.modal-body.accordion{margin-bottom:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}//.modal-open{// overflow:hidden;//}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.removeNoFileChosen{color:transparent!important}.modelContainer .modal-header{border-radius:2px 2px 0 0}.modelContainer form{border-radius:0 0 2px 2px}.hide{display:none}i{cursor:pointer;text-decoration:none!important}.marginbottomZero{margin-bottom:0!important}.marginLeftZero{margin-left:0!important}.marginRightZero{margin-right:0!important}.clearfix{clear:both!important}textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%}.textOverflowEllipsis{overflow:hidden;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;//width:9em}.margin0px{margin:0!important}.padding10{padding:10px;padding-bottom:0}.padding20{padding:20px}.pushDown{margin-top:5px}.boxSizingBorderBox{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.boxSizingContentBox{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.cursorPointer{cursor:pointer;text-decoration:none!important}.zeroOpacity{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.dullOpacity{opacity:.8;-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80)}.fullOpacity{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.redColor{color:red}.highlightBackgroundColor{background:#eeeff2}.contentsBackground{background:#fff;border:1px solid #ddd}.textAlignCenter{text-align:center}.textAlignRight{text-align:right}.alignMiddle{vertical-align:middle}.alignTop{vertical-align:top}.padding1per{padding:1%}.paddingTop20{padding-top:20px}.padding20px{padding:20px}.padding-bottom1per{padding-bottom:1%}.marginBottom10px{margin-bottom:10px}.displayInlineBlock{display:inline-block}.backgroundImageNone{background-image:none}.liStyleNone{list-style:none outside none}.fontBold{font-weight:bold!important}.livesupport_tab,#userfeedback{display:none!important}#reportDetails table tr td.summary{border-bottom:0;border-top:0}#portalDetailViewHttpError{padding-bottom:7px;margin-top:50px;color:red;text-align:center}.slidesjs-pagination{list-style:none}.slidesjs-pagination li a{display:block;width:13px;height:0;padding-top:13px;background-image:url('../images/pagination.png');background-position:0 0;float:left;overflow:hidden}.slidesjs-pagination li a.active,.slidesjs-pagination li a:hover.active{background-position:0 -13px}.extensionStorebtn{background:#f08c39;background-image:-webkit-linear-gradient(top,#f08c39,#e68b3c);background-image:-moz-linear-gradient(top,#f08c39,#e68b3c);background-image:-ms-linear-gradient(top,#f08c39,#e68b3c);background-image:-o-linear-gradient(top,#f08c39,#e68b3c);background-image:linear-gradient(to bottom,#f08c39,#e68b3c);-webkit-border-radius:2;-moz-border-radius:2;border-radius:2px;text-shadow:0 0 1px #595959;color:#fff;font-size:14px;font-weight:bold;padding:8px 20px 8px 20px;text-decoration:none;border:0}.extensionStorebtn:hover{background:#fc9f3c;background-image:-webkit-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-moz-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-ms-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-o-linear-gradient(top,#fc9f3c,#f08a3c);background-image:linear-gradient(to bottom,#fc9f3c,#f08a3c);text-decoration:none}.extensionSearch{padding:8px 12px 8px 30px!important;margin:6px 0 14px 0;box-shadow:inset 2px 2px 10px #ddd;border-radius:2px!important;background:url('../images/search.png') no-repeat;background-position:5px 6px}.banner-container{border-bottom:1px solid #fff;box-sizing:border-box}.banner{margin:0 90px}.bx-wrapper{margin:0 auto 35px!important;padding-top:17px!important}.bx-wrapper li a{display:block}.bx-wrapper a img{height:100px;width:auto;margin:0 auto}.wide,.table td.wide,.listViewEntries td.wide,td.listViewEntryValue.wide{padding:8px!important}.medium,.table td.medium,.listViewEntries td.medium,td.listViewEntryValue.medium{padding:5px 6px!important}.narrow,.table td.narrow,.listViewEntries td.narrow,td.listViewEntryValue.narrow{padding:2px 4px!important}.table thead th.narrow{vertical-align:middle}td.listViewEntryValue .row input{padding:0;margin-bottom:0}.listViewContentDiv{position:relative}.fieldLabel .pull-right{text-align:right}#tagRecordText{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;width:80%!important}#tagRecord{margin-left:5px!important}.tag{float:right!important}.cut-string{text-overflow:ellipsis;-o-text-overflow:ellipsis;-webkit-text-overflow:ellipsis;width:200px;white-space:nowrap;overflow:hidden}.paddingLRZero{padding-left:0;padding-right:0}.paddingRightZero{padding-right:0}.detailViewToolbar{margin-top:5px}.input-group.input-group-sm>.input-group-addon img{width:15px}table tr td .input-sm{min-width:50px}.modal-footer.backgroundColor{background-color:#f5f5f5}.panel-title{font-size:14px}.quickWidgetContainer .panel-body{padding-bottom:0;padding-top:0}tr.summaryViewEntries,#detailView table{font-size:13px}table.listViewEntriesTable{font-size:13px;margin-top:5px}.no-margin{margin:0}.companyLogo img{max-height:200px;max-width:250px}.navbar-inverse .navbar-nav>li>a{color:#fff;padding:15px 12px}.navbar-inverse .navbar-nav .dropdown-menu>li>a{padding:3px 15px;font-size:12px}.headerCalendar .month h3{font-size:18px;font-weight:bold;margin:5px 0 0 0}.columnsSelect{width:100%!important}.marginBottom5{margin-bottom:5px}.editViewContainer .recordEditView table.blockContainer tr td.fieldValue{width:30%}.recordEditView[name=QuickCreate] .quickCreateContent table tr td.fieldValue,#massEditContainer .massEditContent table tr td.fieldValue,#tab_accounts td.functionList{width:30%}.btn{white-space:normal}.valuesAssignedToRole{border:1px solid #adadad;overflow:hidden;text-overflow:ellipsis;padding:6px}table.dataTable .form-control{width:100%!important}#breadcrumb .stepNum{margin-top:0}#breadcrumb .stepText{position:relative;top:-4px}.fc button{height:auto!important}.fc-toolbar{margin-bottom:0!important}.fc-center,.fc-left,.fc-right{margin-bottom:1em}.calendarRightPanel{padding-left:5px;padding-right:5px}.calendarRightPanel ul li{margin-bottom:2px;margin-left:5px}.calendarRightPanel ul li:hover{background-color:#eee!important;border-radius:5px}.square9{width:12px;height:12px;margin:4px}.panel-dark{border-color:#737373}.panel-dark>.panel-heading{color:#fff;background-color:#737373;border-color:#737373}.panel-dark>.panel-heading+.panel-collapse>.panel-body{border-top-color:#737373}.panel-dark>.panel-heading .badge{color:#737373;background-color:#fff}.panel-dark>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#737373}.calendarRightPanel .widgetContainer ul{margin-top:5px;margin-bottom:5px}.paddingLeft5px{padding-left:5px}.marginBottom5px{margin-bottom:5px}.detailview-table .fieldValue .summaryViewEdit{display:none}.detailview-table .fieldValue:hover .summaryViewEdit{display:inherit}.icon-in-history-widget{font-size:17px;padding:4px}#prefPageHeader .logo img{height:70px;width:70px}#myPrefHeading h3{margin-top:12px}.list-user-img{width:50px;height:40px}span[name=existingImages] img{height:200px;width:300px}.narrow.fieldValue .chosen-container-single .chosen-single{height:26px;line-height:26px}.narrow.fieldValue input{height:26px}.narrow.fieldValue .input-group-addon{padding:4px 10px}.narrow.fieldValue .chosen-container-single .chosen-single div b{background-position-y:4px}.image-in-button{width:18px}.fc-time-grid .fc-time-grid-event.fc-event{min-height:27px;min-width:100px}.fc-time-grid-event.fc-short .fc-title{font-size:1em}.paddingTBZero{padding-top:0;padding-bottom:0}.dashboardWidgetContent a .glyphicon{top:-3px}.detailViewTitle .popover{min-width:130px;text-align:center}.cursorDefault{cursor:default!important}.remindersNoticeContainer{position:fixed;right:0;top:109px;z-index:1029;width:0;height:100%;bottom:30px;overflow-y:auto;background:rgba(0,0,0,0.4);border-left:1px solid #797979;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;overflow-y:auto}.remindersNoticeContainer.toggled{width:380px}.remindersContent{margin:5px 8px 0 8px}.activityTypeIcon{height:20px}.remindersNoticeContainer .panel{margin-bottom:10px}.remindersNoticeContainer .panel-body{padding:10px}.remindersNoticeContainer .actionRow a.btn{margin-right:3%}.remindersNotice{color:#fff;padding:15px 12px}.remindersNotice .glyphicon{font-size:20px}.cancelLink.btn[type='reset'],.cancel.btn[type='reset']{float:right;margin-left:5px;margin-bottom:0}.activityWidgetContainer .popover{min-width:240px}.filterActionImage{margin-left:8px}#tagRecord{line-height:25px}#tagsList .btn-info{margin-left:5px}#tagRecordInput{padding-left:15px;padding-right:15px}.clearReferenceSelection,.createReferenceRecord{padding:0 6px}.relatedPopup{padding:0 4px}.popupContainer .popupModuleName{margin-top:0}.mailRows hr{margin:0}.paddingLeftMd{padding-left:15px}.widget_header div:nth-child(2).btn-toolbar,.editViewContainer .contentHeader.row div:nth-child(2){margin-top:20px}.fieldLabel .referenceMandatory{margin-right:-12px}.ui-widget-content{padding:.8em}.ui-autocomplete .ui-autocomplete-category{font-weight:bold;line-height:1.5}.ui-autocomplete .ui-autocomplete-category:first-child{margin:.8em 0 .2em}.ui-autocomplete .ui-menu-item{padding:.2em .8em}.ui-autocomplete .ui-state-focus{border:0;background:#ebebeb}.widgetHr{margin-top:0}.headerLinksMails .btn-group{margin-top:11px}.finalDiscountUI,.finalTaxUI{bottom:5px}.sideBarTitle{font-size:20px}.globalSearchInput{width:300px}#groupsDetailContainer strong{line-height:21px}#addTaskContainer #taskStatus{margin-left:10px}.scanerMailActionsButtons{min-width:96px}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#404040}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active,.ui-menu .ui-menu-item a.ui-widget-content{font-weight:bold;margin:0;background-color:#428bca;border-color:#357ebd;color:#fff;display:block}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style:none}#layoutEditorButtons{margin-bottom:10px;margin-top:-10px}.individualTaxContainer{text-align:left!important}.suppliesItemTable .input-group{max-width:200px}.suppliesItemTable .rowName .input-group{max-width:400px} \ No newline at end of file +@media print{.noprint{display:none}}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}.hide-text{overflow:hidden;text-indent:100%;white-space:nowrap}.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot');src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.woff') format('woff'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.ttf') format('truetype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg')}body{width:100%;font-family:'Open Sans','Lucida Grande',Verdana,Tahoma,Arial,sans-serif!important;font-size:12px!important;background:#fff;color:#2b2b2b}hr{margin:8px 0;border-bottom:1px solid #ddd}.navbar.navbar-fixed-top .navbar-collapse{padding-right:15px!important}.navbar-nav.navbar-left .open ul{display:none}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background:0}.navbar-default .navbar-nav>li:hover{background:#e7e7e7}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background:0}.navbar-inverse .navbar-nav>li:hover{background:#080808}.navbar-nav .hovernav:hover>.dropdown-menu{display:block}#collapsedMenu{display:block;position:relative}#collapsedMenu a{color:#fff}#collapsedMenu .dropdown-menu .shortDropdown{max-height:300px;overflow-y:scroll;padding:10px;position:relative;z-index:10000;-webkit-overflow-scrolling:touch;-webkit-transform:translateZ(0)}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames{margin-bottom:2px}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a{font-size:.9em;padding:3%!important;color:#2b2b2b!important}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a:hover{text-decoration:none;background:#404952;color:#fff!important}.moreMenus{width:52em;padding:24%;left:0;border-radius:2px}.moreMenus.leftAligned:after,.moreMenus.leftAligned:before{left:21px!important}.moreMenus strong{font-size:1.1em;color:#2b2b2b}.moreMenus:after,.moreMenus:before{left:292px!important}.announcement{// display:none;background:#fafad2;// padding:2px 0;// border-bottom:1px solid #ccc;// max-height:24px;// width:100%}.announcement .marStyle{// width:100%}#headerLinks{padding:10px 0 7px;min-width:240px;float:right!important}#headerLinks .headerLinksContainer{margin-right:10px}#headerLinks .headerLinksContainer>[class*="span"]{float:left;margin-left:15px}#headerLinks .headerLinksContainer .dropdown.open .dropdown-toggle{background:transparent}#headerLinks .headerLinksContainer ul.dropdown-menu{top:30px}#headerLinks .headerLinksContainer ul.dropdown-menu:after,#headerLinks .headerLinksContainer ul.dropdown-menu:before{right:15px;left:auto}#headerLinks .headerLinksContainer>span a img,#headerLinks .headerLinksContainer>span a.userName{color:#fff;cursor:pointer;text-decoration:none!important}#headerLinks .headerLinksContainer>span a img .caret,#headerLinks .headerLinksContainer>span a.userName .caret{border-top:4px solid #fff}.dropdown-menu.pull-right{right:0;left:auto;cursor:pointer}.themeMenuContainer{min-width:110px;width:110px;left:-84px!important;padding:10px 0}.themeMenuContainer .themeMenu{padding:0 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement{cursor:pointer;margin:5px;height:20px;width:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement:hover{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}.themeMenuContainer .themeMenu .themeSelected{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}@media screen and (min-width:1161px){#mediumNav,#shortNav,#headerLinksCompact{display:none}#largeNav{margin-left:10px;margin-right:0}}@media screen and (max-width:1160px) and (min-width:960px){.companyLogo{width:100%}.customFilterMainSpan .select2-container{width:300px!important}*{zoom:1!important}}@media screen and (max-width:960px){.bodyContents{margin:0!important}#centerPanel{width:100%!important}.col-md-3#headerLinks{padding:5px 5px 0}.menuBar .col-md-9,.col-md-3#headerLinks{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-width:80px}.menuBar .col-md-9 .qCreate,.col-md-3#headerLinks .qCreate{display:inline-block;margin:0}.menuBar .col-md-9 .qCreate img,.col-md-3#headerLinks .qCreate img{margin-bottom:3px;margin-right:5px}.menuBar .col-md-9 .qCreate ul li.title,.col-md-3#headerLinks .qCreate ul li.title{padding:5px 0 0 15px}.menuBar .col-md-9 li.tabs:first-child>a,.col-md-3#headerLinks li.tabs:first-child>a{padding:10px 12px 9px}.customFilterMainSpan .select2-container{width:300px!important}#quickCreateModules{width:100%!important;padding:0!important}.CompactQC{max-height:300px;overflow-y:scroll;overflow-x:hidden}.CompactQC a:hover{text-decoration:none}}.commonActionsContainer .quickActions{height:3em}.commonActionsContainer .quickActions img{height:60%;margin:40% auto}.commonActionsContainer .quickActions #companyLogo-container img{height:98%;margin:0 auto}.commonActionsContainer .actionsContainer{background:#f3f3f3}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown{min-width:715px;top:28px;margin:0;padding-top:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a{padding:2px;border:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mainContainer{min-height:500px;margin-top:103px;background:#eeeff2;min-width:1200px}.mainContainer>.col-md-2{// padding:0 1.06383%;height:auto!important;// min-width:174px}.mainContainer .contentsDiv{min-height:500px;background:#fafafb;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;border-left:1px solid #e6e6e6;position:relative}.mainContainer #leftPanel{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.toggleButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;left:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-left:0;display:inline-block}.toggleButton .glyphicon-chevron-left{background-position:-434px -72px!important}.toggleButton .glyphicon-chevron-right{background-position:-460px -72px!important}.toggleRightPanelButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;right:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-right:0;display:inline-block}.quickLinksDiv{margin:10px 0}.quickLinksDiv p{font-size:1.2em;padding:3% 0 0 6%;height:40px;cursor:pointer;box-shadow:0 0 0 1px #ddd;border-top:1px solid #fff!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);position:relative;border-radius:2px}.quickLinksDiv p a{color:#2b2b2b}.quickLinksDiv p a:hover{text-decoration:none}.quickLinksDiv p.selectedQuickLink{background-color:#2a2f35;background-image:-moz-linear-gradient(top,#2a2f35,#2a2f35);background-image:-ms-linear-gradient(top,#2a2f35,#2a2f35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#2a2f35),to(#2a2f35));background-image:-webkit-linear-gradient(top,#2a2f35,#2a2f35);background-image:-o-linear-gradient(top,#2a2f35,#2a2f35);background-image:linear-gradient(top,#2a2f35,#2a2f35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2a2f35',endColorstr='#2a2f35',GradientType=0);border-color:#2a2f35 #2a2f35 #08090a;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);background-image:none;position:relative;border:1px solid #fff;box-shadow:4px 0 3px -4px #000 inset}.quickLinksDiv p.selectedQuickLink a{color:#fff}.quickLinksDiv p.selectedQuickLink a:after{border-bottom:19px solid rgba(0,0,0,0);border-left:10px solid #2a2f35;border-top:19px solid rgba(0,0,0,0);content:" ";display:inline-block;position:absolute;left:100%;top:0}.quickWidgetContainer li a{overflow:hidden;white-space:normal;padding:5px;margin:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.quickWidgetContainer .quickWidget{margin-bottom:10px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.sidebarTitleBlock{padding:12px 0}.sidebarTitleBlock a{color:#373737!important}.sidebarTitleBlock a:hover{text-decoration:none}#selectAllMsgDiv,#deSelectAllMsgDiv{display:none;background-color:#fafad2;padding:.01%;text-align:center}.blockUI form,#globalmodal form{margin:0}.dashboardHeading h2{padding-bottom:8px}.dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardHeading .dropdown-menu{left:-70px;right:0}.dashboardContainer{padding:0}.dashboardContainer .dashboardHeading{padding:10px 0 0;background:#f5f5f5}.dashboardContainer .dashboardHeading h2{padding:0 0 8px 20px}.dashboardContainer .dashboardHeading .btn-toolbar{padding:3px 20px 0 0}.dashboardContainer .dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardContainer .dashboardHeading .dropdown-menu{left:-82px}.widgetsList{max-height:400px;overflow-y:auto;overflow-x:hidden}.widgetsList li{display:block}.widgetsList li a{white-space:normal;word-wrap:break-word}.dashboard_notebookWidget_view .row{margin-bottom:5px}.gridster{margin-left:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.gridster ul{width:auto;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:460px}.gridster ul{list-style:none}.gridster ul li.dashboardWidget{background:#fff;border-radius:1px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.gridster ul li.dashboardWidget .dashboardWidgetHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd;color:#444;cursor:move;padding:5px}.gridster ul li.dashboardWidget .dashboardWidgetHeader table{height:28px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .dashboardTitle{text-align:left;padding-left:10px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .widgeticons{opacity:.5;padding-right:6px}.gridster ul li.dashboardWidget .filterContainer{position:absolute;border:1px solid #ddd;background:#fff;margin-left:-7px;margin-right:3px;margin-top:4px;padding:8px 0;border-radius:0 0 5px 5px;box-shadow:0 5px 8px -5px #888}.gridster ul li.dashboardWidget .filterContainer div span{margin-top:6px}.gridster ul li.dashboardWidget .filterContainer .col-md-5{margin-top:3px}.gridster ul li.dashboardWidget .dashboardWidgetContent{padding:10px 0;line-height:20px}.gridster ul li.dashboardWidget .dashboardWidgetContent .dashboard_notebookWidget_viewarea{height:200px}.gridster ul li.dashboardWidget .widgeticons{min-width:50px;height:30px;margin-right:30px}.gridster ul li.dashboardWidget .widgeticons a{cursor:pointer;text-decoration:none}.gridster ul .widgetChartContainer{margin-left:10px}.listViewPageDiv{margin:11px 0}.customFilterMainSpan{width:100%}.customFilterMainSpan .select2-container{width:95%!important}.select2-container .select2-choice{border-radius:2px;background:#fff;border-color:#ddd;font-size:14px;letter-spacing:.01em;color:#2b2b2b}.select2-container .select2-choice div{border-radius:0;border-left:0;background:#fff}.select2-drop{border-color:#ddd}.select2-dropdown ul.filterActions{list-style:none!important;padding-left:15px}.select2-dropdown ul.filterActions li{cursor:pointer}.ui-autocomplete .ui-menu-item #ui-active-menuitem{background:#404952;border-radius:0}li.ui-timepicker-selected,.ui-timepicker-list li:hover,.ui-timepicker-list:hover .ui-timepicker-selected:hover{background:#404952}#relatedTabOrder .select2-input{min-width:200px}.alphabetSorting .alphabetSearch a{vertical-align:middle;display:inline-block;margin-bottom:2px}.alphabetSorting .alphabetSearch:hover{background:#eeeff2}.listViewActions .settingsIcon{display:inline-block;margin-left:5px}.listViewActions>.btn-group{min-width:105px}#listViewPageJumpDropDown,#relatedListPageJumpDropDown{left:-60px}.pageNumbers{display:inline-block;margin-right:5px;margin-top:6px;vertical-align:top}.pageNumbers .totalNumberOfRecords{margin:0 5px}.contents-topscroll,#reportDetails{overflow-x:auto!important;overflow-y:visible}.contents-bottomscroll{overflow-x:auto!important}.bottomscroll-div,.topscroll-div{display:table;min-width:100%}.listViewLoadingImageBlock{background:0;border-radius:0;box-shadow:none;text-align:center}.detailViewContainer{padding:0 20px}.userPreferences .contents{padding-left:0!important}.userPreferences .details{border-right:0!important}.detailViewTitle{padding:1% 0 0 1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .recordLabel{font-size:16px;font-weight:bold}.detailViewTitle .detailViewButtoncontainer{margin-top:8px}.detailViewTitle .detailViewPagingButton{margin-top:8px;padding-right:10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .btn-toolbar{margin:0}.detailview-table th,.detailview-table td{vertical-align:middle}.detailview-table th label,.detailview-table td label{margin-bottom:3px}.detailViewInfo{box-shadow:0 -4px 4px -4px #959595;margin-top:5px}.detailViewInfo .details{// min-height:600px;padding-right:1.5%;border-right:4px solid #404952;padding-bottom:10px;padding-top:10px}.detailViewInfo .related .nav-pills .active>a,.detailViewInfo .related .nav-pills .active>a:hover{background:#404952;border-radius:1px;margin-top:0;margin-bottom:2px}.fieldLabel{width:20%;background:#f7f7f9}.fieldLabel label.marginRight10px{text-align:right}.summaryView{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.summaryView .summary-table tr.summaryViewEntries:last-child .fieldValue,.summaryView .summary-table tr.summaryViewEntries:last-child .fieldLabel{border-bottom:1px solid #ddd}.summaryView .summaryViewEntries .fieldLabel{vertical-align:top;padding:5px 0 5px 5%;border-top:1px solid #ddd;border-right:1px solid #ddd}.summaryView .summaryViewEntries .fieldValue{vertical-align:top;padding:5px 0 5px 5px;border-top:1px solid #ddd}.summaryView .summaryViewEntries:hover .summaryViewEdit{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryView .summaryViewEntries .summaryViewEdit{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryView .toggleViewByMode{margin:8px 0;padding-right:0}.summaryView .toggleViewByMode .changeDetailViewMode{white-space:normal!important}.summaryWidgetContainer{border-radius:2px;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border:1px solid #eaeaea;background:#fff;margin-bottom:10px;padding:15px}.commentContainer .commentTitle{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;margin-bottom:10px}.commentContainer .commentTitle textarea{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordDetails .squeezedWell{padding:3% 0;min-height:105px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordEditView .contentHeader{padding:.5% 0 1% 0}.recordEditView .table .fieldLabel,.recordEditView .table .fieldValue{vertical-align:middle}.recordEditView .table tbody tr:hover td,.recordEditView .table tbody tr:hover th{background:#f7f7f9}.commentContainer{border-radius:2px}.commentContainer hr{margin:0!important}.commentContainer .addCommentBlock .commentsControls{display:inline-block}.commentContainer .commentsList>.liStyleNone>.commentDetails .commentDiv{width:100%}.commentContainer .commentDetails{background:#fff;border:1px solid #ddd;margin-bottom:5px;border-radius:2px;padding:10px 10px 5px;display:inline-block;min-width:354px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentContainer .commentorInfo p{margin-bottom:0}.commentContainer .addCommentBlock{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border:1px solid #ddd;padding:12px 12px 5px;min-height:115px;margin-top:15px;display:block}.commentContainer .addCommentBlock .commentcontent{padding:8px!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;resize:none}.commentContainer .commentInfoContent{padding:1px 0;word-wrap:break-word}.commentTitle .col-md-1{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentTitle .col-md-1 img{width:32px;height:32px}.commentsList>ul{margin-left:0}.singleComment .editedStatus{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:5px 0 5px 32px}.singleComment .editedStatus p{margin-bottom:0}.singleComment .commentActionsDiv{display:none}.singleComment .commentActionsDiv p{margin-bottom:0}.singleComment:hover .commentActionsDiv{display:block;margin-bottom:3px}.recentComments{margin:0;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recentComments .commentDiv{min-width:100%}.recentComments .addCommentBlock{border:0;margin-top:0;display:block}.recentComments .commentDetails{display:block}.singleComment:hover .commentActions .replyComment{display:inline-block}.commentActionsContainer a:hover{text-decoration:none}.commentActionsContainer .editStatus{padding:5px 2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentActionsContainer .editStatus p{margin-bottom:0}.table{background:#fff}.table-bordered{border-radius:1px;margin-bottom:0}.table-bordered th{border-top:1px solid #fff!important}.table th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;color:#444}.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td,.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td{border-left:0;border-right:0}.listViewEntriesTable tbody tr td:first-child{border-left:0 none}.equalSplit td:nth-child(odd){width:20%}.equalSplit td:nth-child(even){width:30%}td.fieldValue input,td.fieldValue .input-group{margin-bottom:0}.actionImage,.actionImages{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.listViewHeaders a{color:#444}.listViewEntriesDiv .listViewHeaders th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd}.listViewEntriesDiv,.listViewEntriesDiv td{overflow:visible}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues{color:#444}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues:hover{text-decoration:none}.listViewEntriesTable td.listViewEntryValue,.listViewEntries td{vertical-align:middle;cursor:pointer;overflow:visible;padding:5px}.listViewEntriesTable td.listViewEntryValue:hover .actionImages,.listViewEntries td:hover .actionImages,.listViewEntriesTable td.listViewEntryValue:hover .actions,.listViewEntries td:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryViewEntries .summaryViewEdit,.activityStatus .editStatus,.activityDescription .editDescription,.addedCalendars .actionImage{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryViewEntries:hover .fieldValue .summaryViewEdit,.activityStatus:hover .editStatus,.activityDescription:hover .editDescription,.addedCalendars:hover .actionImage{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewEntriesTable tr:hover td .actions .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewBasicAction.dropdown-menu{width:100%}.listViewBasicAction.dropdown-menu input{border-radius:2px;height:24px;margin-bottom:0;margin-top:-2px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.emptyRecordsDiv{width:100%;border:1px solid #ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.emptyRecordsDiv td{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.CustomFilterViewTitle{padding-top:1%}#CustomView .filterActions{padding-bottom:20px;overflow:hidden}.filterConditionsDiv{padding-bottom:0}.conditionGroup .header{margin-bottom:20px;font-size:1.2em}.conditionGroup .contents .conditionRow{margin-bottom:10px}.conditionGroup .contents .conditionRow select,.conditionGroup .contents .conditionRow input{width:90%}.conditionGroup .contents .conditionRow .chzn-results li{line-height:20px}.conditionGroup .deleteCondition{vertical-align:bottom}.searchUIBasic{border-collapse:separate!important;border-spacing:10px!important;margin:0 10%}.searchUIBasic .importContents{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.searchUIBasic .listRow .listViewHeaders>td{color:#404952}.searchUIBasic .listRow .defaultInputTextContainer{max-width:87%!important;margin-bottom:0!important}#lineItemTab.table tr:first-child:hover th ~ td{background-color:#f3f3f4;background-image:-moz-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-ms-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f3f3f4),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-o-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:linear-gradient(top,#f3f3f4,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f4',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}#lineItemTab.table tr:nth-child(2):hover td{background:0}.lineItemTable tr td{width:0}.lineItemTable tr td div.finalDiscountUI,.lineItemTable tr td div.discountUI,.lineItemTable tr td div#shipping_handling_div,.lineItemTable tr td div.taxUI,.lineItemTable tr td div.finalTaxUI{border:2px solid #c4c4c4;border-radius:2px}.lineItemTable tr td div.finalDiscountUI table tr td,.lineItemTable tr td div.discountUI table tr td,.lineItemTable tr td div#shipping_handling_div table tr td,.lineItemTable tr td div.taxUI table tr td,.lineItemTable tr td div.finalTaxUI table tr td,.lineItemTable tr td div.finalDiscountUI table tr th,.lineItemTable tr td div.discountUI table tr th,.lineItemTable tr td div#shipping_handling_div table tr th,.lineItemTable tr td div.taxUI table tr th,.lineItemTable tr td div.finalTaxUI table tr th{border-left:0}.lineItemTable tr:hover td{width:0}.lineItemTable tr:hover td div.finalDiscountUI table tr td{background:none!important}.lineItemTable tr:hover td div.discountUI table tr td{background:none!important}.lineItemTable tr:hover td div#shipping_handling_div table tr td{background:none!important}.lineItemTable tr:hover td span.taxDivContainer div table tr td{background:none!important}.lineItemTable tr:hover td div.finalTaxUI table tr td{background:none!important}.lineItemResult{width:70.5%!important}.lineItemResult a:hover{color:#404952}.lineItemInputBox{width:45%;float:right;text-align:right}.discountUI,.taxUI,.finalDiscountUI,.finalTaxUI,#shipping_handling_div{position:absolute;left:46%;width:30%;z-index:500;box-shadow:1px 0 7px #ddd;border-radius:6px}.discountUI table.table,.taxUI table.table,.finalDiscountUI table.table,.finalTaxUI table.table,#shipping_handling_div table.table{margin-bottom:0}.discountUI .table tbody tr:first-child th:first-child,.taxUI .table tbody tr:first-child th:first-child,.finalDiscountUI .table tbody tr:first-child th:first-child,.finalTaxUI .table tbody tr:first-child th:first-child,#shipping_handling_div .table tbody tr:first-child th:first-child{border-radius:4px 0 0 0!important}.discountUI .table tbody tr:first-child th:last-child,.taxUI .table tbody tr:first-child th:last-child,.finalDiscountUI .table tbody tr:first-child th:last-child,.finalTaxUI .table tbody tr:first-child th:last-child,#shipping_handling_div .table tbody tr:first-child th:last-child{border-radius:0 4px 0 0!important}.LineItemDirectPriceReduction{width:65%!important}th.htColHeader,.handsontable thead th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd;padding:6px 2px}.contentHeader{padding:15px;padding-left:5px;line-height:20px}.contentsDiv>div{padding:0 20px}#settingsQuickWidgetContainer .widgetContainer.accordion-body{border-bottom:none!important;border-bottom:3px solid #ddd}#settingsQuickWidgetContainer .widgetContainer.accordion-body>div:hover{background:#eeeff2}#settingsShortCutsContainer{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:1% 3%}#settingsShortCutsContainer .moduleBlock{min-height:60px}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin{display:inline-block;opacity:.4}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin:hover{opacity:.8}.settingsIndexPage .settingsSummary{text-align:center;margin-top:10px}.settingsIndexPage .settingsSummary a{display:inline-block;background:#f3f3f4;color:#444;border-radius:2px;min-width:200px;padding:20px 0 10px;border:1px solid #ddd}.settingsIndexPage .settingsSummary a .summaryText{display:inline-block;margin-top:20px;font-size:15px}.settingsIndexPage .settingsSummary a:hover .summaryText,.settingsIndexPage .settingsSummary a:hover .summaryCount{color:#404952}.settingsIndexPage .moduleBlock h5{font-size:1.2em;margin-bottom:5px}.settingsIndexPage .moduleBlock:hover{background:#f3f3f4}#userPageHeader{padding:8px 0 0}#userPageHeader #userHeading h3{margin-top:10px}.treeView li{border-left:4px solid #ddd;list-style:none;padding-top:15px}.treeView li .toolbar-handle{margin-left:10px;position:relative}.treeView li .toolbar-handle .btn{margin:0}.treeView li .toolbar-handle a:before{background:none repeat scroll 0 0 #ddd;content:" ";display:inline-block;height:4px;left:-10px;position:absolute;top:12px;width:10px}.treeView .btn{margin-bottom:10px}.profilesEditView tr.blockHeader th{text-align:center}.profilesEditView tr.blockHeader th:first-child{text-align:left}.profilesEditView input{margin-right:5px}.profilesEditView tr td.row table.table{border-left:none;margin-bottom:20px}.profilesEditView tr:hover td.row{background:0}.profilesEditView tr:hover td.row table.table tr td{background:0}.profilesEditView tr:hover td.row table.table tr:hover td{background:0}.profilesEditView tr:hover td.row table.table td{background:#f3f3f4}#s2id_memberList li>div,.groupMembersColors li>div{margin-left:10px}#s2id_memberList .Users,.groupMembersColors .Users{background-color:#f99984!important;padding:5px;margin-bottom:2px;background-image:none}#s2id_memberList .Groups,.groupMembersColors .Groups{background-color:#acd5ff!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .Roles,.groupMembersColors .Roles{background-color:#ffec98!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .RoleAndSubordinates,.groupMembersColors .RoleAndSubordinates{background-color:#c4dea2!important;background-image:none;padding:5px;margin-bottom:2px}.collectiveGroupMembers{border:1px solid #ddd;border-top:0}.collectiveGroupMembers ul{padding:0;margin:0}.collectiveGroupMembers ul li{padding:4px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.collectiveGroupMembers ul li a{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;margin:0}.collectiveGroupMembers ul li.groupLabel{background-color:#f3f3f4;border-bottom:1px solid #ddd;border-top:1px solid #ddd;padding:10px 5px;margin:0;color:#444}.mini-slider-control{width:50px}.mini-slider-control+div{margin-left:15px}.mini-slider-control .ui-slider-handle{border:0;border-radius:50%;height:16px;top:-2px;width:16px;cursor:pointer}.mini-slider-control .ui-slider-handle:focus{outline:0}.ui-widget-content{border-radius:6px;border-color:#fff;box-shadow:0 0 3px -1px inset;margin-top:2px;margin-left:5px;height:12px}.ui-slider-disabled{opacity:.5;border-color:#ddd;box-shadow:none;cursor:not-allowed}.ui-slider-disabled .ui-slider-handle{cursor:not-allowed}.ui-slider-disabled+div{opacity:.5;cursor:not-allowed}.mini-slider-control[data-value="0"] .ui-slider-handle{background:#7d7e7d;background:-moz-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#7d7e7d),color-stop(100%,#0e0e0e));background:-webkit-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-o-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-ms-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:linear-gradient(to bottom,#7d7e7d 0,#0e0e0e 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7d7e7d',endColorstr='#0e0e0e',GradientType=0)}.mini-slider-control[data-value="1"] .ui-slider-handle{background:#ffb76b;background:-moz-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ffb76b),color-stop(0%,#ffa73d),color-stop(49%,#ff7c00),color-stop(100%,#ff7f04));background:-webkit-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-o-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-ms-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:linear-gradient(to bottom,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffb76b',endColorstr='#ff7f04',GradientType=0)}.mini-slider-control[data-value="2"] .ui-slider-handle{background:#bfd255;background:-moz-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#bfd255),color-stop(79%,#8eb92a),color-stop(100%,#72aa00),color-stop(100%,#9ecb2d));background:-webkit-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-o-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-ms-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:linear-gradient(to bottom,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bfd255',endColorstr='#9ecb2d',GradientType=0)}#moduleManagerContents{padding-bottom:10px}#moduleManagerContents .moduleManagerBlock .btn-group.open .dropdown-menu{left:-144%}#moduleManagerContents .modulesTable td{width:50%}#importModules .contents .row{margin-bottom:2.2%}.extensionWidgetContainer{background-color:#fff;border:1px solid #ddd;min-height:200px;padding:2%;background:#fafafa;box-shadow:0 0 10px -4px #777}.extensionWidgetContainer .extension_contents{margin-top:2%;background:#fff;padding:10px;box-sizing:border-box;max-height:160px}.extension_contents:hover{border-radius:4px}.thumbnailImage{height:130px;width:130px;float:right}.extensionWidgetContainer .extension_contents .slimScrollDiv{padding-right:10px}.extensionWidgetContainer .extension_header .font-x-x-large{font-size:1.5em;padding-left:3px;font-weight:bold;color:#404952}.extensionWidgetContainer .extensionDescription{line-height:20px}.extensionWidgetContainer .extensionInfo{padding-top:5px}.extensionWidgetContainer .extensionInfo .rating,.extensionDetails .rating{vertical-align:middle;margin-top:2px;display:inline-block}.extensionDetails .authorInfo{margin:3px 0}.extensionDetails .extensionDetailActions{padding:15px 0}.extensionWidgetContainer .tab-pane .bx-wrapper .imageSlider{margin:0}.sliderImage{width:90%;height:360px}.opacity .actions{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.opacity:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.sharingAccessDetails{margin-bottom:30px}.sharingAccessDetails td,.sharingAccessDetails th{text-align:center;vertical-align:middle!important}.sharingAccessDetails tr td:first-child,.sharingAccessDetails tr th:first-child{text-align:left}.sharingAccessDetails td.row>div{display:block}.sharingAccessDetails .customRuleContainer:hover{background:0}.sharingAccessDetails hr{border-bottom:1px solid #bcbcbc}.sharingAccessDetails .title{padding:1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.sharingAccessDetails .title .rulehead{padding-top:5px}.sharingAccessDetails .customRuleEntries:hover .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.layoutContent{border-top:4px solid #404952}.layoutContent #moduleBlocks .editFieldsTable{margin-bottom:20px}.layoutContent #moduleBlocks .editFieldsTable .fieldLabel{background:0}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockLabel{padding-top:13px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group{margin-top:5px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group .dropdown-menu{left:-100%}.layoutContent .relatedTabModulesList{padding:2% 1%}.fieldDetailsForm .search-choice-close{padding:0}.border1px{border:1px solid #ddd}.blockFieldsList .opacity{margin-left:.5%!important}.blockFieldsList .opacity .dropdown-menu a{padding:0!important}.blockFieldsList .opacity a.dropdown-toggle.editFieldDetails{box-shadow:none}.blockFieldsList .editFields .dropdown-menu{z-index:1000003;padding:0;left:-215px;position:absolute}.blockFieldsList .editFieldsWidget .dropdown-menu{z-index:1000003;padding:0;left:-315px;position:absolute}.blockFieldsList .editFields .dropdown-menu .modal-header{border-width:0;border-bottom-width:1px}.blockFieldsList .editFields .dropdown-menu .modal-header .cancel{padding-right:0;font-weight:bold}.blockFieldsList .editFields:hover{background:#f3f3f4!important}#modulePickListValuesContainer .layoutContent{padding-left:2%}#modulePickListValuesContainer .layoutContent .selectedCell,#modulePickListValuesContainer .layoutContent .selectedListItem{background:#a5afb9;white-space:nowrap}#modulePickListValuesContainer .layoutContent .pickListValue{cursor:pointer}.nonEditableValuesDiv .nonEditablePicklistValues{margin-left:0}.nonEditableValuesDiv .nonEditablePicklistValues li{padding:3px 15px;margin-bottom:2px;background:#e0f2ff}.popover{z-index:1000023!important}.popover-content .fieldLabel{width:35%;white-space:normal}#dependencyGraph .tableHeading{text-align:center;padding-top:30px;font-size:1.2em;font-weight:bold}#dependencyGraph .depandencyTable{border:1px solid #ddd;background:#f3f3f4}#dependencyGraph .depandencyTable .blockHeader{border-bottom:1px solid #ddd}#dependencyGraph .depandencyTable .picklistValueMapping{border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping{text-align:center;border-left:1px solid #ddd;border-right:1px solid #ddd;background:#fff}#dependencyGraph .dependencyMapping .mCSB_container{margin-bottom:16px!important}#dependencyGraph .dependencyMapping .pickListDependencyTable{border:0}#dependencyGraph .dependencyMapping .pickListDependencyTable .blockHeader th{background:#f3f3f4;border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping .pickListDependencyTable .selectedCell{background:#a5afb9}.webformFieldInfo{margin-bottom:250px}.targetFieldsTableContainer input[type="text"]{min-width:100px}#customRecordNumbering.table thead th{vertical-align:middle}.addMailBoxBlock{margin-left:83px;padding:0!important;font-size:12px}.addMailBoxStep{background:#fff;padding:30px 0;border:1px solid #ddd;border-radius:1px;min-height:170px}.mailConveterDesc{height:350px;width:96%;border:1.5px solid;border-radius:2px;border-color:#ddd;font-size:11pt;margin-top:55px;margin-left:20px;background:#fff}#mailBoxLabel{margin-top:15px;margin-left:-18px;font-size:12pt;width:75px}.mailBoxDropdownWrapper{height:49px;width:70%;background:url('../images/mailbox-icon.png') no-repeat 5px 5px;overflow:hidden;border:1px solid #ddd}.mailBoxDropdown{background:transparent url('../images/downArrowBlue.png') no-repeat 236px 13px;width:110%;height:50px;font-size:14pt;color:#0065a6;padding:10px 55px;padding-right:0}#mailConverterDragIcon{margin-top:12px}#mailConverterBody{padding-top:20px;margin-left:0}.ruleHead{padding:6px 0;background:#d8d8dc}.mailConverterRuleBlock{font-size:14px;line-height:30px;border:1.5px solid;border-color:#ddd}.mailConverterRuleLegend{font-size:14px;color:#0065a6;margin-bottom:10px;background:#f3f3f4}#mailConverterStats{font-size:10pt;margin-top:5px;margin-left:-10px}.addMailBoxBlock{border-color:#ddd;margin-left:83px;margin-top:20px;padding-top:30px;padding-left:200px;padding-bottom:20px;padding-right:30px;font-size:11pt}.taskTypeUi>.row{margin:10px 0}#taskListContainer .listViewEntriesTable tr td:last-child{border-left:1px solid #ddd}#workflow_step2>.row{padding:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:400px}#open_email_con .detailViewTitle{padding:0}#open_email_con .detailViewTitle .detailViewPagingButton{margin-top:0;padding-right:0}#foldersList .list-group{padding-right:0}.massEditTable th+th,.massEditTable td+td,.massEditTable th+td,.massEditTable td+th{border-left:0}.nav.massEditTabs{margin-bottom:0;border-bottom:0}.nav.massEditTabs li.active a{background:#404952;color:#fff;margin-left:10px}.nav.massEditTabs li a:hover{border-bottom:1px solid #404952}.massEditContent{border-top:3px solid #404952}.calendarSettingsContainer{width:700px}.calendarSettingsContainer .control-label{width:26%}#calendarSettings{margin:1px 0 3px}.calendarMassEdit{min-width:400px}.fc-state-default .fc-button-effect{top:100%!important}.fc-event-style1,.fc-event-style1 .fc-event-skin{background:#17309a;border-color:#17309a;font-weight:normal;text-shadow:none}.fc-event-style2,.fc-event-style2 .fc-event-skin{background:#3a87ad;border-color:#3a87ad;font-weight:normal;text-shadow:none}.fc-event-style3,.fc-event-style3 .fc-event-skin{background:#aa6705;border-color:#aa6705;font-weight:normal;text-shadow:none}.fc-event-style4,.fc-event-style4 .fc-event-skin{background:#953b39;border-color:#953b39;font-weight:normal;text-shadow:none}.fc-event-style5,.fc-event-style5 .fc-event-skin{background:#545252;border-color:#545252;font-weight:normal;text-shadow:none}.fc-event-style6,.fc-event-style6 .fc-event-skin{background:#87865d;border-color:#87865d;font-weight:normal;text-shadow:none}.fc-event-style7,.fc-event-style7 .fc-event-calendarMassEditskin{background:#c71585;border-color:#c71585;font-weight:normal;text-shadow:none}.fc-event-style8,.fc-event-style8 .fc-event-skin{background:#006400;border-color:#006400;font-weight:normal;text-shadow:none}#calendarview th{color:#000}.fc-agenda-divider+div{overflow-y:visible!important}.fc-button{display:inline-block;padding:6px .4em!important;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.fc-button:active .fc-button-inner{background:transparent}.fc-button:active .fc-button-inner .fc-button-content{color:#fff}.fc-button.fc-state-active .fc-button-inner .fc-button-content,.fc-button:active .fc-button-inner .fc-button-content{color:#000!important;background:transparent;background-image:none}.fc-header-title h2{font-size:15px;line-height:20px}.fc-widget-header th{padding:4px 0!important}.fc-widget-header{color:#666;background:#eee;border-color:#ccc}.fc-content{background:#fff;margin-top:15px}.fc-content td:hover{background:#f3f3f3}.btn:focus{outline:0}.reminderPostpone.btn-primary{background:#404952}.reminderPostpone.btn-primary:hover{background:#1e2327}.saveButton{margin-right:5px}.addCustomRule{float:right}.importMore{background:#fff}.lastImport{background:#fff}.undoImport{background:#da4f49}.close{border:0;background:none repeat scroll 0 0 transparent;border:0 none;cursor:pointer}.resetButton{margin-top:0!important}.vtGlyph{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("../images/vtGlyph.png");background-position:0 0;background-repeat:no-repeat;*margin-right:.3em}.vticon-pageJump{background-position:0 0}.vticon-call-inbound{background-position:-14px 0}.vticon-call-outbound{background-position:-28px 0}#massEdit .cancelLinkContainer{padding:5px 0;margin-left:.5em}.ui-pnotify{z-index:1000023}.feedback{z-index:10002}.feedback .handle{z-index:10003;display:block;position:fixed;bottom:50px;left:-30px;left:0\9;bottom:100px\9;background:#2c2c2c;color:white;padding:7px 15px;border:1px solid gray;text-decoration:none;outline:0;-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-o-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg);-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.00000000, M12=1.00000000, M21=-1.00000000, M22=0.00000000,sizingMethod='auto expand')";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0,M12=1,M21=-1,M22=0,sizingMethod='auto expand')}.feedback .handle:hover{text-decoration:none}.vtFooter{text-align:center}.vtFooter p{background:#404952;color:#fff;border-top:1px solid #ddd;padding:1px 0;font-size:.9em;margin-bottom:0}.vtFooter p a{color:#fff}.imageHolder{background:url('../images/loadback.png') repeat-y;background-position:center;padding:10px 0}.breadcrumbContainer{padding:2% 2% 0 2%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;height:auto}.breadcrumb{display:inline-block;height:auto;height:40px}.crumbs{height:40px;margin:0;padding:0 20px 0 0;display:inline-block;font-family:sans-serif}.crumbs li:after{content:'\0000a0';width:0;height:0;border-left:18px solid #ececec;border-top:20px solid transparent;border-bottom:20px solid transparent;display:inline-block;position:relative;top:-20px;left:18px;zoom:1}.crumbs li{height:0;border-top:20px solid #ececec;border-bottom:20px solid #ececec;border-left:20px solid transparent;display:inline-block;box-shadow:0 1px #ddd;margin-right:5px}.crumbs li a{display:inline-block;float:left;margin-top:-13px;font-size:14px;font-weight:bold;color:#666;text-decoration:none}.crumbs li.active{height:0;border-top:20px solid #404952;border-bottom:20px solid #404952;box-shadow:0 1px #404952}.crumbs li.active:after{border-left:18px solid #404952!important}.stepText{display:inline-block;white-space:nowrap;overflow:hidden;font-size:13px;vertical-align:bottom}.active .stepText,.active .stepNum{color:#fff}.stepNum{display:inline-block;padding:0 5px;overflow:hidden;font-size:20px;vertical-align:top;margin-top:5px}.greyStar{background-image:url("../images/stars.png");background-position:20px 20px;height:20px;width:20px;display:inline-block}.yellowStar{background-image:url('../images/stars.png');background-position:0 20px;width:20px;height:20px;display:inline-block}.blockUI{border-radius:2px!important;border:0!important}textarea.col-md-11{width:100%!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.popover .popover-inner{border-radius:2px;font-size:.8em;box-shadow:0}.popover .popover-inner .popover-title{color:#444;font-size:15px}.popover .popover-inner .close{color:#000!important;margin-top:3px;opacity:.5!important}.popover .popover-inner .close:hover{opacity:1!important}.popover .popover-inner td{padding:3px 5px;overflow-wrap:break-word}.popover .popover-inner .detailViewInfo{margin-top:0;box-shadow:0}.popover .popover-inner .detailViewInfo .fieldLabel label{font-size:1em}#findDuplicate>.control-group{margin-bottom:0;width:400px}#moveReports .modal-body{padding:20px 40px}#composeEmailContainer{padding:0 20px}#composeEmailContainer .MultiFile-wrap{display:inline-block}#composeEmailContainer .MultiFile-intercepted .ui-wrapper{min-height:400px}#transferOwnershipContainer .select2-container.select2-container-multi{max-width:220px}.fieldInfo.in{overflow:visible!important;height:auto!important}.moduleSelection{border-radius:2px 2px 0 0!important;border:1px solid #ddd!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);color:#444}.convertLeadModules{margin-bottom:2%;border:1px none}.moduleBlock{border-radius:0!important}.overflowVisible{overflow:visible!important}.convertLeadError{border:3px solid #999;background-color:#fff;width:55%;position:relative;z-index:10000000}.convertLeadError table td{border-bottom:1px solid #ccc;nowrap:nowrap;width:70%}.bootbox,.alert{z-index:1000023}.chzn-container{vertical-align:middle}.chzn-container .chzn-results li{margin-right:7px}.chzn-container .chzn-results .highlighted{background:#404952}.select2-results .select2-highlighted{background:#404952}.select2-result-label i{background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.ui-autocomplete-loading{background:url('../images/load.gif') no-repeat right center}.ui-autocomplete{height:auto!important;border-radius:1px!important}.dropdown-menu.pull-right:after,.dropdown-menu.pull-right:before{right:3px;left:auto;top:-5px;border-bottom-width:6px}span.wrapper a{color:#08c!important;font-size:15px!important;font-weight:bold}a{color:#353c44}a:hover{color:#1e2327;text-decoration:none;cursor:pointer}a:active,a:focus{outline:0}.well{border-radius:2px;padding:15px}.verticalBottomSpacing{margin-bottom:10px}.mergeTables{margin-bottom:0}.font-x-x-large{font-size:18px;line-height:28px}form{margin:0}.fc-state-default .fc-button-effect span{background:0}.dateField{width:183px}.form-horizontal [class^="icon-"],.form-horizontal [class*=" icon-"]{vertical-align:baseline}.timePicker{width:8.5em!important;z-index:1000029!important}.datepicker{z-index:1000029!important}.colorpicker{z-index:1029!important}.colorpicker input{width:30px!important}.colorpicker input[type="text"],.colorpicker input{color:#898989!important}.colorpicker_hex input{width:45px!important}.modal-body.accordion{margin-bottom:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}//.modal-open{// overflow:hidden;//}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.removeNoFileChosen{color:transparent!important}.modelContainer .modal-header{border-radius:2px 2px 0 0}.modelContainer form{border-radius:0 0 2px 2px}.hide{display:none}i{cursor:pointer;text-decoration:none!important}.marginbottomZero{margin-bottom:0!important}.marginLeftZero{margin-left:0!important}.marginRightZero{margin-right:0!important}.clearfix{clear:both!important}textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%}.textOverflowEllipsis{overflow:hidden;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;//width:9em}.margin0px{margin:0!important}.padding10{padding:10px;padding-bottom:0}.padding20{padding:20px}.pushDown{margin-top:5px}.boxSizingBorderBox{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.boxSizingContentBox{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.cursorPointer{cursor:pointer;text-decoration:none!important}.zeroOpacity{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.dullOpacity{opacity:.8;-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80)}.fullOpacity{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.redColor{color:red}.highlightBackgroundColor{background:#eeeff2}.contentsBackground{background:#fff;border:1px solid #ddd}.textAlignCenter{text-align:center}.textAlignRight{text-align:right}.alignMiddle{vertical-align:middle}.alignTop{vertical-align:top}.padding1per{padding:1%}.paddingTop20{padding-top:20px}.padding20px{padding:20px}.padding-bottom1per{padding-bottom:1%}.marginBottom10px{margin-bottom:10px}.displayInlineBlock{display:inline-block}.backgroundImageNone{background-image:none}.liStyleNone{list-style:none outside none}.fontBold{font-weight:bold!important}.livesupport_tab,#userfeedback{display:none!important}#reportDetails table tr td.summary{border-bottom:0;border-top:0}#portalDetailViewHttpError{padding-bottom:7px;margin-top:50px;color:red;text-align:center}.slidesjs-pagination{list-style:none}.slidesjs-pagination li a{display:block;width:13px;height:0;padding-top:13px;background-image:url('../images/pagination.png');background-position:0 0;float:left;overflow:hidden}.slidesjs-pagination li a.active,.slidesjs-pagination li a:hover.active{background-position:0 -13px}.extensionStorebtn{background:#f08c39;background-image:-webkit-linear-gradient(top,#f08c39,#e68b3c);background-image:-moz-linear-gradient(top,#f08c39,#e68b3c);background-image:-ms-linear-gradient(top,#f08c39,#e68b3c);background-image:-o-linear-gradient(top,#f08c39,#e68b3c);background-image:linear-gradient(to bottom,#f08c39,#e68b3c);-webkit-border-radius:2;-moz-border-radius:2;border-radius:2px;text-shadow:0 0 1px #595959;color:#fff;font-size:14px;font-weight:bold;padding:8px 20px 8px 20px;text-decoration:none;border:0}.extensionStorebtn:hover{background:#fc9f3c;background-image:-webkit-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-moz-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-ms-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-o-linear-gradient(top,#fc9f3c,#f08a3c);background-image:linear-gradient(to bottom,#fc9f3c,#f08a3c);text-decoration:none}.extensionSearch{padding:8px 12px 8px 30px!important;margin:6px 0 14px 0;box-shadow:inset 2px 2px 10px #ddd;border-radius:2px!important;background:url('../images/search.png') no-repeat;background-position:5px 6px}.banner-container{border-bottom:1px solid #fff;box-sizing:border-box}.banner{margin:0 90px}.bx-wrapper{margin:0 auto 35px!important;padding-top:17px!important}.bx-wrapper li a{display:block}.bx-wrapper a img{height:100px;width:auto;margin:0 auto}.wide,.table td.wide,.listViewEntries td.wide,td.listViewEntryValue.wide{padding:8px!important}.medium,.table td.medium,.listViewEntries td.medium,td.listViewEntryValue.medium{padding:5px 6px!important}.narrow,.table td.narrow,.listViewEntries td.narrow,td.listViewEntryValue.narrow{padding:2px 4px!important}.table thead th.narrow{vertical-align:middle}td.listViewEntryValue .row input{padding:0;margin-bottom:0}.listViewContentDiv{position:relative}.fieldLabel .pull-right{text-align:right}#tagRecordText{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;width:80%!important}#tagRecord{margin-left:5px!important}.tag{float:right!important}.cut-string{text-overflow:ellipsis;-o-text-overflow:ellipsis;-webkit-text-overflow:ellipsis;width:200px;white-space:nowrap;overflow:hidden}.paddingLRZero{padding-left:0;padding-right:0}.paddingRightZero{padding-right:0}.detailViewToolbar{margin-top:5px}.input-group.input-group-sm>.input-group-addon img{width:15px}table tr td .input-sm{min-width:50px}.modal-footer.backgroundColor{background-color:#f5f5f5}.panel-title{font-size:14px}.quickWidgetContainer .panel-body{padding-bottom:0;padding-top:0}tr.summaryViewEntries,#detailView table{font-size:13px}table.listViewEntriesTable{font-size:13px;margin-top:5px}.no-margin{margin:0}.companyLogo img{max-height:200px;max-width:250px}.navbar-inverse .navbar-nav>li>a{color:#fff;padding:15px 12px}.navbar-inverse .navbar-nav .dropdown-menu>li>a{padding:3px 15px;font-size:12px}.headerCalendar .month h3{font-size:18px;font-weight:bold;margin:5px 0 0 0}.columnsSelect{width:100%!important}.marginBottom5{margin-bottom:5px}.editViewContainer .recordEditView table.blockContainer tr td.fieldValue{width:30%}.recordEditView[name=QuickCreate] .quickCreateContent table tr td.fieldValue,#massEditContainer .massEditContent table tr td.fieldValue,#tab_accounts td.functionList{width:30%}.btn{white-space:normal}.valuesAssignedToRole{border:1px solid #adadad;overflow:hidden;text-overflow:ellipsis;padding:6px}table.dataTable .form-control{width:100%!important}#breadcrumb .stepNum{margin-top:0}#breadcrumb .stepText{position:relative;top:-4px}.fc button{height:auto!important}.fc-toolbar{margin-bottom:0!important}.fc-center,.fc-left,.fc-right{margin-bottom:1em}.calendarRightPanel{padding-left:5px;padding-right:5px}.calendarRightPanel ul li{margin-bottom:2px;margin-left:5px}.calendarRightPanel ul li:hover{background-color:#eee!important;border-radius:5px}.square9{width:12px;height:12px;margin:4px}.panel-dark{border-color:#737373}.panel-dark>.panel-heading{color:#fff;background-color:#737373;border-color:#737373}.panel-dark>.panel-heading+.panel-collapse>.panel-body{border-top-color:#737373}.panel-dark>.panel-heading .badge{color:#737373;background-color:#fff}.panel-dark>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#737373}.calendarRightPanel .widgetContainer ul{margin-top:5px;margin-bottom:5px}.paddingLeft5px{padding-left:5px}.marginBottom5px{margin-bottom:5px}.detailview-table .fieldValue .summaryViewEdit{display:none}.detailview-table .fieldValue:hover .summaryViewEdit{display:inherit}.icon-in-history-widget{font-size:17px;padding:4px}#prefPageHeader .logo img{height:70px;width:70px}#myPrefHeading h3{margin-top:12px}.list-user-img{width:50px;height:40px}span[name=existingImages] img{height:200px;width:300px}.narrow.fieldValue .chosen-container-single .chosen-single{height:26px;line-height:26px}.narrow.fieldValue input{height:26px}.narrow.fieldValue .input-group-addon{padding:4px 10px}.narrow.fieldValue .chosen-container-single .chosen-single div b{background-position-y:4px}.image-in-button{width:18px}.fc-time-grid .fc-time-grid-event.fc-event{min-height:27px;min-width:100px}.fc-time-grid-event.fc-short .fc-title{font-size:1em}.paddingTBZero{padding-top:0;padding-bottom:0}.dashboardWidgetContent a .glyphicon{top:-3px}.detailViewTitle .popover{min-width:130px;text-align:center}.cursorDefault{cursor:default!important}.remindersNoticeContainer{position:fixed;right:0;top:109px;z-index:1029;width:0;height:100%;bottom:30px;overflow-y:auto;background:rgba(0,0,0,0.4);border-left:1px solid #797979;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;overflow-y:auto}.remindersNoticeContainer.toggled{width:380px}.remindersContent{margin:5px 8px 0 8px}.activityTypeIcon{height:20px}.remindersNoticeContainer .panel{margin-bottom:10px}.remindersNoticeContainer .panel-body{padding:10px}.remindersNoticeContainer .actionRow a.btn{margin-right:3%}.remindersNotice{color:#fff;padding:15px 12px}.remindersNotice .glyphicon{font-size:20px}.cancelLink.btn[type='reset'],.cancel.btn[type='reset']{float:right;margin-left:5px;margin-bottom:0}.activityWidgetContainer .popover{min-width:240px}.filterActionImage{margin-left:8px}#tagRecord{line-height:25px}#tagsList .btn-info{margin-left:5px}#tagRecordInput{padding-left:15px;padding-right:15px}.clearReferenceSelection,.createReferenceRecord{padding:0 6px}.relatedPopup{padding:0 4px}.popupContainer .popupModuleName{margin-top:0}.mailRows hr{margin:0}.paddingLeftMd{padding-left:15px}.widget_header div:nth-child(2).btn-toolbar,.editViewContainer .contentHeader.row div:nth-child(2){margin-top:20px}.fieldLabel .referenceMandatory{margin-right:-12px}.ui-widget-content{padding:.8em}.ui-autocomplete .ui-autocomplete-category{font-weight:bold;line-height:1.5}.ui-autocomplete .ui-autocomplete-category:first-child{margin:.8em 0 .2em}.ui-autocomplete .ui-menu-item{padding:.2em .8em}.ui-autocomplete .ui-state-focus{border:0;background:#ebebeb}.widgetHr{margin-top:0}.headerLinksMails .btn-group{margin-top:11px}.finalDiscountUI,.finalTaxUI{bottom:5px}.sideBarTitle{font-size:20px}.globalSearchInput{width:300px}#groupsDetailContainer strong{line-height:21px}#addTaskContainer #taskStatus{margin-left:10px}.scanerMailActionsButtons{min-width:96px}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#404040}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active,.ui-menu .ui-menu-item a.ui-widget-content{font-weight:bold;margin:0;background-color:#428bca;border-color:#357ebd;color:#fff;display:block}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style:none}#layoutEditorButtons{margin-bottom:10px;margin-top:-10px}.individualTaxContainer{text-align:left!important}.suppliesItemTable .input-group{max-width:200px}.suppliesItemTable .rowName .input-group{max-width:400px}.suppliesItemTable td,.suppliesItemTable th{border:1px solid #ddd}.suppliesItemTable tfoot td.hideTd{border:0;background:#fafafb} \ No newline at end of file diff --git a/modules/PriceBooks/models/Record.php b/modules/PriceBooks/models/Record.php index 2ac64606d0f5..67fecafa1734 100644 --- a/modules/PriceBooks/models/Record.php +++ b/modules/PriceBooks/models/Record.php @@ -17,7 +17,7 @@ class PriceBooks_Record_Model extends Vtiger_Record_Model { * Function return the url to fetch List Price of the Product for the current PriceBook * @return */ - function getProductListPriceURL() { + function getProductUnitPriceURL() { $url = 'module=PriceBooks&action=ProductListPrice&record=' . $this->getId(); $rawData = $this->getRawData(); $src_record = $rawData['src_record']; diff --git a/modules/PriceBooks/views/Popup.php b/modules/PriceBooks/views/Popup.php index 74f629e48afa..822b127b3a97 100644 --- a/modules/PriceBooks/views/Popup.php +++ b/modules/PriceBooks/views/Popup.php @@ -36,7 +36,7 @@ public function initializeListViewContents(Vtiger_Request $request, Vtiger_Viewe } if (empty($getUrl) && !empty($sourceField) && $sourceField == 'productid' && !$multiSelectMode) { - $getUrl = 'getProductListPriceURL'; + $getUrl = 'getProductUnitPriceURL'; } if(empty($cvId)) { diff --git a/modules/Supplies/actions/GetDetails.php b/modules/Supplies/actions/GetDetails.php index a77599e4551d..28fb77b65388 100644 --- a/modules/Supplies/actions/GetDetails.php +++ b/modules/Supplies/actions/GetDetails.php @@ -28,8 +28,8 @@ function process(Vtiger_Request $request) $conversionRate = 1; $response = new Vtiger_Response(); - $listPriceValues = $taxes = []; - $listPrice = false; + $unitPriceValues = $taxes = []; + $unitPrice = false; if (empty($idList)) { $info = $this->getRecordDetail($recordId, $currencyId); @@ -45,28 +45,28 @@ function process(Vtiger_Request $request) function getRecordDetail($recordId, $currencyId) { $conversionRate = 1; - $listPriceValues = $taxes = []; - $listPrice = false; + $unitPriceValues = $taxes = []; + $unitPrice = false; $recordModel = Vtiger_Record_Model::getInstanceById($recordId); $moduleName = $recordModel->getModuleName(); if (in_array($moduleName, ['Products', 'Services'])) { - $listPriceValues = $recordModel->getListPriceValues($recordModel->getId()); + $unitPriceValues = $recordModel->getListPriceValues($recordModel->getId()); $priceDetails = $recordModel->getPriceDetails(); foreach ($priceDetails as $currencyDetails) { if ($currencyId == $currencyDetails['curid']) { $conversionRate = $currencyDetails['conversionrate']; } } - $listPrice = (float) $recordModel->get('unit_price') * (float) $conversionRate; + $unitPrice = (float) $recordModel->get('unit_price') * (float) $conversionRate; } $info = [ $recordId => [ 'id' => $recordId, 'name' => decode_html($recordModel->getName()), - 'price' => $listPrice, - 'listpricevalues' => $listPriceValues, + 'price' => $unitPrice, + 'unitPriceValues' => $unitPriceValues, 'description' => decode_html($recordModel->get('description')), ]]; return $info; diff --git a/modules/Supplies/fields/Basic.php b/modules/Supplies/fields/Basic.php index 22da6b6ba3b3..776491ff4b42 100644 --- a/modules/Supplies/fields/Basic.php +++ b/modules/Supplies/fields/Basic.php @@ -15,6 +15,7 @@ class Supplies_Basic_Field extends Vtiger_Base_Model protected $columnname = ''; protected $dbType = 'varchar(100)'; protected $customColumn = []; + protected $summationValue = false; /** * Geting database-type of field @@ -70,6 +71,11 @@ public function getCustomColumn() return $this->customColumn; } + public function isSummary() + { + return $this->summationValue; + } + /** * Data field instance initialization * @param array $valueArray Array for initialization diff --git a/modules/Supplies/fields/Discount.php b/modules/Supplies/fields/Discount.php index 71ea651c30b4..5c68aa93ac56 100644 --- a/modules/Supplies/fields/Discount.php +++ b/modules/Supplies/fields/Discount.php @@ -16,6 +16,7 @@ class Supplies_Discount_Field extends Supplies_Basic_Field protected $customColumn = [ 'discountparam' => 'varchar(255) NOT NULL' ]; + protected $summationValue = true; /** * Geting value to display diff --git a/modules/Supplies/fields/GrossPrice.php b/modules/Supplies/fields/GrossPrice.php index cab71085e557..7d046e9a4f2c 100644 --- a/modules/Supplies/fields/GrossPrice.php +++ b/modules/Supplies/fields/GrossPrice.php @@ -13,6 +13,7 @@ class Supplies_GrossPrice_Field extends Supplies_Basic_Field protected $defaultLabel = 'LBL_GROSS_PRICE'; protected $columnname = 'gross'; protected $dbType = 'decimal(27,8) DEFAULT \'0\''; + protected $summationValue = true; /** * Geting value to display diff --git a/modules/Supplies/fields/NetPrice.php b/modules/Supplies/fields/NetPrice.php index a4e4aee46ebd..4b29a12b0d80 100644 --- a/modules/Supplies/fields/NetPrice.php +++ b/modules/Supplies/fields/NetPrice.php @@ -10,9 +10,10 @@ class Supplies_NetPrice_Field extends Supplies_Basic_Field { protected $name = 'NetPrice'; - protected $defaultLabel = 'LBL_NET_PRICE'; + protected $defaultLabel = 'LBL_DISCOUNT_PRICE'; protected $columnname = 'net'; protected $dbType = 'decimal(27,8) DEFAULT \'0\''; + protected $summationValue = true; /** * Geting value to display diff --git a/modules/Supplies/fields/Tax.php b/modules/Supplies/fields/Tax.php index c4bcfd72ea0b..5a279260bd49 100644 --- a/modules/Supplies/fields/Tax.php +++ b/modules/Supplies/fields/Tax.php @@ -16,6 +16,7 @@ class Supplies_Tax_Field extends Supplies_Basic_Field protected $customColumn = [ 'taxparam' => 'varchar(255) NOT NULL' ]; + protected $summationValue = true; /** * Geting value to display diff --git a/modules/Supplies/fields/TotalPrice.php b/modules/Supplies/fields/TotalPrice.php new file mode 100644 index 000000000000..5020c77463c6 --- /dev/null +++ b/modules/Supplies/fields/TotalPrice.php @@ -0,0 +1,27 @@ + + */ +class Supplies_TotalPrice_Field extends Supplies_Basic_Field +{ + + protected $name = 'TotalPrice'; + protected $defaultLabel = 'LBL_TOTAL_PRICE'; + protected $columnname = 'total'; + protected $dbType = 'decimal(27,8) DEFAULT \'0\''; + protected $summationValue = true; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return CurrencyField::convertToUserFormat($value, null, true); + } +} diff --git a/modules/Supplies/fields/Price.php b/modules/Supplies/fields/UnitPrice.php similarity index 66% rename from modules/Supplies/fields/Price.php rename to modules/Supplies/fields/UnitPrice.php index 6002606ed5ec..27b885d0ded6 100644 --- a/modules/Supplies/fields/Price.php +++ b/modules/Supplies/fields/UnitPrice.php @@ -1,18 +1,19 @@ */ -class Supplies_Price_Field extends Supplies_Basic_Field +class Supplies_UnitPrice_Field extends Supplies_Basic_Field { - protected $name = 'Price'; - protected $defaultLabel = 'LBL_PRICE'; + protected $name = 'UnitPrice'; + protected $defaultLabel = 'LBL_UNIT_PRICE'; protected $columnname = 'price'; protected $dbType = 'decimal(27,8)'; + protected $summationValue = true; /** * Geting value to display diff --git a/modules/Supplies/models/Record.php b/modules/Supplies/models/Record.php index a1071c617bad..941f8cd638bc 100644 --- a/modules/Supplies/models/Record.php +++ b/modules/Supplies/models/Record.php @@ -9,7 +9,7 @@ class Supplies_Record_Model extends Vtiger_Record_Model { - protected $jsonFields = ['discountparam','taxparam']; + protected $jsonFields = ['discountparam', 'taxparam']; /** * Save supplie data @@ -39,7 +39,6 @@ public function saveSupplieData(Vtiger_Request $request) } $db->insert($table, $insertData); } - $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); } @@ -53,6 +52,9 @@ public function getValueForSave(Vtiger_Request $request, $field, $i) } else if ($request->has($field)) { $value = $request->get($field); } + if (in_array($field, ['price','gross','net','discount','purchase','margin','marginp','tax','total'])) { + $value = CurrencyField::convertToDBFormat($value, null, true); + } return $value; } From 5fe4c2dcb7175274583a24cc0cb1a2319cb121f5 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Fri, 21 Aug 2015 14:16:19 +0200 Subject: [PATCH 026/489] Added number parsers --- layouts/vlayout/modules/Vtiger/Header.tpl | 6 ++ layouts/vlayout/resources/app.js | 31 ++++++++++ layouts/vlayout/resources/app.min.js | 2 +- .../resources/validator/FieldValidator.js | 61 +++++++++++++++++++ .../resources/validator/FieldValidator.min.js | 2 +- 5 files changed, 100 insertions(+), 2 deletions(-) diff --git a/layouts/vlayout/modules/Vtiger/Header.tpl b/layouts/vlayout/modules/Vtiger/Header.tpl index a71f9913e2b8..57735d6d6866 100644 --- a/layouts/vlayout/modules/Vtiger/Header.tpl +++ b/layouts/vlayout/modules/Vtiger/Header.tpl @@ -42,10 +42,16 @@ + + + + + +
    diff --git a/layouts/vlayout/resources/app.js b/layouts/vlayout/resources/app.js index 4f87d0b8d732..86b45bd62f94 100644 --- a/layouts/vlayout/resources/app.js +++ b/layouts/vlayout/resources/app.js @@ -14,6 +14,7 @@ var app = { */ languageString: [], weekDaysArray: {Sunday: 0, Monday: 1, Tuesday: 2, Wednesday: 3, Thursday: 4, Friday: 5, Saturday: 6}, + cacheParams: [], /** * Function to get the module name. This function will get the value from element which has id module * @return : string - module name @@ -1085,6 +1086,36 @@ var app = { rand = Math.floor(Math.random() * chars.length); return newchar = chars.substring(rand, rand + 1); }, + getMainParams: function (params) { + if (app.cacheParams[params] != undefined) { + return app.cacheParams[params]; + } + var value = $('#'+params).val(); + app.cacheParams[params] = value; + return value; + }, + parseNumberToShow: function (val) { + if(val == undefined){ + val = 0; + } + var numberOfDecimal = parseInt(app.getMainParams('numberOfCurrencyDecimal')); + var decimalSeparator = app.getMainParams('currencyDecimalSeparator'); + val = parseFloat(val).toFixed(numberOfDecimal); + if(decimalSeparator != '.'){ + val = val.toString().replace('.', decimalSeparator); + } + return val; + }, + parseNumberToFloat: function (val) { + var numberOfDecimal = parseInt(app.getMainParams('numberOfCurrencyDecimal')); + if(val == undefined){ + val = 0; + } + if(app.getMainParams('currencyDecimalSeparator') == ','){ + val = val.toString().replace(/\s/g, "").replace(",", "."); + } + return parseFloat(val); + }, } jQuery(document).ready(function () { diff --git a/layouts/vlayout/resources/app.min.js b/layouts/vlayout/resources/app.min.js index 7642c08c90f7..b0c7599712e0 100644 --- a/layouts/vlayout/resources/app.min.js +++ b/layouts/vlayout/resources/app.min.js @@ -1,2 +1,2 @@ -var app={languageString:[],weekDaysArray:{Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6},getModuleName:function(){return jQuery("#module").val()},getParentModuleName:function(){return jQuery("#parent").val()},getViewName:function(){return jQuery("#view").val()},getRecordId:function(){var a=jQuery('[name="view"]').val();var b;if(a=="Edit"){b=jQuery('[name="record"]').val()}else{if(a=="Detail"){b=jQuery("#recordId").val()}}return b},getContentsContainer:function(){return jQuery(".bodyContents")},changeSelectElementView:function(e,b,a){var f=this;var d=jQuery();if(typeof e=="undefined"){e=jQuery("body")}if(b=="select2"){return app.showSelect2ElementView(e,a)}if(b=="selectize"){return app.showSelectizeElementView(e,a)}d=jQuery(".chzn-select",e);if(e.is("select.chzn-select")){d=e}d.each(function(){if($(this).prop("id").length==0){$(this).attr("id","sel"+f.generateRandomChar()+f.generateRandomChar()+f.generateRandomChar())}});d.filter("[multiple]").filter('[data-validation-engine*="validate"]').on("change",function(i){jQuery(i.currentTarget).trigger("focusout")});var h={no_results_text:app.vtranslate("JS_NO_RESULTS_FOUND")+":"};var c=app.getModuleName();if(d.filter("[multiple]")&&c!="Install"){h.placeholder_text_multiple=" "+app.vtranslate("JS_SELECT_SOME_OPTIONS")}else{if(c!="Install"){h.placeholder_text_single=" "+app.vtranslate("JS_SELECT_AN_OPTION")}}d.chosen(h);d.each(function(){var i=$(this);if(i.attr("readonly")=="readonly"){i.on("chosen:updated",function(){if(i.attr("readonly")){var j=i.is(":disabled");i.attr("disabled","disabled");i.data("chosen").search_field_disabled();if(j){i.attr("disabled","disabled")}else{i.removeAttr("disabled")}}});i.trigger("chosen:updated")}});var g=jQuery(".chosen-container-multi .default").css("width","100%");return g},destroyChosenElement:function(b){var a=jQuery();if(typeof b=="undefined"){b=jQuery("body")}a=jQuery(".chzn-select",b);if(b.is("select.chzn-select")){a=b}a.css("display","block").removeClass("chzn-done").data("chosen",null).next().remove();return a},showSelect2ElementView:function(c,f){if(typeof f=="undefined"){f={}}var d=c.data();if(d!=null){f=jQuery.extend(d,f)}f.language={};f.theme="bootstrap";f.width="100%";f.language.noResults=function(g){return app.vtranslate("JS_NO_RESULTS_FOUND")};if(typeof f.customSortOptGroup!="undefined"&&f.customSortOptGroup){jQuery("optgroup",c).each(function(){var h=jQuery(this);var g=h.children().toArray().sort(function(k,j){var l=jQuery(k).text();var i=jQuery(j).text();return l=b){a.updateResults()}})},getSerializedData:function(h,j){if(typeof j=="undefined"){j="string"}h=jQuery(h);var i=h.children().serialize();if(j=="string"){return i}var g={};var b=i.split("&");for(var e in b){var f=b[e];var a=f.split("=");var d=a[0];var c=a[1];g[d]=decodeURIComponent(c)}return g},showModalWindow:function(g,d,a,f){if(typeof g=="object"&&g!=null&&!(g instanceof jQuery)){f=g.css;a=g.cb;d=g.url;g=g.data}if(typeof d=="function"){if(typeof a=="object"){f=a}a=d;d=false}else{if(typeof d=="object"){a=function(){};f=d;d=false}}if(typeof a!="function"){a=function(){}}var h="globalmodal";var b=jQuery("#"+h);if(b.length){b.remove()}var c=jQuery(".modal-backdrop");if(c.length){c.remove()}b=jQuery("
    ");b.attr("id",h);var e=function(i){var j={show:true,};if(jQuery("#backgroundClosingModal").val()!=1){j.backdrop="static"}if(typeof f=="object"){b.css(f);j=jQuery.extend(j,f)}b.html(i);$.fn.modal.Constructor.prototype.enforceFocus=function(k){$(document).off("focusin.bs.modal").on("focusin.bs.modal",$.proxy(function(l){if($(l.target).hasClass("select2-search__field")){return true}if(this.$element[0]!==l.target&&!this.$element.has(l.target).length){this.$element.trigger("focus")}},this))};b.find(".modal:first").modal(j);jQuery("body").append(b);app.changeSelectElementView(b);app.showSelect2ElementView(b.find("select.select2"));app.showSelectizeElementView(b.find("select.selectize"));app.registerEventForDatePickerFields(b);a(b)};if(g){e(g)}else{jQuery.get(d).then(function(i){e(i)})}return b},hideModalWindow:function(d){var c="globalmodal";var b=jQuery("#"+c);if(b.length<=0){return}if(typeof d!="function"){d=function(){}}var a=b.find(".modal");a.modal("hide");a.one("hidden.bs.modal",d)},isHidden:function(a){if(a.css("display")=="none"){return true}return false},validationEngineOptions:{scroll:false,promptPosition:"topLeft",prettySelect:true,useSuffix:"_chosen",usePrefix:"s2id_",},validationEngineOptionsForRecord:{scroll:false,promptPosition:"topLeft",prettySelect:true,useSuffix:"_chosen",usePrefix:"s2id_",validateNonVisibleFields:true,onBeforePromptType:function(a){var b=a.closest(".blockContainer");if(b.find("tbody").is(":hidden")){b.find(".blockHeader").click()}},},formAlignmentAfterValidation:function(d){var c=d.find(".formError:not('.greenPopup'):first");if(c.length>0){var a=c.offset().top;var b=a-105;jQuery("html").animate({scrollTop:b},"slow")}},convertToDatePickerFormat:function(a){switch(a){case"yyyy-mm-dd":return"Y-m-d";break;case"mm-dd-yyyy":return"m-d-Y";break;case"dd-mm-yyyy":return"d-m-Y";break;case"yyyy.mm.dd":return"Y.m.d";break;case"mm.dd.yyyy":return"m.d.Y";break;case"dd.mm.yyyy":return"d.m.Y";break;case"yyyy/mm/dd":return"Y/m/d";break;case"mm/dd/yyyy":return"m/d/Y";break;case"dd/mm/yyyy":return"d/m/Y";break}},convertTojQueryDatePickerFormat:function(b){var e=0;var g="-";if(b.indexOf("-")!=-1){g="-"}if(b.indexOf(".")!=-1){g="."}if(b.indexOf("/")!=-1){g="/"}var f=b.split(g);for(var e in f){var d=f[e];var a=d.length;if(a==4){var c=d.substring(0,2);f[e]=c}}var h=f.join(g);return h},getDateInVtigerFormat:function(a,c){var d=app.convertTojQueryDatePickerFormat(a);var b=jQuery.datepicker.formatDate(d,c);return b},getDateInDBInsertFormat:function(a,g){var b=0;var k="-";if(a.indexOf("-")!=-1){k="-"}if(a.indexOf(".")!=-1){k="."}if(a.indexOf("/")!=-1){k="/"}var j=a.split(k);var h=g.split(k);var f="";var d="";var e="";for(b in j){var c=j[b];switch(c){case"dd":f=h[b];break;case"mm":d=h[b];break;case"yyyy":e=h[b];break}}return e+"-"+d+"-"+f},registerEventForTextAreaFields:function(a){if(typeof a=="undefined"){a=jQuery("body")}a=jQuery(a);if(a.is("textarea")){var b=a}else{var b=jQuery("textarea",a)}if(b.length==0){return}b.autosize()},registerEventForDatePickerFields:function(l,c,d){if(typeof l=="undefined"){l=jQuery("body")}if(typeof c=="undefined"){c=true}l=jQuery(l);if(l.hasClass("dateField")){var j=l}else{var j=jQuery(".dateField",l)}if(j.length==0){return}if(c==true){var f=j.closest(".date");jQuery(".input-group-addon",f).on("click",function(n){var m=jQuery(n.currentTarget);m.closest(".date").find("input.dateField").get(0).focus()})}var a=j.data("dateFormat");var e=app.convertToDatePickerFormat(a);var i=jQuery("body").data("language");var b=i.split("_");var h=jQuery("#start_day").val();if(h==""||typeof(h)=="undefined"){var k=1}else{k=this.weekDaysArray[h]}var g={format:e,calendars:1,locale:$.fn.datepicker.dates[b[0]],starts:k,eventName:"focus",onChange:function(p){var m=jQuery(this).data("datepicker").el;m=jQuery(m);var n=jQuery("#"+jQuery(this).data("datepicker").id);var o=n.find("table.datepickerViewDays");if(o.length>0&&m.val()!=p){m.DatePickerHide();m.blur()}m.val(p).trigger("change").focusout()},onBeforeShow:function(m){j.each(function(n,o){var p=jQuery(o);if(p[0]!=document.activeElement){p.DatePickerHide();p.blur()}})},};if(typeof d!="undefined"){var g=jQuery.extend(g,d)}j.each(function(n,p){var q=jQuery(p);var m=new Date();var o=app.getDateInVtigerFormat(a,m);if(q.val()!=""){o=q.val()}g.date=o;g.current=o;q.DatePicker(g)})},registerEventForDateFields:function(a){if(typeof a=="undefined"){a=jQuery("body")}a=jQuery(a);if(a.hasClass("dateField")){var b=a}else{var b=jQuery(".dateField",a)}b.datepicker({autoclose:true}).on("changeDate",function(f){var e=jQuery(f.currentTarget);var c=e.data("dateFormat");var g=app.getDateInVtigerFormat(c,f.date);var d=jQuery.datepicker.formatDate(g,f.date);e.val(d)})},registerEventForTimeFields:function(b,a,f){if(typeof cotainer=="undefined"){b=jQuery("body")}if(typeof a=="undefined"){a=true}b=jQuery(b);if(b.hasClass("timepicker-default")){var c=b}else{var c=b.find(".timepicker-default")}if(a==true){var d=c.closest(".time");jQuery(".input-group-addon",d).on("click",function(i){var h=jQuery(i.currentTarget);h.closest(".time").find(".timepicker-default").focus()})}if(typeof f=="undefined"){f={}}var g=c.data("format");if(g=="24"){g="H:i"}else{g="h:i A"}var e={timeFormat:g,className:"timePicker"};var f=jQuery.extend(e,f);c.timepicker(f);return b},destroyTimeFields:function(a){if(typeof cotainer=="undefined"){a=jQuery("body")}if(a.hasClass("timepicker-default")){var b=a}else{var b=a.find(".timepicker-default")}b.data("timepicker-list",null);return a},getChosenElementFromSelect:function(a){var b=a.attr("id");var c=b+"_chosen";return jQuery("#"+c)},getSelect2ElementFromSelect:function(a){var b=a.attr("id");var c="select2-"+b+"-container";return jQuery("#"+c).closest(".select2-container")},getSelectElementFromChosen:function(c){var b=c.attr("id");var a=b.split("_chosen");var d=a["0"];return jQuery("#"+d)},setInheritWidth:function(a){jQuery(a).each(function(b,c){var d=jQuery(c).parent().width();jQuery(c).width(d)})},initGuiders:function(a){},showScrollBar:function(b,a){if(typeof a=="undefined"){a={}}if(typeof a.height=="undefined"){a.height=b.css("height")}return b.slimScroll(a)},showHorizontalScrollBar:function(b,a){if(typeof a=="undefined"){a={}}var c={horizontalScroll:true,theme:"dark-thick",advanced:{autoExpandHorizontalScroll:true}};if(typeof a!="undefined"){var c=jQuery.extend(c,a)}return b.mCustomScrollbar(c)},vtranslate:function(b){if(app.languageString[b]!=undefined){return app.languageString[b]}else{var a=jQuery("#js_strings").text();if(a!=""){app.languageString=JSON.parse(a);if(b in app.languageString){return app.languageString[b]}}}return b},setContentsHeight:function(){var a=parseInt(jQuery(".mainContainer").css("margin-top"))+21;jQuery(".bodyContents").css("min-height",(jQuery(window).innerHeight()-a))},vimage_path:function(a){return jQuery("body").data("skinpath")+"/images/"+a},cacheNSKey:function(a){return"vtiger6."+a},cacheGet:function(b,a){b=this.cacheNSKey(b);return jQuery.jStorage.get(b,a)},cacheSet:function(a,b){a=this.cacheNSKey(a);jQuery.jStorage.set(a,b)},cacheClear:function(a){a=this.cacheNSKey(a);return jQuery.jStorage.deleteKey(a)},htmlEncode:function(a){if(a){return jQuery("
    ").text(a).html()}else{return""}},htmlDecode:function(a){if(a){return $("
    ").html(a).text()}else{return""}},placeAtCenter:function(a){a.css("position","absolute");a.css("top",((jQuery(window).height()-a.outerHeight())/2)+jQuery(window).scrollTop()+"px");a.css("left",((jQuery(window).width()-a.outerWidth())/2)+jQuery(window).scrollLeft()+"px")},getvalidationEngineOptions:function(a){return app.validationEngineOptions},notifyPostAjaxReady:function(){jQuery(document).trigger("postajaxready")},listenPostAjaxReady:function(a){jQuery(document).on("postajaxready",a)},setFormValues:function(b){for(var a in b){jQuery(a).val(b[a])}},setRTEValues:function(c){for(var a in c){var b=CKEDITOR.instances[a];if(b){b.setData(c[a])}}},getPageController:function(){var c=app.getModuleName();var a=app.getViewName();var e=app.getParentModuleName();var d=e+"_"+c+"_"+a+"_Js";if(typeof window[d]=="undefined"){d=e+"_Vtiger_"+a+"_Js"}if(typeof window[d]=="undefined"){d=c+"_"+a+"_Js"}var b=jQuery("#extendModules").val();if(typeof window[d]=="undefined"&&b!=undefined){d=b+"_"+a+"_Js"}if(typeof window[d]=="undefined"){d="Vtiger_"+a+"_Js"}if(typeof window[d]!="undefined"){return new window[d]()}},getDecodedValue:function(a){return jQuery("
    ").html(a).text()},getColorContrast:function(f){var d=parseInt(f.substr(0,2),16);var c=parseInt(f.substr(2,2),16);var a=parseInt(f.substr(4,2),16);var e=((d*299)+(c*587)+(a*114))/1000;return(e>=128)?"light":"dark"},updateRowHeight:function(){var c=jQuery("#row_type").val();if(c.length<=0){var b=app.cacheGet("widthType","mediumWidthType");var e=b;switch(e){case"narrowWidthType":e="narrow";break;case"wideWidthType":e="wide";break;default:e="medium"}var a=jQuery("#current_user_id").val();var d={module:"Users",action:"SaveAjax",record:a,value:e,field:"rowheight"};AppConnector.request(d).then(function(){jQuery(c).val(e)})}},getCookie:function(b){var c=document.cookie;var d=c.indexOf(" "+b+"=");if(d==-1){d=c.indexOf(b+"=")}if(d==-1){c=null}else{d=c.indexOf("=",d)+1;var a=c.indexOf(";",d);if(a==-1){a=c.length}c=unescape(c.substring(d,a))}return c},setCookie:function(a,d,b){var e=new Date();e.setDate(e.getDate()+b);var c=escape(d)+((b==null)?"":"; expires="+e.toUTCString());document.cookie=a+"="+c},getUrlVar:function(b){var a=function(){var d={};var c=window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(e,f,g){d[f]=g});return d};return a()[b]},getStringDate:function(b){var c=b.getDate();var a=b.getMonth()+1;var e=b.getFullYear();c=(c<=9)?("0"+c):c;a=(a<=9)?("0"+a):a;return e+"-"+a+"-"+c},formatDate:function(b){var j=b.getFullYear(),a=b.getMonth()+1,g=b.getDate(),f=b.getHours(),c=b.getMinutes(),e=b.getSeconds();return j+"-"+this.formatDateZ(a)+"-"+this.formatDateZ(g)+" "+this.formatDateZ(f)+":"+this.formatDateZ(c)+":"+this.formatDateZ(e)},formatDateZ:function(a){return(a<=9?"0"+a:a)},saveAjax:function(d,c){var a=jQuery.Deferred();var b={};b.module=app.getModuleName();b.parent=app.getParentModuleName();b.action="SaveAjax";b.mode=d;b.param=c;AppConnector.request(b).then(function(e){a.resolve(e)},function(e){a.reject()});return a.promise()},showBtnSwitch:function(a,b){if(typeof b=="undefined"){b={}}a.bootstrapSwitch(b);return a},generateRandomChar:function(){var c,b,a;c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ";a=Math.floor(Math.random()*c.length);return b=c.substring(a,a+1)},};jQuery(document).ready(function(){app.changeSelectElementView();app.showSelect2ElementView(jQuery("body").find("select.select2"));app.showSelectizeElementView(jQuery("body").find("select.selectize"));app.showPopoverElementView(jQuery("body").find(".popoverTooltip"));app.showBtnSwitch(jQuery("body").find(".switchBtn"));app.setContentsHeight();app.updateRowHeight();jQuery(window).resize(function(){app.setContentsHeight()});String.prototype.toCamelCase=function(){var b=this.valueOf();return b.charAt(0).toUpperCase()+b.slice(1).toLowerCase()};if(/MSIE/.test(navigator.userAgent)||(/Trident/).test(navigator.userAgent)){jQuery("textarea").resizable()}var a=app.getPageController();if(a){a.registerEvents()}});function resizeUI5IframeReset(){jQuery("#ui5frame").height(650)}function resizeUI5Iframe(a){jQuery("#ui5frame").height(parseInt(a,10)+15)}; \ No newline at end of file +var app={languageString:[],weekDaysArray:{Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6},cacheParams:[],getModuleName:function(){return jQuery("#module").val()},getParentModuleName:function(){return jQuery("#parent").val()},getViewName:function(){return jQuery("#view").val()},getRecordId:function(){var a=jQuery('[name="view"]').val();var b;if(a=="Edit"){b=jQuery('[name="record"]').val()}else{if(a=="Detail"){b=jQuery("#recordId").val()}}return b},getContentsContainer:function(){return jQuery(".bodyContents")},changeSelectElementView:function(e,b,a){var f=this;var d=jQuery();if(typeof e=="undefined"){e=jQuery("body")}if(b=="select2"){return app.showSelect2ElementView(e,a)}if(b=="selectize"){return app.showSelectizeElementView(e,a)}d=jQuery(".chzn-select",e);if(e.is("select.chzn-select")){d=e}d.each(function(){if($(this).prop("id").length==0){$(this).attr("id","sel"+f.generateRandomChar()+f.generateRandomChar()+f.generateRandomChar())}});d.filter("[multiple]").filter('[data-validation-engine*="validate"]').on("change",function(i){jQuery(i.currentTarget).trigger("focusout")});var h={no_results_text:app.vtranslate("JS_NO_RESULTS_FOUND")+":"};var c=app.getModuleName();if(d.filter("[multiple]")&&c!="Install"){h.placeholder_text_multiple=" "+app.vtranslate("JS_SELECT_SOME_OPTIONS")}else{if(c!="Install"){h.placeholder_text_single=" "+app.vtranslate("JS_SELECT_AN_OPTION")}}d.chosen(h);d.each(function(){var i=$(this);if(i.attr("readonly")=="readonly"){i.on("chosen:updated",function(){if(i.attr("readonly")){var j=i.is(":disabled");i.attr("disabled","disabled");i.data("chosen").search_field_disabled();if(j){i.attr("disabled","disabled")}else{i.removeAttr("disabled")}}});i.trigger("chosen:updated")}});var g=jQuery(".chosen-container-multi .default").css("width","100%");return g},destroyChosenElement:function(b){var a=jQuery();if(typeof b=="undefined"){b=jQuery("body")}a=jQuery(".chzn-select",b);if(b.is("select.chzn-select")){a=b}a.css("display","block").removeClass("chzn-done").data("chosen",null).next().remove();return a},showSelect2ElementView:function(c,f){if(typeof f=="undefined"){f={}}var d=c.data();if(d!=null){f=jQuery.extend(d,f)}f.language={};f.theme="bootstrap";f.width="100%";f.language.noResults=function(g){return app.vtranslate("JS_NO_RESULTS_FOUND")};if(typeof f.customSortOptGroup!="undefined"&&f.customSortOptGroup){jQuery("optgroup",c).each(function(){var h=jQuery(this);var g=h.children().toArray().sort(function(k,j){var l=jQuery(k).text();var i=jQuery(j).text();return l=b){a.updateResults()}})},getSerializedData:function(h,j){if(typeof j=="undefined"){j="string"}h=jQuery(h);var i=h.children().serialize();if(j=="string"){return i}var g={};var b=i.split("&");for(var e in b){var f=b[e];var a=f.split("=");var d=a[0];var c=a[1];g[d]=decodeURIComponent(c)}return g},showModalWindow:function(g,d,a,f){if(typeof g=="object"&&g!=null&&!(g instanceof jQuery)){f=g.css;a=g.cb;d=g.url;g=g.data}if(typeof d=="function"){if(typeof a=="object"){f=a}a=d;d=false}else{if(typeof d=="object"){a=function(){};f=d;d=false}}if(typeof a!="function"){a=function(){}}var h="globalmodal";var b=jQuery("#"+h);if(b.length){b.remove()}var c=jQuery(".modal-backdrop");if(c.length){c.remove()}b=jQuery("
    ");b.attr("id",h);var e=function(i){var j={show:true,};if(jQuery("#backgroundClosingModal").val()!=1){j.backdrop="static"}if(typeof f=="object"){b.css(f);j=jQuery.extend(j,f)}b.html(i);$.fn.modal.Constructor.prototype.enforceFocus=function(k){$(document).off("focusin.bs.modal").on("focusin.bs.modal",$.proxy(function(l){if($(l.target).hasClass("select2-search__field")){return true}if(this.$element[0]!==l.target&&!this.$element.has(l.target).length){this.$element.trigger("focus")}},this))};b.find(".modal:first").modal(j);jQuery("body").append(b);app.changeSelectElementView(b);app.showSelect2ElementView(b.find("select.select2"));app.showSelectizeElementView(b.find("select.selectize"));app.registerEventForDatePickerFields(b);a(b)};if(g){e(g)}else{jQuery.get(d).then(function(i){e(i)})}return b},hideModalWindow:function(d){var c="globalmodal";var b=jQuery("#"+c);if(b.length<=0){return}if(typeof d!="function"){d=function(){}}var a=b.find(".modal");a.modal("hide");a.one("hidden.bs.modal",d)},isHidden:function(a){if(a.css("display")=="none"){return true}return false},validationEngineOptions:{scroll:false,promptPosition:"topLeft",prettySelect:true,useSuffix:"_chosen",usePrefix:"s2id_",},validationEngineOptionsForRecord:{scroll:false,promptPosition:"topLeft",prettySelect:true,useSuffix:"_chosen",usePrefix:"s2id_",validateNonVisibleFields:true,onBeforePromptType:function(a){var b=a.closest(".blockContainer");if(b.find("tbody").is(":hidden")){b.find(".blockHeader").click()}},},formAlignmentAfterValidation:function(d){var c=d.find(".formError:not('.greenPopup'):first");if(c.length>0){var a=c.offset().top;var b=a-105;jQuery("html").animate({scrollTop:b},"slow")}},convertToDatePickerFormat:function(a){switch(a){case"yyyy-mm-dd":return"Y-m-d";break;case"mm-dd-yyyy":return"m-d-Y";break;case"dd-mm-yyyy":return"d-m-Y";break;case"yyyy.mm.dd":return"Y.m.d";break;case"mm.dd.yyyy":return"m.d.Y";break;case"dd.mm.yyyy":return"d.m.Y";break;case"yyyy/mm/dd":return"Y/m/d";break;case"mm/dd/yyyy":return"m/d/Y";break;case"dd/mm/yyyy":return"d/m/Y";break}},convertTojQueryDatePickerFormat:function(b){var e=0;var g="-";if(b.indexOf("-")!=-1){g="-"}if(b.indexOf(".")!=-1){g="."}if(b.indexOf("/")!=-1){g="/"}var f=b.split(g);for(var e in f){var d=f[e];var a=d.length;if(a==4){var c=d.substring(0,2);f[e]=c}}var h=f.join(g);return h},getDateInVtigerFormat:function(a,c){var d=app.convertTojQueryDatePickerFormat(a);var b=jQuery.datepicker.formatDate(d,c);return b},getDateInDBInsertFormat:function(a,g){var b=0;var k="-";if(a.indexOf("-")!=-1){k="-"}if(a.indexOf(".")!=-1){k="."}if(a.indexOf("/")!=-1){k="/"}var j=a.split(k);var h=g.split(k);var f="";var d="";var e="";for(b in j){var c=j[b];switch(c){case"dd":f=h[b];break;case"mm":d=h[b];break;case"yyyy":e=h[b];break}}return e+"-"+d+"-"+f},registerEventForTextAreaFields:function(a){if(typeof a=="undefined"){a=jQuery("body")}a=jQuery(a);if(a.is("textarea")){var b=a}else{var b=jQuery("textarea",a)}if(b.length==0){return}b.autosize()},registerEventForDatePickerFields:function(l,c,d){if(typeof l=="undefined"){l=jQuery("body")}if(typeof c=="undefined"){c=true}l=jQuery(l);if(l.hasClass("dateField")){var j=l}else{var j=jQuery(".dateField",l)}if(j.length==0){return}if(c==true){var f=j.closest(".date");jQuery(".input-group-addon",f).on("click",function(n){var m=jQuery(n.currentTarget);m.closest(".date").find("input.dateField").get(0).focus()})}var a=j.data("dateFormat");var e=app.convertToDatePickerFormat(a);var i=jQuery("body").data("language");var b=i.split("_");var h=jQuery("#start_day").val();if(h==""||typeof(h)=="undefined"){var k=1}else{k=this.weekDaysArray[h]}var g={format:e,calendars:1,locale:$.fn.datepicker.dates[b[0]],starts:k,eventName:"focus",onChange:function(p){var m=jQuery(this).data("datepicker").el;m=jQuery(m);var n=jQuery("#"+jQuery(this).data("datepicker").id);var o=n.find("table.datepickerViewDays");if(o.length>0&&m.val()!=p){m.DatePickerHide();m.blur()}m.val(p).trigger("change").focusout()},onBeforeShow:function(m){j.each(function(n,o){var p=jQuery(o);if(p[0]!=document.activeElement){p.DatePickerHide();p.blur()}})},};if(typeof d!="undefined"){var g=jQuery.extend(g,d)}j.each(function(n,p){var q=jQuery(p);var m=new Date();var o=app.getDateInVtigerFormat(a,m);if(q.val()!=""){o=q.val()}g.date=o;g.current=o;q.DatePicker(g)})},registerEventForDateFields:function(a){if(typeof a=="undefined"){a=jQuery("body")}a=jQuery(a);if(a.hasClass("dateField")){var b=a}else{var b=jQuery(".dateField",a)}b.datepicker({autoclose:true}).on("changeDate",function(f){var e=jQuery(f.currentTarget);var c=e.data("dateFormat");var g=app.getDateInVtigerFormat(c,f.date);var d=jQuery.datepicker.formatDate(g,f.date);e.val(d)})},registerEventForTimeFields:function(b,a,f){if(typeof cotainer=="undefined"){b=jQuery("body")}if(typeof a=="undefined"){a=true}b=jQuery(b);if(b.hasClass("timepicker-default")){var c=b}else{var c=b.find(".timepicker-default")}if(a==true){var d=c.closest(".time");jQuery(".input-group-addon",d).on("click",function(i){var h=jQuery(i.currentTarget);h.closest(".time").find(".timepicker-default").focus()})}if(typeof f=="undefined"){f={}}var g=c.data("format");if(g=="24"){g="H:i"}else{g="h:i A"}var e={timeFormat:g,className:"timePicker"};var f=jQuery.extend(e,f);c.timepicker(f);return b},destroyTimeFields:function(a){if(typeof cotainer=="undefined"){a=jQuery("body")}if(a.hasClass("timepicker-default")){var b=a}else{var b=a.find(".timepicker-default")}b.data("timepicker-list",null);return a},getChosenElementFromSelect:function(a){var b=a.attr("id");var c=b+"_chosen";return jQuery("#"+c)},getSelect2ElementFromSelect:function(a){var b=a.attr("id");var c="select2-"+b+"-container";return jQuery("#"+c).closest(".select2-container")},getSelectElementFromChosen:function(c){var b=c.attr("id");var a=b.split("_chosen");var d=a["0"];return jQuery("#"+d)},setInheritWidth:function(a){jQuery(a).each(function(b,c){var d=jQuery(c).parent().width();jQuery(c).width(d)})},initGuiders:function(a){},showScrollBar:function(b,a){if(typeof a=="undefined"){a={}}if(typeof a.height=="undefined"){a.height=b.css("height")}return b.slimScroll(a)},showHorizontalScrollBar:function(b,a){if(typeof a=="undefined"){a={}}var c={horizontalScroll:true,theme:"dark-thick",advanced:{autoExpandHorizontalScroll:true}};if(typeof a!="undefined"){var c=jQuery.extend(c,a)}return b.mCustomScrollbar(c)},vtranslate:function(b){if(app.languageString[b]!=undefined){return app.languageString[b]}else{var a=jQuery("#js_strings").text();if(a!=""){app.languageString=JSON.parse(a);if(b in app.languageString){return app.languageString[b]}}}return b},setContentsHeight:function(){var a=parseInt(jQuery(".mainContainer").css("margin-top"))+21;jQuery(".bodyContents").css("min-height",(jQuery(window).innerHeight()-a))},vimage_path:function(a){return jQuery("body").data("skinpath")+"/images/"+a},cacheNSKey:function(a){return"vtiger6."+a},cacheGet:function(b,a){b=this.cacheNSKey(b);return jQuery.jStorage.get(b,a)},cacheSet:function(a,b){a=this.cacheNSKey(a);jQuery.jStorage.set(a,b)},cacheClear:function(a){a=this.cacheNSKey(a);return jQuery.jStorage.deleteKey(a)},htmlEncode:function(a){if(a){return jQuery("
    ").text(a).html()}else{return""}},htmlDecode:function(a){if(a){return $("
    ").html(a).text()}else{return""}},placeAtCenter:function(a){a.css("position","absolute");a.css("top",((jQuery(window).height()-a.outerHeight())/2)+jQuery(window).scrollTop()+"px");a.css("left",((jQuery(window).width()-a.outerWidth())/2)+jQuery(window).scrollLeft()+"px")},getvalidationEngineOptions:function(a){return app.validationEngineOptions},notifyPostAjaxReady:function(){jQuery(document).trigger("postajaxready")},listenPostAjaxReady:function(a){jQuery(document).on("postajaxready",a)},setFormValues:function(b){for(var a in b){jQuery(a).val(b[a])}},setRTEValues:function(c){for(var a in c){var b=CKEDITOR.instances[a];if(b){b.setData(c[a])}}},getPageController:function(){var c=app.getModuleName();var a=app.getViewName();var e=app.getParentModuleName();var d=e+"_"+c+"_"+a+"_Js";if(typeof window[d]=="undefined"){d=e+"_Vtiger_"+a+"_Js"}if(typeof window[d]=="undefined"){d=c+"_"+a+"_Js"}var b=jQuery("#extendModules").val();if(typeof window[d]=="undefined"&&b!=undefined){d=b+"_"+a+"_Js"}if(typeof window[d]=="undefined"){d="Vtiger_"+a+"_Js"}if(typeof window[d]!="undefined"){return new window[d]()}},getDecodedValue:function(a){return jQuery("
    ").html(a).text()},getColorContrast:function(f){var d=parseInt(f.substr(0,2),16);var c=parseInt(f.substr(2,2),16);var a=parseInt(f.substr(4,2),16);var e=((d*299)+(c*587)+(a*114))/1000;return(e>=128)?"light":"dark"},updateRowHeight:function(){var c=jQuery("#row_type").val();if(c.length<=0){var b=app.cacheGet("widthType","mediumWidthType");var e=b;switch(e){case"narrowWidthType":e="narrow";break;case"wideWidthType":e="wide";break;default:e="medium"}var a=jQuery("#current_user_id").val();var d={module:"Users",action:"SaveAjax",record:a,value:e,field:"rowheight"};AppConnector.request(d).then(function(){jQuery(c).val(e)})}},getCookie:function(b){var c=document.cookie;var d=c.indexOf(" "+b+"=");if(d==-1){d=c.indexOf(b+"=")}if(d==-1){c=null}else{d=c.indexOf("=",d)+1;var a=c.indexOf(";",d);if(a==-1){a=c.length}c=unescape(c.substring(d,a))}return c},setCookie:function(a,d,b){var e=new Date();e.setDate(e.getDate()+b);var c=escape(d)+((b==null)?"":"; expires="+e.toUTCString());document.cookie=a+"="+c},getUrlVar:function(b){var a=function(){var d={};var c=window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(e,f,g){d[f]=g});return d};return a()[b]},getStringDate:function(b){var c=b.getDate();var a=b.getMonth()+1;var e=b.getFullYear();c=(c<=9)?("0"+c):c;a=(a<=9)?("0"+a):a;return e+"-"+a+"-"+c},formatDate:function(b){var j=b.getFullYear(),a=b.getMonth()+1,g=b.getDate(),f=b.getHours(),c=b.getMinutes(),e=b.getSeconds();return j+"-"+this.formatDateZ(a)+"-"+this.formatDateZ(g)+" "+this.formatDateZ(f)+":"+this.formatDateZ(c)+":"+this.formatDateZ(e)},formatDateZ:function(a){return(a<=9?"0"+a:a)},saveAjax:function(d,c){var a=jQuery.Deferred();var b={};b.module=app.getModuleName();b.parent=app.getParentModuleName();b.action="SaveAjax";b.mode=d;b.param=c;AppConnector.request(b).then(function(e){a.resolve(e)},function(e){a.reject()});return a.promise()},showBtnSwitch:function(a,b){if(typeof b=="undefined"){b={}}a.bootstrapSwitch(b);return a},generateRandomChar:function(){var c,b,a;c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ";a=Math.floor(Math.random()*c.length);return b=c.substring(a,a+1)},getMainParams:function(b){if(app.cacheParams[b]!=undefined){return app.cacheParams[b]}var a=$("#"+b).val();app.cacheParams[b]=a;return a},parseNumberToShow:function(b){if(b==undefined){b=0}var c=parseInt(app.getMainParams("numberOfCurrencyDecimal"));var a=app.getMainParams("currencyDecimalSeparator");b=parseFloat(b).toFixed(c);if(a!="."){b=b.toString().replace(".",a)}return b},parseNumberToFloat:function(a){var b=parseInt(app.getMainParams("numberOfCurrencyDecimal"));if(a==undefined){a=0}if(app.getMainParams("currencyDecimalSeparator")==","){a=a.toString().replace(/\s/g,"").replace(",",".")}return parseFloat(a)},};jQuery(document).ready(function(){app.changeSelectElementView();app.showSelect2ElementView(jQuery("body").find("select.select2"));app.showSelectizeElementView(jQuery("body").find("select.selectize"));app.showPopoverElementView(jQuery("body").find(".popoverTooltip"));app.showBtnSwitch(jQuery("body").find(".switchBtn"));app.setContentsHeight();app.updateRowHeight();jQuery(window).resize(function(){app.setContentsHeight()});String.prototype.toCamelCase=function(){var b=this.valueOf();return b.charAt(0).toUpperCase()+b.slice(1).toLowerCase()};if(/MSIE/.test(navigator.userAgent)||(/Trident/).test(navigator.userAgent)){jQuery("textarea").resizable()}var a=app.getPageController();if(a){a.registerEvents()}});function resizeUI5IframeReset(){jQuery("#ui5frame").height(650)}function resizeUI5Iframe(a){jQuery("#ui5frame").height(parseInt(a,10)+15)}; \ No newline at end of file diff --git a/modules/Vtiger/resources/validator/FieldValidator.js b/modules/Vtiger/resources/validator/FieldValidator.js index 527e90d666cb..40957c33917e 100644 --- a/modules/Vtiger/resources/validator/FieldValidator.js +++ b/modules/Vtiger/resources/validator/FieldValidator.js @@ -718,6 +718,67 @@ Vtiger_Base_Validator_Js('Vtiger_Currency_Validator_Js', { return true; } }) +Vtiger_Base_Validator_Js("Vtiger_NumberUserFormat_Validator_Js", { + /** + *Function which invokes field validation + *@param accepts field element as parameter + * @return error if validation fails true on success + */ + invokeValidation: function (field, rules, i, options) { + var instance = new Vtiger_NumberUserFormat_Validator_Js(); + instance.setElement(field); + var response = instance.validate(); + if (response != true) { + return instance.getError(); + } + } + +}, { + /** + * Function to validate the Positive Numbers + * @return true if validation is successfull + * @return false if validation error occurs + */ + validate: function () { + var response = this._super(); + if (response != true) { + return response; + } + var field = this.getElement(); + var fieldValue = this.getFieldValue(); + var decimalSeperator = $('#currencyDecimalSeparator').val(); + var groupSeperator = $('#currencyGroupingSeparator').val(); + + var strippedValue = fieldValue.replace(decimalSeperator, ''); + var spacePattern = /\s/; + if (spacePattern.test(decimalSeperator) || spacePattern.test(groupSeperator)) + strippedValue = strippedValue.replace(/ /g, ''); + var errorInfo; + + if (groupSeperator == "$") { + groupSeperator = "\\$" + } + + var regex = new RegExp(groupSeperator, 'g'); + strippedValue = strippedValue.replace(regex, ''); + if (isNaN(strippedValue)) { + errorInfo = app.vtranslate('JS_CONTAINS_ILLEGAL_CHARACTERS'); + this.setError(errorInfo); + return false; + } + if (strippedValue < 0) { + errorInfo = app.vtranslate('JS_ACCEPT_POSITIVE_NUMBER'); + this.setError(errorInfo); + return false; + } + if (parseFloat(strippedValue) != parseInt(strippedValue)) { + errorInfo = app.vtranslate('JS_CONTAINS_ILLEGAL_CHARACTERS'); + this.setError(errorInfo); + return false; + } + return true; + } +}) Vtiger_Base_Validator_Js("Vtiger_ReferenceField_Validator_Js", {}, { /** diff --git a/modules/Vtiger/resources/validator/FieldValidator.min.js b/modules/Vtiger/resources/validator/FieldValidator.min.js index 3a764c2136c2..64896e55bb13 100644 --- a/modules/Vtiger/resources/validator/FieldValidator.min.js +++ b/modules/Vtiger/resources/validator/FieldValidator.min.js @@ -1,2 +1,2 @@ -Vtiger_Base_Validator_Js("Vtiger_Email_Validator_Js",{invokeValidation:function(e,f,d,c){var a=new Vtiger_Email_Validator_Js();a.setElement(e);var b=a.validate();if(b!=true){return a.getError()}}},{validate:function(){var a=this.getFieldValue();return this.validateValue(a)},validateValue:function(c){var a=/^[_/a-zA-Z0-9*]+([!"#$%&'()*+,./:;<=>?\^_`{|}~-]?[a-zA-Z0-9/_/-])*@[a-zA-Z0-9]+([\_\-\.]?[a-zA-Z0-9]+)*\.([\-\_]?[a-zA-Z0-9])+(\.?[a-zA-Z0-9]+)?$/;var b=/[\(\)\<\>\,\;\:\\\"\[\]]/;if(!a.test(c)){var d=app.vtranslate("JS_PLEASE_ENTER_VALID_EMAIL_ADDRESS");this.setError(d);return false}else{if(c.match(b)){var d=app.vtranslate("JS_CONTAINS_ILLEGAL_CHARACTERS");this.setError(d);return false}}return true}});Vtiger_Base_Validator_Js("Vtiger_UserName_Validator_Js",{invokeValidation:function(e,f,c,b){var d=new Vtiger_UserName_Validator_Js();d.setElement(e);var a=d.validate();if(a!=true){return d.getError()}}},{validate:function(){var c=this.getFieldValue();var b=/^[a-zA-Z0-9_.@]{3,32}$/;var a=b.test(c);if(!a){var d=app.vtranslate("JS_CONTAINS_ILLEGAL_CHARACTERS");this.setError(d);return false}return true}});Vtiger_Base_Validator_Js("Vtiger_PositiveNumber_Validator_Js",{invokeValidation:function(e,f,d,b){var c=new Vtiger_PositiveNumber_Validator_Js();c.setElement(e);var a=c.validate();if(a!=true){return c.getError()}}},{validate:function(){var b=this.getFieldValue();var a=/(^[-]+\d+)$/;if(isNaN(b)||b<0||b.match(a)){var c=app.vtranslate("JS_ACCEPT_POSITIVE_NUMBER");this.setError(c);return false}return true}});Vtiger_Base_Validator_Js("Vtiger_Integer_Validator_Js",{invokeValidation:function(e,f,d,c){var b=new Vtiger_Integer_Validator_Js();b.setElement(e);var a=b.validate();if(a!=true){return b.getError()}}},{validate:function(){var c=this.getFieldValue();var a=/(^[-+]?\d+)$/;var b=/(^[-+]?\d?).\d+$/;if((!c.match(a))){if(!c.match(b)){var d=app.vtranslate("JS_PLEASE_ENTER_INTEGER_VALUE");this.setError(d);return false}else{return true}}else{return true}}});Vtiger_PositiveNumber_Validator_Js("Vtiger_Percentage_Validator_Js",{invokeValidation:function(e,f,d,b){var c=new Vtiger_Percentage_Validator_Js();c.setElement(e);var a=c.validate();if(a!=true){return c.getError()}}},{validate:function(){var a=this._super();if(a!=true){return a}else{var b=this.getFieldValue();if(b>100){var c=app.vtranslate("JS_PERCENTAGE_VALUE_SHOULD_BE_LESS_THAN_100");this.setError(c);return false}return true}}});Vtiger_Base_Validator_Js("Vtiger_Url_Validator_Js",{},{validate:function(){var c=this.getFieldValue();var b=/(^|\s)((https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?)/gi;var a=b.test(c);if(!a){if(c.indexOf("http://")===0||c.indexOf("https://")===0||c.indexOf("www.")===0){a=true}}if(!a){var d=app.vtranslate("JS_CONTAINS_ILLEGAL_CHARACTERS");this.setError(d);return false}return true}});Vtiger_Base_Validator_Js("Vtiger_MultiSelect_Validator_Js",{invokeValidation:function(e,f,d,c){var b=new Vtiger_MultiSelect_Validator_Js();b.setElement(e);var a=b.validate();if(a==true){return a}else{return b.getError()}}},{validate:function(){var a=this.getElement();var b=a.val();if(b==null){var c=app.vtranslate("JS_PLEASE_SELECT_ATLEAST_ONE_OPTION");this.setError(c);return false}return true}});Vtiger_Email_Validator_Js("Vtiger_MultiEmails_Validator_Js",{invokeValidation:function(c){var b=new Vtiger_MultiEmails_Validator_Js();b.setElement(c);var a=b.validate();if(!a){return b.getError()}}},{validate:function(){var c=this.getElement();var b=c.val();if(b!=""){var e=b.split(",");var d;for(d=0;d0){var i=a.label+" "+app.vtranslate("JS_SHOULD_BE_GREATER_THAN_OR_EQUAL_TO")+" "+app.vtranslate("JS_CURRENT_DATE");this.setError(i);return false}return true}});Vtiger_Base_Validator_Js("Vtiger_greaterThanDependentField_Validator_Js",{invokeValidation:function(f,g,e,d){var h=f[0];if(jQuery(h).attr("name")=="followup_date_start"){var b=new Array("date_start")}var a=new Vtiger_greaterThanDependentField_Validator_Js();a.setElement(f);var c=a.validate(b);if(c!=true){return a.getError()}}},{validate:function(d){var m=this.getElement();var a=m.data("fieldinfo");var c;if(typeof a=="undefined"){c=jQuery(m).attr("name")}else{c=a.label}var k=m.closest("form");for(var h=0;h0){var b=f.data("fieldinfo").label;var g=this.getDateTimeInstance(m);var e=this.getDateTimeInstance(f);var j=g-e;if(j<0){var n=c+" "+app.vtranslate("JS_SHOULD_BE_GREATER_THAN_OR_EQUAL_TO")+" "+b+"";this.setError(n);return false}}}return true},getDateTimeInstance:function(e){var a=e.data("dateFormat");var c=e.val();try{var d=Vtiger_Helper_Js.getDateInstance(c,a)}catch(b){this.setError(b);return false}return d}});Vtiger_Base_Validator_Js("Vtiger_dateAndTimeGreaterThanDependentField_Validator_Js",{},{fieldDateTime:"",fieldDateTimeInstance:[],dateFormat:"",validate:function(c){var m=this;var l=this.getElement();var b="";var n=[];var g=l.closest("form");var k=g.attr("name");if(k=="EditView"){return true}var e=0;for(var f=0;f0){if(typeof d.data("dateFormat")=="undefined"&&b){b+=" "+d.val();n[e]=Vtiger_Helper_Js.getDateInstance(b,a);e++}else{if(typeof d.data("dateFormat")!="undefined"){var a=d.data("dateFormat");b=d.val()}}}}return m.difference(n)},difference:function(b){if(b.length==2){var a=b[1]-b[0];if(a<0){var c=app.vtranslate("JS_AN_INCORRECT_RANGE_OF_DATES_WAS_ENTERED");this.setError(c);return false}}return true}});Vtiger_Base_Validator_Js("Vtiger_futureEventCannotBeHeld_Validator_Js",{},{validate:function(e){var p=this.getElement();var c=p.data("fieldinfo").label;var j=p.val();var m=p.closest("form");for(var k=0;k0){var b=h.data("fieldinfo").label;var n=new Date();var a=h.data("dateFormat");var f=jQuery("input[name=time_start]",m);var d=h.val()+" "+f.val();var g=Vtiger_Helper_Js.getDateInstance(d,a);var l=n-g;if(l<0&&j=="Held"){var q=c+" "+app.vtranslate("JS_FUTURE_EVENT_CANNOT_BE_HELD")+" "+b+"";this.setError(q);return false}}}return true}});Vtiger_Base_Validator_Js("Vtiger_lessThanDependentField_Validator_Js",{},{validate:function(c){var l=this.getElement();var a=l.data("fieldinfo").label;var j=l.closest("form");if(l.val().length==0){return}for(var g=0;g0){var b=e.data("fieldinfo").label;var f=this.getDateTimeInstance(l);if(e.val().length==0){continue}var d=this.getDateTimeInstance(e);var h=f-d;if(h>0){var m=a+" "+app.vtranslate("JS_SHOULD_BE_LESS_THAN_OR_EQUAL_TO")+" "+b+"";this.setError(m);return false}}}return true},getDateTimeInstance:function(e){var a=e.data("dateFormat");var c=e.val();try{var d=Vtiger_Helper_Js.getDateInstance(c,a)}catch(b){this.setError(b);return false}return d}});Vtiger_Base_Validator_Js("Vtiger_Currency_Validator_Js",{invokeValidation:function(d,e,c,b){var f=new Vtiger_Currency_Validator_Js();f.setElement(d);var a=f.validate();if(a!=true){return f.getError()}}},{validate:function(){var b=this._super();if(b!=true){return b}var g=this.getElement();var f=this.getFieldValue();var c=g.data();var e=f.replace(c.decimalSeperator,"");var a=/\s/;if(a.test(c.decimalSeperator)||a.test(c.groupSeperator)){e=e.replace(/ /g,"")}var h;if(c.groupSeperator=="$"){c.groupSeperator="\\$"}var d=new RegExp(c.groupSeperator,"g");e=e.replace(d,"");if(isNaN(e)){h=app.vtranslate("JS_CONTAINS_ILLEGAL_CHARACTERS");this.setError(h);return false}if(e<0){h=app.vtranslate("JS_ACCEPT_POSITIVE_NUMBER");this.setError(h);return false}return true}});Vtiger_Base_Validator_Js("Vtiger_ReferenceField_Validator_Js",{},{validate:function(){var c=this.getElement();var a=c.closest(".fieldValue");var d=a.find(".sourceField");var f=d.val();var b=d.data().fieldinfo;if(f==""){var e=app.vtranslate("JS_REQUIRED_FIELD");this.setError(e);return false}return true}});Vtiger_Integer_Validator_Js("Vtiger_Double_Validator_Js",{},{validate:function(){var a=this._super();if(a==false){var b=this.getFieldValue();var c=/(^[-+]?\d+)\.\d+$/;if(!b.match(c)){var d=app.vtranslate("JS_PLEASE_ENTER_DECIMAL_VALUE");this.setError(d);return false}return true}return a}});Vtiger_Base_Validator_Js("Vtiger_Date_Validator_Js",{invokeValidation:function(e,f,d,c){var b=new Vtiger_Date_Validator_Js();b.setElement(e);var a=b.validate();if(a!=true){return b.getError()}return a}},{validate:function(){var e=this.getElement();var b=e.data();var a=b.dateFormat;var d=this.getFieldValue();try{Vtiger_Helper_Js.getDateInstance(d,a)}catch(c){var f=app.vtranslate("JS_PLEASE_ENTER_VALID_DATE");this.setError(f);return false}return true}});Vtiger_Base_Validator_Js("Vtiger_Time_Validator_Js",{invokeValidation:function(e,f,d,c){var b=new Vtiger_Time_Validator_Js();b.setElement(e);var a=b.validate();if(a==true){return a}else{return b.getError()}}},{validate:function(){var b=this.getFieldValue();var c=b.replace(b.match(/[AP]M/i),"");var a=c.split(":");if(isNaN(a[0])&&isNaN(a[1])){var d=app.vtranslate("JS_PLEASE_ENTER_VALID_TIME");this.setError(d);return false}return true}});Vtiger_greaterThanDependentField_Validator_Js("Calendar_greaterThanDependentField_Validator_Js",{},{getDateTimeInstance:function(e){var d=e.closest("form");if(e.attr("name")=="date_start"){var c=d.find('[name="time_start"]');var f=c.val()}else{if(e.attr("name")=="due_date"){var c=d.find('[name="time_end"]');if(c.length>0){var f=c.val()}else{f="11:59 PM"}}}var b=e.val()+" "+f;var a=e.data("dateFormat");return Vtiger_Helper_Js.getDateInstance(b,a)}});Vtiger_Base_Validator_Js("Calendar_greaterThanToday_Validator_Js",{},{validate:function(){var h=this.getElement();var c=h.data();var j=c.dateFormat;var a=c.fieldinfo;var b=this.getFieldValue();try{var e=Vtiger_Helper_Js.getDateInstance(b,j)}catch(d){this.setError(d);return false}e.setHours(0,0,0,0);var g=new Date();g.setHours(0,0,0,0);var f=g-e;if(f>=0){var i=a.label+" "+app.vtranslate("JS_SHOULD_BE_GREATER_THAN_CURRENT_DATE");this.setError(i);return false}return true}});Vtiger_Base_Validator_Js("Calendar_RepeatMonthDate_Validator_Js",{invokeValidation:function(e,f,d,c){var b=new Calendar_RepeatMonthDate_Validator_Js();b.setElement(e);var a=b.validate();if(a!=true){return b.getError()}}},{validate:function(){var b=this.getFieldValue();if((parseInt(parseFloat(b)))!=b||b==""||parseInt(b)>"31"||parseInt(b)<=0){var a=app.vtranslate("JS_NUMBER_SHOULD_BE_LESS_THAN_32");this.setError(a);return false}return true}});Vtiger_WholeNumber_Validator_Js("Vtiger_WholeNumberGreaterThanZero_Validator_Js",{invokeValidation:function(e,f,d,c){var a=new Vtiger_WholeNumberGreaterThanZero_Validator_Js();a.setElement(e);var b=a.validate();if(b!=true){return a.getError()}}},{validate:function(){var a=this._super();if(a!=true){return a}else{var b=this.getFieldValue();if(b==0){var c=app.vtranslate("JS_VALUE_SHOULD_BE_GREATER_THAN_ZERO");this.setError(c);return false}}return true}});Vtiger_Base_Validator_Js("Vtiger_AlphaNumeric_Validator_Js",{invokeValidation:function(e,f,d,c){var a=new Vtiger_AlphaNumeric_Validator_Js();a.setElement(e);var b=a.validate();if(b!=true){return a.getError()}}},{validate:function(){var c=this.getElement();var b=c.val();var a=/^[a-z0-9 _-]*$/i;if(!b.match(a)){var d=app.vtranslate("JS_CONTAINS_ILLEGAL_CHARACTERS");this.setError(d);return false}return true}});Vtiger_Base_Validator_Js("Vtiger_AlphaNumericWithSlashes_Validator_Js",{invokeValidation:function(e,f,d,c){var a=new Vtiger_AlphaNumericWithSlashes_Validator_Js();a.setElement(e);var b=a.validate();if(b!=true){return a.getError()}}},{validate:function(){var c=this.getElement();var b=c.val();var a=/^[\/a-z\\0-9 _-]*$/i;if(!b.match(a)){var d=app.vtranslate("JS_CONTAINS_ILLEGAL_CHARACTERS");this.setError(d);return false}return true}});Vtiger_Base_Validator_Js("Vtiger_InputMask_Validator_Js",{invokeValidation:function(e,f,d,c){var b=new Vtiger_InputMask_Validator_Js();b.setElement(e);var a=b.validate();if(a!=true){return b.getError()}}},{validate:function(){var a=this._super();if(a!=true){return a}var d=this.getElement();var c=d.val();if(d.inputmask("hasMaskedValue")){var b=d.inputmask("unmaskedvalue");var e=d.inputmask("getmetadata");var g=(e.match(/9/g)||[]).length+(e.match(/A/g)||[]).length+(e.match(/'*'/g)||[]).length;if(b.length!=0&&g>b.length){var f=app.vtranslate("JS_INVALID_LENGTH");this.setError(f);window.inputMaskValidation=true;return false}else{window.inputMaskValidation=false}}if(window.inputMaskValidation){var f=app.vtranslate("JS_INVALID_LENGTH");this.setError(f);return false}return true}}); \ No newline at end of file +Vtiger_Base_Validator_Js("Vtiger_Email_Validator_Js",{invokeValidation:function(e,f,d,c){var a=new Vtiger_Email_Validator_Js();a.setElement(e);var b=a.validate();if(b!=true){return a.getError()}}},{validate:function(){var a=this.getFieldValue();return this.validateValue(a)},validateValue:function(c){var a=/^[_/a-zA-Z0-9*]+([!"#$%&'()*+,./:;<=>?\^_`{|}~-]?[a-zA-Z0-9/_/-])*@[a-zA-Z0-9]+([\_\-\.]?[a-zA-Z0-9]+)*\.([\-\_]?[a-zA-Z0-9])+(\.?[a-zA-Z0-9]+)?$/;var b=/[\(\)\<\>\,\;\:\\\"\[\]]/;if(!a.test(c)){var d=app.vtranslate("JS_PLEASE_ENTER_VALID_EMAIL_ADDRESS");this.setError(d);return false}else{if(c.match(b)){var d=app.vtranslate("JS_CONTAINS_ILLEGAL_CHARACTERS");this.setError(d);return false}}return true}});Vtiger_Base_Validator_Js("Vtiger_UserName_Validator_Js",{invokeValidation:function(e,f,c,b){var d=new Vtiger_UserName_Validator_Js();d.setElement(e);var a=d.validate();if(a!=true){return d.getError()}}},{validate:function(){var c=this.getFieldValue();var b=/^[a-zA-Z0-9_.@]{3,32}$/;var a=b.test(c);if(!a){var d=app.vtranslate("JS_CONTAINS_ILLEGAL_CHARACTERS");this.setError(d);return false}return true}});Vtiger_Base_Validator_Js("Vtiger_PositiveNumber_Validator_Js",{invokeValidation:function(e,f,d,b){var c=new Vtiger_PositiveNumber_Validator_Js();c.setElement(e);var a=c.validate();if(a!=true){return c.getError()}}},{validate:function(){var b=this.getFieldValue();var a=/(^[-]+\d+)$/;if(isNaN(b)||b<0||b.match(a)){var c=app.vtranslate("JS_ACCEPT_POSITIVE_NUMBER");this.setError(c);return false}return true}});Vtiger_Base_Validator_Js("Vtiger_Integer_Validator_Js",{invokeValidation:function(e,f,d,c){var b=new Vtiger_Integer_Validator_Js();b.setElement(e);var a=b.validate();if(a!=true){return b.getError()}}},{validate:function(){var c=this.getFieldValue();var a=/(^[-+]?\d+)$/;var b=/(^[-+]?\d?).\d+$/;if((!c.match(a))){if(!c.match(b)){var d=app.vtranslate("JS_PLEASE_ENTER_INTEGER_VALUE");this.setError(d);return false}else{return true}}else{return true}}});Vtiger_PositiveNumber_Validator_Js("Vtiger_Percentage_Validator_Js",{invokeValidation:function(e,f,d,b){var c=new Vtiger_Percentage_Validator_Js();c.setElement(e);var a=c.validate();if(a!=true){return c.getError()}}},{validate:function(){var a=this._super();if(a!=true){return a}else{var b=this.getFieldValue();if(b>100){var c=app.vtranslate("JS_PERCENTAGE_VALUE_SHOULD_BE_LESS_THAN_100");this.setError(c);return false}return true}}});Vtiger_Base_Validator_Js("Vtiger_Url_Validator_Js",{},{validate:function(){var c=this.getFieldValue();var b=/(^|\s)((https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?)/gi;var a=b.test(c);if(!a){if(c.indexOf("http://")===0||c.indexOf("https://")===0||c.indexOf("www.")===0){a=true}}if(!a){var d=app.vtranslate("JS_CONTAINS_ILLEGAL_CHARACTERS");this.setError(d);return false}return true}});Vtiger_Base_Validator_Js("Vtiger_MultiSelect_Validator_Js",{invokeValidation:function(e,f,d,c){var b=new Vtiger_MultiSelect_Validator_Js();b.setElement(e);var a=b.validate();if(a==true){return a}else{return b.getError()}}},{validate:function(){var a=this.getElement();var b=a.val();if(b==null){var c=app.vtranslate("JS_PLEASE_SELECT_ATLEAST_ONE_OPTION");this.setError(c);return false}return true}});Vtiger_Email_Validator_Js("Vtiger_MultiEmails_Validator_Js",{invokeValidation:function(c){var b=new Vtiger_MultiEmails_Validator_Js();b.setElement(c);var a=b.validate();if(!a){return b.getError()}}},{validate:function(){var c=this.getElement();var b=c.val();if(b!=""){var e=b.split(",");var d;for(d=0;d0){var i=a.label+" "+app.vtranslate("JS_SHOULD_BE_GREATER_THAN_OR_EQUAL_TO")+" "+app.vtranslate("JS_CURRENT_DATE");this.setError(i);return false}return true}});Vtiger_Base_Validator_Js("Vtiger_greaterThanDependentField_Validator_Js",{invokeValidation:function(f,g,e,d){var h=f[0];if(jQuery(h).attr("name")=="followup_date_start"){var b=new Array("date_start")}var a=new Vtiger_greaterThanDependentField_Validator_Js();a.setElement(f);var c=a.validate(b);if(c!=true){return a.getError()}}},{validate:function(d){var m=this.getElement();var a=m.data("fieldinfo");var c;if(typeof a=="undefined"){c=jQuery(m).attr("name")}else{c=a.label}var k=m.closest("form");for(var h=0;h0){var b=f.data("fieldinfo").label;var g=this.getDateTimeInstance(m);var e=this.getDateTimeInstance(f);var j=g-e;if(j<0){var n=c+" "+app.vtranslate("JS_SHOULD_BE_GREATER_THAN_OR_EQUAL_TO")+" "+b+"";this.setError(n);return false}}}return true},getDateTimeInstance:function(e){var a=e.data("dateFormat");var c=e.val();try{var d=Vtiger_Helper_Js.getDateInstance(c,a)}catch(b){this.setError(b);return false}return d}});Vtiger_Base_Validator_Js("Vtiger_dateAndTimeGreaterThanDependentField_Validator_Js",{},{fieldDateTime:"",fieldDateTimeInstance:[],dateFormat:"",validate:function(c){var m=this;var l=this.getElement();var b="";var n=[];var g=l.closest("form");var k=g.attr("name");if(k=="EditView"){return true}var e=0;for(var f=0;f0){if(typeof d.data("dateFormat")=="undefined"&&b){b+=" "+d.val();n[e]=Vtiger_Helper_Js.getDateInstance(b,a);e++}else{if(typeof d.data("dateFormat")!="undefined"){var a=d.data("dateFormat");b=d.val()}}}}return m.difference(n)},difference:function(b){if(b.length==2){var a=b[1]-b[0];if(a<0){var c=app.vtranslate("JS_AN_INCORRECT_RANGE_OF_DATES_WAS_ENTERED");this.setError(c);return false}}return true}});Vtiger_Base_Validator_Js("Vtiger_futureEventCannotBeHeld_Validator_Js",{},{validate:function(e){var p=this.getElement();var c=p.data("fieldinfo").label;var j=p.val();var m=p.closest("form");for(var k=0;k0){var b=h.data("fieldinfo").label;var n=new Date();var a=h.data("dateFormat");var f=jQuery("input[name=time_start]",m);var d=h.val()+" "+f.val();var g=Vtiger_Helper_Js.getDateInstance(d,a);var l=n-g;if(l<0&&j=="Held"){var q=c+" "+app.vtranslate("JS_FUTURE_EVENT_CANNOT_BE_HELD")+" "+b+"";this.setError(q);return false}}}return true}});Vtiger_Base_Validator_Js("Vtiger_lessThanDependentField_Validator_Js",{},{validate:function(c){var l=this.getElement();var a=l.data("fieldinfo").label;var j=l.closest("form");if(l.val().length==0){return}for(var g=0;g0){var b=e.data("fieldinfo").label;var f=this.getDateTimeInstance(l);if(e.val().length==0){continue}var d=this.getDateTimeInstance(e);var h=f-d;if(h>0){var m=a+" "+app.vtranslate("JS_SHOULD_BE_LESS_THAN_OR_EQUAL_TO")+" "+b+"";this.setError(m);return false}}}return true},getDateTimeInstance:function(e){var a=e.data("dateFormat");var c=e.val();try{var d=Vtiger_Helper_Js.getDateInstance(c,a)}catch(b){this.setError(b);return false}return d}});Vtiger_Base_Validator_Js("Vtiger_Currency_Validator_Js",{invokeValidation:function(d,e,c,b){var f=new Vtiger_Currency_Validator_Js();f.setElement(d);var a=f.validate();if(a!=true){return f.getError()}}},{validate:function(){var b=this._super();if(b!=true){return b}var g=this.getElement();var f=this.getFieldValue();var c=g.data();var e=f.replace(c.decimalSeperator,"");var a=/\s/;if(a.test(c.decimalSeperator)||a.test(c.groupSeperator)){e=e.replace(/ /g,"")}var h;if(c.groupSeperator=="$"){c.groupSeperator="\\$"}var d=new RegExp(c.groupSeperator,"g");e=e.replace(d,"");if(isNaN(e)){h=app.vtranslate("JS_CONTAINS_ILLEGAL_CHARACTERS");this.setError(h);return false}if(e<0){h=app.vtranslate("JS_ACCEPT_POSITIVE_NUMBER");this.setError(h);return false}return true}});Vtiger_Base_Validator_Js("Vtiger_NumberUserFormat_Validator_Js",{invokeValidation:function(e,f,d,c){var a=new Vtiger_NumberUserFormat_Validator_Js();a.setElement(e);var b=a.validate();if(b!=true){return a.getError()}}},{validate:function(){var c=this._super();if(c!=true){return c}var h=this.getElement();var a=this.getFieldValue();var b=$("#currencyDecimalSeparator").val();var d=$("#currencyGroupingSeparator").val();var f=a.replace(b,"");var e=/\s/;if(e.test(b)||e.test(d)){f=f.replace(/ /g,"")}var i;if(d=="$"){d="\\$"}var g=new RegExp(d,"g");f=f.replace(g,"");if(isNaN(f)){i=app.vtranslate("JS_CONTAINS_ILLEGAL_CHARACTERS");this.setError(i);return false}if(f<0){i=app.vtranslate("JS_ACCEPT_POSITIVE_NUMBER");this.setError(i);return false}if(parseFloat(f)!=parseInt(f)){i=app.vtranslate("JS_CONTAINS_ILLEGAL_CHARACTERS");this.setError(i);return false}return true}});Vtiger_Base_Validator_Js("Vtiger_ReferenceField_Validator_Js",{},{validate:function(){var c=this.getElement();var a=c.closest(".fieldValue");var d=a.find(".sourceField");var f=d.val();var b=d.data().fieldinfo;if(f==""){var e=app.vtranslate("JS_REQUIRED_FIELD");this.setError(e);return false}return true}});Vtiger_Integer_Validator_Js("Vtiger_Double_Validator_Js",{},{validate:function(){var a=this._super();if(a==false){var b=this.getFieldValue();var c=/(^[-+]?\d+)\.\d+$/;if(!b.match(c)){var d=app.vtranslate("JS_PLEASE_ENTER_DECIMAL_VALUE");this.setError(d);return false}return true}return a}});Vtiger_Base_Validator_Js("Vtiger_Date_Validator_Js",{invokeValidation:function(e,f,d,c){var b=new Vtiger_Date_Validator_Js();b.setElement(e);var a=b.validate();if(a!=true){return b.getError()}return a}},{validate:function(){var e=this.getElement();var b=e.data();var a=b.dateFormat;var d=this.getFieldValue();try{Vtiger_Helper_Js.getDateInstance(d,a)}catch(c){var f=app.vtranslate("JS_PLEASE_ENTER_VALID_DATE");this.setError(f);return false}return true}});Vtiger_Base_Validator_Js("Vtiger_Time_Validator_Js",{invokeValidation:function(e,f,d,c){var b=new Vtiger_Time_Validator_Js();b.setElement(e);var a=b.validate();if(a==true){return a}else{return b.getError()}}},{validate:function(){var b=this.getFieldValue();var c=b.replace(b.match(/[AP]M/i),"");var a=c.split(":");if(isNaN(a[0])&&isNaN(a[1])){var d=app.vtranslate("JS_PLEASE_ENTER_VALID_TIME");this.setError(d);return false}return true}});Vtiger_greaterThanDependentField_Validator_Js("Calendar_greaterThanDependentField_Validator_Js",{},{getDateTimeInstance:function(e){var d=e.closest("form");if(e.attr("name")=="date_start"){var c=d.find('[name="time_start"]');var f=c.val()}else{if(e.attr("name")=="due_date"){var c=d.find('[name="time_end"]');if(c.length>0){var f=c.val()}else{f="11:59 PM"}}}var b=e.val()+" "+f;var a=e.data("dateFormat");return Vtiger_Helper_Js.getDateInstance(b,a)}});Vtiger_Base_Validator_Js("Calendar_greaterThanToday_Validator_Js",{},{validate:function(){var h=this.getElement();var c=h.data();var j=c.dateFormat;var a=c.fieldinfo;var b=this.getFieldValue();try{var e=Vtiger_Helper_Js.getDateInstance(b,j)}catch(d){this.setError(d);return false}e.setHours(0,0,0,0);var g=new Date();g.setHours(0,0,0,0);var f=g-e;if(f>=0){var i=a.label+" "+app.vtranslate("JS_SHOULD_BE_GREATER_THAN_CURRENT_DATE");this.setError(i);return false}return true}});Vtiger_Base_Validator_Js("Calendar_RepeatMonthDate_Validator_Js",{invokeValidation:function(e,f,d,c){var b=new Calendar_RepeatMonthDate_Validator_Js();b.setElement(e);var a=b.validate();if(a!=true){return b.getError()}}},{validate:function(){var b=this.getFieldValue();if((parseInt(parseFloat(b)))!=b||b==""||parseInt(b)>"31"||parseInt(b)<=0){var a=app.vtranslate("JS_NUMBER_SHOULD_BE_LESS_THAN_32");this.setError(a);return false}return true}});Vtiger_WholeNumber_Validator_Js("Vtiger_WholeNumberGreaterThanZero_Validator_Js",{invokeValidation:function(e,f,d,c){var a=new Vtiger_WholeNumberGreaterThanZero_Validator_Js();a.setElement(e);var b=a.validate();if(b!=true){return a.getError()}}},{validate:function(){var a=this._super();if(a!=true){return a}else{var b=this.getFieldValue();if(b==0){var c=app.vtranslate("JS_VALUE_SHOULD_BE_GREATER_THAN_ZERO");this.setError(c);return false}}return true}});Vtiger_Base_Validator_Js("Vtiger_AlphaNumeric_Validator_Js",{invokeValidation:function(e,f,d,c){var a=new Vtiger_AlphaNumeric_Validator_Js();a.setElement(e);var b=a.validate();if(b!=true){return a.getError()}}},{validate:function(){var c=this.getElement();var b=c.val();var a=/^[a-z0-9 _-]*$/i;if(!b.match(a)){var d=app.vtranslate("JS_CONTAINS_ILLEGAL_CHARACTERS");this.setError(d);return false}return true}});Vtiger_Base_Validator_Js("Vtiger_AlphaNumericWithSlashes_Validator_Js",{invokeValidation:function(e,f,d,c){var a=new Vtiger_AlphaNumericWithSlashes_Validator_Js();a.setElement(e);var b=a.validate();if(b!=true){return a.getError()}}},{validate:function(){var c=this.getElement();var b=c.val();var a=/^[\/a-z\\0-9 _-]*$/i;if(!b.match(a)){var d=app.vtranslate("JS_CONTAINS_ILLEGAL_CHARACTERS");this.setError(d);return false}return true}});Vtiger_Base_Validator_Js("Vtiger_InputMask_Validator_Js",{invokeValidation:function(e,f,d,c){var b=new Vtiger_InputMask_Validator_Js();b.setElement(e);var a=b.validate();if(a!=true){return b.getError()}}},{validate:function(){var a=this._super();if(a!=true){return a}var d=this.getElement();var c=d.val();if(d.inputmask("hasMaskedValue")){var b=d.inputmask("unmaskedvalue");var e=d.inputmask("getmetadata");var g=(e.match(/9/g)||[]).length+(e.match(/A/g)||[]).length+(e.match(/'*'/g)||[]).length;if(b.length!=0&&g>b.length){var f=app.vtranslate("JS_INVALID_LENGTH");this.setError(f);window.inputMaskValidation=true;return false}else{window.inputMaskValidation=false}}if(window.inputMaskValidation){var f=app.vtranslate("JS_INVALID_LENGTH");this.setError(f);return false}return true}}); \ No newline at end of file From 2ceb7222aaf967619682ca0c383c2de8d202e351 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Fri, 21 Aug 2015 15:11:27 +0200 Subject: [PATCH 027/489] Added number parsers --- .../vlayout/modules/Products/Discounts.tpl | 4 +- layouts/vlayout/modules/Products/Taxs.tpl | 4 +- .../vlayout/modules/Products/TaxsType1.tpl | 40 +++++++------- .../vlayout/modules/Products/TaxsType3.tpl | 40 +++++++------- .../modules/Supplies/resources/Edit.js | 52 +++++++++---------- .../modules/Supplies/resources/Edit.min.js | 2 +- 6 files changed, 73 insertions(+), 69 deletions(-) diff --git a/layouts/vlayout/modules/Products/Discounts.tpl b/layouts/vlayout/modules/Products/Discounts.tpl index 42a594b73a3f..18d74eaf98d1 100644 --- a/layouts/vlayout/modules/Products/Discounts.tpl +++ b/layouts/vlayout/modules/Products/Discounts.tpl @@ -17,7 +17,7 @@
    {vtranslate('LBL_PRICE_BEFORE_DISCOUNT', $SUPMODULE)}:
    -
    {$TOTAL_PRICE} {$CURRENCY_SYMBOL}
    +
    {CurrencyField::convertToUserFormat($TOTAL_PRICE, null, true)} {$CURRENCY_SYMBOL}
    {vtranslate('LBL_DISCOUNT_IN_TOTAL', $SUPMODULE)}:
    @@ -25,7 +25,7 @@
    {vtranslate('LBL_PRICE_AFTER_DISCOUNT', $SUPMODULE)}:
    -
    {$TOTAL_PRICE} {$CURRENCY_SYMBOL}
    +
    {CurrencyField::convertToUserFormat($TOTAL_PRICE, null, true)} {$CURRENCY_SYMBOL}
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,c){var i=this;for(var b in c){var a=c[b];var j=a.description;var e=a.unitPriceValues;var d=JSON.stringify(e);for(var g in a){k.find("input."+g).val(a[g])}var h=i.getCurrency();if(typeof e[h]!=="undefined"){i.setUnitPriceValue(k,e[h])}$("input.unitPrice",k).attr("list-info",d);$("textarea.commentTextarea",k).val(j);i.showIndividualTax(k)}if(f==="Products"){i.loadSubProducts(k,true)}this.quantityChangeActions(k)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".discountParam").val(JSON.stringify(c))},saveTaxsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(b.taxMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".taxParam").val(JSON.stringify(c))},showExpandedRow:function(e){var d=this;var c=d.getSupTableContainer();var b=c.find('[numrowex="'+e.attr("numrow")+'"]');var a=e.find(".toggleVisibility");a.data("status","1");a.find(".glyphicon").removeClass("glyphicon-menu-down");a.find(".glyphicon").addClass("glyphicon-menu-up");b.removeClass("hide");d.loadCkEditorElement(b.find(".ckEditorSource"))},hideExpandedRow:function(f){var e=this;var d=e.getSupTableContainer();var c=d.find('[numrowex="'+f.attr("numrow")+'"]');var b=f.find(".toggleVisibility");b.data("status","0");b.find(".glyphicon").removeClass("glyphicon-menu-up");b.find(".glyphicon").addClass("glyphicon-menu-down");c.addClass("hide");var a=CKEDITOR.instances[c.find(".ckEditorSource").attr("id")];if(a){a.destroy()}},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},initTaxParameters:function(d,a){var c=this;var b=d.find(".taxParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.taxMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateTax(d,a)},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#suppliesLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"CheckLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#suppliesLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide()});return a},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackSuppliesTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.find("tr").appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.registerAutoCompleteFields(m);c.initRow(m)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(c,d){a.find(b.rowClass).each(function(e,f){var g=$(f);b.hideExpandedRow(g)});d.item.startPos=d.item.index()},stop:function(d,e){var c=$(e.item.context).attr("numrow");var f=a.find(".numRow"+c).remove().clone();a.find('[numrow="'+c+'"]').after(f);if(e.item.startPos1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackSuppliesTable tbody").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},getTaxModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(c){var b=this;var a=b.getSupTableContainer().find(".colTax");if(b.isIndividualTaxMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".tax").val("0");b.rowsCalculations()}},getDiscountModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(c){var b=this;var a=b.getSupTableContainer().find(".colDiscount");if(b.isIndividualDiscountMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".discount").val("0");b.rowsCalculations()}},getCurrency:function(){var a=$('[name="currency"]',this.getSupTableContainer());return a.find("option:selected").val()},getTax:function(a){return app.parseNumberToFloat($(".tax",a).val())},getQuantityValue:function(a){return app.parseNumberToFloat($(".qty",a).val())},getUnitPriceValue:function(a){return app.parseNumberToFloat($(".unitPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return app.parseNumberToFloat(b)},getNetPrice:function(a){return app.parseNumberToFloat($(".netPrice",a).val())},getTotalPrice:function(a){return app.parseNumberToFloat($(".totalPrice",a).val())},getGrossPrice:function(a){return app.parseNumberToFloat($(".grossPrice",a).val())},getPurchase:function(a){var b=this.getQuantityValue(a);return app.parseNumberToFloat($(".purchase",a).val())*b},getSummaryGrossPrice:function(){var b=this;var a=0;this.getSupTableContainer().find(this.rowClass).each(function(c){a+=b.getGrossPrice($(this))});return app.parseNumberToFloat(a)},setUnitPriceValue:function(b,a){b.find(".unitPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=app.parseNumberToShow(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=app.parseNumberToShow(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=app.parseNumberToShow(a);$(".totalPriceText",b).text(a);$(".totalPrice",b).val(a)},setMargin:function(b,a){a=app.parseNumberToShow(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=app.parseNumberToShow(a);$(".marginp",b).val(a)},quantityChangeActions:function(a){this.rowCalculations(a);this.summaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getSupTableContainer().find(this.rowClass).each(function(b){a.quantityChangeActions($(this))})},summaryCalculations:function(){var a=this;this.getSupTableContainer().find("tfoot .wisableTd").each(function(b){a.calculatSummary($(this),$(this).data("sumfield"))})},calculatSummary:function(a,d){var c=this;var b=0;this.getSupTableContainer().find(this.rowClass).each(function(e){b+=app.parseNumberToFloat($(this).find("."+d).val())});a.text(app.parseNumberToShow(b))},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getUnitPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,c){var e=this.getTotalPrice(j),b=e,k=0,f=0,g=0,a=0;var i=c.find(".discountsType").val();if(i=="0"||i=="1"){if(c.find(".activepanel .globalDiscount").length>0){var k=app.parseNumberToFloat(c.find(".activepanel .globalDiscount").val())}if(c.find(".activepanel .individualDiscountType").length>0){var d=c.find('.activepanel .individualDiscountType[name="individual"]:checked').val();var h=c.find(".activepanel .individualDiscountValue").val();if(d=="percentage"){g=(h/100)*e}else{g=h}}if(c.find(".activepanel .groupCheckbox").length>0&&c.find(".activepanel .groupCheckbox").prop("checked")==true){var f=app.parseNumberToFloat(c.find(".groupValue").val());f=e*(f/100)}b=b*((100-k)/100);b=b-app.parseNumberToFloat(g);b=b-f}else{if(i=="2"){c.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=app.parseNumberToFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=app.parseNumberToFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=app.parseNumberToFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}c.find(".valuePrices").text(app.parseNumberToShow(b));c.find(".valueDiscount").text(app.parseNumberToShow(e-b))},calculateTax:function(k,g){var h=this.getTotalPrice(k),b=h,c=0,f=0,a=0,i=0,e=0;var d=g.find(".taxsType").val();if(d=="0"||d=="1"){if(g.find(".activepanel .globalTax").length>0){var c=g.find(".activepanel .globalTax").val()}if(g.find(".activepanel .individualTaxValue").length>0){var j=app.parseNumberToFloat(g.find(".activepanel .individualTaxValue").val());i=(j/100)*b}if(g.find(".activepanel .groupTax").length>0){var f=app.parseNumberToFloat(g.find(".groupTax").val());f=h*(app.parseNumberToFloat(f)/100)}if(g.find(".activepanel .regionalTax").length>0){var a=app.parseNumberToFloat(g.find(".regionalTax").val());a=h*(app.parseNumberToFloat(a)/100)}b=b*((100+app.parseNumberToFloat(c))/100);b=b+app.parseNumberToFloat(i);b=b+app.parseNumberToFloat(f);b=b+app.parseNumberToFloat(a)}else{if(d=="2"){g.find(".activepanel").each(function(p){var l=$(this);if(l.find(".globalTax").length>0){var o=app.parseNumberToFloat(l.find(".globalTax").val());b=b*((100+o)/100)}else{if(l.find(".groupTax").length>0){var n=app.parseNumberToFloat(l.find(".groupTax").val());b=b*((100+n)/100)}else{if(l.find(".regionalTax").length>0){var m=app.parseNumberToFloat(l.find(".regionalTax").val());b=b*((100+m)/100)}else{if(l.find(".individualTaxValue").length>0){var q=app.parseNumberToFloat(l.find(".individualTaxValue").val());b=((q+100)/100)*b}}}}})}}g.find(".valuePrices").text(app.parseNumberToShow(b));g.find(".valueTax").text(app.parseNumberToShow(b-h))},updateRowSequence:function(){var a=this.getSupTableContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerSuppliesSaveData:function(a){var b=this;a.on(Vtiger_Edit_Js.recordPreSave,function(f,d){if(!b.checkLimits(a)){return false}var c=a.find("#blackSuppliesTable");c.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductUnitPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setUnitPriceValue(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(g,a){var d=this;var c=jQuery("input.sourceField",g).val();var e=g.find('.rowName input[name="popupReferenceModule"]').val();d.removeSubProducts(g);if(c=="0"||$.inArray(e,["Products","Services"])<0){return false}if(d.subProductsCashe[c]){d.addSubProducts(g,d.subProductsCashe[c]);return false}var f={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(f).then(function(i){var h=i.result;d.subProductsCashe[c]=h;d.addSubProducts(g,h);if(b){b.hide()}},function(h,i){if(b){b.hide()}})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,c){var i=this;for(var b in c){var a=c[b];var j=a.description;var e=a.unitPriceValues;var d=JSON.stringify(e);for(var g in a){k.find("input."+g).val(a[g])}var h=i.getCurrency();if(typeof e[h]!=="undefined"){i.setUnitPriceValue(k,e[h])}$("input.unitPrice",k).attr("list-info",d);$("textarea.commentTextarea",k).val(j);i.showIndividualTax(k)}if(f==="Products"){i.loadSubProducts(k,true)}this.quantityChangeActions(k)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".discountParam").val(JSON.stringify(c))},saveTaxsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(b.taxMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".taxParam").val(JSON.stringify(c))},showExpandedRow:function(e){var d=this;var c=d.getSupTableContainer();var b=c.find('[numrowex="'+e.attr("numrow")+'"]');var a=e.find(".toggleVisibility");a.data("status","1");a.find(".glyphicon").removeClass("glyphicon-menu-down");a.find(".glyphicon").addClass("glyphicon-menu-up");b.removeClass("hide");d.loadCkEditorElement(b.find(".ckEditorSource"))},hideExpandedRow:function(f){var e=this;var d=e.getSupTableContainer();var c=d.find('[numrowex="'+f.attr("numrow")+'"]');var b=f.find(".toggleVisibility");b.data("status","0");b.find(".glyphicon").removeClass("glyphicon-menu-up");b.find(".glyphicon").addClass("glyphicon-menu-down");c.addClass("hide");var a=CKEDITOR.instances[c.find(".ckEditorSource").attr("id")];if(a){a.destroy()}},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},initTaxParameters:function(d,a){var c=this;var b=d.find(".taxParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.taxMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateTax(d,a)},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#suppliesLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"CheckLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#suppliesLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide()});return a},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackSuppliesTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.find("tr").appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.registerAutoCompleteFields(m);c.initRow(m)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(c,d){a.find(b.rowClass).each(function(e,f){var g=$(f);b.hideExpandedRow(g)});d.item.startPos=d.item.index()},stop:function(d,e){var c=$(e.item.context).attr("numrow");var f=a.find(".numRow"+c).remove().clone();a.find('[numrow="'+c+'"]').after(f);if(e.item.startPos Date: Fri, 21 Aug 2015 15:23:02 +0200 Subject: [PATCH 028/489] Preview rebuilt in modules Supplies --- .../modules/Supplies/DetailViewSupplies.tpl | 72 ++++++++++--------- .../modules/Supplies/EditViewSupplies.tpl | 1 - modules/Supplies/models/SupField.php | 8 +-- 3 files changed, 44 insertions(+), 37 deletions(-) diff --git a/layouts/vlayout/modules/Supplies/DetailViewSupplies.tpl b/layouts/vlayout/modules/Supplies/DetailViewSupplies.tpl index f0eb130b91c1..caed2f2b2e50 100644 --- a/layouts/vlayout/modules/Supplies/DetailViewSupplies.tpl +++ b/layouts/vlayout/modules/Supplies/DetailViewSupplies.tpl @@ -1,39 +1,47 @@ {**} {strip} {assign var="FIELDS" value=Supplies_SupField_Model::getFields($SUP_MODULE, true)} - {assign var="SUP_RECORD_DATA" value=Supplies_SupField_Model::getRecordData($SUP_MODULE, $SUP_RECORD)} - {assign var="MAIN_PARAMS" value=Supplies_SupField_Model::getMainParams($FIELDS[1])} - - - {if count($FIELDS[0]) neq 0} - - - {foreach item=FIELD from=$FIELDS[0]} - - {/foreach} - - {/if} - - {foreach item=FIELD from=$FIELDS[1]} - - {/foreach} - - - - {foreach key=KEY item=SUP_DATA from=$SUP_RECORD_DATA} - {assign var="ROW_NO" value=$KEY+1} + {if count($FIELDS) neq 0} + {assign var="SUPMODULE" value='Supplies'} + {assign var="COLUMNS" value=Supplies_SupField_Model::getColumns($SUP_MODULE)} + {assign var="SUP_RECORD_DATA" value=$RECORD->getSupplieData()} + {assign var="SUP_RECORD_DATA" value=Supplies_SupField_Model::getRecordData($SUP_MODULE, $SUP_RECORD)} + {assign var="MAIN_PARAMS" value=Supplies_SupField_Model::getMainParams($FIELDS[1])} + {assign var="COUNT_FIELDS0" value=count($FIELDS[0])} + {assign var="COUNT_FIELDS1" value=count($FIELDS[1])} + {assign var="COUNT_FIELDS2" value=count($FIELDS[2])} +
    {vtranslate('LBL_ITEM_DETAILS', $SUP_MODULE)} - {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('DetailView')} - {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$SUP_MODULE) SUP_VALUE=$SUP_DATA[$FIELD->get('columnname')]} -
    {vtranslate($FIELD->get('label'), $SUP_MODULE)}
    + + {if count($FIELDS[0]) neq 0} + + + {foreach item=FIELD from=$FIELDS[0]} + + {/foreach} + + {/if} {foreach item=FIELD from=$FIELDS[1]} - - {/foreach} + + {/foreach} - {/foreach} - -
    {vtranslate('LBL_ITEM_DETAILS', $SUP_MODULE)} + {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('DetailView')} + {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$SUP_MODULE) SUP_VALUE=$SUP_DATA[$FIELD->get('columnname')]} +
    - {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('DetailView')} - {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$SUP_MODULE) SUP_VALUE=$SUP_DATA[$FIELD->get('columnname')]} - {vtranslate($FIELD->get('label'), $SUP_MODULE)}
    + + + {foreach key=KEY item=SUP_DATA from=$SUP_RECORD_DATA} + {assign var="ROW_NO" value=$KEY+1} + + {foreach item=FIELD from=$FIELDS[1]} + + {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('DetailView')} + {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$SUP_MODULE) SUP_VALUE=$SUP_DATA[$FIELD->get('columnname')]} + + {/foreach} + + {/foreach} + + + {/if} {/strip} diff --git a/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl b/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl index ff257e33306a..7fb44596e606 100644 --- a/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl +++ b/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl @@ -6,7 +6,6 @@ {assign var="COLUMNS" value=$SUPFIELD_MODEL->getColumns($MODULE)} {assign var="SUP_RECORD_DATA" value=$RECORD->getSupplieData()} {assign var="MAIN_PARAMS" value=$SUPFIELD_MODEL->getMainParams($FIELDS[1])} - {assign var="BLACK_SUP_DATA" value=[]} {assign var="COUNT_FIELDS0" value=count($FIELDS[0])} {assign var="COUNT_FIELDS1" value=count($FIELDS[1])} {assign var="COUNT_FIELDS2" value=count($FIELDS[2])} diff --git a/modules/Supplies/models/SupField.php b/modules/Supplies/models/SupField.php index 6d99da30bef8..5e4e4df38d76 100644 --- a/modules/Supplies/models/SupField.php +++ b/modules/Supplies/models/SupField.php @@ -88,12 +88,12 @@ public static function isActiveField($row) * @param boolean $returnInBlock Should the result be divided into blocks * @return array Supplies data */ - public function getColumns($module) + public static function getColumns($module) { $log = vglobal('log'); $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . '| ' . $module); - if ($this->columns) { - return $this->columns; + if (self::$columns) { + return self::$columns; } $columns = []; @@ -105,7 +105,7 @@ public function getColumns($module) $columns[] = $name; } } - $this->columns = $columns; + self::$columns = $columns; $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); return $columns; } From e7198cad65a7d1c1971e80338e706281d8714fe0 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Mon, 24 Aug 2015 13:23:02 +0200 Subject: [PATCH 029/489] Added detail view Supplies data --- .../modules/Supplies/DetailViewSupplies.tpl | 64 ++++++++++----- .../modules/Supplies/EditViewSupplies.tpl | 10 +-- .../modules/Supplies/EditViewSuppliesRow.tpl | 8 +- .../Supplies/EditViewSuppliesSummary.tpl | 40 ++++------ ...ailViewCurrency.tpl => DetailViewBase.tpl} | 2 +- ...iscount.tpl => DetailViewDiscountMode.tpl} | 2 +- .../Supplies/fields/DetailViewName.tpl | 5 -- .../Supplies/fields/DetailViewNetPrice.tpl | 4 - .../Supplies/fields/DetailViewQuantity.tpl | 4 - .../Supplies/fields/DetailViewReference.tpl | 4 - ...ailViewPrice.tpl => DetailViewTaxMode.tpl} | 2 +- .../Supplies/fields/DetailViewTaxType.tpl | 4 - .../Supplies/fields/DetailViewTotalPrice.tpl | 4 - .../modules/Supplies/resources/Edit.js | 80 +++++++++++++++---- .../modules/Supplies/resources/Edit.min.js | 2 +- layouts/vlayout/skins/twilight/style.css | 10 +-- layouts/vlayout/skins/twilight/style.min.css | 2 +- modules/Supplies/actions/GetDetails.php | 1 + modules/Supplies/fields/Basic.php | 28 +++++-- modules/Supplies/fields/Comment.php | 2 +- modules/Supplies/fields/Currency.php | 12 ++- modules/Supplies/fields/Discount.php | 10 ++- modules/Supplies/fields/DiscountMode.php | 4 +- modules/Supplies/fields/GrossPrice.php | 2 +- modules/Supplies/fields/Margin.php | 2 +- modules/Supplies/fields/MarginP.php | 2 +- modules/Supplies/fields/Name.php | 2 +- modules/Supplies/fields/NetPrice.php | 2 +- modules/Supplies/fields/Purchase.php | 2 +- modules/Supplies/fields/Quantity.php | 2 +- modules/Supplies/fields/Reference.php | 2 +- modules/Supplies/fields/Tax.php | 18 ++++- modules/Supplies/fields/TaxMode.php | 6 +- modules/Supplies/fields/TotalPrice.php | 2 +- modules/Supplies/fields/UnitPrice.php | 2 +- modules/Supplies/fields/Value.php | 2 +- modules/Supplies/models/SupField.php | 4 +- modules/Supplies/views/Detail.php | 1 - 38 files changed, 224 insertions(+), 131 deletions(-) rename layouts/vlayout/modules/Supplies/fields/{DetailViewCurrency.tpl => DetailViewBase.tpl} (71%) rename layouts/vlayout/modules/Supplies/fields/{DetailViewDiscount.tpl => DetailViewDiscountMode.tpl} (71%) delete mode 100644 layouts/vlayout/modules/Supplies/fields/DetailViewName.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/DetailViewNetPrice.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/DetailViewQuantity.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/DetailViewReference.tpl rename layouts/vlayout/modules/Supplies/fields/{DetailViewPrice.tpl => DetailViewTaxMode.tpl} (71%) delete mode 100644 layouts/vlayout/modules/Supplies/fields/DetailViewTaxType.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/DetailViewTotalPrice.tpl diff --git a/layouts/vlayout/modules/Supplies/DetailViewSupplies.tpl b/layouts/vlayout/modules/Supplies/DetailViewSupplies.tpl index caed2f2b2e50..5abecff7cd13 100644 --- a/layouts/vlayout/modules/Supplies/DetailViewSupplies.tpl +++ b/layouts/vlayout/modules/Supplies/DetailViewSupplies.tpl @@ -1,31 +1,36 @@ {**} {strip} - {assign var="FIELDS" value=Supplies_SupField_Model::getFields($SUP_MODULE, true)} + {assign var="FIELDS" value=Supplies_SupField_Model::getFields($MODULE, true)} {if count($FIELDS) neq 0} {assign var="SUPMODULE" value='Supplies'} - {assign var="COLUMNS" value=Supplies_SupField_Model::getColumns($SUP_MODULE)} + {assign var="COLUMNS" value=Supplies_SupField_Model::getColumns($MODULE)} {assign var="SUP_RECORD_DATA" value=$RECORD->getSupplieData()} - {assign var="SUP_RECORD_DATA" value=Supplies_SupField_Model::getRecordData($SUP_MODULE, $SUP_RECORD)} {assign var="MAIN_PARAMS" value=Supplies_SupField_Model::getMainParams($FIELDS[1])} {assign var="COUNT_FIELDS0" value=count($FIELDS[0])} {assign var="COUNT_FIELDS1" value=count($FIELDS[1])} {assign var="COUNT_FIELDS2" value=count($FIELDS[2])} - +
    + + + + {foreach item=FIELD from=$FIELDS[0]} + + {/foreach} + + +
    + {vtranslate($FIELD->get('label'), $SUPMODULE)}:  + {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('DetailView',$MODULE)} + {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$MODULE) SUP_VALUE=$SUP_RECORD_DATA[0][$FIELD->get('columnname')]} +
    + {assign var="FIELDS_TEXT_ALIGN_RIGHT" value=['TotalPrice','Tax','MarginP','Margin','Purchase','Discount','NetPrice','GrossPrice','UnitPrice','Quantity']} + - {if count($FIELDS[0]) neq 0} - - - {foreach item=FIELD from=$FIELDS[0]} - - {/foreach} - - {/if} {foreach item=FIELD from=$FIELDS[1]} - + {if $FIELD->isVisible($SUP_RECORD_DATA)} + + {/if} {/foreach} @@ -34,14 +39,33 @@ {assign var="ROW_NO" value=$KEY+1} {foreach item=FIELD from=$FIELDS[1]} - + {if $FIELD->isVisible($SUP_RECORD_DATA)} + + {/if} {/foreach} {/foreach} + + + {foreach item=FIELD from=$FIELDS[1]} + {if $FIELD->isVisible($SUP_RECORD_DATA)} + + {/if} + {/foreach} + +
    {vtranslate('LBL_ITEM_DETAILS', $SUP_MODULE)} - {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('DetailView')} - {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$SUP_MODULE) SUP_VALUE=$SUP_DATA[$FIELD->get('columnname')]} -
    {vtranslate($FIELD->get('label'), $SUP_MODULE)}{vtranslate($FIELD->get('label'), $SUPMODULE)}
    - {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('DetailView')} - {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$SUP_MODULE) SUP_VALUE=$SUP_DATA[$FIELD->get('columnname')]} - getName(), $FIELDS_TEXT_ALIGN_RIGHT)}class="textAlignRight"{/if}> + {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('DetailView',$MODULE)} + {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$MODULE) SUP_VALUE=$SUP_DATA[$FIELD->get('columnname')]} +
    + {if $FIELD->isSummary()} + {assign var="SUM" value=0} + {foreach key=KEY item=SUP_DATA from=$SUP_RECORD_DATA} + {assign var="SUM" value=($SUM + $SUP_DATA[$FIELD->get('columnname')])} + {/foreach} + {CurrencyField::convertToUserFormat($SUM, null, true)} + {/if} +
    {/if} {/strip} diff --git a/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl b/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl index 7fb44596e606..277316bbf9fa 100644 --- a/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl +++ b/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl @@ -13,7 +13,7 @@ - +
    {/foreach}
    @@ -30,19 +30,19 @@ {foreach item=FIELD from=$FIELDS[0]} {vtranslate($FIELD->get('label'), $SUPMODULE)}   - {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('EditView')} + {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('EditView',$MODULE)} {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$MODULE) SUP_VALUE=$SUP_RECORD_DATA[0][$FIELD->get('columnname')]}
    - +
    {foreach item=FIELD from=$FIELDS[1]} - + {/foreach} @@ -56,7 +56,7 @@ {foreach item=FIELD from=$FIELDS[1]} - {foreach item=FIELD from=$FIELDS[1]} - {/foreach} @@ -32,8 +32,8 @@ {else} {assign var="COLSPAN" value=$FIELD->get('colspan')} {/if} - {/foreach} diff --git a/layouts/vlayout/modules/Supplies/EditViewSuppliesSummary.tpl b/layouts/vlayout/modules/Supplies/EditViewSuppliesSummary.tpl index a7c78d4f7f7c..1e4ee8412540 100644 --- a/layouts/vlayout/modules/Supplies/EditViewSuppliesSummary.tpl +++ b/layouts/vlayout/modules/Supplies/EditViewSuppliesSummary.tpl @@ -2,7 +2,7 @@ {strip}
    -
      {vtranslate($FIELD->get('label'), $SUPMODULE)}{vtranslate($FIELD->get('label'), $SUPMODULE)}
       + {if $FIELD->isSummary()} {assign var="SUM" value=0} {foreach key=KEY item=SUP_DATA from=$SUP_RECORD_DATA} diff --git a/layouts/vlayout/modules/Supplies/EditViewSuppliesRow.tpl b/layouts/vlayout/modules/Supplies/EditViewSuppliesRow.tpl index fbe740f8fbf6..89f77abe5381 100644 --- a/layouts/vlayout/modules/Supplies/EditViewSuppliesRow.tpl +++ b/layouts/vlayout/modules/Supplies/EditViewSuppliesRow.tpl @@ -18,8 +18,8 @@ {/if} - {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('EditView')} + + {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('EditView',$MODULE)} {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$MODULE) SUP_VALUE=$SUP_DATA[$FIELD->get('columnname')]} - {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('EditView')} + + {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('EditView',$MODULE)} {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$MODULE) SUP_VALUE=$SUP_DATA[$FIELD->get('columnname')]}
    +
    {foreach item=FIELD from=$FIELDS[2]} @@ -18,34 +18,28 @@
    - +
    + + + + + + - {foreach item=FIELD from=$FIELDS[2]} - - - - - {/foreach} +
    {vtranslate('LBL_TAX_RATE',$SUPMODULE)}{vtranslate('LBL_TAX_VALUE',$SUPMODULE)}
    - xx - - vv -
    - +
    + + + + + + - {foreach item=FIELD from=$FIELDS[2]} - - - - - {/foreach} +
    {vtranslate('LBL_TAX_RATE',$SUPMODULE)}{vtranslate('LBL_TAX_VALUE',$SUPMODULE)}
    - xx - - vv -
    diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewCurrency.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewBase.tpl similarity index 71% rename from layouts/vlayout/modules/Supplies/fields/DetailViewCurrency.tpl rename to layouts/vlayout/modules/Supplies/fields/DetailViewBase.tpl index fdbab255bd8b..46bc023508e4 100644 --- a/layouts/vlayout/modules/Supplies/fields/DetailViewCurrency.tpl +++ b/layouts/vlayout/modules/Supplies/fields/DetailViewBase.tpl @@ -1,4 +1,4 @@ {**} {strip} - {$FIELD->getDisplayValue($SUP_DATA[$FIELD->get('columnname')])} + {$FIELD->getDisplayValue($SUP_VALUE)} {/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewDiscount.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewDiscountMode.tpl similarity index 71% rename from layouts/vlayout/modules/Supplies/fields/DetailViewDiscount.tpl rename to layouts/vlayout/modules/Supplies/fields/DetailViewDiscountMode.tpl index fdbab255bd8b..7009f01922e4 100644 --- a/layouts/vlayout/modules/Supplies/fields/DetailViewDiscount.tpl +++ b/layouts/vlayout/modules/Supplies/fields/DetailViewDiscountMode.tpl @@ -1,4 +1,4 @@ {**} {strip} - {$FIELD->getDisplayValue($SUP_DATA[$FIELD->get('columnname')])} + {vtranslate($FIELD->getDisplayValue($SUP_VALUE), $SUPMODULE)} {/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewName.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewName.tpl deleted file mode 100644 index e41a9e8c4908..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/DetailViewName.tpl +++ /dev/null @@ -1,5 +0,0 @@ -{**} -{strip} - {$FIELD->getDisplayValue($SUP_DATA[$FIELD->get('columnname')])}
    - {$SUP_DATA['comment']} -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewNetPrice.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewNetPrice.tpl deleted file mode 100644 index fdbab255bd8b..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/DetailViewNetPrice.tpl +++ /dev/null @@ -1,4 +0,0 @@ -{**} -{strip} - {$FIELD->getDisplayValue($SUP_DATA[$FIELD->get('columnname')])} -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewQuantity.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewQuantity.tpl deleted file mode 100644 index fdbab255bd8b..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/DetailViewQuantity.tpl +++ /dev/null @@ -1,4 +0,0 @@ -{**} -{strip} - {$FIELD->getDisplayValue($SUP_DATA[$FIELD->get('columnname')])} -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewReference.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewReference.tpl deleted file mode 100644 index fdbab255bd8b..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/DetailViewReference.tpl +++ /dev/null @@ -1,4 +0,0 @@ -{**} -{strip} - {$FIELD->getDisplayValue($SUP_DATA[$FIELD->get('columnname')])} -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewPrice.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewTaxMode.tpl similarity index 71% rename from layouts/vlayout/modules/Supplies/fields/DetailViewPrice.tpl rename to layouts/vlayout/modules/Supplies/fields/DetailViewTaxMode.tpl index fdbab255bd8b..7009f01922e4 100644 --- a/layouts/vlayout/modules/Supplies/fields/DetailViewPrice.tpl +++ b/layouts/vlayout/modules/Supplies/fields/DetailViewTaxMode.tpl @@ -1,4 +1,4 @@ {**} {strip} - {$FIELD->getDisplayValue($SUP_DATA[$FIELD->get('columnname')])} + {vtranslate($FIELD->getDisplayValue($SUP_VALUE), $SUPMODULE)} {/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewTaxType.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewTaxType.tpl deleted file mode 100644 index fdbab255bd8b..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/DetailViewTaxType.tpl +++ /dev/null @@ -1,4 +0,0 @@ -{**} -{strip} - {$FIELD->getDisplayValue($SUP_DATA[$FIELD->get('columnname')])} -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewTotalPrice.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewTotalPrice.tpl deleted file mode 100644 index fdbab255bd8b..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/DetailViewTotalPrice.tpl +++ /dev/null @@ -1,4 +0,0 @@ -{**} -{strip} - {$FIELD->getDisplayValue($SUP_DATA[$FIELD->get('columnname')])} -{/strip} diff --git a/layouts/vlayout/modules/Supplies/resources/Edit.js b/layouts/vlayout/modules/Supplies/resources/Edit.js index 04fea4d3ffca..2faee2a55f00 100644 --- a/layouts/vlayout/modules/Supplies/resources/Edit.js +++ b/layouts/vlayout/modules/Supplies/resources/Edit.js @@ -8,7 +8,9 @@ *************************************************************************************/ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { - lineItemContentsContainer: false, + supTableContainer: false, + supTableHeadContainer: false, + summaryTaxesContainer: false, rowClass: 'tr.rowSup', discountMondalFields: ['aggregationType', 'globalDiscount', 'groupCheckbox', 'groupDiscount', 'individualDiscount', 'individualDiscountType'], taxMondalFields: ['aggregationType', 'globalTax', 'groupCheckbox', 'groupTax', 'individualTax'], @@ -17,10 +19,22 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { * @return : jQuery object */ getSupTableContainer: function () { - if (this.lineItemContentsContainer == false) { - this.lineItemContentsContainer = $('.suppliesItemTable'); + if (this.supTableContainer === false) { + this.supTableContainer = $('.suppliesItemsTable'); } - return this.lineItemContentsContainer; + return this.supTableContainer; + }, + getSupTableHeadContainer: function () { + if (this.supTableHeadContainer === false) { + this.supTableHeadContainer = $('.suppliesHeaderTable'); + } + return this.supTableHeadContainer; + }, + getSupSummaryTaxesContainer: function () { + if (this.summaryTaxesContainer === false) { + this.summaryTaxesContainer = $('.suppliesSummaryTaxes tbody'); + } + return this.summaryTaxesContainer; }, getNextLineItemRowNumber: function () { var rowNumber = $(this.rowClass, this.getSupTableContainer()).length; @@ -66,7 +80,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { return response; }, getTaxModeSelectElement: function (row) { - var subTable = this.getSupTableContainer(); + var subTable = this.getSupTableHeadContainer(); if (subTable.find('thead .taxMode').length > 0) { return $('.taxMode'); } @@ -100,7 +114,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { } }, getDiscountModeSelectElement: function (row) { - var subTable = this.getSupTableContainer(); + var subTable = this.getSupTableHeadContainer(); if (subTable.find('thead .discountMode').length > 0) { return $('.discountMode'); } @@ -126,7 +140,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { } }, getCurrency: function () { - var currency = $('[name="currency"]', this.getSupTableContainer()); + var currency = $('[name="currency"]', this.getSupTableHeadContainer()); return currency.find('option:selected').val(); }, getTax: function (row) { @@ -211,9 +225,10 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { }, summaryCalculations: function () { var thisInstance = this; - this.getSupTableContainer().find('tfoot .wisableTd').each(function (index) { + thisInstance.getSupTableContainer().find('tfoot .wisableTd').each(function (index) { thisInstance.calculatSummary($(this), $(this).data('sumfield')); }); + thisInstance.calculatTaxSummary(); }, calculatSummary: function (element, field) { var thisInstance = this; @@ -223,6 +238,42 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { }); element.text(app.parseNumberToShow(sum)); }, + calculatTaxSummary: function () { + var thisInstance = this; + var taxs = thisInstance.getAllTaxs(); + var container = thisInstance.getSupSummaryTaxesContainer(); + $.each(taxs, function (index, value) { + if (value != undefined) { + $('' + index + '%' + app.parseNumberToShow(value) + '').appendTo(container); + } + }); + console.log(taxs); + }, + getAllTaxs: function () { + var thisInstance = this; + var tax = []; + this.getSupTableContainer().find(this.rowClass).each(function (index) { + var row = $(this); + var netPrice = thisInstance.getNetPrice(row); + var params = row.find('.taxParam').val(); + if (params != '') { + var param = $.parseJSON(params); + if (typeof param.aggregationType == 'string') { + param.aggregationType = [param.aggregationType]; + } + $.each(param.aggregationType, function (index, name) { + var name = name + 'Tax'; + var precent = param[name]; + var old = 0; + if (tax[precent] != undefined) { + old = parseFloat(tax[precent]); + } + tax[precent] = old + netPrice * (precent / 100); + }); + } + }); + return tax; + }, calculateNetPrice: function (row) { var netPrice = this.getTotalPrice(row) - this.getDiscount(row); this.setNetPrice(row, netPrice); @@ -464,8 +515,8 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { var unitPriceValues = recordData.unitPriceValues; var unitPriceValuesJson = JSON.stringify(unitPriceValues); - for (var field in recordData) { - parentRow.find('input.' + field).val(recordData[field]); + for (var field in recordData['autoFields']) { + parentRow.find('input.' + field).val(recordData['autoFields'][field]); } var currencyId = thisInstance.getCurrency(); @@ -747,11 +798,12 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { var element = $(e.currentTarget); thisInstance.quantityChangeActions(thisInstance.getClosestRow(element)); }); - container.on('change', '.taxMode', function (e) { + var headContainer = thisInstance.getSupTableHeadContainer(); + headContainer.on('change', '.taxMode', function (e) { var element = $(e.currentTarget); thisInstance.showIndividualTax(thisInstance.getClosestRow(element)); }); - container.on('change', '.discountMode', function (e) { + headContainer.on('change', '.discountMode', function (e) { var element = $(e.currentTarget); thisInstance.showIndividualDiscount(thisInstance.getClosestRow(element)); }); @@ -841,8 +893,8 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { }); mondal.on('click', '.saveDiscount', function (e) { parentRow.find('.discount').val(mondal.find('.valueDiscount').text()); - thisInstance.quantityChangeActions(parentRow); thisInstance.saveDiscountsParameters(parentRow, mondal); + thisInstance.quantityChangeActions(parentRow); app.hideModalWindow(); }); }, @@ -907,8 +959,8 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { }); mondal.on('click', '.saveTaxs', function (e) { parentRow.find('.tax').val(mondal.find('.valueTax').text()); - thisInstance.quantityChangeActions(parentRow); thisInstance.saveTaxsParameters(parentRow, mondal); + thisInstance.quantityChangeActions(parentRow); app.hideModalWindow(); }); }, diff --git a/layouts/vlayout/modules/Supplies/resources/Edit.min.js b/layouts/vlayout/modules/Supplies/resources/Edit.min.js index 43d082193630..5c5c237e01bf 100644 --- a/layouts/vlayout/modules/Supplies/resources/Edit.min.js +++ b/layouts/vlayout/modules/Supplies/resources/Edit.min.js @@ -1,2 +1,2 @@ -Vtiger_Edit_Js("Supplies_Edit_Js",{},{lineItemContentsContainer:false,rowClass:"tr.rowSup",discountMondalFields:["aggregationType","globalDiscount","groupCheckbox","groupDiscount","individualDiscount","individualDiscountType"],taxMondalFields:["aggregationType","globalTax","groupCheckbox","groupTax","individualTax"],getSupTableContainer:function(){if(this.lineItemContentsContainer==false){this.lineItemContentsContainer=$(".suppliesItemTable")}return this.lineItemContentsContainer},getNextLineItemRowNumber:function(){var a=$(this.rowClass,this.getSupTableContainer()).length;$("#suppliesRowNo").val(a+1);return ++a},getAccountId:function(){var a=$("#accountReferenceField").val();if(a!=""){return $('[name="'+a+'"]').val()}return""},checkDeleteIcon:function(){var a=this.getSupTableContainer();if(a.find(this.rowClass).length>1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackSuppliesTable tbody").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},getTaxModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(c){var b=this;var a=b.getSupTableContainer().find(".colTax");if(b.isIndividualTaxMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".tax").val("0");b.rowsCalculations()}},getDiscountModeSelectElement:function(b){var a=this.getSupTableContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(c){var b=this;var a=b.getSupTableContainer().find(".colDiscount");if(b.isIndividualDiscountMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".discount").val("0");b.rowsCalculations()}},getCurrency:function(){var a=$('[name="currency"]',this.getSupTableContainer());return a.find("option:selected").val()},getTax:function(a){return app.parseNumberToFloat($(".tax",a).val())},getQuantityValue:function(a){return app.parseNumberToFloat($(".qty",a).val())},getUnitPriceValue:function(a){return app.parseNumberToFloat($(".unitPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return app.parseNumberToFloat(b)},getNetPrice:function(a){return app.parseNumberToFloat($(".netPrice",a).val())},getTotalPrice:function(a){return app.parseNumberToFloat($(".totalPrice",a).val())},getGrossPrice:function(a){return app.parseNumberToFloat($(".grossPrice",a).val())},getPurchase:function(a){var b=this.getQuantityValue(a);return app.parseNumberToFloat($(".purchase",a).val())*b},getSummaryGrossPrice:function(){var b=this;var a=0;this.getSupTableContainer().find(this.rowClass).each(function(c){a+=b.getGrossPrice($(this))});return app.parseNumberToFloat(a)},setUnitPriceValue:function(b,a){b.find(".unitPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=app.parseNumberToShow(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=app.parseNumberToShow(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=app.parseNumberToShow(a);$(".totalPriceText",b).text(a);$(".totalPrice",b).val(a)},setMargin:function(b,a){a=app.parseNumberToShow(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=app.parseNumberToShow(a);$(".marginp",b).val(a)},quantityChangeActions:function(a){this.rowCalculations(a);this.summaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getSupTableContainer().find(this.rowClass).each(function(b){a.quantityChangeActions($(this))})},summaryCalculations:function(){var a=this;this.getSupTableContainer().find("tfoot .wisableTd").each(function(b){a.calculatSummary($(this),$(this).data("sumfield"))})},calculatSummary:function(a,d){var c=this;var b=0;this.getSupTableContainer().find(this.rowClass).each(function(e){b+=app.parseNumberToFloat($(this).find("."+d).val())});a.text(app.parseNumberToShow(b))},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getUnitPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,c){var e=this.getTotalPrice(j),b=e,k=0,f=0,g=0,a=0;var i=c.find(".discountsType").val();if(i=="0"||i=="1"){if(c.find(".activepanel .globalDiscount").length>0){var k=app.parseNumberToFloat(c.find(".activepanel .globalDiscount").val())}if(c.find(".activepanel .individualDiscountType").length>0){var d=c.find('.activepanel .individualDiscountType[name="individual"]:checked').val();var h=c.find(".activepanel .individualDiscountValue").val();if(d=="percentage"){g=(h/100)*e}else{g=h}}if(c.find(".activepanel .groupCheckbox").length>0&&c.find(".activepanel .groupCheckbox").prop("checked")==true){var f=app.parseNumberToFloat(c.find(".groupValue").val());f=e*(f/100)}b=b*((100-k)/100);b=b-app.parseNumberToFloat(g);b=b-f}else{if(i=="2"){c.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=app.parseNumberToFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=app.parseNumberToFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=app.parseNumberToFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}c.find(".valuePrices").text(app.parseNumberToShow(b));c.find(".valueDiscount").text(app.parseNumberToShow(e-b))},calculateTax:function(k,g){var h=this.getTotalPrice(k),b=h,c=0,f=0,a=0,i=0,e=0;var d=g.find(".taxsType").val();if(d=="0"||d=="1"){if(g.find(".activepanel .globalTax").length>0){var c=g.find(".activepanel .globalTax").val()}if(g.find(".activepanel .individualTaxValue").length>0){var j=app.parseNumberToFloat(g.find(".activepanel .individualTaxValue").val());i=(j/100)*b}if(g.find(".activepanel .groupTax").length>0){var f=app.parseNumberToFloat(g.find(".groupTax").val());f=h*(app.parseNumberToFloat(f)/100)}if(g.find(".activepanel .regionalTax").length>0){var a=app.parseNumberToFloat(g.find(".regionalTax").val());a=h*(app.parseNumberToFloat(a)/100)}b=b*((100+app.parseNumberToFloat(c))/100);b=b+app.parseNumberToFloat(i);b=b+app.parseNumberToFloat(f);b=b+app.parseNumberToFloat(a)}else{if(d=="2"){g.find(".activepanel").each(function(p){var l=$(this);if(l.find(".globalTax").length>0){var o=app.parseNumberToFloat(l.find(".globalTax").val());b=b*((100+o)/100)}else{if(l.find(".groupTax").length>0){var n=app.parseNumberToFloat(l.find(".groupTax").val());b=b*((100+n)/100)}else{if(l.find(".regionalTax").length>0){var m=app.parseNumberToFloat(l.find(".regionalTax").val());b=b*((100+m)/100)}else{if(l.find(".individualTaxValue").length>0){var q=app.parseNumberToFloat(l.find(".individualTaxValue").val());b=((q+100)/100)*b}}}}})}}g.find(".valuePrices").text(app.parseNumberToShow(b));g.find(".valueTax").text(app.parseNumberToShow(b-h))},updateRowSequence:function(){var a=this.getSupTableContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerSuppliesSaveData:function(a){var b=this;a.on(Vtiger_Edit_Js.recordPreSave,function(f,d){if(!b.checkLimits(a)){return false}var c=a.find("#blackSuppliesTable");c.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductUnitPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setUnitPriceValue(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(g,a){var d=this;var c=jQuery("input.sourceField",g).val();var e=g.find('.rowName input[name="popupReferenceModule"]').val();d.removeSubProducts(g);if(c=="0"||$.inArray(e,["Products","Services"])<0){return false}if(d.subProductsCashe[c]){d.addSubProducts(g,d.subProductsCashe[c]);return false}var f={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(f).then(function(i){var h=i.result;d.subProductsCashe[c]=h;d.addSubProducts(g,h);if(b){b.hide()}},function(h,i){if(b){b.hide()}})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,c){var i=this;for(var b in c){var a=c[b];var j=a.description;var e=a.unitPriceValues;var d=JSON.stringify(e);for(var g in a){k.find("input."+g).val(a[g])}var h=i.getCurrency();if(typeof e[h]!=="undefined"){i.setUnitPriceValue(k,e[h])}$("input.unitPrice",k).attr("list-info",d);$("textarea.commentTextarea",k).val(j);i.showIndividualTax(k)}if(f==="Products"){i.loadSubProducts(k,true)}this.quantityChangeActions(k)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".discountParam").val(JSON.stringify(c))},saveTaxsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(b.taxMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".taxParam").val(JSON.stringify(c))},showExpandedRow:function(e){var d=this;var c=d.getSupTableContainer();var b=c.find('[numrowex="'+e.attr("numrow")+'"]');var a=e.find(".toggleVisibility");a.data("status","1");a.find(".glyphicon").removeClass("glyphicon-menu-down");a.find(".glyphicon").addClass("glyphicon-menu-up");b.removeClass("hide");d.loadCkEditorElement(b.find(".ckEditorSource"))},hideExpandedRow:function(f){var e=this;var d=e.getSupTableContainer();var c=d.find('[numrowex="'+f.attr("numrow")+'"]');var b=f.find(".toggleVisibility");b.data("status","0");b.find(".glyphicon").removeClass("glyphicon-menu-up");b.find(".glyphicon").addClass("glyphicon-menu-down");c.addClass("hide");var a=CKEDITOR.instances[c.find(".ckEditorSource").attr("id")];if(a){a.destroy()}},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},initTaxParameters:function(d,a){var c=this;var b=d.find(".taxParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.taxMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateTax(d,a)},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#suppliesLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"CheckLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#suppliesLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide()});return a},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackSuppliesTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.find("tr").appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.registerAutoCompleteFields(m);c.initRow(m)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(c,d){a.find(b.rowClass).each(function(e,f){var g=$(f);b.hideExpandedRow(g)});d.item.startPos=d.item.index()},stop:function(d,e){var c=$(e.item.context).attr("numrow");var f=a.find(".numRow"+c).remove().clone();a.find('[numrow="'+c+'"]').after(f);if(e.item.startPos1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackSuppliesTable tbody").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},getTaxModeSelectElement:function(b){var a=this.getSupTableHeadContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(c){var b=this;var a=b.getSupTableContainer().find(".colTax");if(b.isIndividualTaxMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".tax").val("0");b.rowsCalculations()}},getDiscountModeSelectElement:function(b){var a=this.getSupTableHeadContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(c){var b=this;var a=b.getSupTableContainer().find(".colDiscount");if(b.isIndividualDiscountMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".discount").val("0");b.rowsCalculations()}},getCurrency:function(){var a=$('[name="currency"]',this.getSupTableHeadContainer());return a.find("option:selected").val()},getTax:function(a){return app.parseNumberToFloat($(".tax",a).val())},getQuantityValue:function(a){return app.parseNumberToFloat($(".qty",a).val())},getUnitPriceValue:function(a){return app.parseNumberToFloat($(".unitPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return app.parseNumberToFloat(b)},getNetPrice:function(a){return app.parseNumberToFloat($(".netPrice",a).val())},getTotalPrice:function(a){return app.parseNumberToFloat($(".totalPrice",a).val())},getGrossPrice:function(a){return app.parseNumberToFloat($(".grossPrice",a).val())},getPurchase:function(a){var b=this.getQuantityValue(a);return app.parseNumberToFloat($(".purchase",a).val())*b},getSummaryGrossPrice:function(){var b=this;var a=0;this.getSupTableContainer().find(this.rowClass).each(function(c){a+=b.getGrossPrice($(this))});return app.parseNumberToFloat(a)},setUnitPriceValue:function(b,a){b.find(".unitPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=app.parseNumberToShow(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=app.parseNumberToShow(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=app.parseNumberToShow(a);$(".totalPriceText",b).text(a);$(".totalPrice",b).val(a)},setMargin:function(b,a){a=app.parseNumberToShow(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=app.parseNumberToShow(a);$(".marginp",b).val(a)},quantityChangeActions:function(a){this.rowCalculations(a);this.summaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getSupTableContainer().find(this.rowClass).each(function(b){a.quantityChangeActions($(this))})},summaryCalculations:function(){var a=this;a.getSupTableContainer().find("tfoot .wisableTd").each(function(b){a.calculatSummary($(this),$(this).data("sumfield"))});a.calculatTaxSummary()},calculatSummary:function(a,d){var c=this;var b=0;this.getSupTableContainer().find(this.rowClass).each(function(e){b+=app.parseNumberToFloat($(this).find("."+d).val())});a.text(app.parseNumberToShow(b))},calculatTaxSummary:function(){var c=this;var b=c.getAllTaxs();var a=c.getSupSummaryTaxesContainer();$.each(b,function(d,e){if(e!=undefined){$(""+d+"%"+app.parseNumberToShow(e)+"").appendTo(a)}});console.log(b)},getAllTaxs:function(){var b=this;var a=[];this.getSupTableContainer().find(this.rowClass).each(function(c){var f=$(this);var g=b.getNetPrice(f);var e=f.find(".taxParam").val();if(e!=""){var d=$.parseJSON(e);if(typeof d.aggregationType=="string"){d.aggregationType=[d.aggregationType]}$.each(d.aggregationType,function(k,j){var j=j+"Tax";var i=d[j];var h=0;if(a[i]!=undefined){h=parseFloat(a[i])}a[i]=h+g*(i/100)})}});return a},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getUnitPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,c){var e=this.getTotalPrice(j),b=e,k=0,f=0,g=0,a=0;var i=c.find(".discountsType").val();if(i=="0"||i=="1"){if(c.find(".activepanel .globalDiscount").length>0){var k=app.parseNumberToFloat(c.find(".activepanel .globalDiscount").val())}if(c.find(".activepanel .individualDiscountType").length>0){var d=c.find('.activepanel .individualDiscountType[name="individual"]:checked').val();var h=c.find(".activepanel .individualDiscountValue").val();if(d=="percentage"){g=(h/100)*e}else{g=h}}if(c.find(".activepanel .groupCheckbox").length>0&&c.find(".activepanel .groupCheckbox").prop("checked")==true){var f=app.parseNumberToFloat(c.find(".groupValue").val());f=e*(f/100)}b=b*((100-k)/100);b=b-app.parseNumberToFloat(g);b=b-f}else{if(i=="2"){c.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=app.parseNumberToFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=app.parseNumberToFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=app.parseNumberToFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}c.find(".valuePrices").text(app.parseNumberToShow(b));c.find(".valueDiscount").text(app.parseNumberToShow(e-b))},calculateTax:function(k,g){var h=this.getTotalPrice(k),b=h,c=0,f=0,a=0,i=0,e=0;var d=g.find(".taxsType").val();if(d=="0"||d=="1"){if(g.find(".activepanel .globalTax").length>0){var c=g.find(".activepanel .globalTax").val()}if(g.find(".activepanel .individualTaxValue").length>0){var j=app.parseNumberToFloat(g.find(".activepanel .individualTaxValue").val());i=(j/100)*b}if(g.find(".activepanel .groupTax").length>0){var f=app.parseNumberToFloat(g.find(".groupTax").val());f=h*(app.parseNumberToFloat(f)/100)}if(g.find(".activepanel .regionalTax").length>0){var a=app.parseNumberToFloat(g.find(".regionalTax").val());a=h*(app.parseNumberToFloat(a)/100)}b=b*((100+app.parseNumberToFloat(c))/100);b=b+app.parseNumberToFloat(i);b=b+app.parseNumberToFloat(f);b=b+app.parseNumberToFloat(a)}else{if(d=="2"){g.find(".activepanel").each(function(p){var l=$(this);if(l.find(".globalTax").length>0){var o=app.parseNumberToFloat(l.find(".globalTax").val());b=b*((100+o)/100)}else{if(l.find(".groupTax").length>0){var n=app.parseNumberToFloat(l.find(".groupTax").val());b=b*((100+n)/100)}else{if(l.find(".regionalTax").length>0){var m=app.parseNumberToFloat(l.find(".regionalTax").val());b=b*((100+m)/100)}else{if(l.find(".individualTaxValue").length>0){var q=app.parseNumberToFloat(l.find(".individualTaxValue").val());b=((q+100)/100)*b}}}}})}}g.find(".valuePrices").text(app.parseNumberToShow(b));g.find(".valueTax").text(app.parseNumberToShow(b-h))},updateRowSequence:function(){var a=this.getSupTableContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerSuppliesSaveData:function(a){var b=this;a.on(Vtiger_Edit_Js.recordPreSave,function(f,d){if(!b.checkLimits(a)){return false}var c=a.find("#blackSuppliesTable");c.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductUnitPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setUnitPriceValue(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(g,a){var d=this;var c=jQuery("input.sourceField",g).val();var e=g.find('.rowName input[name="popupReferenceModule"]').val();d.removeSubProducts(g);if(c=="0"||$.inArray(e,["Products","Services"])<0){return false}if(d.subProductsCashe[c]){d.addSubProducts(g,d.subProductsCashe[c]);return false}var f={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(f).then(function(i){var h=i.result;d.subProductsCashe[c]=h;d.addSubProducts(g,h);if(b){b.hide()}},function(h,i){if(b){b.hide()}})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,c){var i=this;for(var b in c){var a=c[b];var j=a.description;var e=a.unitPriceValues;var d=JSON.stringify(e);for(var g in a.autoFields){k.find("input."+g).val(a.autoFields[g])}var h=i.getCurrency();if(typeof e[h]!=="undefined"){i.setUnitPriceValue(k,e[h])}$("input.unitPrice",k).attr("list-info",d);$("textarea.commentTextarea",k).val(j);i.showIndividualTax(k)}if(f==="Products"){i.loadSubProducts(k,true)}this.quantityChangeActions(k)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".discountParam").val(JSON.stringify(c))},saveTaxsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(b.taxMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".taxParam").val(JSON.stringify(c))},showExpandedRow:function(e){var d=this;var c=d.getSupTableContainer();var b=c.find('[numrowex="'+e.attr("numrow")+'"]');var a=e.find(".toggleVisibility");a.data("status","1");a.find(".glyphicon").removeClass("glyphicon-menu-down");a.find(".glyphicon").addClass("glyphicon-menu-up");b.removeClass("hide");d.loadCkEditorElement(b.find(".ckEditorSource"))},hideExpandedRow:function(f){var e=this;var d=e.getSupTableContainer();var c=d.find('[numrowex="'+f.attr("numrow")+'"]');var b=f.find(".toggleVisibility");b.data("status","0");b.find(".glyphicon").removeClass("glyphicon-menu-up");b.find(".glyphicon").addClass("glyphicon-menu-down");c.addClass("hide");var a=CKEDITOR.instances[c.find(".ckEditorSource").attr("id")];if(a){a.destroy()}},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},initTaxParameters:function(d,a){var c=this;var b=d.find(".taxParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.taxMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateTax(d,a)},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#suppliesLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"CheckLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#suppliesLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide()});return a},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackSuppliesTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.find("tr").appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.registerAutoCompleteFields(m);c.initRow(m)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(c,d){a.find(b.rowClass).each(function(e,f){var g=$(f);b.hideExpandedRow(g)});d.item.startPos=d.item.index()},stop:function(d,e){var c=$(e.item.context).attr("numrow");var f=a.find(".numRow"+c).remove().clone();a.find('[numrow="'+c+'"]').after(f);if(e.item.startPos.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background:0}.navbar-default .navbar-nav>li:hover{background:#e7e7e7}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background:0}.navbar-inverse .navbar-nav>li:hover{background:#080808}.navbar-nav .hovernav:hover>.dropdown-menu{display:block}#collapsedMenu{display:block;position:relative}#collapsedMenu a{color:#fff}#collapsedMenu .dropdown-menu .shortDropdown{max-height:300px;overflow-y:scroll;padding:10px;position:relative;z-index:10000;-webkit-overflow-scrolling:touch;-webkit-transform:translateZ(0)}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames{margin-bottom:2px}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a{font-size:.9em;padding:3%!important;color:#2b2b2b!important}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a:hover{text-decoration:none;background:#404952;color:#fff!important}.moreMenus{width:52em;padding:24%;left:0;border-radius:2px}.moreMenus.leftAligned:after,.moreMenus.leftAligned:before{left:21px!important}.moreMenus strong{font-size:1.1em;color:#2b2b2b}.moreMenus:after,.moreMenus:before{left:292px!important}.announcement{// display:none;background:#fafad2;// padding:2px 0;// border-bottom:1px solid #ccc;// max-height:24px;// width:100%}.announcement .marStyle{// width:100%}#headerLinks{padding:10px 0 7px;min-width:240px;float:right!important}#headerLinks .headerLinksContainer{margin-right:10px}#headerLinks .headerLinksContainer>[class*="span"]{float:left;margin-left:15px}#headerLinks .headerLinksContainer .dropdown.open .dropdown-toggle{background:transparent}#headerLinks .headerLinksContainer ul.dropdown-menu{top:30px}#headerLinks .headerLinksContainer ul.dropdown-menu:after,#headerLinks .headerLinksContainer ul.dropdown-menu:before{right:15px;left:auto}#headerLinks .headerLinksContainer>span a img,#headerLinks .headerLinksContainer>span a.userName{color:#fff;cursor:pointer;text-decoration:none!important}#headerLinks .headerLinksContainer>span a img .caret,#headerLinks .headerLinksContainer>span a.userName .caret{border-top:4px solid #fff}.dropdown-menu.pull-right{right:0;left:auto;cursor:pointer}.themeMenuContainer{min-width:110px;width:110px;left:-84px!important;padding:10px 0}.themeMenuContainer .themeMenu{padding:0 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement{cursor:pointer;margin:5px;height:20px;width:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement:hover{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}.themeMenuContainer .themeMenu .themeSelected{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}@media screen and (min-width:1161px){#mediumNav,#shortNav,#headerLinksCompact{display:none}#largeNav{margin-left:10px;margin-right:0}}@media screen and (max-width:1160px) and (min-width:960px){.companyLogo{width:100%}.customFilterMainSpan .select2-container{width:300px!important}*{zoom:1!important}}@media screen and (max-width:960px){.bodyContents{margin:0!important}#centerPanel{width:100%!important}.col-md-3#headerLinks{padding:5px 5px 0}.menuBar .col-md-9,.col-md-3#headerLinks{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-width:80px}.menuBar .col-md-9 .qCreate,.col-md-3#headerLinks .qCreate{display:inline-block;margin:0}.menuBar .col-md-9 .qCreate img,.col-md-3#headerLinks .qCreate img{margin-bottom:3px;margin-right:5px}.menuBar .col-md-9 .qCreate ul li.title,.col-md-3#headerLinks .qCreate ul li.title{padding:5px 0 0 15px}.menuBar .col-md-9 li.tabs:first-child>a,.col-md-3#headerLinks li.tabs:first-child>a{padding:10px 12px 9px}.customFilterMainSpan .select2-container{width:300px!important}#quickCreateModules{width:100%!important;padding:0!important}.CompactQC{max-height:300px;overflow-y:scroll;overflow-x:hidden}.CompactQC a:hover{text-decoration:none}}.commonActionsContainer .quickActions{height:3em}.commonActionsContainer .quickActions img{height:60%;margin:40% auto}.commonActionsContainer .quickActions #companyLogo-container img{height:98%;margin:0 auto}.commonActionsContainer .actionsContainer{background:#f3f3f3}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown{min-width:715px;top:28px;margin:0;padding-top:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a{padding:2px;border:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mainContainer{min-height:500px;margin-top:103px;background:#eeeff2;min-width:1200px}.mainContainer>.col-md-2{// padding:0 1.06383%;height:auto!important;// min-width:174px}.mainContainer .contentsDiv{min-height:500px;background:#fafafb;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;border-left:1px solid #e6e6e6;position:relative}.mainContainer #leftPanel{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.toggleButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;left:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-left:0;display:inline-block}.toggleButton .glyphicon-chevron-left{background-position:-434px -72px!important}.toggleButton .glyphicon-chevron-right{background-position:-460px -72px!important}.toggleRightPanelButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;right:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-right:0;display:inline-block}.quickLinksDiv{margin:10px 0}.quickLinksDiv p{font-size:1.2em;padding:3% 0 0 6%;height:40px;cursor:pointer;box-shadow:0 0 0 1px #ddd;border-top:1px solid #fff!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);position:relative;border-radius:2px}.quickLinksDiv p a{color:#2b2b2b}.quickLinksDiv p a:hover{text-decoration:none}.quickLinksDiv p.selectedQuickLink{background-color:#2a2f35;background-image:-moz-linear-gradient(top,#2a2f35,#2a2f35);background-image:-ms-linear-gradient(top,#2a2f35,#2a2f35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#2a2f35),to(#2a2f35));background-image:-webkit-linear-gradient(top,#2a2f35,#2a2f35);background-image:-o-linear-gradient(top,#2a2f35,#2a2f35);background-image:linear-gradient(top,#2a2f35,#2a2f35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2a2f35',endColorstr='#2a2f35',GradientType=0);border-color:#2a2f35 #2a2f35 #08090a;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);background-image:none;position:relative;border:1px solid #fff;box-shadow:4px 0 3px -4px #000 inset}.quickLinksDiv p.selectedQuickLink a{color:#fff}.quickLinksDiv p.selectedQuickLink a:after{border-bottom:19px solid rgba(0,0,0,0);border-left:10px solid #2a2f35;border-top:19px solid rgba(0,0,0,0);content:" ";display:inline-block;position:absolute;left:100%;top:0}.quickWidgetContainer li a{overflow:hidden;white-space:normal;padding:5px;margin:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.quickWidgetContainer .quickWidget{margin-bottom:10px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.sidebarTitleBlock{padding:12px 0}.sidebarTitleBlock a{color:#373737!important}.sidebarTitleBlock a:hover{text-decoration:none}#selectAllMsgDiv,#deSelectAllMsgDiv{display:none;background-color:#fafad2;padding:.01%;text-align:center}.blockUI form,#globalmodal form{margin:0}.dashboardHeading h2{padding-bottom:8px}.dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardHeading .dropdown-menu{left:-70px;right:0}.dashboardContainer{padding:0}.dashboardContainer .dashboardHeading{padding:10px 0 0;background:#f5f5f5}.dashboardContainer .dashboardHeading h2{padding:0 0 8px 20px}.dashboardContainer .dashboardHeading .btn-toolbar{padding:3px 20px 0 0}.dashboardContainer .dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardContainer .dashboardHeading .dropdown-menu{left:-82px}.widgetsList{max-height:400px;overflow-y:auto;overflow-x:hidden}.widgetsList li{display:block}.widgetsList li a{white-space:normal;word-wrap:break-word}.dashboard_notebookWidget_view .row{margin-bottom:5px}.gridster{margin-left:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.gridster ul{width:auto;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:460px}.gridster ul{list-style:none}.gridster ul li.dashboardWidget{background:#fff;border-radius:1px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.gridster ul li.dashboardWidget .dashboardWidgetHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd;color:#444;cursor:move;padding:5px}.gridster ul li.dashboardWidget .dashboardWidgetHeader table{height:28px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .dashboardTitle{text-align:left;padding-left:10px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .widgeticons{opacity:.5;padding-right:6px}.gridster ul li.dashboardWidget .filterContainer{position:absolute;border:1px solid #ddd;background:#fff;margin-left:-7px;margin-right:3px;margin-top:4px;padding:8px 0;border-radius:0 0 5px 5px;box-shadow:0 5px 8px -5px #888}.gridster ul li.dashboardWidget .filterContainer div span{margin-top:6px}.gridster ul li.dashboardWidget .filterContainer .col-md-5{margin-top:3px}.gridster ul li.dashboardWidget .dashboardWidgetContent{padding:10px 0;line-height:20px}.gridster ul li.dashboardWidget .dashboardWidgetContent .dashboard_notebookWidget_viewarea{height:200px}.gridster ul li.dashboardWidget .widgeticons{min-width:50px;height:30px;margin-right:30px}.gridster ul li.dashboardWidget .widgeticons a{cursor:pointer;text-decoration:none}.gridster ul .widgetChartContainer{margin-left:10px}.listViewPageDiv{margin:11px 0}.customFilterMainSpan{width:100%}.customFilterMainSpan .select2-container{width:95%!important}.select2-container .select2-choice{border-radius:2px;background:#fff;border-color:#ddd;font-size:14px;letter-spacing:.01em;color:#2b2b2b}.select2-container .select2-choice div{border-radius:0;border-left:0;background:#fff}.select2-drop{border-color:#ddd}.select2-dropdown ul.filterActions{list-style:none!important;padding-left:15px}.select2-dropdown ul.filterActions li{cursor:pointer}.ui-autocomplete .ui-menu-item #ui-active-menuitem{background:#404952;border-radius:0}li.ui-timepicker-selected,.ui-timepicker-list li:hover,.ui-timepicker-list:hover .ui-timepicker-selected:hover{background:#404952}#relatedTabOrder .select2-input{min-width:200px}.alphabetSorting .alphabetSearch a{vertical-align:middle;display:inline-block;margin-bottom:2px}.alphabetSorting .alphabetSearch:hover{background:#eeeff2}.listViewActions .settingsIcon{display:inline-block;margin-left:5px}.listViewActions>.btn-group{min-width:105px}#listViewPageJumpDropDown,#relatedListPageJumpDropDown{left:-60px}.pageNumbers{display:inline-block;margin-right:5px;margin-top:6px;vertical-align:top}.pageNumbers .totalNumberOfRecords{margin:0 5px}.contents-topscroll,#reportDetails{overflow-x:auto!important;overflow-y:visible}.contents-bottomscroll{overflow-x:auto!important}.bottomscroll-div,.topscroll-div{display:table;min-width:100%}.listViewLoadingImageBlock{background:0;border-radius:0;box-shadow:none;text-align:center}.detailViewContainer{padding:0 20px}.userPreferences .contents{padding-left:0!important}.userPreferences .details{border-right:0!important}.detailViewTitle{padding:1% 0 0 1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .recordLabel{font-size:16px;font-weight:bold}.detailViewTitle .detailViewButtoncontainer{margin-top:8px}.detailViewTitle .detailViewPagingButton{margin-top:8px;padding-right:10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .btn-toolbar{margin:0}.detailview-table th,.detailview-table td{vertical-align:middle}.detailview-table th label,.detailview-table td label{margin-bottom:3px}.detailViewInfo{box-shadow:0 -4px 4px -4px #959595;margin-top:5px}.detailViewInfo .details{// min-height:600px;padding-right:1.5%;border-right:4px solid #404952;padding-bottom:10px;padding-top:10px}.detailViewInfo .related .nav-pills .active>a,.detailViewInfo .related .nav-pills .active>a:hover{background:#404952;border-radius:1px;margin-top:0;margin-bottom:2px}.fieldLabel{width:20%;background:#f7f7f9}.fieldLabel label.marginRight10px{text-align:right}.summaryView{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.summaryView .summary-table tr.summaryViewEntries:last-child .fieldValue,.summaryView .summary-table tr.summaryViewEntries:last-child .fieldLabel{border-bottom:1px solid #ddd}.summaryView .summaryViewEntries .fieldLabel{vertical-align:top;padding:5px 0 5px 5%;border-top:1px solid #ddd;border-right:1px solid #ddd}.summaryView .summaryViewEntries .fieldValue{vertical-align:top;padding:5px 0 5px 5px;border-top:1px solid #ddd}.summaryView .summaryViewEntries:hover .summaryViewEdit{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryView .summaryViewEntries .summaryViewEdit{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryView .toggleViewByMode{margin:8px 0;padding-right:0}.summaryView .toggleViewByMode .changeDetailViewMode{white-space:normal!important}.summaryWidgetContainer{border-radius:2px;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border:1px solid #eaeaea;background:#fff;margin-bottom:10px;padding:15px}.commentContainer .commentTitle{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;margin-bottom:10px}.commentContainer .commentTitle textarea{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordDetails .squeezedWell{padding:3% 0;min-height:105px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordEditView .contentHeader{padding:.5% 0 1% 0}.recordEditView .table .fieldLabel,.recordEditView .table .fieldValue{vertical-align:middle}.recordEditView .table tbody tr:hover td,.recordEditView .table tbody tr:hover th{background:#f7f7f9}.commentContainer{border-radius:2px}.commentContainer hr{margin:0!important}.commentContainer .addCommentBlock .commentsControls{display:inline-block}.commentContainer .commentsList>.liStyleNone>.commentDetails .commentDiv{width:100%}.commentContainer .commentDetails{background:#fff;border:1px solid #ddd;margin-bottom:5px;border-radius:2px;padding:10px 10px 5px;display:inline-block;min-width:354px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentContainer .commentorInfo p{margin-bottom:0}.commentContainer .addCommentBlock{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border:1px solid #ddd;padding:12px 12px 5px;min-height:115px;margin-top:15px;display:block}.commentContainer .addCommentBlock .commentcontent{padding:8px!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;resize:none}.commentContainer .commentInfoContent{padding:1px 0;word-wrap:break-word}.commentTitle .col-md-1{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentTitle .col-md-1 img{width:32px;height:32px}.commentsList>ul{margin-left:0}.singleComment .editedStatus{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:5px 0 5px 32px}.singleComment .editedStatus p{margin-bottom:0}.singleComment .commentActionsDiv{display:none}.singleComment .commentActionsDiv p{margin-bottom:0}.singleComment:hover .commentActionsDiv{display:block;margin-bottom:3px}.recentComments{margin:0;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recentComments .commentDiv{min-width:100%}.recentComments .addCommentBlock{border:0;margin-top:0;display:block}.recentComments .commentDetails{display:block}.singleComment:hover .commentActions .replyComment{display:inline-block}.commentActionsContainer a:hover{text-decoration:none}.commentActionsContainer .editStatus{padding:5px 2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentActionsContainer .editStatus p{margin-bottom:0}.table{background:#fff}.table-bordered{border-radius:1px;margin-bottom:0}.table-bordered th{border-top:1px solid #fff!important}.table th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;color:#444}.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td,.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td{border-left:0;border-right:0}.listViewEntriesTable tbody tr td:first-child{border-left:0 none}.equalSplit td:nth-child(odd){width:20%}.equalSplit td:nth-child(even){width:30%}td.fieldValue input,td.fieldValue .input-group{margin-bottom:0}.actionImage,.actionImages{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.listViewHeaders a{color:#444}.listViewEntriesDiv .listViewHeaders th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd}.listViewEntriesDiv,.listViewEntriesDiv td{overflow:visible}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues{color:#444}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues:hover{text-decoration:none}.listViewEntriesTable td.listViewEntryValue,.listViewEntries td{vertical-align:middle;cursor:pointer;overflow:visible;padding:5px}.listViewEntriesTable td.listViewEntryValue:hover .actionImages,.listViewEntries td:hover .actionImages,.listViewEntriesTable td.listViewEntryValue:hover .actions,.listViewEntries td:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryViewEntries .summaryViewEdit,.activityStatus .editStatus,.activityDescription .editDescription,.addedCalendars .actionImage{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryViewEntries:hover .fieldValue .summaryViewEdit,.activityStatus:hover .editStatus,.activityDescription:hover .editDescription,.addedCalendars:hover .actionImage{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewEntriesTable tr:hover td .actions .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewBasicAction.dropdown-menu{width:100%}.listViewBasicAction.dropdown-menu input{border-radius:2px;height:24px;margin-bottom:0;margin-top:-2px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.emptyRecordsDiv{width:100%;border:1px solid #ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.emptyRecordsDiv td{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.CustomFilterViewTitle{padding-top:1%}#CustomView .filterActions{padding-bottom:20px;overflow:hidden}.filterConditionsDiv{padding-bottom:0}.conditionGroup .header{margin-bottom:20px;font-size:1.2em}.conditionGroup .contents .conditionRow{margin-bottom:10px}.conditionGroup .contents .conditionRow select,.conditionGroup .contents .conditionRow input{width:90%}.conditionGroup .contents .conditionRow .chzn-results li{line-height:20px}.conditionGroup .deleteCondition{vertical-align:bottom}.searchUIBasic{border-collapse:separate!important;border-spacing:10px!important;margin:0 10%}.searchUIBasic .importContents{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.searchUIBasic .listRow .listViewHeaders>td{color:#404952}.searchUIBasic .listRow .defaultInputTextContainer{max-width:87%!important;margin-bottom:0!important}#lineItemTab.table tr:first-child:hover th ~ td{background-color:#f3f3f4;background-image:-moz-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-ms-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f3f3f4),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-o-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:linear-gradient(top,#f3f3f4,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f4',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}#lineItemTab.table tr:nth-child(2):hover td{background:0}.lineItemTable tr td{width:0}.lineItemTable tr td div.finalDiscountUI,.lineItemTable tr td div.discountUI,.lineItemTable tr td div#shipping_handling_div,.lineItemTable tr td div.taxUI,.lineItemTable tr td div.finalTaxUI{border:2px solid #c4c4c4;border-radius:2px}.lineItemTable tr td div.finalDiscountUI table tr td,.lineItemTable tr td div.discountUI table tr td,.lineItemTable tr td div#shipping_handling_div table tr td,.lineItemTable tr td div.taxUI table tr td,.lineItemTable tr td div.finalTaxUI table tr td,.lineItemTable tr td div.finalDiscountUI table tr th,.lineItemTable tr td div.discountUI table tr th,.lineItemTable tr td div#shipping_handling_div table tr th,.lineItemTable tr td div.taxUI table tr th,.lineItemTable tr td div.finalTaxUI table tr th{border-left:0}.lineItemTable tr:hover td{width:0}.lineItemTable tr:hover td div.finalDiscountUI table tr td{background:none!important}.lineItemTable tr:hover td div.discountUI table tr td{background:none!important}.lineItemTable tr:hover td div#shipping_handling_div table tr td{background:none!important}.lineItemTable tr:hover td span.taxDivContainer div table tr td{background:none!important}.lineItemTable tr:hover td div.finalTaxUI table tr td{background:none!important}.lineItemResult{width:70.5%!important}.lineItemResult a:hover{color:#404952}.lineItemInputBox{width:45%;float:right;text-align:right}.discountUI,.taxUI,.finalDiscountUI,.finalTaxUI,#shipping_handling_div{position:absolute;left:46%;width:30%;z-index:500;box-shadow:1px 0 7px #ddd;border-radius:6px}.discountUI table.table,.taxUI table.table,.finalDiscountUI table.table,.finalTaxUI table.table,#shipping_handling_div table.table{margin-bottom:0}.discountUI .table tbody tr:first-child th:first-child,.taxUI .table tbody tr:first-child th:first-child,.finalDiscountUI .table tbody tr:first-child th:first-child,.finalTaxUI .table tbody tr:first-child th:first-child,#shipping_handling_div .table tbody tr:first-child th:first-child{border-radius:4px 0 0 0!important}.discountUI .table tbody tr:first-child th:last-child,.taxUI .table tbody tr:first-child th:last-child,.finalDiscountUI .table tbody tr:first-child th:last-child,.finalTaxUI .table tbody tr:first-child th:last-child,#shipping_handling_div .table tbody tr:first-child th:last-child{border-radius:0 4px 0 0!important}.LineItemDirectPriceReduction{width:65%!important}th.htColHeader,.handsontable thead th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd;padding:6px 2px}.contentHeader{padding:15px;padding-left:5px;line-height:20px}.contentsDiv>div{padding:0 20px}#settingsQuickWidgetContainer .widgetContainer.accordion-body{border-bottom:none!important;border-bottom:3px solid #ddd}#settingsQuickWidgetContainer .widgetContainer.accordion-body>div:hover{background:#eeeff2}#settingsShortCutsContainer{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:1% 3%}#settingsShortCutsContainer .moduleBlock{min-height:60px}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin{display:inline-block;opacity:.4}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin:hover{opacity:.8}.settingsIndexPage .settingsSummary{text-align:center;margin-top:10px}.settingsIndexPage .settingsSummary a{display:inline-block;background:#f3f3f4;color:#444;border-radius:2px;min-width:200px;padding:20px 0 10px;border:1px solid #ddd}.settingsIndexPage .settingsSummary a .summaryText{display:inline-block;margin-top:20px;font-size:15px}.settingsIndexPage .settingsSummary a:hover .summaryText,.settingsIndexPage .settingsSummary a:hover .summaryCount{color:#404952}.settingsIndexPage .moduleBlock h5{font-size:1.2em;margin-bottom:5px}.settingsIndexPage .moduleBlock:hover{background:#f3f3f4}#userPageHeader{padding:8px 0 0}#userPageHeader #userHeading h3{margin-top:10px}.treeView li{border-left:4px solid #ddd;list-style:none;padding-top:15px}.treeView li .toolbar-handle{margin-left:10px;position:relative}.treeView li .toolbar-handle .btn{margin:0}.treeView li .toolbar-handle a:before{background:none repeat scroll 0 0 #ddd;content:" ";display:inline-block;height:4px;left:-10px;position:absolute;top:12px;width:10px}.treeView .btn{margin-bottom:10px}.profilesEditView tr.blockHeader th{text-align:center}.profilesEditView tr.blockHeader th:first-child{text-align:left}.profilesEditView input{margin-right:5px}.profilesEditView tr td.row table.table{border-left:none;margin-bottom:20px}.profilesEditView tr:hover td.row{background:0}.profilesEditView tr:hover td.row table.table tr td{background:0}.profilesEditView tr:hover td.row table.table tr:hover td{background:0}.profilesEditView tr:hover td.row table.table td{background:#f3f3f4}#s2id_memberList li>div,.groupMembersColors li>div{margin-left:10px}#s2id_memberList .Users,.groupMembersColors .Users{background-color:#f99984!important;padding:5px;margin-bottom:2px;background-image:none}#s2id_memberList .Groups,.groupMembersColors .Groups{background-color:#acd5ff!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .Roles,.groupMembersColors .Roles{background-color:#ffec98!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .RoleAndSubordinates,.groupMembersColors .RoleAndSubordinates{background-color:#c4dea2!important;background-image:none;padding:5px;margin-bottom:2px}.collectiveGroupMembers{border:1px solid #ddd;border-top:0}.collectiveGroupMembers ul{padding:0;margin:0}.collectiveGroupMembers ul li{padding:4px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.collectiveGroupMembers ul li a{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;margin:0}.collectiveGroupMembers ul li.groupLabel{background-color:#f3f3f4;border-bottom:1px solid #ddd;border-top:1px solid #ddd;padding:10px 5px;margin:0;color:#444}.mini-slider-control{width:50px}.mini-slider-control+div{margin-left:15px}.mini-slider-control .ui-slider-handle{border:0;border-radius:50%;height:16px;top:-2px;width:16px;cursor:pointer}.mini-slider-control .ui-slider-handle:focus{outline:0}.ui-widget-content{border-radius:6px;border-color:#fff;box-shadow:0 0 3px -1px inset;margin-top:2px;margin-left:5px;height:12px}.ui-slider-disabled{opacity:.5;border-color:#ddd;box-shadow:none;cursor:not-allowed}.ui-slider-disabled .ui-slider-handle{cursor:not-allowed}.ui-slider-disabled+div{opacity:.5;cursor:not-allowed}.mini-slider-control[data-value="0"] .ui-slider-handle{background:#7d7e7d;background:-moz-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#7d7e7d),color-stop(100%,#0e0e0e));background:-webkit-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-o-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-ms-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:linear-gradient(to bottom,#7d7e7d 0,#0e0e0e 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7d7e7d',endColorstr='#0e0e0e',GradientType=0)}.mini-slider-control[data-value="1"] .ui-slider-handle{background:#ffb76b;background:-moz-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ffb76b),color-stop(0%,#ffa73d),color-stop(49%,#ff7c00),color-stop(100%,#ff7f04));background:-webkit-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-o-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-ms-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:linear-gradient(to bottom,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffb76b',endColorstr='#ff7f04',GradientType=0)}.mini-slider-control[data-value="2"] .ui-slider-handle{background:#bfd255;background:-moz-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#bfd255),color-stop(79%,#8eb92a),color-stop(100%,#72aa00),color-stop(100%,#9ecb2d));background:-webkit-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-o-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-ms-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:linear-gradient(to bottom,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bfd255',endColorstr='#9ecb2d',GradientType=0)}#moduleManagerContents{padding-bottom:10px}#moduleManagerContents .moduleManagerBlock .btn-group.open .dropdown-menu{left:-144%}#moduleManagerContents .modulesTable td{width:50%}#importModules .contents .row{margin-bottom:2.2%}.extensionWidgetContainer{background-color:#fff;border:1px solid #ddd;min-height:200px;padding:2%;background:#fafafa;box-shadow:0 0 10px -4px #777}.extensionWidgetContainer .extension_contents{margin-top:2%;background:#fff;padding:10px;box-sizing:border-box;max-height:160px}.extension_contents:hover{border-radius:4px}.thumbnailImage{height:130px;width:130px;float:right}.extensionWidgetContainer .extension_contents .slimScrollDiv{padding-right:10px}.extensionWidgetContainer .extension_header .font-x-x-large{font-size:1.5em;padding-left:3px;font-weight:bold;color:#404952}.extensionWidgetContainer .extensionDescription{line-height:20px}.extensionWidgetContainer .extensionInfo{padding-top:5px}.extensionWidgetContainer .extensionInfo .rating,.extensionDetails .rating{vertical-align:middle;margin-top:2px;display:inline-block}.extensionDetails .authorInfo{margin:3px 0}.extensionDetails .extensionDetailActions{padding:15px 0}.extensionWidgetContainer .tab-pane .bx-wrapper .imageSlider{margin:0}.sliderImage{width:90%;height:360px}.opacity .actions{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.opacity:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.sharingAccessDetails{margin-bottom:30px}.sharingAccessDetails td,.sharingAccessDetails th{text-align:center;vertical-align:middle!important}.sharingAccessDetails tr td:first-child,.sharingAccessDetails tr th:first-child{text-align:left}.sharingAccessDetails td.row>div{display:block}.sharingAccessDetails .customRuleContainer:hover{background:0}.sharingAccessDetails hr{border-bottom:1px solid #bcbcbc}.sharingAccessDetails .title{padding:1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.sharingAccessDetails .title .rulehead{padding-top:5px}.sharingAccessDetails .customRuleEntries:hover .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.layoutContent{border-top:4px solid #404952}.layoutContent #moduleBlocks .editFieldsTable{margin-bottom:20px}.layoutContent #moduleBlocks .editFieldsTable .fieldLabel{background:0}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockLabel{padding-top:13px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group{margin-top:5px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group .dropdown-menu{left:-100%}.layoutContent .relatedTabModulesList{padding:2% 1%}.fieldDetailsForm .search-choice-close{padding:0}.border1px{border:1px solid #ddd}.blockFieldsList .opacity{margin-left:.5%!important}.blockFieldsList .opacity .dropdown-menu a{padding:0!important}.blockFieldsList .opacity a.dropdown-toggle.editFieldDetails{box-shadow:none}.blockFieldsList .editFields .dropdown-menu{z-index:1000003;padding:0;left:-215px;position:absolute}.blockFieldsList .editFieldsWidget .dropdown-menu{z-index:1000003;padding:0;left:-315px;position:absolute}.blockFieldsList .editFields .dropdown-menu .modal-header{border-width:0;border-bottom-width:1px}.blockFieldsList .editFields .dropdown-menu .modal-header .cancel{padding-right:0;font-weight:bold}.blockFieldsList .editFields:hover{background:#f3f3f4!important}#modulePickListValuesContainer .layoutContent{padding-left:2%}#modulePickListValuesContainer .layoutContent .selectedCell,#modulePickListValuesContainer .layoutContent .selectedListItem{background:#a5afb9;white-space:nowrap}#modulePickListValuesContainer .layoutContent .pickListValue{cursor:pointer}.nonEditableValuesDiv .nonEditablePicklistValues{margin-left:0}.nonEditableValuesDiv .nonEditablePicklistValues li{padding:3px 15px;margin-bottom:2px;background:#e0f2ff}.popover{z-index:1000023!important}.popover-content .fieldLabel{width:35%;white-space:normal}#dependencyGraph .tableHeading{text-align:center;padding-top:30px;font-size:1.2em;font-weight:bold}#dependencyGraph .depandencyTable{border:1px solid #ddd;background:#f3f3f4}#dependencyGraph .depandencyTable .blockHeader{border-bottom:1px solid #ddd}#dependencyGraph .depandencyTable .picklistValueMapping{border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping{text-align:center;border-left:1px solid #ddd;border-right:1px solid #ddd;background:#fff}#dependencyGraph .dependencyMapping .mCSB_container{margin-bottom:16px!important}#dependencyGraph .dependencyMapping .pickListDependencyTable{border:0}#dependencyGraph .dependencyMapping .pickListDependencyTable .blockHeader th{background:#f3f3f4;border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping .pickListDependencyTable .selectedCell{background:#a5afb9}.webformFieldInfo{margin-bottom:250px}.targetFieldsTableContainer input[type="text"]{min-width:100px}#customRecordNumbering.table thead th{vertical-align:middle}.addMailBoxBlock{margin-left:83px;padding:0!important;font-size:12px}.addMailBoxStep{background:#fff;padding:30px 0;border:1px solid #ddd;border-radius:1px;min-height:170px}.mailConveterDesc{height:350px;width:96%;border:1.5px solid;border-radius:2px;border-color:#ddd;font-size:11pt;margin-top:55px;margin-left:20px;background:#fff}#mailBoxLabel{margin-top:15px;margin-left:-18px;font-size:12pt;width:75px}.mailBoxDropdownWrapper{height:49px;width:70%;background:url('../images/mailbox-icon.png') no-repeat 5px 5px;overflow:hidden;border:1px solid #ddd}.mailBoxDropdown{background:transparent url('../images/downArrowBlue.png') no-repeat 236px 13px;width:110%;height:50px;font-size:14pt;color:#0065a6;padding:10px 55px;padding-right:0}#mailConverterDragIcon{margin-top:12px}#mailConverterBody{padding-top:20px;margin-left:0}.ruleHead{padding:6px 0;background:#d8d8dc}.mailConverterRuleBlock{font-size:14px;line-height:30px;border:1.5px solid;border-color:#ddd}.mailConverterRuleLegend{font-size:14px;color:#0065a6;margin-bottom:10px;background:#f3f3f4}#mailConverterStats{font-size:10pt;margin-top:5px;margin-left:-10px}.addMailBoxBlock{border-color:#ddd;margin-left:83px;margin-top:20px;padding-top:30px;padding-left:200px;padding-bottom:20px;padding-right:30px;font-size:11pt}.taskTypeUi>.row{margin:10px 0}#taskListContainer .listViewEntriesTable tr td:last-child{border-left:1px solid #ddd}#workflow_step2>.row{padding:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:400px}#open_email_con .detailViewTitle{padding:0}#open_email_con .detailViewTitle .detailViewPagingButton{margin-top:0;padding-right:0}#foldersList .list-group{padding-right:0}.massEditTable th+th,.massEditTable td+td,.massEditTable th+td,.massEditTable td+th{border-left:0}.nav.massEditTabs{margin-bottom:0;border-bottom:0}.nav.massEditTabs li.active a{background:#404952;color:#fff;margin-left:10px}.nav.massEditTabs li a:hover{border-bottom:1px solid #404952}.massEditContent{border-top:3px solid #404952}.calendarSettingsContainer{width:700px}.calendarSettingsContainer .control-label{width:26%}#calendarSettings{margin:1px 0 3px}.calendarMassEdit{min-width:400px}.fc-state-default .fc-button-effect{top:100%!important}.fc-event-style1,.fc-event-style1 .fc-event-skin{background:#17309a;border-color:#17309a;font-weight:normal;text-shadow:none}.fc-event-style2,.fc-event-style2 .fc-event-skin{background:#3a87ad;border-color:#3a87ad;font-weight:normal;text-shadow:none}.fc-event-style3,.fc-event-style3 .fc-event-skin{background:#aa6705;border-color:#aa6705;font-weight:normal;text-shadow:none}.fc-event-style4,.fc-event-style4 .fc-event-skin{background:#953b39;border-color:#953b39;font-weight:normal;text-shadow:none}.fc-event-style5,.fc-event-style5 .fc-event-skin{background:#545252;border-color:#545252;font-weight:normal;text-shadow:none}.fc-event-style6,.fc-event-style6 .fc-event-skin{background:#87865d;border-color:#87865d;font-weight:normal;text-shadow:none}.fc-event-style7,.fc-event-style7 .fc-event-calendarMassEditskin{background:#c71585;border-color:#c71585;font-weight:normal;text-shadow:none}.fc-event-style8,.fc-event-style8 .fc-event-skin{background:#006400;border-color:#006400;font-weight:normal;text-shadow:none}#calendarview th{color:#000}.fc-agenda-divider+div{overflow-y:visible!important}.fc-button{display:inline-block;padding:6px .4em!important;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.fc-button:active .fc-button-inner{background:transparent}.fc-button:active .fc-button-inner .fc-button-content{color:#fff}.fc-button.fc-state-active .fc-button-inner .fc-button-content,.fc-button:active .fc-button-inner .fc-button-content{color:#000!important;background:transparent;background-image:none}.fc-header-title h2{font-size:15px;line-height:20px}.fc-widget-header th{padding:4px 0!important}.fc-widget-header{color:#666;background:#eee;border-color:#ccc}.fc-content{background:#fff;margin-top:15px}.fc-content td:hover{background:#f3f3f3}.btn:focus{outline:0}.reminderPostpone.btn-primary{background:#404952}.reminderPostpone.btn-primary:hover{background:#1e2327}.saveButton{margin-right:5px}.addCustomRule{float:right}.importMore{background:#fff}.lastImport{background:#fff}.undoImport{background:#da4f49}.close{border:0;background:none repeat scroll 0 0 transparent;border:0 none;cursor:pointer}.resetButton{margin-top:0!important}.vtGlyph{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("../images/vtGlyph.png");background-position:0 0;background-repeat:no-repeat;*margin-right:.3em}.vticon-pageJump{background-position:0 0}.vticon-call-inbound{background-position:-14px 0}.vticon-call-outbound{background-position:-28px 0}#massEdit .cancelLinkContainer{padding:5px 0;margin-left:.5em}.ui-pnotify{z-index:1000023}.feedback{z-index:10002}.feedback .handle{z-index:10003;display:block;position:fixed;bottom:50px;left:-30px;left:0\9;bottom:100px\9;background:#2c2c2c;color:white;padding:7px 15px;border:1px solid gray;text-decoration:none;outline:0;-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-o-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg);-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.00000000, M12=1.00000000, M21=-1.00000000, M22=0.00000000,sizingMethod='auto expand')";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0,M12=1,M21=-1,M22=0,sizingMethod='auto expand')}.feedback .handle:hover{text-decoration:none}.vtFooter{text-align:center}.vtFooter p{background:#404952;color:#fff;border-top:1px solid #ddd;padding:1px 0;font-size:.9em;margin-bottom:0}.vtFooter p a{color:#fff}.imageHolder{background:url('../images/loadback.png') repeat-y;background-position:center;padding:10px 0}.breadcrumbContainer{padding:2% 2% 0 2%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;height:auto}.breadcrumb{display:inline-block;height:auto;height:40px}.crumbs{height:40px;margin:0;padding:0 20px 0 0;display:inline-block;font-family:sans-serif}.crumbs li:after{content:'\0000a0';width:0;height:0;border-left:18px solid #ececec;border-top:20px solid transparent;border-bottom:20px solid transparent;display:inline-block;position:relative;top:-20px;left:18px;zoom:1}.crumbs li{height:0;border-top:20px solid #ececec;border-bottom:20px solid #ececec;border-left:20px solid transparent;display:inline-block;box-shadow:0 1px #ddd;margin-right:5px}.crumbs li a{display:inline-block;float:left;margin-top:-13px;font-size:14px;font-weight:bold;color:#666;text-decoration:none}.crumbs li.active{height:0;border-top:20px solid #404952;border-bottom:20px solid #404952;box-shadow:0 1px #404952}.crumbs li.active:after{border-left:18px solid #404952!important}.stepText{display:inline-block;white-space:nowrap;overflow:hidden;font-size:13px;vertical-align:bottom}.active .stepText,.active .stepNum{color:#fff}.stepNum{display:inline-block;padding:0 5px;overflow:hidden;font-size:20px;vertical-align:top;margin-top:5px}.greyStar{background-image:url("../images/stars.png");background-position:20px 20px;height:20px;width:20px;display:inline-block}.yellowStar{background-image:url('../images/stars.png');background-position:0 20px;width:20px;height:20px;display:inline-block}.blockUI{border-radius:2px!important;border:0!important}textarea.col-md-11{width:100%!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.popover .popover-inner{border-radius:2px;font-size:.8em;box-shadow:0}.popover .popover-inner .popover-title{color:#444;font-size:15px}.popover .popover-inner .close{color:#000!important;margin-top:3px;opacity:.5!important}.popover .popover-inner .close:hover{opacity:1!important}.popover .popover-inner td{padding:3px 5px;overflow-wrap:break-word}.popover .popover-inner .detailViewInfo{margin-top:0;box-shadow:0}.popover .popover-inner .detailViewInfo .fieldLabel label{font-size:1em}#findDuplicate>.control-group{margin-bottom:0;width:400px}#moveReports .modal-body{padding:20px 40px}#composeEmailContainer{padding:0 20px}#composeEmailContainer .MultiFile-wrap{display:inline-block}#composeEmailContainer .MultiFile-intercepted .ui-wrapper{min-height:400px}#transferOwnershipContainer .select2-container.select2-container-multi{max-width:220px}.fieldInfo.in{overflow:visible!important;height:auto!important}.moduleSelection{border-radius:2px 2px 0 0!important;border:1px solid #ddd!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);color:#444}.convertLeadModules{margin-bottom:2%;border:1px none}.moduleBlock{border-radius:0!important}.overflowVisible{overflow:visible!important}.convertLeadError{border:3px solid #999;background-color:#fff;width:55%;position:relative;z-index:10000000}.convertLeadError table td{border-bottom:1px solid #ccc;nowrap:nowrap;width:70%}.bootbox,.alert{z-index:1000023}.chzn-container{vertical-align:middle}.chzn-container .chzn-results li{margin-right:7px}.chzn-container .chzn-results .highlighted{background:#404952}.select2-results .select2-highlighted{background:#404952}.select2-result-label i{background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.ui-autocomplete-loading{background:url('../images/load.gif') no-repeat right center}.ui-autocomplete{height:auto!important;border-radius:1px!important}.dropdown-menu.pull-right:after,.dropdown-menu.pull-right:before{right:3px;left:auto;top:-5px;border-bottom-width:6px}span.wrapper a{color:#08c!important;font-size:15px!important;font-weight:bold}a{color:#353c44}a:hover{color:#1e2327;text-decoration:none;cursor:pointer}a:active,a:focus{outline:0}.well{border-radius:2px;padding:15px}.verticalBottomSpacing{margin-bottom:10px}.mergeTables{margin-bottom:0}.font-x-x-large{font-size:18px;line-height:28px}form{margin:0}.fc-state-default .fc-button-effect span{background:0}.dateField{width:183px}.form-horizontal [class^="icon-"],.form-horizontal [class*=" icon-"]{vertical-align:baseline}.timePicker{width:8.5em!important;z-index:1000029!important}.datepicker{z-index:1000029!important}.colorpicker{z-index:1029!important}.colorpicker input{width:30px!important}.colorpicker input[type="text"],.colorpicker input{color:#898989!important}.colorpicker_hex input{width:45px!important}.modal-body.accordion{margin-bottom:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}//.modal-open{// overflow:hidden;//}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.removeNoFileChosen{color:transparent!important}.modelContainer .modal-header{border-radius:2px 2px 0 0}.modelContainer form{border-radius:0 0 2px 2px}.hide{display:none}i{cursor:pointer;text-decoration:none!important}.marginbottomZero{margin-bottom:0!important}.marginLeftZero{margin-left:0!important}.marginRightZero{margin-right:0!important}.clearfix{clear:both!important}textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%}.textOverflowEllipsis{overflow:hidden;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;//width:9em}.margin0px{margin:0!important}.padding10{padding:10px;padding-bottom:0}.padding20{padding:20px}.pushDown{margin-top:5px}.boxSizingBorderBox{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.boxSizingContentBox{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.cursorPointer{cursor:pointer;text-decoration:none!important}.zeroOpacity{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.dullOpacity{opacity:.8;-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80)}.fullOpacity{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.redColor{color:red}.highlightBackgroundColor{background:#eeeff2}.contentsBackground{background:#fff;border:1px solid #ddd}.textAlignCenter{text-align:center}.textAlignRight{text-align:right}.alignMiddle{vertical-align:middle}.alignTop{vertical-align:top}.padding1per{padding:1%}.paddingTop20{padding-top:20px}.padding20px{padding:20px}.padding-bottom1per{padding-bottom:1%}.marginBottom10px{margin-bottom:10px}.displayInlineBlock{display:inline-block}.backgroundImageNone{background-image:none}.liStyleNone{list-style:none outside none}.fontBold{font-weight:bold!important}.livesupport_tab,#userfeedback{display:none!important}#reportDetails table tr td.summary{border-bottom:0;border-top:0}#portalDetailViewHttpError{padding-bottom:7px;margin-top:50px;color:red;text-align:center}.slidesjs-pagination{list-style:none}.slidesjs-pagination li a{display:block;width:13px;height:0;padding-top:13px;background-image:url('../images/pagination.png');background-position:0 0;float:left;overflow:hidden}.slidesjs-pagination li a.active,.slidesjs-pagination li a:hover.active{background-position:0 -13px}.extensionStorebtn{background:#f08c39;background-image:-webkit-linear-gradient(top,#f08c39,#e68b3c);background-image:-moz-linear-gradient(top,#f08c39,#e68b3c);background-image:-ms-linear-gradient(top,#f08c39,#e68b3c);background-image:-o-linear-gradient(top,#f08c39,#e68b3c);background-image:linear-gradient(to bottom,#f08c39,#e68b3c);-webkit-border-radius:2;-moz-border-radius:2;border-radius:2px;text-shadow:0 0 1px #595959;color:#fff;font-size:14px;font-weight:bold;padding:8px 20px 8px 20px;text-decoration:none;border:0}.extensionStorebtn:hover{background:#fc9f3c;background-image:-webkit-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-moz-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-ms-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-o-linear-gradient(top,#fc9f3c,#f08a3c);background-image:linear-gradient(to bottom,#fc9f3c,#f08a3c);text-decoration:none}.extensionSearch{padding:8px 12px 8px 30px!important;margin:6px 0 14px 0;box-shadow:inset 2px 2px 10px #ddd;border-radius:2px!important;background:url('../images/search.png') no-repeat;background-position:5px 6px}.banner-container{border-bottom:1px solid #fff;box-sizing:border-box}.banner{margin:0 90px}.bx-wrapper{margin:0 auto 35px!important;padding-top:17px!important}.bx-wrapper li a{display:block}.bx-wrapper a img{height:100px;width:auto;margin:0 auto}.wide,.table td.wide,.listViewEntries td.wide,td.listViewEntryValue.wide{padding:8px!important}.medium,.table td.medium,.listViewEntries td.medium,td.listViewEntryValue.medium{padding:5px 6px!important}.narrow,.table td.narrow,.listViewEntries td.narrow,td.listViewEntryValue.narrow{padding:2px 4px!important}.table thead th.narrow{vertical-align:middle}td.listViewEntryValue .row input{padding:0;margin-bottom:0}.listViewContentDiv{position:relative}.fieldLabel .pull-right{text-align:right}#tagRecordText{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;width:80%!important}#tagRecord{margin-left:5px!important}.tag{float:right!important}.cut-string{text-overflow:ellipsis;-o-text-overflow:ellipsis;-webkit-text-overflow:ellipsis;width:200px;white-space:nowrap;overflow:hidden}.paddingLRZero{padding-left:0;padding-right:0}.paddingRightZero{padding-right:0}.detailViewToolbar{margin-top:5px}.input-group.input-group-sm>.input-group-addon img{width:15px}table tr td .input-sm{min-width:50px}.modal-footer.backgroundColor{background-color:#f5f5f5}.panel-title{font-size:14px}.quickWidgetContainer .panel-body{padding-bottom:0;padding-top:0}tr.summaryViewEntries,#detailView table{font-size:13px}table.listViewEntriesTable{font-size:13px;margin-top:5px}.no-margin{margin:0}.companyLogo img{max-height:200px;max-width:250px}.navbar-inverse .navbar-nav>li>a{color:#fff;padding:15px 12px}.navbar-inverse .navbar-nav .dropdown-menu>li>a{padding:3px 15px;font-size:12px}.headerCalendar .month h3{font-size:18px;font-weight:bold;margin:5px 0 0 0}.columnsSelect{width:100%!important}.marginBottom5{margin-bottom:5px}.editViewContainer .recordEditView table.blockContainer tr td.fieldValue{width:30%}.recordEditView[name=QuickCreate] .quickCreateContent table tr td.fieldValue,#massEditContainer .massEditContent table tr td.fieldValue,#tab_accounts td.functionList{width:30%}.btn{white-space:normal}.valuesAssignedToRole{border:1px solid #adadad;overflow:hidden;text-overflow:ellipsis;padding:6px}table.dataTable .form-control{width:100%!important}#breadcrumb .stepNum{margin-top:0}#breadcrumb .stepText{position:relative;top:-4px}.fc button{height:auto!important}.fc-toolbar{margin-bottom:0!important}.fc-center,.fc-left,.fc-right{margin-bottom:1em}.calendarRightPanel{padding-left:5px;padding-right:5px}.calendarRightPanel ul li{margin-bottom:2px;margin-left:5px}.calendarRightPanel ul li:hover{background-color:#eee!important;border-radius:5px}.square9{width:12px;height:12px;margin:4px}.panel-dark{border-color:#737373}.panel-dark>.panel-heading{color:#fff;background-color:#737373;border-color:#737373}.panel-dark>.panel-heading+.panel-collapse>.panel-body{border-top-color:#737373}.panel-dark>.panel-heading .badge{color:#737373;background-color:#fff}.panel-dark>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#737373}.calendarRightPanel .widgetContainer ul{margin-top:5px;margin-bottom:5px}.paddingLeft5px{padding-left:5px}.marginBottom5px{margin-bottom:5px}.detailview-table .fieldValue .summaryViewEdit{display:none}.detailview-table .fieldValue:hover .summaryViewEdit{display:inherit}.icon-in-history-widget{font-size:17px;padding:4px}#prefPageHeader .logo img{height:70px;width:70px}#myPrefHeading h3{margin-top:12px}.list-user-img{width:50px;height:40px}span[name=existingImages] img{height:200px;width:300px}.narrow.fieldValue .chosen-container-single .chosen-single{height:26px;line-height:26px}.narrow.fieldValue input{height:26px}.narrow.fieldValue .input-group-addon{padding:4px 10px}.narrow.fieldValue .chosen-container-single .chosen-single div b{background-position-y:4px}.image-in-button{width:18px}.fc-time-grid .fc-time-grid-event.fc-event{min-height:27px;min-width:100px}.fc-time-grid-event.fc-short .fc-title{font-size:1em}.paddingTBZero{padding-top:0;padding-bottom:0}.dashboardWidgetContent a .glyphicon{top:-3px}.detailViewTitle .popover{min-width:130px;text-align:center}.cursorDefault{cursor:default!important}.remindersNoticeContainer{position:fixed;right:0;top:109px;z-index:1029;width:0;height:100%;bottom:30px;overflow-y:auto;background:rgba(0,0,0,0.4);border-left:1px solid #797979;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;overflow-y:auto}.remindersNoticeContainer.toggled{width:380px}.remindersContent{margin:5px 8px 0 8px}.activityTypeIcon{height:20px}.remindersNoticeContainer .panel{margin-bottom:10px}.remindersNoticeContainer .panel-body{padding:10px}.remindersNoticeContainer .actionRow a.btn{margin-right:3%}.remindersNotice{color:#fff;padding:15px 12px}.remindersNotice .glyphicon{font-size:20px}.cancelLink.btn[type='reset'],.cancel.btn[type='reset']{float:right;margin-left:5px;margin-bottom:0}.activityWidgetContainer .popover{min-width:240px}.filterActionImage{margin-left:8px}#tagRecord{line-height:25px}#tagsList .btn-info{margin-left:5px}#tagRecordInput{padding-left:15px;padding-right:15px}.clearReferenceSelection,.createReferenceRecord{padding:0 6px}.relatedPopup{padding:0 4px}.popupContainer .popupModuleName{margin-top:0}.mailRows hr{margin:0}.paddingLeftMd{padding-left:15px}.widget_header div:nth-child(2).btn-toolbar,.editViewContainer .contentHeader.row div:nth-child(2){margin-top:20px}.fieldLabel .referenceMandatory{margin-right:-12px}.ui-widget-content{padding:.8em}.ui-autocomplete .ui-autocomplete-category{font-weight:bold;line-height:1.5}.ui-autocomplete .ui-autocomplete-category:first-child{margin:.8em 0 .2em}.ui-autocomplete .ui-menu-item{padding:.2em .8em}.ui-autocomplete .ui-state-focus{border:0;background:#ebebeb}.widgetHr{margin-top:0}.headerLinksMails .btn-group{margin-top:11px}.finalDiscountUI,.finalTaxUI{bottom:5px}.sideBarTitle{font-size:20px}.globalSearchInput{width:300px}#groupsDetailContainer strong{line-height:21px}#addTaskContainer #taskStatus{margin-left:10px}.scanerMailActionsButtons{min-width:96px}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#404040}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active,.ui-menu .ui-menu-item a.ui-widget-content{font-weight:bold;margin:0;background-color:#428bca;border-color:#357ebd;color:#fff;display:block}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style:none}#layoutEditorButtons{margin-bottom:10px;margin-top:-10px}.individualTaxContainer{text-align:left!important}.suppliesItemTable .input-group{max-width:200px}.suppliesItemTable .rowName .input-group{max-width:400px}.suppliesItemTable td,.suppliesItemTable th{border:1px solid #ddd}.suppliesItemTable tfoot td.hideTd{border:0;background:#fafafb} \ No newline at end of file +@media print{.noprint{display:none}}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}.hide-text{overflow:hidden;text-indent:100%;white-space:nowrap}.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot');src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.woff') format('woff'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.ttf') format('truetype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg')}body{width:100%;font-family:'Open Sans','Lucida Grande',Verdana,Tahoma,Arial,sans-serif!important;font-size:12px!important;background:#fff;color:#2b2b2b}hr{margin:8px 0;border-bottom:1px solid #ddd}.navbar.navbar-fixed-top .navbar-collapse{padding-right:15px!important}.navbar-nav.navbar-left .open ul{display:none}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background:0}.navbar-default .navbar-nav>li:hover{background:#e7e7e7}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background:0}.navbar-inverse .navbar-nav>li:hover{background:#080808}.navbar-nav .hovernav:hover>.dropdown-menu{display:block}#collapsedMenu{display:block;position:relative}#collapsedMenu a{color:#fff}#collapsedMenu .dropdown-menu .shortDropdown{max-height:300px;overflow-y:scroll;padding:10px;position:relative;z-index:10000;-webkit-overflow-scrolling:touch;-webkit-transform:translateZ(0)}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames{margin-bottom:2px}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a{font-size:.9em;padding:3%!important;color:#2b2b2b!important}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a:hover{text-decoration:none;background:#404952;color:#fff!important}.moreMenus{width:52em;padding:24%;left:0;border-radius:2px}.moreMenus.leftAligned:after,.moreMenus.leftAligned:before{left:21px!important}.moreMenus strong{font-size:1.1em;color:#2b2b2b}.moreMenus:after,.moreMenus:before{left:292px!important}.announcement{// display:none;background:#fafad2;// padding:2px 0;// border-bottom:1px solid #ccc;// max-height:24px;// width:100%}.announcement .marStyle{// width:100%}#headerLinks{padding:10px 0 7px;min-width:240px;float:right!important}#headerLinks .headerLinksContainer{margin-right:10px}#headerLinks .headerLinksContainer>[class*="span"]{float:left;margin-left:15px}#headerLinks .headerLinksContainer .dropdown.open .dropdown-toggle{background:transparent}#headerLinks .headerLinksContainer ul.dropdown-menu{top:30px}#headerLinks .headerLinksContainer ul.dropdown-menu:after,#headerLinks .headerLinksContainer ul.dropdown-menu:before{right:15px;left:auto}#headerLinks .headerLinksContainer>span a img,#headerLinks .headerLinksContainer>span a.userName{color:#fff;cursor:pointer;text-decoration:none!important}#headerLinks .headerLinksContainer>span a img .caret,#headerLinks .headerLinksContainer>span a.userName .caret{border-top:4px solid #fff}.dropdown-menu.pull-right{right:0;left:auto;cursor:pointer}.themeMenuContainer{min-width:110px;width:110px;left:-84px!important;padding:10px 0}.themeMenuContainer .themeMenu{padding:0 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement{cursor:pointer;margin:5px;height:20px;width:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement:hover{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}.themeMenuContainer .themeMenu .themeSelected{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}@media screen and (min-width:1161px){#mediumNav,#shortNav,#headerLinksCompact{display:none}#largeNav{margin-left:10px;margin-right:0}}@media screen and (max-width:1160px) and (min-width:960px){.companyLogo{width:100%}.customFilterMainSpan .select2-container{width:300px!important}*{zoom:1!important}}@media screen and (max-width:960px){.bodyContents{margin:0!important}#centerPanel{width:100%!important}.col-md-3#headerLinks{padding:5px 5px 0}.menuBar .col-md-9,.col-md-3#headerLinks{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-width:80px}.menuBar .col-md-9 .qCreate,.col-md-3#headerLinks .qCreate{display:inline-block;margin:0}.menuBar .col-md-9 .qCreate img,.col-md-3#headerLinks .qCreate img{margin-bottom:3px;margin-right:5px}.menuBar .col-md-9 .qCreate ul li.title,.col-md-3#headerLinks .qCreate ul li.title{padding:5px 0 0 15px}.menuBar .col-md-9 li.tabs:first-child>a,.col-md-3#headerLinks li.tabs:first-child>a{padding:10px 12px 9px}.customFilterMainSpan .select2-container{width:300px!important}#quickCreateModules{width:100%!important;padding:0!important}.CompactQC{max-height:300px;overflow-y:scroll;overflow-x:hidden}.CompactQC a:hover{text-decoration:none}}.commonActionsContainer .quickActions{height:3em}.commonActionsContainer .quickActions img{height:60%;margin:40% auto}.commonActionsContainer .quickActions #companyLogo-container img{height:98%;margin:0 auto}.commonActionsContainer .actionsContainer{background:#f3f3f3}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown{min-width:715px;top:28px;margin:0;padding-top:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a{padding:2px;border:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mainContainer{min-height:500px;margin-top:103px;background:#eeeff2;min-width:1200px}.mainContainer>.col-md-2{// padding:0 1.06383%;height:auto!important;// min-width:174px}.mainContainer .contentsDiv{min-height:500px;background:#fafafb;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;border-left:1px solid #e6e6e6;position:relative}.mainContainer #leftPanel{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.toggleButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;left:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-left:0;display:inline-block}.toggleButton .glyphicon-chevron-left{background-position:-434px -72px!important}.toggleButton .glyphicon-chevron-right{background-position:-460px -72px!important}.toggleRightPanelButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;right:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-right:0;display:inline-block}.quickLinksDiv{margin:10px 0}.quickLinksDiv p{font-size:1.2em;padding:3% 0 0 6%;height:40px;cursor:pointer;box-shadow:0 0 0 1px #ddd;border-top:1px solid #fff!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);position:relative;border-radius:2px}.quickLinksDiv p a{color:#2b2b2b}.quickLinksDiv p a:hover{text-decoration:none}.quickLinksDiv p.selectedQuickLink{background-color:#2a2f35;background-image:-moz-linear-gradient(top,#2a2f35,#2a2f35);background-image:-ms-linear-gradient(top,#2a2f35,#2a2f35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#2a2f35),to(#2a2f35));background-image:-webkit-linear-gradient(top,#2a2f35,#2a2f35);background-image:-o-linear-gradient(top,#2a2f35,#2a2f35);background-image:linear-gradient(top,#2a2f35,#2a2f35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2a2f35',endColorstr='#2a2f35',GradientType=0);border-color:#2a2f35 #2a2f35 #08090a;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);background-image:none;position:relative;border:1px solid #fff;box-shadow:4px 0 3px -4px #000 inset}.quickLinksDiv p.selectedQuickLink a{color:#fff}.quickLinksDiv p.selectedQuickLink a:after{border-bottom:19px solid rgba(0,0,0,0);border-left:10px solid #2a2f35;border-top:19px solid rgba(0,0,0,0);content:" ";display:inline-block;position:absolute;left:100%;top:0}.quickWidgetContainer li a{overflow:hidden;white-space:normal;padding:5px;margin:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.quickWidgetContainer .quickWidget{margin-bottom:10px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.sidebarTitleBlock{padding:12px 0}.sidebarTitleBlock a{color:#373737!important}.sidebarTitleBlock a:hover{text-decoration:none}#selectAllMsgDiv,#deSelectAllMsgDiv{display:none;background-color:#fafad2;padding:.01%;text-align:center}.blockUI form,#globalmodal form{margin:0}.dashboardHeading h2{padding-bottom:8px}.dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardHeading .dropdown-menu{left:-70px;right:0}.dashboardContainer{padding:0}.dashboardContainer .dashboardHeading{padding:10px 0 0;background:#f5f5f5}.dashboardContainer .dashboardHeading h2{padding:0 0 8px 20px}.dashboardContainer .dashboardHeading .btn-toolbar{padding:3px 20px 0 0}.dashboardContainer .dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardContainer .dashboardHeading .dropdown-menu{left:-82px}.widgetsList{max-height:400px;overflow-y:auto;overflow-x:hidden}.widgetsList li{display:block}.widgetsList li a{white-space:normal;word-wrap:break-word}.dashboard_notebookWidget_view .row{margin-bottom:5px}.gridster{margin-left:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.gridster ul{width:auto;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:460px}.gridster ul{list-style:none}.gridster ul li.dashboardWidget{background:#fff;border-radius:1px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.gridster ul li.dashboardWidget .dashboardWidgetHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd;color:#444;cursor:move;padding:5px}.gridster ul li.dashboardWidget .dashboardWidgetHeader table{height:28px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .dashboardTitle{text-align:left;padding-left:10px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .widgeticons{opacity:.5;padding-right:6px}.gridster ul li.dashboardWidget .filterContainer{position:absolute;border:1px solid #ddd;background:#fff;margin-left:-7px;margin-right:3px;margin-top:4px;padding:8px 0;border-radius:0 0 5px 5px;box-shadow:0 5px 8px -5px #888}.gridster ul li.dashboardWidget .filterContainer div span{margin-top:6px}.gridster ul li.dashboardWidget .filterContainer .col-md-5{margin-top:3px}.gridster ul li.dashboardWidget .dashboardWidgetContent{padding:10px 0;line-height:20px}.gridster ul li.dashboardWidget .dashboardWidgetContent .dashboard_notebookWidget_viewarea{height:200px}.gridster ul li.dashboardWidget .widgeticons{min-width:50px;height:30px;margin-right:30px}.gridster ul li.dashboardWidget .widgeticons a{cursor:pointer;text-decoration:none}.gridster ul .widgetChartContainer{margin-left:10px}.listViewPageDiv{margin:11px 0}.customFilterMainSpan{width:100%}.customFilterMainSpan .select2-container{width:95%!important}.select2-container .select2-choice{border-radius:2px;background:#fff;border-color:#ddd;font-size:14px;letter-spacing:.01em;color:#2b2b2b}.select2-container .select2-choice div{border-radius:0;border-left:0;background:#fff}.select2-drop{border-color:#ddd}.select2-dropdown ul.filterActions{list-style:none!important;padding-left:15px}.select2-dropdown ul.filterActions li{cursor:pointer}.ui-autocomplete .ui-menu-item #ui-active-menuitem{background:#404952;border-radius:0}li.ui-timepicker-selected,.ui-timepicker-list li:hover,.ui-timepicker-list:hover .ui-timepicker-selected:hover{background:#404952}#relatedTabOrder .select2-input{min-width:200px}.alphabetSorting .alphabetSearch a{vertical-align:middle;display:inline-block;margin-bottom:2px}.alphabetSorting .alphabetSearch:hover{background:#eeeff2}.listViewActions .settingsIcon{display:inline-block;margin-left:5px}.listViewActions>.btn-group{min-width:105px}#listViewPageJumpDropDown,#relatedListPageJumpDropDown{left:-60px}.pageNumbers{display:inline-block;margin-right:5px;margin-top:6px;vertical-align:top}.pageNumbers .totalNumberOfRecords{margin:0 5px}.contents-topscroll,#reportDetails{overflow-x:auto!important;overflow-y:visible}.contents-bottomscroll{overflow-x:auto!important}.bottomscroll-div,.topscroll-div{display:table;min-width:100%}.listViewLoadingImageBlock{background:0;border-radius:0;box-shadow:none;text-align:center}.detailViewContainer{padding:0 20px}.userPreferences .contents{padding-left:0!important}.userPreferences .details{border-right:0!important}.detailViewTitle{padding:1% 0 0 1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .recordLabel{font-size:16px;font-weight:bold}.detailViewTitle .detailViewButtoncontainer{margin-top:8px}.detailViewTitle .detailViewPagingButton{margin-top:8px;padding-right:10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .btn-toolbar{margin:0}.detailview-table th,.detailview-table td{vertical-align:middle}.detailview-table th label,.detailview-table td label{margin-bottom:3px}.detailViewInfo{box-shadow:0 -4px 4px -4px #959595;margin-top:5px}.detailViewInfo .details{// min-height:600px;padding-right:1.5%;border-right:4px solid #404952;padding-bottom:10px;padding-top:10px}.detailViewInfo .related .nav-pills .active>a,.detailViewInfo .related .nav-pills .active>a:hover{background:#404952;border-radius:1px;margin-top:0;margin-bottom:2px}.fieldLabel{width:20%;background:#f7f7f9}.fieldLabel label.marginRight10px{text-align:right}.summaryView{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.summaryView .summary-table tr.summaryViewEntries:last-child .fieldValue,.summaryView .summary-table tr.summaryViewEntries:last-child .fieldLabel{border-bottom:1px solid #ddd}.summaryView .summaryViewEntries .fieldLabel{vertical-align:top;padding:5px 0 5px 5%;border-top:1px solid #ddd;border-right:1px solid #ddd}.summaryView .summaryViewEntries .fieldValue{vertical-align:top;padding:5px 0 5px 5px;border-top:1px solid #ddd}.summaryView .summaryViewEntries:hover .summaryViewEdit{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryView .summaryViewEntries .summaryViewEdit{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryView .toggleViewByMode{margin:8px 0;padding-right:0}.summaryView .toggleViewByMode .changeDetailViewMode{white-space:normal!important}.summaryWidgetContainer{border-radius:2px;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border:1px solid #eaeaea;background:#fff;margin-bottom:10px;padding:15px}.commentContainer .commentTitle{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;margin-bottom:10px}.commentContainer .commentTitle textarea{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordDetails .squeezedWell{padding:3% 0;min-height:105px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordEditView .contentHeader{padding:.5% 0 1% 0}.recordEditView .table .fieldLabel,.recordEditView .table .fieldValue{vertical-align:middle}.recordEditView .table tbody tr:hover td,.recordEditView .table tbody tr:hover th{background:#f7f7f9}.commentContainer{border-radius:2px}.commentContainer hr{margin:0!important}.commentContainer .addCommentBlock .commentsControls{display:inline-block}.commentContainer .commentsList>.liStyleNone>.commentDetails .commentDiv{width:100%}.commentContainer .commentDetails{background:#fff;border:1px solid #ddd;margin-bottom:5px;border-radius:2px;padding:10px 10px 5px;display:inline-block;min-width:354px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentContainer .commentorInfo p{margin-bottom:0}.commentContainer .addCommentBlock{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border:1px solid #ddd;padding:12px 12px 5px;min-height:115px;margin-top:15px;display:block}.commentContainer .addCommentBlock .commentcontent{padding:8px!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;resize:none}.commentContainer .commentInfoContent{padding:1px 0;word-wrap:break-word}.commentTitle .col-md-1{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentTitle .col-md-1 img{width:32px;height:32px}.commentsList>ul{margin-left:0}.singleComment .editedStatus{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:5px 0 5px 32px}.singleComment .editedStatus p{margin-bottom:0}.singleComment .commentActionsDiv{display:none}.singleComment .commentActionsDiv p{margin-bottom:0}.singleComment:hover .commentActionsDiv{display:block;margin-bottom:3px}.recentComments{margin:0;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recentComments .commentDiv{min-width:100%}.recentComments .addCommentBlock{border:0;margin-top:0;display:block}.recentComments .commentDetails{display:block}.singleComment:hover .commentActions .replyComment{display:inline-block}.commentActionsContainer a:hover{text-decoration:none}.commentActionsContainer .editStatus{padding:5px 2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentActionsContainer .editStatus p{margin-bottom:0}.table{background:#fff}.table-bordered{border-radius:1px;margin-bottom:0}.table-bordered th{border-top:1px solid #fff!important}.table th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;color:#444}.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td,.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td{border-left:0;border-right:0}.listViewEntriesTable tbody tr td:first-child{border-left:0 none}.equalSplit td:nth-child(odd){width:20%}.equalSplit td:nth-child(even){width:30%}td.fieldValue input,td.fieldValue .input-group{margin-bottom:0}.actionImage,.actionImages{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.listViewHeaders a{color:#444}.listViewEntriesDiv .listViewHeaders th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd}.listViewEntriesDiv,.listViewEntriesDiv td{overflow:visible}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues{color:#444}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues:hover{text-decoration:none}.listViewEntriesTable td.listViewEntryValue,.listViewEntries td{vertical-align:middle;cursor:pointer;overflow:visible;padding:5px}.listViewEntriesTable td.listViewEntryValue:hover .actionImages,.listViewEntries td:hover .actionImages,.listViewEntriesTable td.listViewEntryValue:hover .actions,.listViewEntries td:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryViewEntries .summaryViewEdit,.activityStatus .editStatus,.activityDescription .editDescription,.addedCalendars .actionImage{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryViewEntries:hover .fieldValue .summaryViewEdit,.activityStatus:hover .editStatus,.activityDescription:hover .editDescription,.addedCalendars:hover .actionImage{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewEntriesTable tr:hover td .actions .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewBasicAction.dropdown-menu{width:100%}.listViewBasicAction.dropdown-menu input{border-radius:2px;height:24px;margin-bottom:0;margin-top:-2px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.emptyRecordsDiv{width:100%;border:1px solid #ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.emptyRecordsDiv td{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.CustomFilterViewTitle{padding-top:1%}#CustomView .filterActions{padding-bottom:20px;overflow:hidden}.filterConditionsDiv{padding-bottom:0}.conditionGroup .header{margin-bottom:20px;font-size:1.2em}.conditionGroup .contents .conditionRow{margin-bottom:10px}.conditionGroup .contents .conditionRow select,.conditionGroup .contents .conditionRow input{width:90%}.conditionGroup .contents .conditionRow .chzn-results li{line-height:20px}.conditionGroup .deleteCondition{vertical-align:bottom}.searchUIBasic{border-collapse:separate!important;border-spacing:10px!important;margin:0 10%}.searchUIBasic .importContents{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.searchUIBasic .listRow .listViewHeaders>td{color:#404952}.searchUIBasic .listRow .defaultInputTextContainer{max-width:87%!important;margin-bottom:0!important}#lineItemTab.table tr:first-child:hover th ~ td{background-color:#f3f3f4;background-image:-moz-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-ms-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f3f3f4),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-o-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:linear-gradient(top,#f3f3f4,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f4',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}#lineItemTab.table tr:nth-child(2):hover td{background:0}.lineItemTable tr td{width:0}.lineItemTable tr td div.finalDiscountUI,.lineItemTable tr td div.discountUI,.lineItemTable tr td div#shipping_handling_div,.lineItemTable tr td div.taxUI,.lineItemTable tr td div.finalTaxUI{border:2px solid #c4c4c4;border-radius:2px}.lineItemTable tr td div.finalDiscountUI table tr td,.lineItemTable tr td div.discountUI table tr td,.lineItemTable tr td div#shipping_handling_div table tr td,.lineItemTable tr td div.taxUI table tr td,.lineItemTable tr td div.finalTaxUI table tr td,.lineItemTable tr td div.finalDiscountUI table tr th,.lineItemTable tr td div.discountUI table tr th,.lineItemTable tr td div#shipping_handling_div table tr th,.lineItemTable tr td div.taxUI table tr th,.lineItemTable tr td div.finalTaxUI table tr th{border-left:0}.lineItemTable tr:hover td{width:0}.lineItemTable tr:hover td div.finalDiscountUI table tr td{background:none!important}.lineItemTable tr:hover td div.discountUI table tr td{background:none!important}.lineItemTable tr:hover td div#shipping_handling_div table tr td{background:none!important}.lineItemTable tr:hover td span.taxDivContainer div table tr td{background:none!important}.lineItemTable tr:hover td div.finalTaxUI table tr td{background:none!important}.lineItemResult{width:70.5%!important}.lineItemResult a:hover{color:#404952}.lineItemInputBox{width:45%;float:right;text-align:right}.discountUI,.taxUI,.finalDiscountUI,.finalTaxUI,#shipping_handling_div{position:absolute;left:46%;width:30%;z-index:500;box-shadow:1px 0 7px #ddd;border-radius:6px}.discountUI table.table,.taxUI table.table,.finalDiscountUI table.table,.finalTaxUI table.table,#shipping_handling_div table.table{margin-bottom:0}.discountUI .table tbody tr:first-child th:first-child,.taxUI .table tbody tr:first-child th:first-child,.finalDiscountUI .table tbody tr:first-child th:first-child,.finalTaxUI .table tbody tr:first-child th:first-child,#shipping_handling_div .table tbody tr:first-child th:first-child{border-radius:4px 0 0 0!important}.discountUI .table tbody tr:first-child th:last-child,.taxUI .table tbody tr:first-child th:last-child,.finalDiscountUI .table tbody tr:first-child th:last-child,.finalTaxUI .table tbody tr:first-child th:last-child,#shipping_handling_div .table tbody tr:first-child th:last-child{border-radius:0 4px 0 0!important}.LineItemDirectPriceReduction{width:65%!important}th.htColHeader,.handsontable thead th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd;padding:6px 2px}.contentHeader{padding:15px;padding-left:5px;line-height:20px}.contentsDiv>div{padding:0 20px}#settingsQuickWidgetContainer .widgetContainer.accordion-body{border-bottom:none!important;border-bottom:3px solid #ddd}#settingsQuickWidgetContainer .widgetContainer.accordion-body>div:hover{background:#eeeff2}#settingsShortCutsContainer{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:1% 3%}#settingsShortCutsContainer .moduleBlock{min-height:60px}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin{display:inline-block;opacity:.4}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin:hover{opacity:.8}.settingsIndexPage .settingsSummary{text-align:center;margin-top:10px}.settingsIndexPage .settingsSummary a{display:inline-block;background:#f3f3f4;color:#444;border-radius:2px;min-width:200px;padding:20px 0 10px;border:1px solid #ddd}.settingsIndexPage .settingsSummary a .summaryText{display:inline-block;margin-top:20px;font-size:15px}.settingsIndexPage .settingsSummary a:hover .summaryText,.settingsIndexPage .settingsSummary a:hover .summaryCount{color:#404952}.settingsIndexPage .moduleBlock h5{font-size:1.2em;margin-bottom:5px}.settingsIndexPage .moduleBlock:hover{background:#f3f3f4}#userPageHeader{padding:8px 0 0}#userPageHeader #userHeading h3{margin-top:10px}.treeView li{border-left:4px solid #ddd;list-style:none;padding-top:15px}.treeView li .toolbar-handle{margin-left:10px;position:relative}.treeView li .toolbar-handle .btn{margin:0}.treeView li .toolbar-handle a:before{background:none repeat scroll 0 0 #ddd;content:" ";display:inline-block;height:4px;left:-10px;position:absolute;top:12px;width:10px}.treeView .btn{margin-bottom:10px}.profilesEditView tr.blockHeader th{text-align:center}.profilesEditView tr.blockHeader th:first-child{text-align:left}.profilesEditView input{margin-right:5px}.profilesEditView tr td.row table.table{border-left:none;margin-bottom:20px}.profilesEditView tr:hover td.row{background:0}.profilesEditView tr:hover td.row table.table tr td{background:0}.profilesEditView tr:hover td.row table.table tr:hover td{background:0}.profilesEditView tr:hover td.row table.table td{background:#f3f3f4}#s2id_memberList li>div,.groupMembersColors li>div{margin-left:10px}#s2id_memberList .Users,.groupMembersColors .Users{background-color:#f99984!important;padding:5px;margin-bottom:2px;background-image:none}#s2id_memberList .Groups,.groupMembersColors .Groups{background-color:#acd5ff!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .Roles,.groupMembersColors .Roles{background-color:#ffec98!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .RoleAndSubordinates,.groupMembersColors .RoleAndSubordinates{background-color:#c4dea2!important;background-image:none;padding:5px;margin-bottom:2px}.collectiveGroupMembers{border:1px solid #ddd;border-top:0}.collectiveGroupMembers ul{padding:0;margin:0}.collectiveGroupMembers ul li{padding:4px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.collectiveGroupMembers ul li a{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;margin:0}.collectiveGroupMembers ul li.groupLabel{background-color:#f3f3f4;border-bottom:1px solid #ddd;border-top:1px solid #ddd;padding:10px 5px;margin:0;color:#444}.mini-slider-control{width:50px}.mini-slider-control+div{margin-left:15px}.mini-slider-control .ui-slider-handle{border:0;border-radius:50%;height:16px;top:-2px;width:16px;cursor:pointer}.mini-slider-control .ui-slider-handle:focus{outline:0}.ui-widget-content{border-radius:6px;border-color:#fff;box-shadow:0 0 3px -1px inset;margin-top:2px;margin-left:5px;height:12px}.ui-slider-disabled{opacity:.5;border-color:#ddd;box-shadow:none;cursor:not-allowed}.ui-slider-disabled .ui-slider-handle{cursor:not-allowed}.ui-slider-disabled+div{opacity:.5;cursor:not-allowed}.mini-slider-control[data-value="0"] .ui-slider-handle{background:#7d7e7d;background:-moz-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#7d7e7d),color-stop(100%,#0e0e0e));background:-webkit-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-o-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-ms-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:linear-gradient(to bottom,#7d7e7d 0,#0e0e0e 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7d7e7d',endColorstr='#0e0e0e',GradientType=0)}.mini-slider-control[data-value="1"] .ui-slider-handle{background:#ffb76b;background:-moz-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ffb76b),color-stop(0%,#ffa73d),color-stop(49%,#ff7c00),color-stop(100%,#ff7f04));background:-webkit-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-o-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-ms-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:linear-gradient(to bottom,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffb76b',endColorstr='#ff7f04',GradientType=0)}.mini-slider-control[data-value="2"] .ui-slider-handle{background:#bfd255;background:-moz-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#bfd255),color-stop(79%,#8eb92a),color-stop(100%,#72aa00),color-stop(100%,#9ecb2d));background:-webkit-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-o-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-ms-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:linear-gradient(to bottom,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bfd255',endColorstr='#9ecb2d',GradientType=0)}#moduleManagerContents{padding-bottom:10px}#moduleManagerContents .moduleManagerBlock .btn-group.open .dropdown-menu{left:-144%}#moduleManagerContents .modulesTable td{width:50%}#importModules .contents .row{margin-bottom:2.2%}.extensionWidgetContainer{background-color:#fff;border:1px solid #ddd;min-height:200px;padding:2%;background:#fafafa;box-shadow:0 0 10px -4px #777}.extensionWidgetContainer .extension_contents{margin-top:2%;background:#fff;padding:10px;box-sizing:border-box;max-height:160px}.extension_contents:hover{border-radius:4px}.thumbnailImage{height:130px;width:130px;float:right}.extensionWidgetContainer .extension_contents .slimScrollDiv{padding-right:10px}.extensionWidgetContainer .extension_header .font-x-x-large{font-size:1.5em;padding-left:3px;font-weight:bold;color:#404952}.extensionWidgetContainer .extensionDescription{line-height:20px}.extensionWidgetContainer .extensionInfo{padding-top:5px}.extensionWidgetContainer .extensionInfo .rating,.extensionDetails .rating{vertical-align:middle;margin-top:2px;display:inline-block}.extensionDetails .authorInfo{margin:3px 0}.extensionDetails .extensionDetailActions{padding:15px 0}.extensionWidgetContainer .tab-pane .bx-wrapper .imageSlider{margin:0}.sliderImage{width:90%;height:360px}.opacity .actions{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.opacity:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.sharingAccessDetails{margin-bottom:30px}.sharingAccessDetails td,.sharingAccessDetails th{text-align:center;vertical-align:middle!important}.sharingAccessDetails tr td:first-child,.sharingAccessDetails tr th:first-child{text-align:left}.sharingAccessDetails td.row>div{display:block}.sharingAccessDetails .customRuleContainer:hover{background:0}.sharingAccessDetails hr{border-bottom:1px solid #bcbcbc}.sharingAccessDetails .title{padding:1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.sharingAccessDetails .title .rulehead{padding-top:5px}.sharingAccessDetails .customRuleEntries:hover .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.layoutContent{border-top:4px solid #404952}.layoutContent #moduleBlocks .editFieldsTable{margin-bottom:20px}.layoutContent #moduleBlocks .editFieldsTable .fieldLabel{background:0}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockLabel{padding-top:13px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group{margin-top:5px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group .dropdown-menu{left:-100%}.layoutContent .relatedTabModulesList{padding:2% 1%}.fieldDetailsForm .search-choice-close{padding:0}.border1px{border:1px solid #ddd}.blockFieldsList .opacity{margin-left:.5%!important}.blockFieldsList .opacity .dropdown-menu a{padding:0!important}.blockFieldsList .opacity a.dropdown-toggle.editFieldDetails{box-shadow:none}.blockFieldsList .editFields .dropdown-menu{z-index:1000003;padding:0;left:-215px;position:absolute}.blockFieldsList .editFieldsWidget .dropdown-menu{z-index:1000003;padding:0;left:-315px;position:absolute}.blockFieldsList .editFields .dropdown-menu .modal-header{border-width:0;border-bottom-width:1px}.blockFieldsList .editFields .dropdown-menu .modal-header .cancel{padding-right:0;font-weight:bold}.blockFieldsList .editFields:hover{background:#f3f3f4!important}#modulePickListValuesContainer .layoutContent{padding-left:2%}#modulePickListValuesContainer .layoutContent .selectedCell,#modulePickListValuesContainer .layoutContent .selectedListItem{background:#a5afb9;white-space:nowrap}#modulePickListValuesContainer .layoutContent .pickListValue{cursor:pointer}.nonEditableValuesDiv .nonEditablePicklistValues{margin-left:0}.nonEditableValuesDiv .nonEditablePicklistValues li{padding:3px 15px;margin-bottom:2px;background:#e0f2ff}.popover{z-index:1000023!important}.popover-content .fieldLabel{width:35%;white-space:normal}#dependencyGraph .tableHeading{text-align:center;padding-top:30px;font-size:1.2em;font-weight:bold}#dependencyGraph .depandencyTable{border:1px solid #ddd;background:#f3f3f4}#dependencyGraph .depandencyTable .blockHeader{border-bottom:1px solid #ddd}#dependencyGraph .depandencyTable .picklistValueMapping{border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping{text-align:center;border-left:1px solid #ddd;border-right:1px solid #ddd;background:#fff}#dependencyGraph .dependencyMapping .mCSB_container{margin-bottom:16px!important}#dependencyGraph .dependencyMapping .pickListDependencyTable{border:0}#dependencyGraph .dependencyMapping .pickListDependencyTable .blockHeader th{background:#f3f3f4;border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping .pickListDependencyTable .selectedCell{background:#a5afb9}.webformFieldInfo{margin-bottom:250px}.targetFieldsTableContainer input[type="text"]{min-width:100px}#customRecordNumbering.table thead th{vertical-align:middle}.addMailBoxBlock{margin-left:83px;padding:0!important;font-size:12px}.addMailBoxStep{background:#fff;padding:30px 0;border:1px solid #ddd;border-radius:1px;min-height:170px}.mailConveterDesc{height:350px;width:96%;border:1.5px solid;border-radius:2px;border-color:#ddd;font-size:11pt;margin-top:55px;margin-left:20px;background:#fff}#mailBoxLabel{margin-top:15px;margin-left:-18px;font-size:12pt;width:75px}.mailBoxDropdownWrapper{height:49px;width:70%;background:url('../images/mailbox-icon.png') no-repeat 5px 5px;overflow:hidden;border:1px solid #ddd}.mailBoxDropdown{background:transparent url('../images/downArrowBlue.png') no-repeat 236px 13px;width:110%;height:50px;font-size:14pt;color:#0065a6;padding:10px 55px;padding-right:0}#mailConverterDragIcon{margin-top:12px}#mailConverterBody{padding-top:20px;margin-left:0}.ruleHead{padding:6px 0;background:#d8d8dc}.mailConverterRuleBlock{font-size:14px;line-height:30px;border:1.5px solid;border-color:#ddd}.mailConverterRuleLegend{font-size:14px;color:#0065a6;margin-bottom:10px;background:#f3f3f4}#mailConverterStats{font-size:10pt;margin-top:5px;margin-left:-10px}.addMailBoxBlock{border-color:#ddd;margin-left:83px;margin-top:20px;padding-top:30px;padding-left:200px;padding-bottom:20px;padding-right:30px;font-size:11pt}.taskTypeUi>.row{margin:10px 0}#taskListContainer .listViewEntriesTable tr td:last-child{border-left:1px solid #ddd}#workflow_step2>.row{padding:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:400px}#open_email_con .detailViewTitle{padding:0}#open_email_con .detailViewTitle .detailViewPagingButton{margin-top:0;padding-right:0}#foldersList .list-group{padding-right:0}.massEditTable th+th,.massEditTable td+td,.massEditTable th+td,.massEditTable td+th{border-left:0}.nav.massEditTabs{margin-bottom:0;border-bottom:0}.nav.massEditTabs li.active a{background:#404952;color:#fff;margin-left:10px}.nav.massEditTabs li a:hover{border-bottom:1px solid #404952}.massEditContent{border-top:3px solid #404952}.calendarSettingsContainer{width:700px}.calendarSettingsContainer .control-label{width:26%}#calendarSettings{margin:1px 0 3px}.calendarMassEdit{min-width:400px}.fc-state-default .fc-button-effect{top:100%!important}.fc-event-style1,.fc-event-style1 .fc-event-skin{background:#17309a;border-color:#17309a;font-weight:normal;text-shadow:none}.fc-event-style2,.fc-event-style2 .fc-event-skin{background:#3a87ad;border-color:#3a87ad;font-weight:normal;text-shadow:none}.fc-event-style3,.fc-event-style3 .fc-event-skin{background:#aa6705;border-color:#aa6705;font-weight:normal;text-shadow:none}.fc-event-style4,.fc-event-style4 .fc-event-skin{background:#953b39;border-color:#953b39;font-weight:normal;text-shadow:none}.fc-event-style5,.fc-event-style5 .fc-event-skin{background:#545252;border-color:#545252;font-weight:normal;text-shadow:none}.fc-event-style6,.fc-event-style6 .fc-event-skin{background:#87865d;border-color:#87865d;font-weight:normal;text-shadow:none}.fc-event-style7,.fc-event-style7 .fc-event-calendarMassEditskin{background:#c71585;border-color:#c71585;font-weight:normal;text-shadow:none}.fc-event-style8,.fc-event-style8 .fc-event-skin{background:#006400;border-color:#006400;font-weight:normal;text-shadow:none}#calendarview th{color:#000}.fc-agenda-divider+div{overflow-y:visible!important}.fc-button{display:inline-block;padding:6px .4em!important;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.fc-button:active .fc-button-inner{background:transparent}.fc-button:active .fc-button-inner .fc-button-content{color:#fff}.fc-button.fc-state-active .fc-button-inner .fc-button-content,.fc-button:active .fc-button-inner .fc-button-content{color:#000!important;background:transparent;background-image:none}.fc-header-title h2{font-size:15px;line-height:20px}.fc-widget-header th{padding:4px 0!important}.fc-widget-header{color:#666;background:#eee;border-color:#ccc}.fc-content{background:#fff;margin-top:15px}.fc-content td:hover{background:#f3f3f3}.btn:focus{outline:0}.reminderPostpone.btn-primary{background:#404952}.reminderPostpone.btn-primary:hover{background:#1e2327}.saveButton{margin-right:5px}.addCustomRule{float:right}.importMore{background:#fff}.lastImport{background:#fff}.undoImport{background:#da4f49}.close{border:0;background:none repeat scroll 0 0 transparent;border:0 none;cursor:pointer}.resetButton{margin-top:0!important}.vtGlyph{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("../images/vtGlyph.png");background-position:0 0;background-repeat:no-repeat;*margin-right:.3em}.vticon-pageJump{background-position:0 0}.vticon-call-inbound{background-position:-14px 0}.vticon-call-outbound{background-position:-28px 0}#massEdit .cancelLinkContainer{padding:5px 0;margin-left:.5em}.ui-pnotify{z-index:1000023}.feedback{z-index:10002}.feedback .handle{z-index:10003;display:block;position:fixed;bottom:50px;left:-30px;left:0\9;bottom:100px\9;background:#2c2c2c;color:white;padding:7px 15px;border:1px solid gray;text-decoration:none;outline:0;-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-o-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg);-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.00000000, M12=1.00000000, M21=-1.00000000, M22=0.00000000,sizingMethod='auto expand')";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0,M12=1,M21=-1,M22=0,sizingMethod='auto expand')}.feedback .handle:hover{text-decoration:none}.vtFooter{text-align:center}.vtFooter p{background:#404952;color:#fff;border-top:1px solid #ddd;padding:1px 0;font-size:.9em;margin-bottom:0}.vtFooter p a{color:#fff}.imageHolder{background:url('../images/loadback.png') repeat-y;background-position:center;padding:10px 0}.breadcrumbContainer{padding:2% 2% 0 2%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;height:auto}.breadcrumb{display:inline-block;height:auto;height:40px}.crumbs{height:40px;margin:0;padding:0 20px 0 0;display:inline-block;font-family:sans-serif}.crumbs li:after{content:'\0000a0';width:0;height:0;border-left:18px solid #ececec;border-top:20px solid transparent;border-bottom:20px solid transparent;display:inline-block;position:relative;top:-20px;left:18px;zoom:1}.crumbs li{height:0;border-top:20px solid #ececec;border-bottom:20px solid #ececec;border-left:20px solid transparent;display:inline-block;box-shadow:0 1px #ddd;margin-right:5px}.crumbs li a{display:inline-block;float:left;margin-top:-13px;font-size:14px;font-weight:bold;color:#666;text-decoration:none}.crumbs li.active{height:0;border-top:20px solid #404952;border-bottom:20px solid #404952;box-shadow:0 1px #404952}.crumbs li.active:after{border-left:18px solid #404952!important}.stepText{display:inline-block;white-space:nowrap;overflow:hidden;font-size:13px;vertical-align:bottom}.active .stepText,.active .stepNum{color:#fff}.stepNum{display:inline-block;padding:0 5px;overflow:hidden;font-size:20px;vertical-align:top;margin-top:5px}.greyStar{background-image:url("../images/stars.png");background-position:20px 20px;height:20px;width:20px;display:inline-block}.yellowStar{background-image:url('../images/stars.png');background-position:0 20px;width:20px;height:20px;display:inline-block}.blockUI{border-radius:2px!important;border:0!important}textarea.col-md-11{width:100%!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.popover .popover-inner{border-radius:2px;font-size:.8em;box-shadow:0}.popover .popover-inner .popover-title{color:#444;font-size:15px}.popover .popover-inner .close{color:#000!important;margin-top:3px;opacity:.5!important}.popover .popover-inner .close:hover{opacity:1!important}.popover .popover-inner td{padding:3px 5px;overflow-wrap:break-word}.popover .popover-inner .detailViewInfo{margin-top:0;box-shadow:0}.popover .popover-inner .detailViewInfo .fieldLabel label{font-size:1em}#findDuplicate>.control-group{margin-bottom:0;width:400px}#moveReports .modal-body{padding:20px 40px}#composeEmailContainer{padding:0 20px}#composeEmailContainer .MultiFile-wrap{display:inline-block}#composeEmailContainer .MultiFile-intercepted .ui-wrapper{min-height:400px}#transferOwnershipContainer .select2-container.select2-container-multi{max-width:220px}.fieldInfo.in{overflow:visible!important;height:auto!important}.moduleSelection{border-radius:2px 2px 0 0!important;border:1px solid #ddd!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);color:#444}.convertLeadModules{margin-bottom:2%;border:1px none}.moduleBlock{border-radius:0!important}.overflowVisible{overflow:visible!important}.convertLeadError{border:3px solid #999;background-color:#fff;width:55%;position:relative;z-index:10000000}.convertLeadError table td{border-bottom:1px solid #ccc;nowrap:nowrap;width:70%}.bootbox,.alert{z-index:1000023}.chzn-container{vertical-align:middle}.chzn-container .chzn-results li{margin-right:7px}.chzn-container .chzn-results .highlighted{background:#404952}.select2-results .select2-highlighted{background:#404952}.select2-result-label i{background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.ui-autocomplete-loading{background:url('../images/load.gif') no-repeat right center}.ui-autocomplete{height:auto!important;border-radius:1px!important}.dropdown-menu.pull-right:after,.dropdown-menu.pull-right:before{right:3px;left:auto;top:-5px;border-bottom-width:6px}span.wrapper a{color:#08c!important;font-size:15px!important;font-weight:bold}a{color:#353c44}a:hover{color:#1e2327;text-decoration:none;cursor:pointer}a:active,a:focus{outline:0}.well{border-radius:2px;padding:15px}.verticalBottomSpacing{margin-bottom:10px}.mergeTables{margin-bottom:0}.font-x-x-large{font-size:18px;line-height:28px}form{margin:0}.fc-state-default .fc-button-effect span{background:0}.dateField{width:183px}.form-horizontal [class^="icon-"],.form-horizontal [class*=" icon-"]{vertical-align:baseline}.timePicker{width:8.5em!important;z-index:1000029!important}.datepicker{z-index:1000029!important}.colorpicker{z-index:1029!important}.colorpicker input{width:30px!important}.colorpicker input[type="text"],.colorpicker input{color:#898989!important}.colorpicker_hex input{width:45px!important}.modal-body.accordion{margin-bottom:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}//.modal-open{// overflow:hidden;//}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.removeNoFileChosen{color:transparent!important}.modelContainer .modal-header{border-radius:2px 2px 0 0}.modelContainer form{border-radius:0 0 2px 2px}.hide{display:none}i{cursor:pointer;text-decoration:none!important}.marginbottomZero{margin-bottom:0!important}.marginLeftZero{margin-left:0!important}.marginRightZero{margin-right:0!important}.clearfix{clear:both!important}textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%}.textOverflowEllipsis{overflow:hidden;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;//width:9em}.margin0px{margin:0!important}.padding10{padding:10px;padding-bottom:0}.padding20{padding:20px}.pushDown{margin-top:5px}.boxSizingBorderBox{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.boxSizingContentBox{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.cursorPointer{cursor:pointer;text-decoration:none!important}.zeroOpacity{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.dullOpacity{opacity:.8;-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80)}.fullOpacity{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.redColor{color:red}.highlightBackgroundColor{background:#eeeff2}.contentsBackground{background:#fff;border:1px solid #ddd}.textAlignCenter{text-align:center}.textAlignRight{text-align:right}.alignMiddle{vertical-align:middle}.alignTop{vertical-align:top}.padding1per{padding:1%}.paddingTop20{padding-top:20px}.padding20px{padding:20px}.padding-bottom1per{padding-bottom:1%}.marginBottom10px{margin-bottom:10px}.displayInlineBlock{display:inline-block}.backgroundImageNone{background-image:none}.liStyleNone{list-style:none outside none}.fontBold{font-weight:bold!important}.livesupport_tab,#userfeedback{display:none!important}#reportDetails table tr td.summary{border-bottom:0;border-top:0}#portalDetailViewHttpError{padding-bottom:7px;margin-top:50px;color:red;text-align:center}.slidesjs-pagination{list-style:none}.slidesjs-pagination li a{display:block;width:13px;height:0;padding-top:13px;background-image:url('../images/pagination.png');background-position:0 0;float:left;overflow:hidden}.slidesjs-pagination li a.active,.slidesjs-pagination li a:hover.active{background-position:0 -13px}.extensionStorebtn{background:#f08c39;background-image:-webkit-linear-gradient(top,#f08c39,#e68b3c);background-image:-moz-linear-gradient(top,#f08c39,#e68b3c);background-image:-ms-linear-gradient(top,#f08c39,#e68b3c);background-image:-o-linear-gradient(top,#f08c39,#e68b3c);background-image:linear-gradient(to bottom,#f08c39,#e68b3c);-webkit-border-radius:2;-moz-border-radius:2;border-radius:2px;text-shadow:0 0 1px #595959;color:#fff;font-size:14px;font-weight:bold;padding:8px 20px 8px 20px;text-decoration:none;border:0}.extensionStorebtn:hover{background:#fc9f3c;background-image:-webkit-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-moz-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-ms-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-o-linear-gradient(top,#fc9f3c,#f08a3c);background-image:linear-gradient(to bottom,#fc9f3c,#f08a3c);text-decoration:none}.extensionSearch{padding:8px 12px 8px 30px!important;margin:6px 0 14px 0;box-shadow:inset 2px 2px 10px #ddd;border-radius:2px!important;background:url('../images/search.png') no-repeat;background-position:5px 6px}.banner-container{border-bottom:1px solid #fff;box-sizing:border-box}.banner{margin:0 90px}.bx-wrapper{margin:0 auto 35px!important;padding-top:17px!important}.bx-wrapper li a{display:block}.bx-wrapper a img{height:100px;width:auto;margin:0 auto}.wide,.table td.wide,.listViewEntries td.wide,td.listViewEntryValue.wide{padding:8px!important}.medium,.table td.medium,.listViewEntries td.medium,td.listViewEntryValue.medium{padding:5px 6px!important}.narrow,.table td.narrow,.listViewEntries td.narrow,td.listViewEntryValue.narrow{padding:2px 4px!important}.table thead th.narrow{vertical-align:middle}td.listViewEntryValue .row input{padding:0;margin-bottom:0}.listViewContentDiv{position:relative}.fieldLabel .pull-right{text-align:right}#tagRecordText{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;width:80%!important}#tagRecord{margin-left:5px!important}.tag{float:right!important}.cut-string{text-overflow:ellipsis;-o-text-overflow:ellipsis;-webkit-text-overflow:ellipsis;width:200px;white-space:nowrap;overflow:hidden}.paddingLRZero{padding-left:0;padding-right:0}.paddingRightZero{padding-right:0}.detailViewToolbar{margin-top:5px}.input-group.input-group-sm>.input-group-addon img{width:15px}table tr td .input-sm{min-width:50px}.modal-footer.backgroundColor{background-color:#f5f5f5}.panel-title{font-size:14px}.quickWidgetContainer .panel-body{padding-bottom:0;padding-top:0}tr.summaryViewEntries,#detailView table{font-size:13px}table.listViewEntriesTable{font-size:13px;margin-top:5px}.no-margin{margin:0}.companyLogo img{max-height:200px;max-width:250px}.navbar-inverse .navbar-nav>li>a{color:#fff;padding:15px 12px}.navbar-inverse .navbar-nav .dropdown-menu>li>a{padding:3px 15px;font-size:12px}.headerCalendar .month h3{font-size:18px;font-weight:bold;margin:5px 0 0 0}.columnsSelect{width:100%!important}.marginBottom5{margin-bottom:5px}.editViewContainer .recordEditView table.blockContainer tr td.fieldValue{width:30%}.recordEditView[name=QuickCreate] .quickCreateContent table tr td.fieldValue,#massEditContainer .massEditContent table tr td.fieldValue,#tab_accounts td.functionList{width:30%}.btn{white-space:normal}.valuesAssignedToRole{border:1px solid #adadad;overflow:hidden;text-overflow:ellipsis;padding:6px}table.dataTable .form-control{width:100%!important}#breadcrumb .stepNum{margin-top:0}#breadcrumb .stepText{position:relative;top:-4px}.fc button{height:auto!important}.fc-toolbar{margin-bottom:0!important}.fc-center,.fc-left,.fc-right{margin-bottom:1em}.calendarRightPanel{padding-left:5px;padding-right:5px}.calendarRightPanel ul li{margin-bottom:2px;margin-left:5px}.calendarRightPanel ul li:hover{background-color:#eee!important;border-radius:5px}.square9{width:12px;height:12px;margin:4px}.panel-dark{border-color:#737373}.panel-dark>.panel-heading{color:#fff;background-color:#737373;border-color:#737373}.panel-dark>.panel-heading+.panel-collapse>.panel-body{border-top-color:#737373}.panel-dark>.panel-heading .badge{color:#737373;background-color:#fff}.panel-dark>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#737373}.calendarRightPanel .widgetContainer ul{margin-top:5px;margin-bottom:5px}.paddingLeft5px{padding-left:5px}.marginBottom5px{margin-bottom:5px}.detailview-table .fieldValue .summaryViewEdit{display:none}.detailview-table .fieldValue:hover .summaryViewEdit{display:inherit}.icon-in-history-widget{font-size:17px;padding:4px}#prefPageHeader .logo img{height:70px;width:70px}#myPrefHeading h3{margin-top:12px}.list-user-img{width:50px;height:40px}span[name=existingImages] img{height:200px;width:300px}.narrow.fieldValue .chosen-container-single .chosen-single{height:26px;line-height:26px}.narrow.fieldValue input{height:26px}.narrow.fieldValue .input-group-addon{padding:4px 10px}.narrow.fieldValue .chosen-container-single .chosen-single div b{background-position-y:4px}.image-in-button{width:18px}.fc-time-grid .fc-time-grid-event.fc-event{min-height:27px;min-width:100px}.fc-time-grid-event.fc-short .fc-title{font-size:1em}.paddingTBZero{padding-top:0;padding-bottom:0}.dashboardWidgetContent a .glyphicon{top:-3px}.detailViewTitle .popover{min-width:130px;text-align:center}.cursorDefault{cursor:default!important}.remindersNoticeContainer{position:fixed;right:0;top:109px;z-index:1029;width:0;height:100%;bottom:30px;overflow-y:auto;background:rgba(0,0,0,0.4);border-left:1px solid #797979;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;overflow-y:auto}.remindersNoticeContainer.toggled{width:380px}.remindersContent{margin:5px 8px 0 8px}.activityTypeIcon{height:20px}.remindersNoticeContainer .panel{margin-bottom:10px}.remindersNoticeContainer .panel-body{padding:10px}.remindersNoticeContainer .actionRow a.btn{margin-right:3%}.remindersNotice{color:#fff;padding:15px 12px}.remindersNotice .glyphicon{font-size:20px}.cancelLink.btn[type='reset'],.cancel.btn[type='reset']{float:right;margin-left:5px;margin-bottom:0}.activityWidgetContainer .popover{min-width:240px}.filterActionImage{margin-left:8px}#tagRecord{line-height:25px}#tagsList .btn-info{margin-left:5px}#tagRecordInput{padding-left:15px;padding-right:15px}.clearReferenceSelection,.createReferenceRecord{padding:0 6px}.relatedPopup{padding:0 4px}.popupContainer .popupModuleName{margin-top:0}.mailRows hr{margin:0}.paddingLeftMd{padding-left:15px}.widget_header div:nth-child(2).btn-toolbar,.editViewContainer .contentHeader.row div:nth-child(2){margin-top:20px}.fieldLabel .referenceMandatory{margin-right:-12px}.ui-widget-content{padding:.8em}.ui-autocomplete .ui-autocomplete-category{font-weight:bold;line-height:1.5}.ui-autocomplete .ui-autocomplete-category:first-child{margin:.8em 0 .2em}.ui-autocomplete .ui-menu-item{padding:.2em .8em}.ui-autocomplete .ui-state-focus{border:0;background:#ebebeb}.widgetHr{margin-top:0}.headerLinksMails .btn-group{margin-top:11px}.finalDiscountUI,.finalTaxUI{bottom:5px}.sideBarTitle{font-size:20px}.globalSearchInput{width:300px}#groupsDetailContainer strong{line-height:21px}#addTaskContainer #taskStatus{margin-left:10px}.scanerMailActionsButtons{min-width:96px}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#404040}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active,.ui-menu .ui-menu-item a.ui-widget-content{font-weight:bold;margin:0;background-color:#428bca;border-color:#357ebd;color:#fff;display:block}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style:none}#layoutEditorButtons{margin-bottom:10px;margin-top:-10px}.individualTaxContainer{text-align:left!important}.suppliesItemsTable .input-group{max-width:200px}.suppliesItemsTable .rowName .input-group{max-width:400px}.suppliesItemsTable td,.suppliesItemsTable th{border:1px solid #ddd}.suppliesItemsTable tfoot td.hideTd{border:0;background:#fafafb} \ No newline at end of file diff --git a/modules/Supplies/actions/GetDetails.php b/modules/Supplies/actions/GetDetails.php index 28fb77b65388..b022ef01dd87 100644 --- a/modules/Supplies/actions/GetDetails.php +++ b/modules/Supplies/actions/GetDetails.php @@ -68,6 +68,7 @@ function getRecordDetail($recordId, $currencyId) 'price' => $unitPrice, 'unitPriceValues' => $unitPriceValues, 'description' => decode_html($recordModel->get('description')), + 'autoFields' => [], ]]; return $info; } diff --git a/modules/Supplies/fields/Basic.php b/modules/Supplies/fields/Basic.php index 776491ff4b42..7144cbbdb7f0 100644 --- a/modules/Supplies/fields/Basic.php +++ b/modules/Supplies/fields/Basic.php @@ -12,7 +12,7 @@ class Supplies_Basic_Field extends Vtiger_Base_Model protected $name = ''; protected $defaultLabel = 'LBL_CURRENCY'; protected $defaultValue = ''; - protected $columnname = ''; + protected $columnName = ''; protected $dbType = 'varchar(100)'; protected $customColumn = []; protected $summationValue = false; @@ -30,9 +30,18 @@ public function getDBType() * Geting template name * @return string templateName */ - public function getTemplateName($view) + public function getTemplateName($view, $moduleName) { - return $view . $this->name . '.tpl'; + $tpl = $view . $this->name . '.tpl'; + $filename = 'layouts' . DIRECTORY_SEPARATOR . 'vlayout' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . $moduleName . DIRECTORY_SEPARATOR . 'fields' . DIRECTORY_SEPARATOR . $tpl; + if (is_file($filename)) { + return $tpl; + } + $filename = 'layouts' . DIRECTORY_SEPARATOR . 'vlayout' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'Supplies' . DIRECTORY_SEPARATOR . 'fields' . DIRECTORY_SEPARATOR . $tpl; + if (is_file($filename)) { + return $tpl; + } + return $view . 'Base' . '.tpl'; } /** @@ -55,16 +64,16 @@ public function getName() /** * Geting column name - * @return string columnname + * @return string columnName */ public function getColumnName() { - return $this->columnname; + return $this->columnName; } /** * Geting column name - * @return string columnname + * @return string customColumn */ public function getCustomColumn() { @@ -75,7 +84,7 @@ public function isSummary() { return $this->summationValue; } - + /** * Data field instance initialization * @param array $valueArray Array for initialization @@ -122,4 +131,9 @@ public function isMandatory() { return true; } + + public function isVisible($data) + { + return true; + } } diff --git a/modules/Supplies/fields/Comment.php b/modules/Supplies/fields/Comment.php index d862cf433761..d5b909163822 100644 --- a/modules/Supplies/fields/Comment.php +++ b/modules/Supplies/fields/Comment.php @@ -11,7 +11,7 @@ class Supplies_Comment_Field extends Supplies_Basic_Field protected $name = 'Comment'; protected $defaultLabel = 'LBL_COMMENT'; - protected $columnname = 'comment'; + protected $columnName = 'comment'; protected $dbType = 'varchar(500)'; } diff --git a/modules/Supplies/fields/Currency.php b/modules/Supplies/fields/Currency.php index 79daa24be425..a461adde880e 100644 --- a/modules/Supplies/fields/Currency.php +++ b/modules/Supplies/fields/Currency.php @@ -11,6 +11,16 @@ class Supplies_Currency_Field extends Supplies_Basic_Field protected $name = 'Currency'; protected $defaultLabel = 'LBL_CURRENCY'; - protected $columnname = 'currency'; + protected $columnName = 'currency'; protected $dbType = 'int(10)'; + + /** + * Geting value to display + * @param int $value + * @return string + */ + public function getDisplayValue($value) + { + return Vtiger_Functions::getCurrencyName($value,false); + } } diff --git a/modules/Supplies/fields/Discount.php b/modules/Supplies/fields/Discount.php index 5c68aa93ac56..48fe28f60c36 100644 --- a/modules/Supplies/fields/Discount.php +++ b/modules/Supplies/fields/Discount.php @@ -11,7 +11,7 @@ class Supplies_Discount_Field extends Supplies_Basic_Field protected $name = 'Discount'; protected $defaultLabel = 'LBL_DISCOUNT'; - protected $columnname = 'discount'; + protected $columnName = 'discount'; protected $dbType = 'decimal(27,8) DEFAULT \'0\''; protected $customColumn = [ 'discountparam' => 'varchar(255) NOT NULL' @@ -27,4 +27,12 @@ public function getDisplayValue($value) { return CurrencyField::convertToUserFormat($value, null, true); } + + public function isVisible($data) + { + if (count($data) > 0 && $data[0]['discountmode'] == 0) { + return false; + } + return true; + } } diff --git a/modules/Supplies/fields/DiscountMode.php b/modules/Supplies/fields/DiscountMode.php index ed0fa34dcea8..7126e20f333f 100644 --- a/modules/Supplies/fields/DiscountMode.php +++ b/modules/Supplies/fields/DiscountMode.php @@ -12,7 +12,7 @@ class Supplies_DiscountMode_Field extends Supplies_Basic_Field protected $name = 'DiscountMode'; protected $defaultLabel = 'LBL_DISCOUNT_MODE'; protected $defaultValue = '0'; - protected $columnname = 'discountmode'; + protected $columnName = 'discountmode'; protected $dbType = "tinyint(1) NOT NULL DEFAULT '0'"; protected $values = [0 => 'group', 1 => 'individual']; @@ -23,6 +23,6 @@ class Supplies_DiscountMode_Field extends Supplies_Basic_Field */ public function getDisplayValue($value) { - return $this->values[$value]; + return 'LBL_' . strtoupper($this->values[$value]); } } diff --git a/modules/Supplies/fields/GrossPrice.php b/modules/Supplies/fields/GrossPrice.php index 7d046e9a4f2c..88bc30280028 100644 --- a/modules/Supplies/fields/GrossPrice.php +++ b/modules/Supplies/fields/GrossPrice.php @@ -11,7 +11,7 @@ class Supplies_GrossPrice_Field extends Supplies_Basic_Field protected $name = 'GrossPrice'; protected $defaultLabel = 'LBL_GROSS_PRICE'; - protected $columnname = 'gross'; + protected $columnName = 'gross'; protected $dbType = 'decimal(27,8) DEFAULT \'0\''; protected $summationValue = true; diff --git a/modules/Supplies/fields/Margin.php b/modules/Supplies/fields/Margin.php index 14ee697badc4..c06819309d2b 100644 --- a/modules/Supplies/fields/Margin.php +++ b/modules/Supplies/fields/Margin.php @@ -11,7 +11,7 @@ class Supplies_Margin_Field extends Supplies_Basic_Field protected $name = 'Margin'; protected $defaultLabel = 'LBL_MARGIN'; - protected $columnname = 'margin'; + protected $columnName = 'margin'; protected $dbType = 'decimal(27,8) DEFAULT \'0\''; /** diff --git a/modules/Supplies/fields/MarginP.php b/modules/Supplies/fields/MarginP.php index 8b4c90aa9eee..63cd22182a15 100644 --- a/modules/Supplies/fields/MarginP.php +++ b/modules/Supplies/fields/MarginP.php @@ -11,7 +11,7 @@ class Supplies_MarginP_Field extends Supplies_Basic_Field protected $name = 'MarginP'; protected $defaultLabel = 'LBL_MARGIN_PRECENT'; - protected $columnname = 'marginp'; + protected $columnName = 'marginp'; protected $dbType = 'decimal(27,8) DEFAULT \'0\''; /** diff --git a/modules/Supplies/fields/Name.php b/modules/Supplies/fields/Name.php index 62f67108f5cb..4ec9a7296268 100644 --- a/modules/Supplies/fields/Name.php +++ b/modules/Supplies/fields/Name.php @@ -11,7 +11,7 @@ class Supplies_Name_Field extends Supplies_Basic_Field protected $name = 'Name'; protected $defaultLabel = 'LBL_ITEM_NAME'; - protected $columnname = 'name'; + protected $columnName = 'name'; protected $dbType = 'int(19) DEFAULT \'0\''; /** diff --git a/modules/Supplies/fields/NetPrice.php b/modules/Supplies/fields/NetPrice.php index 4b29a12b0d80..204970e07986 100644 --- a/modules/Supplies/fields/NetPrice.php +++ b/modules/Supplies/fields/NetPrice.php @@ -11,7 +11,7 @@ class Supplies_NetPrice_Field extends Supplies_Basic_Field protected $name = 'NetPrice'; protected $defaultLabel = 'LBL_DISCOUNT_PRICE'; - protected $columnname = 'net'; + protected $columnName = 'net'; protected $dbType = 'decimal(27,8) DEFAULT \'0\''; protected $summationValue = true; diff --git a/modules/Supplies/fields/Purchase.php b/modules/Supplies/fields/Purchase.php index 3a7b8f05a156..8bec2052773b 100644 --- a/modules/Supplies/fields/Purchase.php +++ b/modules/Supplies/fields/Purchase.php @@ -11,7 +11,7 @@ class Supplies_Purchase_Field extends Supplies_Basic_Field protected $name = 'Purchase'; protected $defaultLabel = 'LBL_PURCHASE'; - protected $columnname = 'purchase'; + protected $columnName = 'purchase'; protected $dbType = 'decimal(27,8) DEFAULT \'0\''; /** diff --git a/modules/Supplies/fields/Quantity.php b/modules/Supplies/fields/Quantity.php index 76c76aabc24b..5c4fa7fc5ecb 100644 --- a/modules/Supplies/fields/Quantity.php +++ b/modules/Supplies/fields/Quantity.php @@ -12,7 +12,7 @@ class Supplies_Quantity_Field extends Supplies_Basic_Field protected $name = 'Quantity'; protected $defaultLabel = 'LBL_QUANTITY'; protected $defaultValue = '1'; - protected $columnname = 'qty'; + protected $columnName = 'qty'; protected $dbType = 'decimal(25,3)'; /** diff --git a/modules/Supplies/fields/Reference.php b/modules/Supplies/fields/Reference.php index deed1ebf1105..fa737238982d 100644 --- a/modules/Supplies/fields/Reference.php +++ b/modules/Supplies/fields/Reference.php @@ -11,7 +11,7 @@ class Supplies_Reference_Field extends Supplies_Basic_Field protected $name = 'Reference'; protected $defaultLabel = 'LBL_REFERENCE'; - protected $columnname = 'ref'; + protected $columnName = 'ref'; protected $dbType = 'int(19)'; /** diff --git a/modules/Supplies/fields/Tax.php b/modules/Supplies/fields/Tax.php index 5a279260bd49..3586af1506dd 100644 --- a/modules/Supplies/fields/Tax.php +++ b/modules/Supplies/fields/Tax.php @@ -11,7 +11,7 @@ class Supplies_Tax_Field extends Supplies_Basic_Field protected $name = 'Tax'; protected $defaultLabel = 'LBL_TAX'; - protected $columnname = 'tax'; + protected $columnName = 'tax'; protected $dbType = 'decimal(27,8) DEFAULT \'0\''; protected $customColumn = [ 'taxparam' => 'varchar(255) NOT NULL' @@ -27,4 +27,20 @@ public function getDisplayValue($value) { return CurrencyField::convertToUserFormat($value, null, true); } + + public function getClassName($data) + { + if(count($data) > 0 && $data[0]['taxmode'] == 0){ + return 'hide'; + } + return ''; + } + + public function isVisible($data) + { + if (count($data) > 0 && $data[0]['taxmode'] == 0) { + return false; + } + return true; + } } diff --git a/modules/Supplies/fields/TaxMode.php b/modules/Supplies/fields/TaxMode.php index 550d6a960d5a..665bbabba6d8 100644 --- a/modules/Supplies/fields/TaxMode.php +++ b/modules/Supplies/fields/TaxMode.php @@ -12,10 +12,10 @@ class Supplies_TaxMode_Field extends Supplies_Basic_Field protected $name = 'TaxMode'; protected $defaultLabel = 'LBL_TAX_MODE'; protected $defaultValue = '0'; - protected $columnname = 'taxmode'; + protected $columnName = 'taxmode'; protected $dbType = "tinyint(1) NOT NULL DEFAULT '0'"; protected $values = [0 => 'group', 1 => 'individual']; - + /** * Geting value to display * @param int $value @@ -23,6 +23,6 @@ class Supplies_TaxMode_Field extends Supplies_Basic_Field */ public function getDisplayValue($value) { - return $this->values[$value]; + return 'LBL_' . strtoupper($this->values[$value]); } } diff --git a/modules/Supplies/fields/TotalPrice.php b/modules/Supplies/fields/TotalPrice.php index 5020c77463c6..f34fc51523e3 100644 --- a/modules/Supplies/fields/TotalPrice.php +++ b/modules/Supplies/fields/TotalPrice.php @@ -11,7 +11,7 @@ class Supplies_TotalPrice_Field extends Supplies_Basic_Field protected $name = 'TotalPrice'; protected $defaultLabel = 'LBL_TOTAL_PRICE'; - protected $columnname = 'total'; + protected $columnName = 'total'; protected $dbType = 'decimal(27,8) DEFAULT \'0\''; protected $summationValue = true; diff --git a/modules/Supplies/fields/UnitPrice.php b/modules/Supplies/fields/UnitPrice.php index 27b885d0ded6..017966c4b24b 100644 --- a/modules/Supplies/fields/UnitPrice.php +++ b/modules/Supplies/fields/UnitPrice.php @@ -11,7 +11,7 @@ class Supplies_UnitPrice_Field extends Supplies_Basic_Field protected $name = 'UnitPrice'; protected $defaultLabel = 'LBL_UNIT_PRICE'; - protected $columnname = 'price'; + protected $columnName = 'price'; protected $dbType = 'decimal(27,8)'; protected $summationValue = true; diff --git a/modules/Supplies/fields/Value.php b/modules/Supplies/fields/Value.php index 5fa4b6ef3c84..a161c1ca909d 100644 --- a/modules/Supplies/fields/Value.php +++ b/modules/Supplies/fields/Value.php @@ -11,6 +11,6 @@ class Supplies_Value_Field extends Supplies_Basic_Field protected $name = 'Value'; protected $defaultLabel = 'LBL_VALUE'; - protected $columnname = 'value'; + protected $columnName = 'value'; protected $dbType = 'varchar(255)'; } diff --git a/modules/Supplies/models/SupField.php b/modules/Supplies/models/SupField.php index 5e4e4df38d76..fe1fa9555170 100644 --- a/modules/Supplies/models/SupField.php +++ b/modules/Supplies/models/SupField.php @@ -12,7 +12,7 @@ class Supplies_SupField_Model const DATA_PREFIX = '_sups'; const FIELDS_PREFIX = '_supfield'; - protected $columns = false; + protected static $columns = false; /** * Create the name of the Supplies data table @@ -97,7 +97,7 @@ public static function getColumns($module) } $columns = []; - foreach ($this->getFields($module) as $field) { + foreach (self::getFields($module) as $field) { $column = $field->getColumnName(); if ($column != '') $columns[] = $column; diff --git a/modules/Supplies/views/Detail.php b/modules/Supplies/views/Detail.php index 662efb2db59c..4af7501b72d9 100644 --- a/modules/Supplies/views/Detail.php +++ b/modules/Supplies/views/Detail.php @@ -26,7 +26,6 @@ function showLineItemDetails(Vtiger_Request $request) $viewer = $this->getViewer($request); $viewer->assign('SUP_RECORD', $record); - $viewer->assign('SUP_MODULE', $moduleName); echo $viewer->view('DetailViewSupplies.tpl', Supplies_Module_Model::getModuleNameForTpl('DetailViewSupplies.tpl', $moduleName), true); } } From 0ef45eaa2b2126c8f17473fa4c6faff95fad21ce Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Mon, 24 Aug 2015 14:16:30 +0200 Subject: [PATCH 030/489] Added automatic data loading in Supplies module --- .../modules/Supplies/fields/EditViewValue.tpl | 2 +- modules/Products/models/Record.php | 2 +- modules/Supplies/actions/GetDetails.php | 25 +++++++++++++------ modules/Supplies/models/SupField.php | 20 +++++++++++++++ vtlib/Vtiger/ModuleBasic.php | 2 +- 5 files changed, 40 insertions(+), 11 deletions(-) diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewValue.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewValue.tpl index ac92dab957ff..ffb123e36404 100644 --- a/layouts/vlayout/modules/Supplies/fields/EditViewValue.tpl +++ b/layouts/vlayout/modules/Supplies/fields/EditViewValue.tpl @@ -6,5 +6,5 @@ {assign var="INPUT_TYPE" value='hidden'} {$SUP_VALUE} {/if} - + {/strip} diff --git a/modules/Products/models/Record.php b/modules/Products/models/Record.php index 621fe6a4aa5f..9e13eb31350c 100644 --- a/modules/Products/models/Record.php +++ b/modules/Products/models/Record.php @@ -53,7 +53,7 @@ static function getListPriceValues($id) $listPrice = $db->pquery('SELECT * FROM vtiger_productcurrencyrel WHERE productid = ?', [$id]); $listpriceValues = []; while ($row = $db->fetch_array($listPrice)) { - $listpriceValues[$row['currencyid']] = $row['actual_price']; + $listpriceValues[$row['currencyid']] = CurrencyField::convertToUserFormat($row['actual_price'], null, true); } return $listpriceValues; } diff --git a/modules/Supplies/actions/GetDetails.php b/modules/Supplies/actions/GetDetails.php index b022ef01dd87..0bf347c309f0 100644 --- a/modules/Supplies/actions/GetDetails.php +++ b/modules/Supplies/actions/GetDetails.php @@ -25,6 +25,7 @@ function process(Vtiger_Request $request) $recordId = $request->get('record'); $idList = $request->get('idlist'); $currencyId = $request->get('currency_id'); + $moduleName = $request->getModule(); $conversionRate = 1; $response = new Vtiger_Response(); @@ -32,25 +33,25 @@ function process(Vtiger_Request $request) $unitPrice = false; if (empty($idList)) { - $info = $this->getRecordDetail($recordId, $currencyId); + $info = $this->getRecordDetail($recordId, $currencyId, $moduleName); } else { foreach ($idList as $id) { - $info[] = $this->getRecordDetail($id, $currencyId); + $info[] = $this->getRecordDetail($id, $currencyId, $moduleName); } } $response->setResult($info); $response->emit(); } - function getRecordDetail($recordId, $currencyId) + function getRecordDetail($recordId, $currencyId, $moduleName) { $conversionRate = 1; $unitPriceValues = $taxes = []; $unitPrice = false; $recordModel = Vtiger_Record_Model::getInstanceById($recordId); - $moduleName = $recordModel->getModuleName(); - if (in_array($moduleName, ['Products', 'Services'])) { + $recordModuleName = $recordModel->getModuleName(); + if (in_array($recordModuleName, ['Products', 'Services'])) { $unitPriceValues = $recordModel->getListPriceValues($recordModel->getId()); $priceDetails = $recordModel->getPriceDetails(); foreach ($priceDetails as $currencyDetails) { @@ -60,15 +61,23 @@ function getRecordDetail($recordId, $currencyId) } $unitPrice = (float) $recordModel->get('unit_price') * (float) $conversionRate; } - + $autoCompleteField = Supplies_SupField_Model::getAutoCompleteField($recordModuleName, $moduleName); + $autoFields = []; + if ($autoCompleteField) { + foreach ($autoCompleteField as $field) { + if ($recordModel->has($field['field']) && $recordModel->get($field['field']) != '') { + $autoFields[$field['tofield']] = $recordModel->get($field['field']); + } + } + } $info = [ $recordId => [ 'id' => $recordId, 'name' => decode_html($recordModel->getName()), - 'price' => $unitPrice, + 'price' => CurrencyField::convertToUserFormat($unitPrice, null, true), 'unitPriceValues' => $unitPriceValues, 'description' => decode_html($recordModel->get('description')), - 'autoFields' => [], + 'autoFields' => $autoFields, ]]; return $info; } diff --git a/modules/Supplies/models/SupField.php b/modules/Supplies/models/SupField.php index fe1fa9555170..e6d3cd50a285 100644 --- a/modules/Supplies/models/SupField.php +++ b/modules/Supplies/models/SupField.php @@ -11,6 +11,7 @@ class Supplies_SupField_Model const DATA_PREFIX = '_sups'; const FIELDS_PREFIX = '_supfield'; + const AUTOFIELD_PREFIX = '_supmap'; protected static $columns = false; @@ -29,6 +30,9 @@ public function getTableName($module, $type = 'data') case 'fields': $prefix = self::FIELDS_PREFIX; break; + case 'autofield': + $prefix = self::AUTOFIELD_PREFIX; + break; } $moduleName = strtolower($module); $basetable = 'vtiger_' . $moduleName; @@ -183,4 +187,20 @@ public static function getCleanInstance() $instance = new self(); return $instance; } + + public static function getAutoCompleteField($recordModuleName, $moduleName) + { + $db = PearDatabase::getInstance(); + $table = self::getTableName($moduleName, 'autofield'); + $result = $db->query("SHOW TABLES LIKE '$table'"); + if ($result->rowCount() == 0) { + return false; + } + $result = $db->pquery('SELECT * FROM ' . $table . ' WHERE module = ?', [$recordModuleName]); + $fields = []; + while ($row = $db->fetch_array($result)) { + $fields[] = $row; + } + return $fields; + } } diff --git a/vtlib/Vtiger/ModuleBasic.php b/vtlib/Vtiger/ModuleBasic.php index 8e9a1f9f1d46..df611a0d453c 100644 --- a/vtlib/Vtiger/ModuleBasic.php +++ b/vtlib/Vtiger/ModuleBasic.php @@ -303,8 +303,8 @@ function initTables($basetable = false, $basetableid = false) Vtiger_Utils::CreateTable($this->basetable. '_supfield', "(id int(19) AUTO_INCREMENT PRIMARY KEY, columnname varchar(30) NOT NULL, label varchar(50) NOT NULL, suptype varchar(30) NOT NULL,presence tinyint(1) unsigned NOT NULL DEFAULT '0', defaultvalue varchar(255),sequence int(10) unsigned NOT NULL, block tinyint(1) unsigned NOT NULL,displaytype tinyint(1) unsigned NOT NULL, params text, colspan tinyint(1) unsigned NOT NULL DEFAULT '1')", true); Vtiger_Utils::CreateTable($this->basetable. '_sups', "(id int(19) PRIMARY KEY,seq int(10),CONSTRAINT `fk_1_$this->basetable` FOREIGN KEY (`id`) REFERENCES `$this->basetable` (`$this->basetableid`) ON DELETE CASCADE)", true); + Vtiger_Utils::CreateTable($this->basetable. '_supmap', '(module varchar(50) PRIMARY KEY,field varchar(50),tofield varchar(50)', true); } - } /** From 53d59b0afaa7ebefc293ce6e516def008d54d29c Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Wed, 26 Aug 2015 09:17:19 +0200 Subject: [PATCH 031/489] Added summary modules Supplies Improved currency change --- languages/pl_pl/Supplies.php | 15 +- .../modules/Supplies/EditViewSupplies.tpl | 16 +- .../Supplies/EditViewSuppliesSummary.tpl | 111 +++++++---- .../Supplies/fields/EditViewCurrency.tpl | 22 ++- .../modules/Supplies/resources/Edit.js | 178 ++++++++++++++++-- .../modules/Supplies/resources/Edit.min.js | 2 +- layouts/vlayout/skins/twilight/style.css | 18 ++ layouts/vlayout/skins/twilight/style.min.css | 2 +- modules/Supplies/actions/Inventory.php | 46 +++++ 9 files changed, 347 insertions(+), 63 deletions(-) create mode 100644 modules/Supplies/actions/Inventory.php diff --git a/languages/pl_pl/Supplies.php b/languages/pl_pl/Supplies.php index 9d26b149a98e..f2f8054adb10 100644 --- a/languages/pl_pl/Supplies.php +++ b/languages/pl_pl/Supplies.php @@ -11,7 +11,7 @@ $languageStrings = [ 'LBL_DISCOUNT' => 'Rabat', 'LBL_TAX' => 'Podatek', - 'LBL_TOTAL_PRICE' => 'Cena przed rabatem', + 'LBL_TOTAL_PRICE' => 'Netto', 'LBL_ROW_COMMENT' => 'Opis', 'LBL_SELECT_DISCOUNT' => 'Wybierz rabat', 'LBL_GLOBAL_DISCOUNTS' => 'Globalny', @@ -29,7 +29,7 @@ 'LBL_REFERENCE' => 'Powiązanie', 'LBL_UNIT_PRICE' => 'Cena jednostkowa', 'LBL_MARGIN_PRECENT' => 'Marża (%)', - 'LBL_GROSS_PRICE' => 'Cena brutto', + 'LBL_GROSS_PRICE' => 'Brutto', 'LBL_DISCOUNT_PRICE' => 'Cena po rabacie', 'LBL_SELECT_TAX' => 'Wybierz podatek', 'LBL_PRICE_BEFORE_TAX' => 'Cena bez podatku', @@ -49,7 +49,16 @@ 'LBL_LIMIT_ALERT' => 'Nie można zapisać rekordu', 'LBL_IMAGE' => 'Zdjęcie', - 'LBL_GROUP_TsAXS' => 'Grupowy', + 'LBL_TAX_RATE' => 'Stawka VAT', + 'LBL_TAX_VALUE' => 'Podatek', + 'LBL_DISCOUNTS_SUMMARY' => 'Podsumowanie rabatu', + 'LBL_TAX_SUMMARY' => 'Podsumowanie podatu', + 'LBL_CURRENCIES_SUMMARY' => 'Podsumowanie walut', + 'LBL_CHANGE_CURRENCY' => 'Zmiana waluty', + 'LBL_CHANGE_CURRENCY_INFO' => 'Zmiana waluty spowoduje przeliczenie wszystkich wartości.
    Czy jesteś pewien czy chcesz to zroić?', + 'LBL_SUMMARY' => 'Podsumowanie', + 'LBL_AMOUNT' => 'Suma', + 'LBL_GROUP_TsAXS' => 'Grupowy', 'LBL_GROUP_TsAXS' => 'Grupowy', ]; diff --git a/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl b/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl index 277316bbf9fa..9d0b97e77eaf 100644 --- a/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl +++ b/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl @@ -9,7 +9,14 @@ {assign var="COUNT_FIELDS0" value=count($FIELDS[0])} {assign var="COUNT_FIELDS1" value=count($FIELDS[1])} {assign var="COUNT_FIELDS2" value=count($FIELDS[2])} - + {if in_array("currency",$COLUMNS)} + {if count($SUP_RECORD_DATA) > 0} + {assign var="CURRENCY" value=$SUP_RECORD_DATA[0]['currency']} + {else} + {assign var="CURRENCY" value=$SUP_RECORD_DATA[0]['currency']} + {/if} + {assign var="CURRENCY_SYMBOLAND" value=Vtiger_Functions::getCurrencySymbolandRate($CURRENCY)} + {/if} @@ -41,9 +48,9 @@    - {foreach item=FIELD from=$FIELDS[1]} + {foreach item=FIELD from=$FIELDS[1]} {vtranslate($FIELD->get('label'), $SUPMODULE)} - {/foreach} + {/foreach} @@ -64,6 +71,9 @@ {/foreach} {CurrencyField::convertToUserFormat($SUM, null, true)} {/if} + {if $FIELD->getName() == 'Name'} + {vtranslate('LBL_SUMMARY', $SUPMODULE)} + {/if} {/foreach} diff --git a/layouts/vlayout/modules/Supplies/EditViewSuppliesSummary.tpl b/layouts/vlayout/modules/Supplies/EditViewSuppliesSummary.tpl index 1e4ee8412540..5596dbf94882 100644 --- a/layouts/vlayout/modules/Supplies/EditViewSuppliesSummary.tpl +++ b/layouts/vlayout/modules/Supplies/EditViewSuppliesSummary.tpl @@ -2,46 +2,87 @@ {strip}
    - - - {foreach item=FIELD from=$FIELDS[2]} - - - - - {/foreach} - -
    - xx - - vv -
    +
    +
    + {vtranslate('LBL_DISCOUNT', $SUPMODULE)}   + {vtranslate('LBL_DISCOUNTS_SUMMARY',$SUPMODULE)} +
    +
    +
    +
    + + {if in_array("currency",$COLUMNS)} +
    {$CURRENCY_SYMBOLAND['symbol']}
    + {/if} +
    +
    +
    +
    - - - - - - - - - - -
    {vtranslate('LBL_TAX_RATE',$SUPMODULE)}{vtranslate('LBL_TAX_VALUE',$SUPMODULE)}
    +
    +
    + {vtranslate('LBL_TAX', $SUPMODULE)}   + {vtranslate('LBL_TAX_SUMMARY',$SUPMODULE)} +
    +
    + +
    + +
    +
    +
    +
    + + {if in_array("currency",$COLUMNS)} +
    {$CURRENCY_SYMBOLAND['symbol']}
    + {/if} +
    +
    +
    +
    - - - - - - - - +
    +
    + {vtranslate('LBL_CURRENCIES_SUMMARY',$SUPMODULE)} +
    +
    -
    -
    {vtranslate('LBL_TAX_RATE',$SUPMODULE)}{vtranslate('LBL_TAX_VALUE',$SUPMODULE)}
    +
    + +
    +
    +
    +
    + + {if in_array("currency",$COLUMNS)} +
    {$CURRENCY_SYMBOLAND['symbol']}
    + {/if} +
    +
    +
    +
    {/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewCurrency.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewCurrency.tpl index 4c81e2990a95..6606f438a42e 100644 --- a/layouts/vlayout/modules/Supplies/fields/EditViewCurrency.tpl +++ b/layouts/vlayout/modules/Supplies/fields/EditViewCurrency.tpl @@ -10,11 +10,29 @@ {/if} {/foreach} {/if} - get('displaytype') == 10}readonly="readonly"{/if}> {foreach item=CURRENCY key=count from=$CURRENCIES} - {/foreach} + {/strip} diff --git a/layouts/vlayout/modules/Supplies/resources/Edit.js b/layouts/vlayout/modules/Supplies/resources/Edit.js index 2faee2a55f00..b63bf68373ea 100644 --- a/layouts/vlayout/modules/Supplies/resources/Edit.js +++ b/layouts/vlayout/modules/Supplies/resources/Edit.js @@ -11,6 +11,8 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { supTableContainer: false, supTableHeadContainer: false, summaryTaxesContainer: false, + summaryDiscountContainer: false, + summaryCurrenciesContainer: false, rowClass: 'tr.rowSup', discountMondalFields: ['aggregationType', 'globalDiscount', 'groupCheckbox', 'groupDiscount', 'individualDiscount', 'individualDiscountType'], taxMondalFields: ['aggregationType', 'globalTax', 'groupCheckbox', 'groupTax', 'individualTax'], @@ -30,12 +32,24 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { } return this.supTableHeadContainer; }, + getSupSummaryDiscountContainer: function () { + if (this.summaryDiscountContainer === false) { + this.summaryDiscountContainer = $('.suppliesSummaryDiscounts'); + } + return this.summaryDiscountContainer; + }, getSupSummaryTaxesContainer: function () { if (this.summaryTaxesContainer === false) { - this.summaryTaxesContainer = $('.suppliesSummaryTaxes tbody'); + this.summaryTaxesContainer = $('.suppliesSummaryTaxes'); } return this.summaryTaxesContainer; }, + getSupSummaryCurrenciesContainer: function () { + if (this.summaryCurrenciesContainer === false) { + this.summaryCurrenciesContainer = $('.suppliesSummaryCurrencies'); + } + return this.summaryCurrenciesContainer; + }, getNextLineItemRowNumber: function () { var rowNumber = $(this.rowClass, this.getSupTableContainer()).length; $('#suppliesRowNo').val(rowNumber + 1); @@ -109,7 +123,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { colTax.removeClass('hide'); } else { colTax.addClass('hide'); - colTax.find('.tax').val('0'); + thisInstance.setTax(colTax, '0'); thisInstance.rowsCalculations(); } }, @@ -135,7 +149,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { colDiscount.removeClass('hide'); } else { colDiscount.addClass('hide'); - colDiscount.find('.discount').val('0'); + thisInstance.setDiscount(colDiscount, '0'); thisInstance.rowsCalculations(); } }, @@ -180,7 +194,8 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { }); return app.parseNumberToFloat(price); }, - setUnitPriceValue: function (row, val) { + setUnitPrice: function (row, val) { + val = app.parseNumberToShow(val); row.find('.unitPrice').val(val).attr('title', val); return this; }, @@ -207,6 +222,14 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { val = app.parseNumberToShow(val); $('.marginp', row).val(val); }, + setDiscount: function (row, val) { + val = app.parseNumberToShow(val); + $('.discount', row).val(val); + }, + setTax: function (row, val) { + val = app.parseNumberToShow(val); + $('.tax', row).val(val); + }, quantityChangeActions: function (row) { this.rowCalculations(row); this.summaryCalculations(); @@ -219,7 +242,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { }, rowsCalculations: function () { var thisInstance = this; - this.getSupTableContainer().find(this.rowClass).each(function (index) { + this.getSupTableContainer().find(thisInstance.rowClass).each(function (index) { thisInstance.quantityChangeActions($(this)); }); }, @@ -228,31 +251,83 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { thisInstance.getSupTableContainer().find('tfoot .wisableTd').each(function (index) { thisInstance.calculatSummary($(this), $(this).data('sumfield')); }); + thisInstance.calculatDiscountSummary(); thisInstance.calculatTaxSummary(); + thisInstance.calculatCurrenciesSummary(); }, calculatSummary: function (element, field) { var thisInstance = this; var sum = 0; - this.getSupTableContainer().find(this.rowClass).each(function (index) { + this.getSupTableContainer().find(thisInstance.rowClass).each(function (index) { sum += app.parseNumberToFloat($(this).find('.' + field).val()); }); element.text(app.parseNumberToShow(sum)); }, + calculatDiscountSummary: function () { + var thisInstance = this; + var discount = thisInstance.getAllDiscount(); + var container = thisInstance.getSupSummaryDiscountContainer(); + container.find('input').val(app.parseNumberToShow(discount)); + }, + getAllDiscount: function () { + var thisInstance = this; + var discount = 0; + this.getSupTableContainer().find(thisInstance.rowClass).each(function (index) { + var row = $(this); + var rowDiscount = thisInstance.getDiscount(row); + discount += rowDiscount; + }); + return discount; + }, + calculatCurrenciesSummary: function () { + var thisInstance = this; + var container = thisInstance.getSupSummaryCurrenciesContainer(); + var selected = $('[name="currency"] option:selected', thisInstance.getSupTableHeadContainer()); + var base = $('[name="currency"] option[data-base-currency="1"]', thisInstance.getSupTableHeadContainer()); + var conversionRate = selected.data('conversionRate'); + var prevConversionRate = base.data('conversionRate'); + if (conversionRate == prevConversionRate) { + container.addClass('hide'); + return; + } + conversionRate = parseFloat(prevConversionRate) / parseFloat(conversionRate); + container.removeClass('hide'); + var taxs = thisInstance.getAllTaxs(); + var sum = 0; + container.find('.panel-body').html(''); + $.each(taxs, function (index, value) { + if (value != undefined) { + value = value * conversionRate; + var row = container.find('.hide .form-group').clone(); + row.find('.percent').text(index + '%'); + row.find('input').val(app.parseNumberToShow(value)); + row.appendTo(container.find('.panel-body')); + sum += value; + } + }); + container.find('.panel-footer input').val(app.parseNumberToShow(sum)); + }, calculatTaxSummary: function () { var thisInstance = this; var taxs = thisInstance.getAllTaxs(); var container = thisInstance.getSupSummaryTaxesContainer(); + container.find('.panel-body').html(''); + var sum = 0; $.each(taxs, function (index, value) { if (value != undefined) { - $('' + index + '%' + app.parseNumberToShow(value) + '').appendTo(container); + var row = container.find('.hide .form-group').clone(); + row.find('.percent').text(index + '%'); + row.find('input').val(app.parseNumberToShow(value)); + row.appendTo(container.find('.panel-body')); + sum += value; } }); - console.log(taxs); + container.find('.panel-footer input').val(app.parseNumberToShow(sum)); }, getAllTaxs: function () { var thisInstance = this; var tax = []; - this.getSupTableContainer().find(this.rowClass).each(function (index) { + this.getSupTableContainer().find(thisInstance.rowClass).each(function (index) { var row = $(this); var netPrice = thisInstance.getNetPrice(row); var params = row.find('.taxParam').val(); @@ -272,6 +347,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { }); } }); + return tax; }, calculateNetPrice: function (row) { @@ -317,10 +393,10 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { var globalDiscount = app.parseNumberToFloat(mondal.find('.activepanel .globalDiscount').val()); } if (mondal.find('.activepanel .individualDiscountType').length > 0) { - var individualTypeDiscount = mondal.find('.activepanel .individualDiscountType[name="individual"]:checked').val(); + var individualTypeDiscount = mondal.find('.activepanel .individualDiscountType:checked').val(); var value = mondal.find('.activepanel .individualDiscountValue').val(); if (individualTypeDiscount == 'percentage') { - individualDiscount = (value / 100) * netPriceBeforeDiscount; + individualDiscount = netPriceBeforeDiscount * (value / 100); } else { individualDiscount = value; } @@ -357,7 +433,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { mondal.find('.valueDiscount').text(app.parseNumberToShow(netPriceBeforeDiscount - valuePrices)); }, calculateTax: function (row, mondal) { - var netPriceWithoutTax = this.getTotalPrice(row), + var netPriceWithoutTax = this.getNetPrice(row), valuePrices = netPriceWithoutTax, globalTax = 0, groupTax = 0, @@ -444,7 +520,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { this.showPopup(params).then(function (data) { var responseData = JSON.parse(data); for (var id in responseData) { - thisInstance.setUnitPriceValue(lineItemRow, responseData[id]); + thisInstance.setUnitPrice(lineItemRow, responseData[id]); } thisInstance.quantityChangeActions(thisInstance.getClosestRow(rowName)); }); @@ -491,7 +567,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { if (progressInstace) { progressInstace.hide(); } - //TODO : handle the error case + console.error(error, err); } ); }, @@ -521,7 +597,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { var currencyId = thisInstance.getCurrency(); if (typeof unitPriceValues[currencyId] !== 'undefined') { - thisInstance.setUnitPriceValue(parentRow, unitPriceValues[currencyId]); + thisInstance.setUnitPrice(parentRow, unitPriceValues[currencyId]); } $('input.unitPrice', parentRow).attr('list-info', unitPriceValuesJson); $('textarea.commentTextarea', parentRow).val(description); @@ -701,10 +777,61 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { }, function (error, err) { progressInstace.hide(); + console.error(error, err); } ); return response; }, + currencyChangeActions: function (select, option) { + var thisInstance = this; + if (option.data('baseCurrency') == 0) { + thisInstance.showCurrencyChangeMondal(select); + } else { + thisInstance.currencyConvertValues(select); + select.data('oldValue', select.val()); + } + }, + showCurrencyChangeMondal: function (select) { + var thisInstance = this; + if (thisInstance.lockCurrencyChange == true) { + return; + } + thisInstance.lockCurrencyChange = true; + var mondal = select.closest('th').find('.modelContainer').clone(); + app.showModalWindow(mondal, function (data) { + var mondal = $(data); + mondal.on('click', 'button[type="submit"]', function (e) { + thisInstance.currencyConvertValues(select); + select.data('oldValue', select.val()); + app.hideModalWindow(); + thisInstance.lockCurrencyChange = false; + }); + mondal.on('click', 'button[type="reset"]', function (e) { + select.val(select.data('oldValue')).change(); + thisInstance.lockCurrencyChange = false; + }); + }); + }, + currencyConvertValues: function (select) { + var thisInstance = this; + var selected = select.find('option:selected'); + var previous = select.find('option[value="' + select.data('oldValue') + '"]'); + if (selected.data('baseCurrency') == '1') { + + } + this.getSupTableContainer().find(thisInstance.rowClass).each(function (index) { + var row = $(this); + var conversionRate = selected.data('conversionRate'); + var prevConversionRate = previous.data('conversionRate'); + + conversionRate = parseFloat(conversionRate) / parseFloat(prevConversionRate); + thisInstance.setUnitPrice(row, app.parseNumberToFloat(thisInstance.getUnitPriceValue(row) * conversionRate)); + thisInstance.setDiscount(row, app.parseNumberToFloat(thisInstance.getDiscount(row) * conversionRate)); + thisInstance.setTax(row, app.parseNumberToFloat(thisInstance.getTax(row) * conversionRate)); + + thisInstance.quantityChangeActions(row); + }); + }, registerAddRow: function (container) { var thisInstance = this; var subTable = this.getSupTableContainer(); @@ -861,6 +988,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { }, function (error, err) { progressInstace.hide(); + console.error(error, err); } ); }); @@ -892,7 +1020,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { thisInstance.calculateDiscount(parentRow, mondal); }); mondal.on('click', '.saveDiscount', function (e) { - parentRow.find('.discount').val(mondal.find('.valueDiscount').text()); + thisInstance.setDiscount(parentRow, mondal.find('.valueDiscount').text()); thisInstance.saveDiscountsParameters(parentRow, mondal); thisInstance.quantityChangeActions(parentRow); app.hideModalWindow(); @@ -912,7 +1040,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { currency: thisInstance.getCurrency(), sourceModule: app.getModuleName(), sourceRecord: app.getRecordId(), - totalPrice: thisInstance.getTotalPrice(parentRow), + totalPrice: thisInstance.getNetPrice(parentRow), accountField: container.find('#accountReferenceField').val(), } @@ -927,10 +1055,21 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { }, function (error, err) { progressInstace.hide(); + console.error(error, err); } ); }); }, + lockCurrencyChange: false, + registerChangeCurrency: function (container) { + var thisInstance = this; + container.on('change', '[name="currency"]', function (e) { + var element = $(e.currentTarget); + var symbol = element.find('option:selected').data('conversionSymbol'); + thisInstance.currencyChangeActions(element, element.find('option:selected')); + container.find('.currencySymbol').text(symbol); + }); + }, registerChangeTaxModal: function (mondal, parentRow, params) { var thisInstance = this; mondal.on('change', '.individualTaxType', function (e) { @@ -958,7 +1097,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { thisInstance.calculateTax(parentRow, mondal); }); mondal.on('click', '.saveTaxs', function (e) { - parentRow.find('.tax').val(mondal.find('.valueTax').text()); + thisInstance.setTax(parentRow, mondal.find('.valueTax').text()); thisInstance.saveTaxsParameters(parentRow, mondal); thisInstance.quantityChangeActions(parentRow); app.hideModalWindow(); @@ -991,6 +1130,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { } }, function (error, err) { + console.error(error, err); } ); }); @@ -1005,6 +1145,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { thisInstance.registerRowChangeEvent(container); thisInstance.registerRowAutoComplete(container); thisInstance.checkDeleteIcon(); + thisInstance.summaryCalculations(); }, /** * Function which will register all the events @@ -1021,6 +1162,7 @@ Vtiger_Edit_Js("Supplies_Edit_Js", {}, { this.registerChangeTax(container); this.registerClearReferenceSelection(container); this.registerShowHideExpanded(container); + this.registerChangeCurrency(container); }, }); diff --git a/layouts/vlayout/modules/Supplies/resources/Edit.min.js b/layouts/vlayout/modules/Supplies/resources/Edit.min.js index 5c5c237e01bf..68b87d89212a 100644 --- a/layouts/vlayout/modules/Supplies/resources/Edit.min.js +++ b/layouts/vlayout/modules/Supplies/resources/Edit.min.js @@ -1,2 +1,2 @@ -Vtiger_Edit_Js("Supplies_Edit_Js",{},{supTableContainer:false,supTableHeadContainer:false,summaryTaxesContainer:false,rowClass:"tr.rowSup",discountMondalFields:["aggregationType","globalDiscount","groupCheckbox","groupDiscount","individualDiscount","individualDiscountType"],taxMondalFields:["aggregationType","globalTax","groupCheckbox","groupTax","individualTax"],getSupTableContainer:function(){if(this.supTableContainer===false){this.supTableContainer=$(".suppliesItemsTable")}return this.supTableContainer},getSupTableHeadContainer:function(){if(this.supTableHeadContainer===false){this.supTableHeadContainer=$(".suppliesHeaderTable")}return this.supTableHeadContainer},getSupSummaryTaxesContainer:function(){if(this.summaryTaxesContainer===false){this.summaryTaxesContainer=$(".suppliesSummaryTaxes tbody")}return this.summaryTaxesContainer},getNextLineItemRowNumber:function(){var a=$(this.rowClass,this.getSupTableContainer()).length;$("#suppliesRowNo").val(a+1);return ++a},getAccountId:function(){var a=$("#accountReferenceField").val();if(a!=""){return $('[name="'+a+'"]').val()}return""},checkDeleteIcon:function(){var a=this.getSupTableContainer();if(a.find(this.rowClass).length>1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackSuppliesTable tbody").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},getTaxModeSelectElement:function(b){var a=this.getSupTableHeadContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(c){var b=this;var a=b.getSupTableContainer().find(".colTax");if(b.isIndividualTaxMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".tax").val("0");b.rowsCalculations()}},getDiscountModeSelectElement:function(b){var a=this.getSupTableHeadContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(c){var b=this;var a=b.getSupTableContainer().find(".colDiscount");if(b.isIndividualDiscountMode()){a.removeClass("hide")}else{a.addClass("hide");a.find(".discount").val("0");b.rowsCalculations()}},getCurrency:function(){var a=$('[name="currency"]',this.getSupTableHeadContainer());return a.find("option:selected").val()},getTax:function(a){return app.parseNumberToFloat($(".tax",a).val())},getQuantityValue:function(a){return app.parseNumberToFloat($(".qty",a).val())},getUnitPriceValue:function(a){return app.parseNumberToFloat($(".unitPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return app.parseNumberToFloat(b)},getNetPrice:function(a){return app.parseNumberToFloat($(".netPrice",a).val())},getTotalPrice:function(a){return app.parseNumberToFloat($(".totalPrice",a).val())},getGrossPrice:function(a){return app.parseNumberToFloat($(".grossPrice",a).val())},getPurchase:function(a){var b=this.getQuantityValue(a);return app.parseNumberToFloat($(".purchase",a).val())*b},getSummaryGrossPrice:function(){var b=this;var a=0;this.getSupTableContainer().find(this.rowClass).each(function(c){a+=b.getGrossPrice($(this))});return app.parseNumberToFloat(a)},setUnitPriceValue:function(b,a){b.find(".unitPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=app.parseNumberToShow(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=app.parseNumberToShow(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=app.parseNumberToShow(a);$(".totalPriceText",b).text(a);$(".totalPrice",b).val(a)},setMargin:function(b,a){a=app.parseNumberToShow(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=app.parseNumberToShow(a);$(".marginp",b).val(a)},quantityChangeActions:function(a){this.rowCalculations(a);this.summaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getSupTableContainer().find(this.rowClass).each(function(b){a.quantityChangeActions($(this))})},summaryCalculations:function(){var a=this;a.getSupTableContainer().find("tfoot .wisableTd").each(function(b){a.calculatSummary($(this),$(this).data("sumfield"))});a.calculatTaxSummary()},calculatSummary:function(a,d){var c=this;var b=0;this.getSupTableContainer().find(this.rowClass).each(function(e){b+=app.parseNumberToFloat($(this).find("."+d).val())});a.text(app.parseNumberToShow(b))},calculatTaxSummary:function(){var c=this;var b=c.getAllTaxs();var a=c.getSupSummaryTaxesContainer();$.each(b,function(d,e){if(e!=undefined){$(""+d+"%"+app.parseNumberToShow(e)+"").appendTo(a)}});console.log(b)},getAllTaxs:function(){var b=this;var a=[];this.getSupTableContainer().find(this.rowClass).each(function(c){var f=$(this);var g=b.getNetPrice(f);var e=f.find(".taxParam").val();if(e!=""){var d=$.parseJSON(e);if(typeof d.aggregationType=="string"){d.aggregationType=[d.aggregationType]}$.each(d.aggregationType,function(k,j){var j=j+"Tax";var i=d[j];var h=0;if(a[i]!=undefined){h=parseFloat(a[i])}a[i]=h+g*(i/100)})}});return a},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getUnitPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,c){var e=this.getTotalPrice(j),b=e,k=0,f=0,g=0,a=0;var i=c.find(".discountsType").val();if(i=="0"||i=="1"){if(c.find(".activepanel .globalDiscount").length>0){var k=app.parseNumberToFloat(c.find(".activepanel .globalDiscount").val())}if(c.find(".activepanel .individualDiscountType").length>0){var d=c.find('.activepanel .individualDiscountType[name="individual"]:checked').val();var h=c.find(".activepanel .individualDiscountValue").val();if(d=="percentage"){g=(h/100)*e}else{g=h}}if(c.find(".activepanel .groupCheckbox").length>0&&c.find(".activepanel .groupCheckbox").prop("checked")==true){var f=app.parseNumberToFloat(c.find(".groupValue").val());f=e*(f/100)}b=b*((100-k)/100);b=b-app.parseNumberToFloat(g);b=b-f}else{if(i=="2"){c.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=app.parseNumberToFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=app.parseNumberToFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=app.parseNumberToFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}c.find(".valuePrices").text(app.parseNumberToShow(b));c.find(".valueDiscount").text(app.parseNumberToShow(e-b))},calculateTax:function(k,g){var h=this.getTotalPrice(k),b=h,c=0,f=0,a=0,i=0,e=0;var d=g.find(".taxsType").val();if(d=="0"||d=="1"){if(g.find(".activepanel .globalTax").length>0){var c=g.find(".activepanel .globalTax").val()}if(g.find(".activepanel .individualTaxValue").length>0){var j=app.parseNumberToFloat(g.find(".activepanel .individualTaxValue").val());i=(j/100)*b}if(g.find(".activepanel .groupTax").length>0){var f=app.parseNumberToFloat(g.find(".groupTax").val());f=h*(app.parseNumberToFloat(f)/100)}if(g.find(".activepanel .regionalTax").length>0){var a=app.parseNumberToFloat(g.find(".regionalTax").val());a=h*(app.parseNumberToFloat(a)/100)}b=b*((100+app.parseNumberToFloat(c))/100);b=b+app.parseNumberToFloat(i);b=b+app.parseNumberToFloat(f);b=b+app.parseNumberToFloat(a)}else{if(d=="2"){g.find(".activepanel").each(function(p){var l=$(this);if(l.find(".globalTax").length>0){var o=app.parseNumberToFloat(l.find(".globalTax").val());b=b*((100+o)/100)}else{if(l.find(".groupTax").length>0){var n=app.parseNumberToFloat(l.find(".groupTax").val());b=b*((100+n)/100)}else{if(l.find(".regionalTax").length>0){var m=app.parseNumberToFloat(l.find(".regionalTax").val());b=b*((100+m)/100)}else{if(l.find(".individualTaxValue").length>0){var q=app.parseNumberToFloat(l.find(".individualTaxValue").val());b=((q+100)/100)*b}}}}})}}g.find(".valuePrices").text(app.parseNumberToShow(b));g.find(".valueTax").text(app.parseNumberToShow(b-h))},updateRowSequence:function(){var a=this.getSupTableContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerSuppliesSaveData:function(a){var b=this;a.on(Vtiger_Edit_Js.recordPreSave,function(f,d){if(!b.checkLimits(a)){return false}var c=a.find("#blackSuppliesTable");c.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductUnitPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setUnitPriceValue(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(g,a){var d=this;var c=jQuery("input.sourceField",g).val();var e=g.find('.rowName input[name="popupReferenceModule"]').val();d.removeSubProducts(g);if(c=="0"||$.inArray(e,["Products","Services"])<0){return false}if(d.subProductsCashe[c]){d.addSubProducts(g,d.subProductsCashe[c]);return false}var f={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(f).then(function(i){var h=i.result;d.subProductsCashe[c]=h;d.addSubProducts(g,h);if(b){b.hide()}},function(h,i){if(b){b.hide()}})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,c){var i=this;for(var b in c){var a=c[b];var j=a.description;var e=a.unitPriceValues;var d=JSON.stringify(e);for(var g in a.autoFields){k.find("input."+g).val(a.autoFields[g])}var h=i.getCurrency();if(typeof e[h]!=="undefined"){i.setUnitPriceValue(k,e[h])}$("input.unitPrice",k).attr("list-info",d);$("textarea.commentTextarea",k).val(j);i.showIndividualTax(k)}if(f==="Products"){i.loadSubProducts(k,true)}this.quantityChangeActions(k)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".discountParam").val(JSON.stringify(c))},saveTaxsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(b.taxMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".taxParam").val(JSON.stringify(c))},showExpandedRow:function(e){var d=this;var c=d.getSupTableContainer();var b=c.find('[numrowex="'+e.attr("numrow")+'"]');var a=e.find(".toggleVisibility");a.data("status","1");a.find(".glyphicon").removeClass("glyphicon-menu-down");a.find(".glyphicon").addClass("glyphicon-menu-up");b.removeClass("hide");d.loadCkEditorElement(b.find(".ckEditorSource"))},hideExpandedRow:function(f){var e=this;var d=e.getSupTableContainer();var c=d.find('[numrowex="'+f.attr("numrow")+'"]');var b=f.find(".toggleVisibility");b.data("status","0");b.find(".glyphicon").removeClass("glyphicon-menu-up");b.find(".glyphicon").addClass("glyphicon-menu-down");c.addClass("hide");var a=CKEDITOR.instances[c.find(".ckEditorSource").attr("id")];if(a){a.destroy()}},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},initTaxParameters:function(d,a){var c=this;var b=d.find(".taxParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.taxMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateTax(d,a)},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#suppliesLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"CheckLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#suppliesLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide()});return a},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackSuppliesTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.find("tr").appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.registerAutoCompleteFields(m);c.initRow(m)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(c,d){a.find(b.rowClass).each(function(e,f){var g=$(f);b.hideExpandedRow(g)});d.item.startPos=d.item.index()},stop:function(d,e){var c=$(e.item.context).attr("numrow");var f=a.find(".numRow"+c).remove().clone();a.find('[numrow="'+c+'"]').after(f);if(e.item.startPos1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackSuppliesTable tbody").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},getTaxModeSelectElement:function(b){var a=this.getSupTableHeadContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(c){var b=this;var a=b.getSupTableContainer().find(".colTax");if(b.isIndividualTaxMode()){a.removeClass("hide")}else{a.addClass("hide");b.setTax(a,"0");b.rowsCalculations()}},getDiscountModeSelectElement:function(b){var a=this.getSupTableHeadContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(c){var b=this;var a=b.getSupTableContainer().find(".colDiscount");if(b.isIndividualDiscountMode()){a.removeClass("hide")}else{a.addClass("hide");b.setDiscount(a,"0");b.rowsCalculations()}},getCurrency:function(){var a=$('[name="currency"]',this.getSupTableHeadContainer());return a.find("option:selected").val()},getTax:function(a){return app.parseNumberToFloat($(".tax",a).val())},getQuantityValue:function(a){return app.parseNumberToFloat($(".qty",a).val())},getUnitPriceValue:function(a){return app.parseNumberToFloat($(".unitPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return app.parseNumberToFloat(b)},getNetPrice:function(a){return app.parseNumberToFloat($(".netPrice",a).val())},getTotalPrice:function(a){return app.parseNumberToFloat($(".totalPrice",a).val())},getGrossPrice:function(a){return app.parseNumberToFloat($(".grossPrice",a).val())},getPurchase:function(a){var b=this.getQuantityValue(a);return app.parseNumberToFloat($(".purchase",a).val())*b},getSummaryGrossPrice:function(){var b=this;var a=0;this.getSupTableContainer().find(this.rowClass).each(function(c){a+=b.getGrossPrice($(this))});return app.parseNumberToFloat(a)},setUnitPrice:function(b,a){a=app.parseNumberToShow(a);b.find(".unitPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=app.parseNumberToShow(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=app.parseNumberToShow(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=app.parseNumberToShow(a);$(".totalPriceText",b).text(a);$(".totalPrice",b).val(a)},setMargin:function(b,a){a=app.parseNumberToShow(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=app.parseNumberToShow(a);$(".marginp",b).val(a)},setDiscount:function(b,a){a=app.parseNumberToShow(a);$(".discount",b).val(a)},setTax:function(b,a){a=app.parseNumberToShow(a);$(".tax",b).val(a)},quantityChangeActions:function(a){this.rowCalculations(a);this.summaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getSupTableContainer().find(a.rowClass).each(function(b){a.quantityChangeActions($(this))})},summaryCalculations:function(){var a=this;a.getSupTableContainer().find("tfoot .wisableTd").each(function(b){a.calculatSummary($(this),$(this).data("sumfield"))});a.calculatDiscountSummary();a.calculatTaxSummary();a.calculatCurrenciesSummary()},calculatSummary:function(a,d){var c=this;var b=0;this.getSupTableContainer().find(c.rowClass).each(function(e){b+=app.parseNumberToFloat($(this).find("."+d).val())});a.text(app.parseNumberToShow(b))},calculatDiscountSummary:function(){var b=this;var c=b.getAllDiscount();var a=b.getSupSummaryDiscountContainer();a.find("input").val(app.parseNumberToShow(c))},getAllDiscount:function(){var a=this;var b=0;this.getSupTableContainer().find(a.rowClass).each(function(d){var e=$(this);var c=a.getDiscount(e);b+=c});return b},calculatCurrenciesSummary:function(){var g=this;var a=g.getSupSummaryCurrenciesContainer();var f=$('[name="currency"] option:selected',g.getSupTableHeadContainer());var h=$('[name="currency"] option[data-base-currency="1"]',g.getSupTableHeadContainer());var b=f.data("conversionRate");var d=h.data("conversionRate");if(b==d){a.addClass("hide");return}b=parseFloat(d)/parseFloat(b);a.removeClass("hide");var c=g.getAllTaxs();var e=0;a.find(".panel-body").html("");$.each(c,function(i,j){if(j!=undefined){j=j*b;var k=a.find(".hide .form-group").clone();k.find(".percent").text(i+"%");k.find("input").val(app.parseNumberToShow(j));k.appendTo(a.find(".panel-body"));e+=j}});a.find(".panel-footer input").val(app.parseNumberToShow(e))},calculatTaxSummary:function(){var d=this;var b=d.getAllTaxs();var a=d.getSupSummaryTaxesContainer();a.find(".panel-body").html("");var c=0;$.each(b,function(e,f){if(f!=undefined){var g=a.find(".hide .form-group").clone();g.find(".percent").text(e+"%");g.find("input").val(app.parseNumberToShow(f));g.appendTo(a.find(".panel-body"));c+=f}});a.find(".panel-footer input").val(app.parseNumberToShow(c))},getAllTaxs:function(){var b=this;var a=[];this.getSupTableContainer().find(b.rowClass).each(function(c){var f=$(this);var g=b.getNetPrice(f);var e=f.find(".taxParam").val();if(e!=""){var d=$.parseJSON(e);if(typeof d.aggregationType=="string"){d.aggregationType=[d.aggregationType]}$.each(d.aggregationType,function(k,j){var j=j+"Tax";var i=d[j];var h=0;if(a[i]!=undefined){h=parseFloat(a[i])}a[i]=h+g*(i/100)})}});return a},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getUnitPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,c){var e=this.getTotalPrice(j),b=e,k=0,f=0,g=0,a=0;var i=c.find(".discountsType").val();if(i=="0"||i=="1"){if(c.find(".activepanel .globalDiscount").length>0){var k=app.parseNumberToFloat(c.find(".activepanel .globalDiscount").val())}if(c.find(".activepanel .individualDiscountType").length>0){var d=c.find(".activepanel .individualDiscountType:checked").val();var h=c.find(".activepanel .individualDiscountValue").val();if(d=="percentage"){g=e*(h/100)}else{g=h}}if(c.find(".activepanel .groupCheckbox").length>0&&c.find(".activepanel .groupCheckbox").prop("checked")==true){var f=app.parseNumberToFloat(c.find(".groupValue").val());f=e*(f/100)}b=b*((100-k)/100);b=b-app.parseNumberToFloat(g);b=b-f}else{if(i=="2"){c.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=app.parseNumberToFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=app.parseNumberToFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=app.parseNumberToFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}c.find(".valuePrices").text(app.parseNumberToShow(b));c.find(".valueDiscount").text(app.parseNumberToShow(e-b))},calculateTax:function(k,g){var h=this.getNetPrice(k),b=h,c=0,f=0,a=0,i=0,e=0;var d=g.find(".taxsType").val();if(d=="0"||d=="1"){if(g.find(".activepanel .globalTax").length>0){var c=g.find(".activepanel .globalTax").val()}if(g.find(".activepanel .individualTaxValue").length>0){var j=app.parseNumberToFloat(g.find(".activepanel .individualTaxValue").val());i=(j/100)*b}if(g.find(".activepanel .groupTax").length>0){var f=app.parseNumberToFloat(g.find(".groupTax").val());f=h*(app.parseNumberToFloat(f)/100)}if(g.find(".activepanel .regionalTax").length>0){var a=app.parseNumberToFloat(g.find(".regionalTax").val());a=h*(app.parseNumberToFloat(a)/100)}b=b*((100+app.parseNumberToFloat(c))/100);b=b+app.parseNumberToFloat(i);b=b+app.parseNumberToFloat(f);b=b+app.parseNumberToFloat(a)}else{if(d=="2"){g.find(".activepanel").each(function(p){var l=$(this);if(l.find(".globalTax").length>0){var o=app.parseNumberToFloat(l.find(".globalTax").val());b=b*((100+o)/100)}else{if(l.find(".groupTax").length>0){var n=app.parseNumberToFloat(l.find(".groupTax").val());b=b*((100+n)/100)}else{if(l.find(".regionalTax").length>0){var m=app.parseNumberToFloat(l.find(".regionalTax").val());b=b*((100+m)/100)}else{if(l.find(".individualTaxValue").length>0){var q=app.parseNumberToFloat(l.find(".individualTaxValue").val());b=((q+100)/100)*b}}}}})}}g.find(".valuePrices").text(app.parseNumberToShow(b));g.find(".valueTax").text(app.parseNumberToShow(b-h))},updateRowSequence:function(){var a=this.getSupTableContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerSuppliesSaveData:function(a){var b=this;a.on(Vtiger_Edit_Js.recordPreSave,function(f,d){if(!b.checkLimits(a)){return false}var c=a.find("#blackSuppliesTable");c.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductUnitPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setUnitPrice(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(g,a){var d=this;var c=jQuery("input.sourceField",g).val();var e=g.find('.rowName input[name="popupReferenceModule"]').val();d.removeSubProducts(g);if(c=="0"||$.inArray(e,["Products","Services"])<0){return false}if(d.subProductsCashe[c]){d.addSubProducts(g,d.subProductsCashe[c]);return false}var f={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(f).then(function(i){var h=i.result;d.subProductsCashe[c]=h;d.addSubProducts(g,h);if(b){b.hide()}},function(h,i){if(b){b.hide()}console.error(h,i)})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,c){var i=this;for(var b in c){var a=c[b];var j=a.description;var e=a.unitPriceValues;var d=JSON.stringify(e);for(var g in a.autoFields){k.find("input."+g).val(a.autoFields[g])}var h=i.getCurrency();if(typeof e[h]!=="undefined"){i.setUnitPrice(k,e[h])}$("input.unitPrice",k).attr("list-info",d);$("textarea.commentTextarea",k).val(j);i.showIndividualTax(k)}if(f==="Products"){i.loadSubProducts(k,true)}this.quantityChangeActions(k)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".discountParam").val(JSON.stringify(c))},saveTaxsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(b.taxMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".taxParam").val(JSON.stringify(c))},showExpandedRow:function(e){var d=this;var c=d.getSupTableContainer();var b=c.find('[numrowex="'+e.attr("numrow")+'"]');var a=e.find(".toggleVisibility");a.data("status","1");a.find(".glyphicon").removeClass("glyphicon-menu-down");a.find(".glyphicon").addClass("glyphicon-menu-up");b.removeClass("hide");d.loadCkEditorElement(b.find(".ckEditorSource"))},hideExpandedRow:function(f){var e=this;var d=e.getSupTableContainer();var c=d.find('[numrowex="'+f.attr("numrow")+'"]');var b=f.find(".toggleVisibility");b.data("status","0");b.find(".glyphicon").removeClass("glyphicon-menu-up");b.find(".glyphicon").addClass("glyphicon-menu-down");c.addClass("hide");var a=CKEDITOR.instances[c.find(".ckEditorSource").attr("id")];if(a){a.destroy()}},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},initTaxParameters:function(d,a){var c=this;var b=d.find(".taxParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.taxMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateTax(d,a)},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#suppliesLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"CheckLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#suppliesLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide();console.error(f,g)});return a},currencyChangeActions:function(a,b){var c=this;if(b.data("baseCurrency")==0){c.showCurrencyChangeMondal(a)}else{c.currencyConvertValues(a);a.data("oldValue",a.val())}},showCurrencyChangeMondal:function(a){var c=this;if(c.lockCurrencyChange==true){return}c.lockCurrencyChange=true;var b=a.closest("th").find(".modelContainer").clone();app.showModalWindow(b,function(e){var d=$(e);d.on("click",'button[type="submit"]',function(f){c.currencyConvertValues(a);a.data("oldValue",a.val());app.hideModalWindow();c.lockCurrencyChange=false});d.on("click",'button[type="reset"]',function(f){a.val(a.data("oldValue")).change();c.lockCurrencyChange=false})})},currencyConvertValues:function(a){var d=this;var b=a.find("option:selected");var c=a.find('option[value="'+a.data("oldValue")+'"]');if(b.data("baseCurrency")=="1"){}this.getSupTableContainer().find(d.rowClass).each(function(f){var h=$(this);var e=b.data("conversionRate");var g=c.data("conversionRate");e=parseFloat(e)/parseFloat(g);d.setUnitPrice(h,app.parseNumberToFloat(d.getUnitPriceValue(h)*e));d.setDiscount(h,app.parseNumberToFloat(d.getDiscount(h)*e));d.setTax(h,app.parseNumberToFloat(d.getTax(h)*e));d.quantityChangeActions(h)})},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackSuppliesTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.find("tr").appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.registerAutoCompleteFields(m);c.initRow(m)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(c,d){a.find(b.rowClass).each(function(e,f){var g=$(f);b.hideExpandedRow(g)});d.item.startPos=d.item.index()},stop:function(d,e){var c=$(e.item.context).attr("numrow");var f=a.find(".numRow"+c).remove().clone();a.find('[numrow="'+c+'"]').after(f);if(e.item.startPos.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background:0}.navbar-default .navbar-nav>li:hover{background:#e7e7e7}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background:0}.navbar-inverse .navbar-nav>li:hover{background:#080808}.navbar-nav .hovernav:hover>.dropdown-menu{display:block}#collapsedMenu{display:block;position:relative}#collapsedMenu a{color:#fff}#collapsedMenu .dropdown-menu .shortDropdown{max-height:300px;overflow-y:scroll;padding:10px;position:relative;z-index:10000;-webkit-overflow-scrolling:touch;-webkit-transform:translateZ(0)}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames{margin-bottom:2px}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a{font-size:.9em;padding:3%!important;color:#2b2b2b!important}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a:hover{text-decoration:none;background:#404952;color:#fff!important}.moreMenus{width:52em;padding:24%;left:0;border-radius:2px}.moreMenus.leftAligned:after,.moreMenus.leftAligned:before{left:21px!important}.moreMenus strong{font-size:1.1em;color:#2b2b2b}.moreMenus:after,.moreMenus:before{left:292px!important}.announcement{// display:none;background:#fafad2;// padding:2px 0;// border-bottom:1px solid #ccc;// max-height:24px;// width:100%}.announcement .marStyle{// width:100%}#headerLinks{padding:10px 0 7px;min-width:240px;float:right!important}#headerLinks .headerLinksContainer{margin-right:10px}#headerLinks .headerLinksContainer>[class*="span"]{float:left;margin-left:15px}#headerLinks .headerLinksContainer .dropdown.open .dropdown-toggle{background:transparent}#headerLinks .headerLinksContainer ul.dropdown-menu{top:30px}#headerLinks .headerLinksContainer ul.dropdown-menu:after,#headerLinks .headerLinksContainer ul.dropdown-menu:before{right:15px;left:auto}#headerLinks .headerLinksContainer>span a img,#headerLinks .headerLinksContainer>span a.userName{color:#fff;cursor:pointer;text-decoration:none!important}#headerLinks .headerLinksContainer>span a img .caret,#headerLinks .headerLinksContainer>span a.userName .caret{border-top:4px solid #fff}.dropdown-menu.pull-right{right:0;left:auto;cursor:pointer}.themeMenuContainer{min-width:110px;width:110px;left:-84px!important;padding:10px 0}.themeMenuContainer .themeMenu{padding:0 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement{cursor:pointer;margin:5px;height:20px;width:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement:hover{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}.themeMenuContainer .themeMenu .themeSelected{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}@media screen and (min-width:1161px){#mediumNav,#shortNav,#headerLinksCompact{display:none}#largeNav{margin-left:10px;margin-right:0}}@media screen and (max-width:1160px) and (min-width:960px){.companyLogo{width:100%}.customFilterMainSpan .select2-container{width:300px!important}*{zoom:1!important}}@media screen and (max-width:960px){.bodyContents{margin:0!important}#centerPanel{width:100%!important}.col-md-3#headerLinks{padding:5px 5px 0}.menuBar .col-md-9,.col-md-3#headerLinks{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-width:80px}.menuBar .col-md-9 .qCreate,.col-md-3#headerLinks .qCreate{display:inline-block;margin:0}.menuBar .col-md-9 .qCreate img,.col-md-3#headerLinks .qCreate img{margin-bottom:3px;margin-right:5px}.menuBar .col-md-9 .qCreate ul li.title,.col-md-3#headerLinks .qCreate ul li.title{padding:5px 0 0 15px}.menuBar .col-md-9 li.tabs:first-child>a,.col-md-3#headerLinks li.tabs:first-child>a{padding:10px 12px 9px}.customFilterMainSpan .select2-container{width:300px!important}#quickCreateModules{width:100%!important;padding:0!important}.CompactQC{max-height:300px;overflow-y:scroll;overflow-x:hidden}.CompactQC a:hover{text-decoration:none}}.commonActionsContainer .quickActions{height:3em}.commonActionsContainer .quickActions img{height:60%;margin:40% auto}.commonActionsContainer .quickActions #companyLogo-container img{height:98%;margin:0 auto}.commonActionsContainer .actionsContainer{background:#f3f3f3}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown{min-width:715px;top:28px;margin:0;padding-top:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a{padding:2px;border:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mainContainer{min-height:500px;margin-top:103px;background:#eeeff2;min-width:1200px}.mainContainer>.col-md-2{// padding:0 1.06383%;height:auto!important;// min-width:174px}.mainContainer .contentsDiv{min-height:500px;background:#fafafb;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;border-left:1px solid #e6e6e6;position:relative}.mainContainer #leftPanel{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.toggleButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;left:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-left:0;display:inline-block}.toggleButton .glyphicon-chevron-left{background-position:-434px -72px!important}.toggleButton .glyphicon-chevron-right{background-position:-460px -72px!important}.toggleRightPanelButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;right:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-right:0;display:inline-block}.quickLinksDiv{margin:10px 0}.quickLinksDiv p{font-size:1.2em;padding:3% 0 0 6%;height:40px;cursor:pointer;box-shadow:0 0 0 1px #ddd;border-top:1px solid #fff!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);position:relative;border-radius:2px}.quickLinksDiv p a{color:#2b2b2b}.quickLinksDiv p a:hover{text-decoration:none}.quickLinksDiv p.selectedQuickLink{background-color:#2a2f35;background-image:-moz-linear-gradient(top,#2a2f35,#2a2f35);background-image:-ms-linear-gradient(top,#2a2f35,#2a2f35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#2a2f35),to(#2a2f35));background-image:-webkit-linear-gradient(top,#2a2f35,#2a2f35);background-image:-o-linear-gradient(top,#2a2f35,#2a2f35);background-image:linear-gradient(top,#2a2f35,#2a2f35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2a2f35',endColorstr='#2a2f35',GradientType=0);border-color:#2a2f35 #2a2f35 #08090a;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);background-image:none;position:relative;border:1px solid #fff;box-shadow:4px 0 3px -4px #000 inset}.quickLinksDiv p.selectedQuickLink a{color:#fff}.quickLinksDiv p.selectedQuickLink a:after{border-bottom:19px solid rgba(0,0,0,0);border-left:10px solid #2a2f35;border-top:19px solid rgba(0,0,0,0);content:" ";display:inline-block;position:absolute;left:100%;top:0}.quickWidgetContainer li a{overflow:hidden;white-space:normal;padding:5px;margin:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.quickWidgetContainer .quickWidget{margin-bottom:10px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.sidebarTitleBlock{padding:12px 0}.sidebarTitleBlock a{color:#373737!important}.sidebarTitleBlock a:hover{text-decoration:none}#selectAllMsgDiv,#deSelectAllMsgDiv{display:none;background-color:#fafad2;padding:.01%;text-align:center}.blockUI form,#globalmodal form{margin:0}.dashboardHeading h2{padding-bottom:8px}.dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardHeading .dropdown-menu{left:-70px;right:0}.dashboardContainer{padding:0}.dashboardContainer .dashboardHeading{padding:10px 0 0;background:#f5f5f5}.dashboardContainer .dashboardHeading h2{padding:0 0 8px 20px}.dashboardContainer .dashboardHeading .btn-toolbar{padding:3px 20px 0 0}.dashboardContainer .dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardContainer .dashboardHeading .dropdown-menu{left:-82px}.widgetsList{max-height:400px;overflow-y:auto;overflow-x:hidden}.widgetsList li{display:block}.widgetsList li a{white-space:normal;word-wrap:break-word}.dashboard_notebookWidget_view .row{margin-bottom:5px}.gridster{margin-left:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.gridster ul{width:auto;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:460px}.gridster ul{list-style:none}.gridster ul li.dashboardWidget{background:#fff;border-radius:1px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.gridster ul li.dashboardWidget .dashboardWidgetHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd;color:#444;cursor:move;padding:5px}.gridster ul li.dashboardWidget .dashboardWidgetHeader table{height:28px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .dashboardTitle{text-align:left;padding-left:10px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .widgeticons{opacity:.5;padding-right:6px}.gridster ul li.dashboardWidget .filterContainer{position:absolute;border:1px solid #ddd;background:#fff;margin-left:-7px;margin-right:3px;margin-top:4px;padding:8px 0;border-radius:0 0 5px 5px;box-shadow:0 5px 8px -5px #888}.gridster ul li.dashboardWidget .filterContainer div span{margin-top:6px}.gridster ul li.dashboardWidget .filterContainer .col-md-5{margin-top:3px}.gridster ul li.dashboardWidget .dashboardWidgetContent{padding:10px 0;line-height:20px}.gridster ul li.dashboardWidget .dashboardWidgetContent .dashboard_notebookWidget_viewarea{height:200px}.gridster ul li.dashboardWidget .widgeticons{min-width:50px;height:30px;margin-right:30px}.gridster ul li.dashboardWidget .widgeticons a{cursor:pointer;text-decoration:none}.gridster ul .widgetChartContainer{margin-left:10px}.listViewPageDiv{margin:11px 0}.customFilterMainSpan{width:100%}.customFilterMainSpan .select2-container{width:95%!important}.select2-container .select2-choice{border-radius:2px;background:#fff;border-color:#ddd;font-size:14px;letter-spacing:.01em;color:#2b2b2b}.select2-container .select2-choice div{border-radius:0;border-left:0;background:#fff}.select2-drop{border-color:#ddd}.select2-dropdown ul.filterActions{list-style:none!important;padding-left:15px}.select2-dropdown ul.filterActions li{cursor:pointer}.ui-autocomplete .ui-menu-item #ui-active-menuitem{background:#404952;border-radius:0}li.ui-timepicker-selected,.ui-timepicker-list li:hover,.ui-timepicker-list:hover .ui-timepicker-selected:hover{background:#404952}#relatedTabOrder .select2-input{min-width:200px}.alphabetSorting .alphabetSearch a{vertical-align:middle;display:inline-block;margin-bottom:2px}.alphabetSorting .alphabetSearch:hover{background:#eeeff2}.listViewActions .settingsIcon{display:inline-block;margin-left:5px}.listViewActions>.btn-group{min-width:105px}#listViewPageJumpDropDown,#relatedListPageJumpDropDown{left:-60px}.pageNumbers{display:inline-block;margin-right:5px;margin-top:6px;vertical-align:top}.pageNumbers .totalNumberOfRecords{margin:0 5px}.contents-topscroll,#reportDetails{overflow-x:auto!important;overflow-y:visible}.contents-bottomscroll{overflow-x:auto!important}.bottomscroll-div,.topscroll-div{display:table;min-width:100%}.listViewLoadingImageBlock{background:0;border-radius:0;box-shadow:none;text-align:center}.detailViewContainer{padding:0 20px}.userPreferences .contents{padding-left:0!important}.userPreferences .details{border-right:0!important}.detailViewTitle{padding:1% 0 0 1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .recordLabel{font-size:16px;font-weight:bold}.detailViewTitle .detailViewButtoncontainer{margin-top:8px}.detailViewTitle .detailViewPagingButton{margin-top:8px;padding-right:10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .btn-toolbar{margin:0}.detailview-table th,.detailview-table td{vertical-align:middle}.detailview-table th label,.detailview-table td label{margin-bottom:3px}.detailViewInfo{box-shadow:0 -4px 4px -4px #959595;margin-top:5px}.detailViewInfo .details{// min-height:600px;padding-right:1.5%;border-right:4px solid #404952;padding-bottom:10px;padding-top:10px}.detailViewInfo .related .nav-pills .active>a,.detailViewInfo .related .nav-pills .active>a:hover{background:#404952;border-radius:1px;margin-top:0;margin-bottom:2px}.fieldLabel{width:20%;background:#f7f7f9}.fieldLabel label.marginRight10px{text-align:right}.summaryView{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.summaryView .summary-table tr.summaryViewEntries:last-child .fieldValue,.summaryView .summary-table tr.summaryViewEntries:last-child .fieldLabel{border-bottom:1px solid #ddd}.summaryView .summaryViewEntries .fieldLabel{vertical-align:top;padding:5px 0 5px 5%;border-top:1px solid #ddd;border-right:1px solid #ddd}.summaryView .summaryViewEntries .fieldValue{vertical-align:top;padding:5px 0 5px 5px;border-top:1px solid #ddd}.summaryView .summaryViewEntries:hover .summaryViewEdit{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryView .summaryViewEntries .summaryViewEdit{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryView .toggleViewByMode{margin:8px 0;padding-right:0}.summaryView .toggleViewByMode .changeDetailViewMode{white-space:normal!important}.summaryWidgetContainer{border-radius:2px;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border:1px solid #eaeaea;background:#fff;margin-bottom:10px;padding:15px}.commentContainer .commentTitle{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;margin-bottom:10px}.commentContainer .commentTitle textarea{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordDetails .squeezedWell{padding:3% 0;min-height:105px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordEditView .contentHeader{padding:.5% 0 1% 0}.recordEditView .table .fieldLabel,.recordEditView .table .fieldValue{vertical-align:middle}.recordEditView .table tbody tr:hover td,.recordEditView .table tbody tr:hover th{background:#f7f7f9}.commentContainer{border-radius:2px}.commentContainer hr{margin:0!important}.commentContainer .addCommentBlock .commentsControls{display:inline-block}.commentContainer .commentsList>.liStyleNone>.commentDetails .commentDiv{width:100%}.commentContainer .commentDetails{background:#fff;border:1px solid #ddd;margin-bottom:5px;border-radius:2px;padding:10px 10px 5px;display:inline-block;min-width:354px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentContainer .commentorInfo p{margin-bottom:0}.commentContainer .addCommentBlock{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border:1px solid #ddd;padding:12px 12px 5px;min-height:115px;margin-top:15px;display:block}.commentContainer .addCommentBlock .commentcontent{padding:8px!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;resize:none}.commentContainer .commentInfoContent{padding:1px 0;word-wrap:break-word}.commentTitle .col-md-1{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentTitle .col-md-1 img{width:32px;height:32px}.commentsList>ul{margin-left:0}.singleComment .editedStatus{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:5px 0 5px 32px}.singleComment .editedStatus p{margin-bottom:0}.singleComment .commentActionsDiv{display:none}.singleComment .commentActionsDiv p{margin-bottom:0}.singleComment:hover .commentActionsDiv{display:block;margin-bottom:3px}.recentComments{margin:0;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recentComments .commentDiv{min-width:100%}.recentComments .addCommentBlock{border:0;margin-top:0;display:block}.recentComments .commentDetails{display:block}.singleComment:hover .commentActions .replyComment{display:inline-block}.commentActionsContainer a:hover{text-decoration:none}.commentActionsContainer .editStatus{padding:5px 2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentActionsContainer .editStatus p{margin-bottom:0}.table{background:#fff}.table-bordered{border-radius:1px;margin-bottom:0}.table-bordered th{border-top:1px solid #fff!important}.table th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;color:#444}.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td,.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td{border-left:0;border-right:0}.listViewEntriesTable tbody tr td:first-child{border-left:0 none}.equalSplit td:nth-child(odd){width:20%}.equalSplit td:nth-child(even){width:30%}td.fieldValue input,td.fieldValue .input-group{margin-bottom:0}.actionImage,.actionImages{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.listViewHeaders a{color:#444}.listViewEntriesDiv .listViewHeaders th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd}.listViewEntriesDiv,.listViewEntriesDiv td{overflow:visible}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues{color:#444}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues:hover{text-decoration:none}.listViewEntriesTable td.listViewEntryValue,.listViewEntries td{vertical-align:middle;cursor:pointer;overflow:visible;padding:5px}.listViewEntriesTable td.listViewEntryValue:hover .actionImages,.listViewEntries td:hover .actionImages,.listViewEntriesTable td.listViewEntryValue:hover .actions,.listViewEntries td:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryViewEntries .summaryViewEdit,.activityStatus .editStatus,.activityDescription .editDescription,.addedCalendars .actionImage{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryViewEntries:hover .fieldValue .summaryViewEdit,.activityStatus:hover .editStatus,.activityDescription:hover .editDescription,.addedCalendars:hover .actionImage{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewEntriesTable tr:hover td .actions .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewBasicAction.dropdown-menu{width:100%}.listViewBasicAction.dropdown-menu input{border-radius:2px;height:24px;margin-bottom:0;margin-top:-2px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.emptyRecordsDiv{width:100%;border:1px solid #ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.emptyRecordsDiv td{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.CustomFilterViewTitle{padding-top:1%}#CustomView .filterActions{padding-bottom:20px;overflow:hidden}.filterConditionsDiv{padding-bottom:0}.conditionGroup .header{margin-bottom:20px;font-size:1.2em}.conditionGroup .contents .conditionRow{margin-bottom:10px}.conditionGroup .contents .conditionRow select,.conditionGroup .contents .conditionRow input{width:90%}.conditionGroup .contents .conditionRow .chzn-results li{line-height:20px}.conditionGroup .deleteCondition{vertical-align:bottom}.searchUIBasic{border-collapse:separate!important;border-spacing:10px!important;margin:0 10%}.searchUIBasic .importContents{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.searchUIBasic .listRow .listViewHeaders>td{color:#404952}.searchUIBasic .listRow .defaultInputTextContainer{max-width:87%!important;margin-bottom:0!important}#lineItemTab.table tr:first-child:hover th ~ td{background-color:#f3f3f4;background-image:-moz-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-ms-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f3f3f4),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-o-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:linear-gradient(top,#f3f3f4,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f4',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}#lineItemTab.table tr:nth-child(2):hover td{background:0}.lineItemTable tr td{width:0}.lineItemTable tr td div.finalDiscountUI,.lineItemTable tr td div.discountUI,.lineItemTable tr td div#shipping_handling_div,.lineItemTable tr td div.taxUI,.lineItemTable tr td div.finalTaxUI{border:2px solid #c4c4c4;border-radius:2px}.lineItemTable tr td div.finalDiscountUI table tr td,.lineItemTable tr td div.discountUI table tr td,.lineItemTable tr td div#shipping_handling_div table tr td,.lineItemTable tr td div.taxUI table tr td,.lineItemTable tr td div.finalTaxUI table tr td,.lineItemTable tr td div.finalDiscountUI table tr th,.lineItemTable tr td div.discountUI table tr th,.lineItemTable tr td div#shipping_handling_div table tr th,.lineItemTable tr td div.taxUI table tr th,.lineItemTable tr td div.finalTaxUI table tr th{border-left:0}.lineItemTable tr:hover td{width:0}.lineItemTable tr:hover td div.finalDiscountUI table tr td{background:none!important}.lineItemTable tr:hover td div.discountUI table tr td{background:none!important}.lineItemTable tr:hover td div#shipping_handling_div table tr td{background:none!important}.lineItemTable tr:hover td span.taxDivContainer div table tr td{background:none!important}.lineItemTable tr:hover td div.finalTaxUI table tr td{background:none!important}.lineItemResult{width:70.5%!important}.lineItemResult a:hover{color:#404952}.lineItemInputBox{width:45%;float:right;text-align:right}.discountUI,.taxUI,.finalDiscountUI,.finalTaxUI,#shipping_handling_div{position:absolute;left:46%;width:30%;z-index:500;box-shadow:1px 0 7px #ddd;border-radius:6px}.discountUI table.table,.taxUI table.table,.finalDiscountUI table.table,.finalTaxUI table.table,#shipping_handling_div table.table{margin-bottom:0}.discountUI .table tbody tr:first-child th:first-child,.taxUI .table tbody tr:first-child th:first-child,.finalDiscountUI .table tbody tr:first-child th:first-child,.finalTaxUI .table tbody tr:first-child th:first-child,#shipping_handling_div .table tbody tr:first-child th:first-child{border-radius:4px 0 0 0!important}.discountUI .table tbody tr:first-child th:last-child,.taxUI .table tbody tr:first-child th:last-child,.finalDiscountUI .table tbody tr:first-child th:last-child,.finalTaxUI .table tbody tr:first-child th:last-child,#shipping_handling_div .table tbody tr:first-child th:last-child{border-radius:0 4px 0 0!important}.LineItemDirectPriceReduction{width:65%!important}th.htColHeader,.handsontable thead th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd;padding:6px 2px}.contentHeader{padding:15px;padding-left:5px;line-height:20px}.contentsDiv>div{padding:0 20px}#settingsQuickWidgetContainer .widgetContainer.accordion-body{border-bottom:none!important;border-bottom:3px solid #ddd}#settingsQuickWidgetContainer .widgetContainer.accordion-body>div:hover{background:#eeeff2}#settingsShortCutsContainer{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:1% 3%}#settingsShortCutsContainer .moduleBlock{min-height:60px}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin{display:inline-block;opacity:.4}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin:hover{opacity:.8}.settingsIndexPage .settingsSummary{text-align:center;margin-top:10px}.settingsIndexPage .settingsSummary a{display:inline-block;background:#f3f3f4;color:#444;border-radius:2px;min-width:200px;padding:20px 0 10px;border:1px solid #ddd}.settingsIndexPage .settingsSummary a .summaryText{display:inline-block;margin-top:20px;font-size:15px}.settingsIndexPage .settingsSummary a:hover .summaryText,.settingsIndexPage .settingsSummary a:hover .summaryCount{color:#404952}.settingsIndexPage .moduleBlock h5{font-size:1.2em;margin-bottom:5px}.settingsIndexPage .moduleBlock:hover{background:#f3f3f4}#userPageHeader{padding:8px 0 0}#userPageHeader #userHeading h3{margin-top:10px}.treeView li{border-left:4px solid #ddd;list-style:none;padding-top:15px}.treeView li .toolbar-handle{margin-left:10px;position:relative}.treeView li .toolbar-handle .btn{margin:0}.treeView li .toolbar-handle a:before{background:none repeat scroll 0 0 #ddd;content:" ";display:inline-block;height:4px;left:-10px;position:absolute;top:12px;width:10px}.treeView .btn{margin-bottom:10px}.profilesEditView tr.blockHeader th{text-align:center}.profilesEditView tr.blockHeader th:first-child{text-align:left}.profilesEditView input{margin-right:5px}.profilesEditView tr td.row table.table{border-left:none;margin-bottom:20px}.profilesEditView tr:hover td.row{background:0}.profilesEditView tr:hover td.row table.table tr td{background:0}.profilesEditView tr:hover td.row table.table tr:hover td{background:0}.profilesEditView tr:hover td.row table.table td{background:#f3f3f4}#s2id_memberList li>div,.groupMembersColors li>div{margin-left:10px}#s2id_memberList .Users,.groupMembersColors .Users{background-color:#f99984!important;padding:5px;margin-bottom:2px;background-image:none}#s2id_memberList .Groups,.groupMembersColors .Groups{background-color:#acd5ff!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .Roles,.groupMembersColors .Roles{background-color:#ffec98!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .RoleAndSubordinates,.groupMembersColors .RoleAndSubordinates{background-color:#c4dea2!important;background-image:none;padding:5px;margin-bottom:2px}.collectiveGroupMembers{border:1px solid #ddd;border-top:0}.collectiveGroupMembers ul{padding:0;margin:0}.collectiveGroupMembers ul li{padding:4px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.collectiveGroupMembers ul li a{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;margin:0}.collectiveGroupMembers ul li.groupLabel{background-color:#f3f3f4;border-bottom:1px solid #ddd;border-top:1px solid #ddd;padding:10px 5px;margin:0;color:#444}.mini-slider-control{width:50px}.mini-slider-control+div{margin-left:15px}.mini-slider-control .ui-slider-handle{border:0;border-radius:50%;height:16px;top:-2px;width:16px;cursor:pointer}.mini-slider-control .ui-slider-handle:focus{outline:0}.ui-widget-content{border-radius:6px;border-color:#fff;box-shadow:0 0 3px -1px inset;margin-top:2px;margin-left:5px;height:12px}.ui-slider-disabled{opacity:.5;border-color:#ddd;box-shadow:none;cursor:not-allowed}.ui-slider-disabled .ui-slider-handle{cursor:not-allowed}.ui-slider-disabled+div{opacity:.5;cursor:not-allowed}.mini-slider-control[data-value="0"] .ui-slider-handle{background:#7d7e7d;background:-moz-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#7d7e7d),color-stop(100%,#0e0e0e));background:-webkit-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-o-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-ms-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:linear-gradient(to bottom,#7d7e7d 0,#0e0e0e 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7d7e7d',endColorstr='#0e0e0e',GradientType=0)}.mini-slider-control[data-value="1"] .ui-slider-handle{background:#ffb76b;background:-moz-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ffb76b),color-stop(0%,#ffa73d),color-stop(49%,#ff7c00),color-stop(100%,#ff7f04));background:-webkit-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-o-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-ms-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:linear-gradient(to bottom,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffb76b',endColorstr='#ff7f04',GradientType=0)}.mini-slider-control[data-value="2"] .ui-slider-handle{background:#bfd255;background:-moz-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#bfd255),color-stop(79%,#8eb92a),color-stop(100%,#72aa00),color-stop(100%,#9ecb2d));background:-webkit-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-o-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-ms-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:linear-gradient(to bottom,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bfd255',endColorstr='#9ecb2d',GradientType=0)}#moduleManagerContents{padding-bottom:10px}#moduleManagerContents .moduleManagerBlock .btn-group.open .dropdown-menu{left:-144%}#moduleManagerContents .modulesTable td{width:50%}#importModules .contents .row{margin-bottom:2.2%}.extensionWidgetContainer{background-color:#fff;border:1px solid #ddd;min-height:200px;padding:2%;background:#fafafa;box-shadow:0 0 10px -4px #777}.extensionWidgetContainer .extension_contents{margin-top:2%;background:#fff;padding:10px;box-sizing:border-box;max-height:160px}.extension_contents:hover{border-radius:4px}.thumbnailImage{height:130px;width:130px;float:right}.extensionWidgetContainer .extension_contents .slimScrollDiv{padding-right:10px}.extensionWidgetContainer .extension_header .font-x-x-large{font-size:1.5em;padding-left:3px;font-weight:bold;color:#404952}.extensionWidgetContainer .extensionDescription{line-height:20px}.extensionWidgetContainer .extensionInfo{padding-top:5px}.extensionWidgetContainer .extensionInfo .rating,.extensionDetails .rating{vertical-align:middle;margin-top:2px;display:inline-block}.extensionDetails .authorInfo{margin:3px 0}.extensionDetails .extensionDetailActions{padding:15px 0}.extensionWidgetContainer .tab-pane .bx-wrapper .imageSlider{margin:0}.sliderImage{width:90%;height:360px}.opacity .actions{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.opacity:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.sharingAccessDetails{margin-bottom:30px}.sharingAccessDetails td,.sharingAccessDetails th{text-align:center;vertical-align:middle!important}.sharingAccessDetails tr td:first-child,.sharingAccessDetails tr th:first-child{text-align:left}.sharingAccessDetails td.row>div{display:block}.sharingAccessDetails .customRuleContainer:hover{background:0}.sharingAccessDetails hr{border-bottom:1px solid #bcbcbc}.sharingAccessDetails .title{padding:1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.sharingAccessDetails .title .rulehead{padding-top:5px}.sharingAccessDetails .customRuleEntries:hover .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.layoutContent{border-top:4px solid #404952}.layoutContent #moduleBlocks .editFieldsTable{margin-bottom:20px}.layoutContent #moduleBlocks .editFieldsTable .fieldLabel{background:0}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockLabel{padding-top:13px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group{margin-top:5px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group .dropdown-menu{left:-100%}.layoutContent .relatedTabModulesList{padding:2% 1%}.fieldDetailsForm .search-choice-close{padding:0}.border1px{border:1px solid #ddd}.blockFieldsList .opacity{margin-left:.5%!important}.blockFieldsList .opacity .dropdown-menu a{padding:0!important}.blockFieldsList .opacity a.dropdown-toggle.editFieldDetails{box-shadow:none}.blockFieldsList .editFields .dropdown-menu{z-index:1000003;padding:0;left:-215px;position:absolute}.blockFieldsList .editFieldsWidget .dropdown-menu{z-index:1000003;padding:0;left:-315px;position:absolute}.blockFieldsList .editFields .dropdown-menu .modal-header{border-width:0;border-bottom-width:1px}.blockFieldsList .editFields .dropdown-menu .modal-header .cancel{padding-right:0;font-weight:bold}.blockFieldsList .editFields:hover{background:#f3f3f4!important}#modulePickListValuesContainer .layoutContent{padding-left:2%}#modulePickListValuesContainer .layoutContent .selectedCell,#modulePickListValuesContainer .layoutContent .selectedListItem{background:#a5afb9;white-space:nowrap}#modulePickListValuesContainer .layoutContent .pickListValue{cursor:pointer}.nonEditableValuesDiv .nonEditablePicklistValues{margin-left:0}.nonEditableValuesDiv .nonEditablePicklistValues li{padding:3px 15px;margin-bottom:2px;background:#e0f2ff}.popover{z-index:1000023!important}.popover-content .fieldLabel{width:35%;white-space:normal}#dependencyGraph .tableHeading{text-align:center;padding-top:30px;font-size:1.2em;font-weight:bold}#dependencyGraph .depandencyTable{border:1px solid #ddd;background:#f3f3f4}#dependencyGraph .depandencyTable .blockHeader{border-bottom:1px solid #ddd}#dependencyGraph .depandencyTable .picklistValueMapping{border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping{text-align:center;border-left:1px solid #ddd;border-right:1px solid #ddd;background:#fff}#dependencyGraph .dependencyMapping .mCSB_container{margin-bottom:16px!important}#dependencyGraph .dependencyMapping .pickListDependencyTable{border:0}#dependencyGraph .dependencyMapping .pickListDependencyTable .blockHeader th{background:#f3f3f4;border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping .pickListDependencyTable .selectedCell{background:#a5afb9}.webformFieldInfo{margin-bottom:250px}.targetFieldsTableContainer input[type="text"]{min-width:100px}#customRecordNumbering.table thead th{vertical-align:middle}.addMailBoxBlock{margin-left:83px;padding:0!important;font-size:12px}.addMailBoxStep{background:#fff;padding:30px 0;border:1px solid #ddd;border-radius:1px;min-height:170px}.mailConveterDesc{height:350px;width:96%;border:1.5px solid;border-radius:2px;border-color:#ddd;font-size:11pt;margin-top:55px;margin-left:20px;background:#fff}#mailBoxLabel{margin-top:15px;margin-left:-18px;font-size:12pt;width:75px}.mailBoxDropdownWrapper{height:49px;width:70%;background:url('../images/mailbox-icon.png') no-repeat 5px 5px;overflow:hidden;border:1px solid #ddd}.mailBoxDropdown{background:transparent url('../images/downArrowBlue.png') no-repeat 236px 13px;width:110%;height:50px;font-size:14pt;color:#0065a6;padding:10px 55px;padding-right:0}#mailConverterDragIcon{margin-top:12px}#mailConverterBody{padding-top:20px;margin-left:0}.ruleHead{padding:6px 0;background:#d8d8dc}.mailConverterRuleBlock{font-size:14px;line-height:30px;border:1.5px solid;border-color:#ddd}.mailConverterRuleLegend{font-size:14px;color:#0065a6;margin-bottom:10px;background:#f3f3f4}#mailConverterStats{font-size:10pt;margin-top:5px;margin-left:-10px}.addMailBoxBlock{border-color:#ddd;margin-left:83px;margin-top:20px;padding-top:30px;padding-left:200px;padding-bottom:20px;padding-right:30px;font-size:11pt}.taskTypeUi>.row{margin:10px 0}#taskListContainer .listViewEntriesTable tr td:last-child{border-left:1px solid #ddd}#workflow_step2>.row{padding:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:400px}#open_email_con .detailViewTitle{padding:0}#open_email_con .detailViewTitle .detailViewPagingButton{margin-top:0;padding-right:0}#foldersList .list-group{padding-right:0}.massEditTable th+th,.massEditTable td+td,.massEditTable th+td,.massEditTable td+th{border-left:0}.nav.massEditTabs{margin-bottom:0;border-bottom:0}.nav.massEditTabs li.active a{background:#404952;color:#fff;margin-left:10px}.nav.massEditTabs li a:hover{border-bottom:1px solid #404952}.massEditContent{border-top:3px solid #404952}.calendarSettingsContainer{width:700px}.calendarSettingsContainer .control-label{width:26%}#calendarSettings{margin:1px 0 3px}.calendarMassEdit{min-width:400px}.fc-state-default .fc-button-effect{top:100%!important}.fc-event-style1,.fc-event-style1 .fc-event-skin{background:#17309a;border-color:#17309a;font-weight:normal;text-shadow:none}.fc-event-style2,.fc-event-style2 .fc-event-skin{background:#3a87ad;border-color:#3a87ad;font-weight:normal;text-shadow:none}.fc-event-style3,.fc-event-style3 .fc-event-skin{background:#aa6705;border-color:#aa6705;font-weight:normal;text-shadow:none}.fc-event-style4,.fc-event-style4 .fc-event-skin{background:#953b39;border-color:#953b39;font-weight:normal;text-shadow:none}.fc-event-style5,.fc-event-style5 .fc-event-skin{background:#545252;border-color:#545252;font-weight:normal;text-shadow:none}.fc-event-style6,.fc-event-style6 .fc-event-skin{background:#87865d;border-color:#87865d;font-weight:normal;text-shadow:none}.fc-event-style7,.fc-event-style7 .fc-event-calendarMassEditskin{background:#c71585;border-color:#c71585;font-weight:normal;text-shadow:none}.fc-event-style8,.fc-event-style8 .fc-event-skin{background:#006400;border-color:#006400;font-weight:normal;text-shadow:none}#calendarview th{color:#000}.fc-agenda-divider+div{overflow-y:visible!important}.fc-button{display:inline-block;padding:6px .4em!important;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.fc-button:active .fc-button-inner{background:transparent}.fc-button:active .fc-button-inner .fc-button-content{color:#fff}.fc-button.fc-state-active .fc-button-inner .fc-button-content,.fc-button:active .fc-button-inner .fc-button-content{color:#000!important;background:transparent;background-image:none}.fc-header-title h2{font-size:15px;line-height:20px}.fc-widget-header th{padding:4px 0!important}.fc-widget-header{color:#666;background:#eee;border-color:#ccc}.fc-content{background:#fff;margin-top:15px}.fc-content td:hover{background:#f3f3f3}.btn:focus{outline:0}.reminderPostpone.btn-primary{background:#404952}.reminderPostpone.btn-primary:hover{background:#1e2327}.saveButton{margin-right:5px}.addCustomRule{float:right}.importMore{background:#fff}.lastImport{background:#fff}.undoImport{background:#da4f49}.close{border:0;background:none repeat scroll 0 0 transparent;border:0 none;cursor:pointer}.resetButton{margin-top:0!important}.vtGlyph{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("../images/vtGlyph.png");background-position:0 0;background-repeat:no-repeat;*margin-right:.3em}.vticon-pageJump{background-position:0 0}.vticon-call-inbound{background-position:-14px 0}.vticon-call-outbound{background-position:-28px 0}#massEdit .cancelLinkContainer{padding:5px 0;margin-left:.5em}.ui-pnotify{z-index:1000023}.feedback{z-index:10002}.feedback .handle{z-index:10003;display:block;position:fixed;bottom:50px;left:-30px;left:0\9;bottom:100px\9;background:#2c2c2c;color:white;padding:7px 15px;border:1px solid gray;text-decoration:none;outline:0;-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-o-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg);-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.00000000, M12=1.00000000, M21=-1.00000000, M22=0.00000000,sizingMethod='auto expand')";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0,M12=1,M21=-1,M22=0,sizingMethod='auto expand')}.feedback .handle:hover{text-decoration:none}.vtFooter{text-align:center}.vtFooter p{background:#404952;color:#fff;border-top:1px solid #ddd;padding:1px 0;font-size:.9em;margin-bottom:0}.vtFooter p a{color:#fff}.imageHolder{background:url('../images/loadback.png') repeat-y;background-position:center;padding:10px 0}.breadcrumbContainer{padding:2% 2% 0 2%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;height:auto}.breadcrumb{display:inline-block;height:auto;height:40px}.crumbs{height:40px;margin:0;padding:0 20px 0 0;display:inline-block;font-family:sans-serif}.crumbs li:after{content:'\0000a0';width:0;height:0;border-left:18px solid #ececec;border-top:20px solid transparent;border-bottom:20px solid transparent;display:inline-block;position:relative;top:-20px;left:18px;zoom:1}.crumbs li{height:0;border-top:20px solid #ececec;border-bottom:20px solid #ececec;border-left:20px solid transparent;display:inline-block;box-shadow:0 1px #ddd;margin-right:5px}.crumbs li a{display:inline-block;float:left;margin-top:-13px;font-size:14px;font-weight:bold;color:#666;text-decoration:none}.crumbs li.active{height:0;border-top:20px solid #404952;border-bottom:20px solid #404952;box-shadow:0 1px #404952}.crumbs li.active:after{border-left:18px solid #404952!important}.stepText{display:inline-block;white-space:nowrap;overflow:hidden;font-size:13px;vertical-align:bottom}.active .stepText,.active .stepNum{color:#fff}.stepNum{display:inline-block;padding:0 5px;overflow:hidden;font-size:20px;vertical-align:top;margin-top:5px}.greyStar{background-image:url("../images/stars.png");background-position:20px 20px;height:20px;width:20px;display:inline-block}.yellowStar{background-image:url('../images/stars.png');background-position:0 20px;width:20px;height:20px;display:inline-block}.blockUI{border-radius:2px!important;border:0!important}textarea.col-md-11{width:100%!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.popover .popover-inner{border-radius:2px;font-size:.8em;box-shadow:0}.popover .popover-inner .popover-title{color:#444;font-size:15px}.popover .popover-inner .close{color:#000!important;margin-top:3px;opacity:.5!important}.popover .popover-inner .close:hover{opacity:1!important}.popover .popover-inner td{padding:3px 5px;overflow-wrap:break-word}.popover .popover-inner .detailViewInfo{margin-top:0;box-shadow:0}.popover .popover-inner .detailViewInfo .fieldLabel label{font-size:1em}#findDuplicate>.control-group{margin-bottom:0;width:400px}#moveReports .modal-body{padding:20px 40px}#composeEmailContainer{padding:0 20px}#composeEmailContainer .MultiFile-wrap{display:inline-block}#composeEmailContainer .MultiFile-intercepted .ui-wrapper{min-height:400px}#transferOwnershipContainer .select2-container.select2-container-multi{max-width:220px}.fieldInfo.in{overflow:visible!important;height:auto!important}.moduleSelection{border-radius:2px 2px 0 0!important;border:1px solid #ddd!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);color:#444}.convertLeadModules{margin-bottom:2%;border:1px none}.moduleBlock{border-radius:0!important}.overflowVisible{overflow:visible!important}.convertLeadError{border:3px solid #999;background-color:#fff;width:55%;position:relative;z-index:10000000}.convertLeadError table td{border-bottom:1px solid #ccc;nowrap:nowrap;width:70%}.bootbox,.alert{z-index:1000023}.chzn-container{vertical-align:middle}.chzn-container .chzn-results li{margin-right:7px}.chzn-container .chzn-results .highlighted{background:#404952}.select2-results .select2-highlighted{background:#404952}.select2-result-label i{background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.ui-autocomplete-loading{background:url('../images/load.gif') no-repeat right center}.ui-autocomplete{height:auto!important;border-radius:1px!important}.dropdown-menu.pull-right:after,.dropdown-menu.pull-right:before{right:3px;left:auto;top:-5px;border-bottom-width:6px}span.wrapper a{color:#08c!important;font-size:15px!important;font-weight:bold}a{color:#353c44}a:hover{color:#1e2327;text-decoration:none;cursor:pointer}a:active,a:focus{outline:0}.well{border-radius:2px;padding:15px}.verticalBottomSpacing{margin-bottom:10px}.mergeTables{margin-bottom:0}.font-x-x-large{font-size:18px;line-height:28px}form{margin:0}.fc-state-default .fc-button-effect span{background:0}.dateField{width:183px}.form-horizontal [class^="icon-"],.form-horizontal [class*=" icon-"]{vertical-align:baseline}.timePicker{width:8.5em!important;z-index:1000029!important}.datepicker{z-index:1000029!important}.colorpicker{z-index:1029!important}.colorpicker input{width:30px!important}.colorpicker input[type="text"],.colorpicker input{color:#898989!important}.colorpicker_hex input{width:45px!important}.modal-body.accordion{margin-bottom:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}//.modal-open{// overflow:hidden;//}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.removeNoFileChosen{color:transparent!important}.modelContainer .modal-header{border-radius:2px 2px 0 0}.modelContainer form{border-radius:0 0 2px 2px}.hide{display:none}i{cursor:pointer;text-decoration:none!important}.marginbottomZero{margin-bottom:0!important}.marginLeftZero{margin-left:0!important}.marginRightZero{margin-right:0!important}.clearfix{clear:both!important}textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%}.textOverflowEllipsis{overflow:hidden;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;//width:9em}.margin0px{margin:0!important}.padding10{padding:10px;padding-bottom:0}.padding20{padding:20px}.pushDown{margin-top:5px}.boxSizingBorderBox{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.boxSizingContentBox{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.cursorPointer{cursor:pointer;text-decoration:none!important}.zeroOpacity{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.dullOpacity{opacity:.8;-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80)}.fullOpacity{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.redColor{color:red}.highlightBackgroundColor{background:#eeeff2}.contentsBackground{background:#fff;border:1px solid #ddd}.textAlignCenter{text-align:center}.textAlignRight{text-align:right}.alignMiddle{vertical-align:middle}.alignTop{vertical-align:top}.padding1per{padding:1%}.paddingTop20{padding-top:20px}.padding20px{padding:20px}.padding-bottom1per{padding-bottom:1%}.marginBottom10px{margin-bottom:10px}.displayInlineBlock{display:inline-block}.backgroundImageNone{background-image:none}.liStyleNone{list-style:none outside none}.fontBold{font-weight:bold!important}.livesupport_tab,#userfeedback{display:none!important}#reportDetails table tr td.summary{border-bottom:0;border-top:0}#portalDetailViewHttpError{padding-bottom:7px;margin-top:50px;color:red;text-align:center}.slidesjs-pagination{list-style:none}.slidesjs-pagination li a{display:block;width:13px;height:0;padding-top:13px;background-image:url('../images/pagination.png');background-position:0 0;float:left;overflow:hidden}.slidesjs-pagination li a.active,.slidesjs-pagination li a:hover.active{background-position:0 -13px}.extensionStorebtn{background:#f08c39;background-image:-webkit-linear-gradient(top,#f08c39,#e68b3c);background-image:-moz-linear-gradient(top,#f08c39,#e68b3c);background-image:-ms-linear-gradient(top,#f08c39,#e68b3c);background-image:-o-linear-gradient(top,#f08c39,#e68b3c);background-image:linear-gradient(to bottom,#f08c39,#e68b3c);-webkit-border-radius:2;-moz-border-radius:2;border-radius:2px;text-shadow:0 0 1px #595959;color:#fff;font-size:14px;font-weight:bold;padding:8px 20px 8px 20px;text-decoration:none;border:0}.extensionStorebtn:hover{background:#fc9f3c;background-image:-webkit-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-moz-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-ms-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-o-linear-gradient(top,#fc9f3c,#f08a3c);background-image:linear-gradient(to bottom,#fc9f3c,#f08a3c);text-decoration:none}.extensionSearch{padding:8px 12px 8px 30px!important;margin:6px 0 14px 0;box-shadow:inset 2px 2px 10px #ddd;border-radius:2px!important;background:url('../images/search.png') no-repeat;background-position:5px 6px}.banner-container{border-bottom:1px solid #fff;box-sizing:border-box}.banner{margin:0 90px}.bx-wrapper{margin:0 auto 35px!important;padding-top:17px!important}.bx-wrapper li a{display:block}.bx-wrapper a img{height:100px;width:auto;margin:0 auto}.wide,.table td.wide,.listViewEntries td.wide,td.listViewEntryValue.wide{padding:8px!important}.medium,.table td.medium,.listViewEntries td.medium,td.listViewEntryValue.medium{padding:5px 6px!important}.narrow,.table td.narrow,.listViewEntries td.narrow,td.listViewEntryValue.narrow{padding:2px 4px!important}.table thead th.narrow{vertical-align:middle}td.listViewEntryValue .row input{padding:0;margin-bottom:0}.listViewContentDiv{position:relative}.fieldLabel .pull-right{text-align:right}#tagRecordText{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;width:80%!important}#tagRecord{margin-left:5px!important}.tag{float:right!important}.cut-string{text-overflow:ellipsis;-o-text-overflow:ellipsis;-webkit-text-overflow:ellipsis;width:200px;white-space:nowrap;overflow:hidden}.paddingLRZero{padding-left:0;padding-right:0}.paddingRightZero{padding-right:0}.detailViewToolbar{margin-top:5px}.input-group.input-group-sm>.input-group-addon img{width:15px}table tr td .input-sm{min-width:50px}.modal-footer.backgroundColor{background-color:#f5f5f5}.panel-title{font-size:14px}.quickWidgetContainer .panel-body{padding-bottom:0;padding-top:0}tr.summaryViewEntries,#detailView table{font-size:13px}table.listViewEntriesTable{font-size:13px;margin-top:5px}.no-margin{margin:0}.companyLogo img{max-height:200px;max-width:250px}.navbar-inverse .navbar-nav>li>a{color:#fff;padding:15px 12px}.navbar-inverse .navbar-nav .dropdown-menu>li>a{padding:3px 15px;font-size:12px}.headerCalendar .month h3{font-size:18px;font-weight:bold;margin:5px 0 0 0}.columnsSelect{width:100%!important}.marginBottom5{margin-bottom:5px}.editViewContainer .recordEditView table.blockContainer tr td.fieldValue{width:30%}.recordEditView[name=QuickCreate] .quickCreateContent table tr td.fieldValue,#massEditContainer .massEditContent table tr td.fieldValue,#tab_accounts td.functionList{width:30%}.btn{white-space:normal}.valuesAssignedToRole{border:1px solid #adadad;overflow:hidden;text-overflow:ellipsis;padding:6px}table.dataTable .form-control{width:100%!important}#breadcrumb .stepNum{margin-top:0}#breadcrumb .stepText{position:relative;top:-4px}.fc button{height:auto!important}.fc-toolbar{margin-bottom:0!important}.fc-center,.fc-left,.fc-right{margin-bottom:1em}.calendarRightPanel{padding-left:5px;padding-right:5px}.calendarRightPanel ul li{margin-bottom:2px;margin-left:5px}.calendarRightPanel ul li:hover{background-color:#eee!important;border-radius:5px}.square9{width:12px;height:12px;margin:4px}.panel-dark{border-color:#737373}.panel-dark>.panel-heading{color:#fff;background-color:#737373;border-color:#737373}.panel-dark>.panel-heading+.panel-collapse>.panel-body{border-top-color:#737373}.panel-dark>.panel-heading .badge{color:#737373;background-color:#fff}.panel-dark>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#737373}.calendarRightPanel .widgetContainer ul{margin-top:5px;margin-bottom:5px}.paddingLeft5px{padding-left:5px}.marginBottom5px{margin-bottom:5px}.detailview-table .fieldValue .summaryViewEdit{display:none}.detailview-table .fieldValue:hover .summaryViewEdit{display:inherit}.icon-in-history-widget{font-size:17px;padding:4px}#prefPageHeader .logo img{height:70px;width:70px}#myPrefHeading h3{margin-top:12px}.list-user-img{width:50px;height:40px}span[name=existingImages] img{height:200px;width:300px}.narrow.fieldValue .chosen-container-single .chosen-single{height:26px;line-height:26px}.narrow.fieldValue input{height:26px}.narrow.fieldValue .input-group-addon{padding:4px 10px}.narrow.fieldValue .chosen-container-single .chosen-single div b{background-position-y:4px}.image-in-button{width:18px}.fc-time-grid .fc-time-grid-event.fc-event{min-height:27px;min-width:100px}.fc-time-grid-event.fc-short .fc-title{font-size:1em}.paddingTBZero{padding-top:0;padding-bottom:0}.dashboardWidgetContent a .glyphicon{top:-3px}.detailViewTitle .popover{min-width:130px;text-align:center}.cursorDefault{cursor:default!important}.remindersNoticeContainer{position:fixed;right:0;top:109px;z-index:1029;width:0;height:100%;bottom:30px;overflow-y:auto;background:rgba(0,0,0,0.4);border-left:1px solid #797979;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;overflow-y:auto}.remindersNoticeContainer.toggled{width:380px}.remindersContent{margin:5px 8px 0 8px}.activityTypeIcon{height:20px}.remindersNoticeContainer .panel{margin-bottom:10px}.remindersNoticeContainer .panel-body{padding:10px}.remindersNoticeContainer .actionRow a.btn{margin-right:3%}.remindersNotice{color:#fff;padding:15px 12px}.remindersNotice .glyphicon{font-size:20px}.cancelLink.btn[type='reset'],.cancel.btn[type='reset']{float:right;margin-left:5px;margin-bottom:0}.activityWidgetContainer .popover{min-width:240px}.filterActionImage{margin-left:8px}#tagRecord{line-height:25px}#tagsList .btn-info{margin-left:5px}#tagRecordInput{padding-left:15px;padding-right:15px}.clearReferenceSelection,.createReferenceRecord{padding:0 6px}.relatedPopup{padding:0 4px}.popupContainer .popupModuleName{margin-top:0}.mailRows hr{margin:0}.paddingLeftMd{padding-left:15px}.widget_header div:nth-child(2).btn-toolbar,.editViewContainer .contentHeader.row div:nth-child(2){margin-top:20px}.fieldLabel .referenceMandatory{margin-right:-12px}.ui-widget-content{padding:.8em}.ui-autocomplete .ui-autocomplete-category{font-weight:bold;line-height:1.5}.ui-autocomplete .ui-autocomplete-category:first-child{margin:.8em 0 .2em}.ui-autocomplete .ui-menu-item{padding:.2em .8em}.ui-autocomplete .ui-state-focus{border:0;background:#ebebeb}.widgetHr{margin-top:0}.headerLinksMails .btn-group{margin-top:11px}.finalDiscountUI,.finalTaxUI{bottom:5px}.sideBarTitle{font-size:20px}.globalSearchInput{width:300px}#groupsDetailContainer strong{line-height:21px}#addTaskContainer #taskStatus{margin-left:10px}.scanerMailActionsButtons{min-width:96px}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#404040}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active,.ui-menu .ui-menu-item a.ui-widget-content{font-weight:bold;margin:0;background-color:#428bca;border-color:#357ebd;color:#fff;display:block}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style:none}#layoutEditorButtons{margin-bottom:10px;margin-top:-10px}.individualTaxContainer{text-align:left!important}.suppliesItemsTable .input-group{max-width:200px}.suppliesItemsTable .rowName .input-group{max-width:400px}.suppliesItemsTable td,.suppliesItemsTable th{border:1px solid #ddd}.suppliesItemsTable tfoot td.hideTd{border:0;background:#fafafb} \ No newline at end of file +@media print{.noprint{display:none}}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}.hide-text{overflow:hidden;text-indent:100%;white-space:nowrap}.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot');src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.woff') format('woff'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.ttf') format('truetype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg')}body{width:100%;font-family:'Open Sans','Lucida Grande',Verdana,Tahoma,Arial,sans-serif!important;font-size:12px!important;background:#fff;color:#2b2b2b}hr{margin:8px 0;border-bottom:1px solid #ddd}.navbar.navbar-fixed-top .navbar-collapse{padding-right:15px!important}.navbar-nav.navbar-left .open ul{display:none}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background:0}.navbar-default .navbar-nav>li:hover{background:#e7e7e7}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background:0}.navbar-inverse .navbar-nav>li:hover{background:#080808}.navbar-nav .hovernav:hover>.dropdown-menu{display:block}#collapsedMenu{display:block;position:relative}#collapsedMenu a{color:#fff}#collapsedMenu .dropdown-menu .shortDropdown{max-height:300px;overflow-y:scroll;padding:10px;position:relative;z-index:10000;-webkit-overflow-scrolling:touch;-webkit-transform:translateZ(0)}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames{margin-bottom:2px}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a{font-size:.9em;padding:3%!important;color:#2b2b2b!important}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a:hover{text-decoration:none;background:#404952;color:#fff!important}.moreMenus{width:52em;padding:24%;left:0;border-radius:2px}.moreMenus.leftAligned:after,.moreMenus.leftAligned:before{left:21px!important}.moreMenus strong{font-size:1.1em;color:#2b2b2b}.moreMenus:after,.moreMenus:before{left:292px!important}.announcement{// display:none;background:#fafad2;// padding:2px 0;// border-bottom:1px solid #ccc;// max-height:24px;// width:100%}.announcement .marStyle{// width:100%}#headerLinks{padding:10px 0 7px;min-width:240px;float:right!important}#headerLinks .headerLinksContainer{margin-right:10px}#headerLinks .headerLinksContainer>[class*="span"]{float:left;margin-left:15px}#headerLinks .headerLinksContainer .dropdown.open .dropdown-toggle{background:transparent}#headerLinks .headerLinksContainer ul.dropdown-menu{top:30px}#headerLinks .headerLinksContainer ul.dropdown-menu:after,#headerLinks .headerLinksContainer ul.dropdown-menu:before{right:15px;left:auto}#headerLinks .headerLinksContainer>span a img,#headerLinks .headerLinksContainer>span a.userName{color:#fff;cursor:pointer;text-decoration:none!important}#headerLinks .headerLinksContainer>span a img .caret,#headerLinks .headerLinksContainer>span a.userName .caret{border-top:4px solid #fff}.dropdown-menu.pull-right{right:0;left:auto;cursor:pointer}.themeMenuContainer{min-width:110px;width:110px;left:-84px!important;padding:10px 0}.themeMenuContainer .themeMenu{padding:0 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement{cursor:pointer;margin:5px;height:20px;width:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement:hover{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}.themeMenuContainer .themeMenu .themeSelected{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}@media screen and (min-width:1161px){#mediumNav,#shortNav,#headerLinksCompact{display:none}#largeNav{margin-left:10px;margin-right:0}}@media screen and (max-width:1160px) and (min-width:960px){.companyLogo{width:100%}.customFilterMainSpan .select2-container{width:300px!important}*{zoom:1!important}}@media screen and (max-width:960px){.bodyContents{margin:0!important}#centerPanel{width:100%!important}.col-md-3#headerLinks{padding:5px 5px 0}.menuBar .col-md-9,.col-md-3#headerLinks{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-width:80px}.menuBar .col-md-9 .qCreate,.col-md-3#headerLinks .qCreate{display:inline-block;margin:0}.menuBar .col-md-9 .qCreate img,.col-md-3#headerLinks .qCreate img{margin-bottom:3px;margin-right:5px}.menuBar .col-md-9 .qCreate ul li.title,.col-md-3#headerLinks .qCreate ul li.title{padding:5px 0 0 15px}.menuBar .col-md-9 li.tabs:first-child>a,.col-md-3#headerLinks li.tabs:first-child>a{padding:10px 12px 9px}.customFilterMainSpan .select2-container{width:300px!important}#quickCreateModules{width:100%!important;padding:0!important}.CompactQC{max-height:300px;overflow-y:scroll;overflow-x:hidden}.CompactQC a:hover{text-decoration:none}}.commonActionsContainer .quickActions{height:3em}.commonActionsContainer .quickActions img{height:60%;margin:40% auto}.commonActionsContainer .quickActions #companyLogo-container img{height:98%;margin:0 auto}.commonActionsContainer .actionsContainer{background:#f3f3f3}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown{min-width:715px;top:28px;margin:0;padding-top:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a{padding:2px;border:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mainContainer{min-height:500px;margin-top:103px;background:#eeeff2;min-width:1200px}.mainContainer>.col-md-2{// padding:0 1.06383%;height:auto!important;// min-width:174px}.mainContainer .contentsDiv{min-height:500px;background:#fafafb;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;border-left:1px solid #e6e6e6;position:relative}.mainContainer #leftPanel{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.toggleButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;left:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-left:0;display:inline-block}.toggleButton .glyphicon-chevron-left{background-position:-434px -72px!important}.toggleButton .glyphicon-chevron-right{background-position:-460px -72px!important}.toggleRightPanelButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;right:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-right:0;display:inline-block}.quickLinksDiv{margin:10px 0}.quickLinksDiv p{font-size:1.2em;padding:3% 0 0 6%;height:40px;cursor:pointer;box-shadow:0 0 0 1px #ddd;border-top:1px solid #fff!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);position:relative;border-radius:2px}.quickLinksDiv p a{color:#2b2b2b}.quickLinksDiv p a:hover{text-decoration:none}.quickLinksDiv p.selectedQuickLink{background-color:#2a2f35;background-image:-moz-linear-gradient(top,#2a2f35,#2a2f35);background-image:-ms-linear-gradient(top,#2a2f35,#2a2f35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#2a2f35),to(#2a2f35));background-image:-webkit-linear-gradient(top,#2a2f35,#2a2f35);background-image:-o-linear-gradient(top,#2a2f35,#2a2f35);background-image:linear-gradient(top,#2a2f35,#2a2f35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2a2f35',endColorstr='#2a2f35',GradientType=0);border-color:#2a2f35 #2a2f35 #08090a;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);background-image:none;position:relative;border:1px solid #fff;box-shadow:4px 0 3px -4px #000 inset}.quickLinksDiv p.selectedQuickLink a{color:#fff}.quickLinksDiv p.selectedQuickLink a:after{border-bottom:19px solid rgba(0,0,0,0);border-left:10px solid #2a2f35;border-top:19px solid rgba(0,0,0,0);content:" ";display:inline-block;position:absolute;left:100%;top:0}.quickWidgetContainer li a{overflow:hidden;white-space:normal;padding:5px;margin:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.quickWidgetContainer .quickWidget{margin-bottom:10px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.sidebarTitleBlock{padding:12px 0}.sidebarTitleBlock a{color:#373737!important}.sidebarTitleBlock a:hover{text-decoration:none}#selectAllMsgDiv,#deSelectAllMsgDiv{display:none;background-color:#fafad2;padding:.01%;text-align:center}.blockUI form,#globalmodal form{margin:0}.dashboardHeading h2{padding-bottom:8px}.dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardHeading .dropdown-menu{left:-70px;right:0}.dashboardContainer{padding:0}.dashboardContainer .dashboardHeading{padding:10px 0 0;background:#f5f5f5}.dashboardContainer .dashboardHeading h2{padding:0 0 8px 20px}.dashboardContainer .dashboardHeading .btn-toolbar{padding:3px 20px 0 0}.dashboardContainer .dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardContainer .dashboardHeading .dropdown-menu{left:-82px}.widgetsList{max-height:400px;overflow-y:auto;overflow-x:hidden}.widgetsList li{display:block}.widgetsList li a{white-space:normal;word-wrap:break-word}.dashboard_notebookWidget_view .row{margin-bottom:5px}.gridster{margin-left:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.gridster ul{width:auto;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:460px}.gridster ul{list-style:none}.gridster ul li.dashboardWidget{background:#fff;border-radius:1px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.gridster ul li.dashboardWidget .dashboardWidgetHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd;color:#444;cursor:move;padding:5px}.gridster ul li.dashboardWidget .dashboardWidgetHeader table{height:28px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .dashboardTitle{text-align:left;padding-left:10px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .widgeticons{opacity:.5;padding-right:6px}.gridster ul li.dashboardWidget .filterContainer{position:absolute;border:1px solid #ddd;background:#fff;margin-left:-7px;margin-right:3px;margin-top:4px;padding:8px 0;border-radius:0 0 5px 5px;box-shadow:0 5px 8px -5px #888}.gridster ul li.dashboardWidget .filterContainer div span{margin-top:6px}.gridster ul li.dashboardWidget .filterContainer .col-md-5{margin-top:3px}.gridster ul li.dashboardWidget .dashboardWidgetContent{padding:10px 0;line-height:20px}.gridster ul li.dashboardWidget .dashboardWidgetContent .dashboard_notebookWidget_viewarea{height:200px}.gridster ul li.dashboardWidget .widgeticons{min-width:50px;height:30px;margin-right:30px}.gridster ul li.dashboardWidget .widgeticons a{cursor:pointer;text-decoration:none}.gridster ul .widgetChartContainer{margin-left:10px}.listViewPageDiv{margin:11px 0}.customFilterMainSpan{width:100%}.customFilterMainSpan .select2-container{width:95%!important}.select2-container .select2-choice{border-radius:2px;background:#fff;border-color:#ddd;font-size:14px;letter-spacing:.01em;color:#2b2b2b}.select2-container .select2-choice div{border-radius:0;border-left:0;background:#fff}.select2-drop{border-color:#ddd}.select2-dropdown ul.filterActions{list-style:none!important;padding-left:15px}.select2-dropdown ul.filterActions li{cursor:pointer}.ui-autocomplete .ui-menu-item #ui-active-menuitem{background:#404952;border-radius:0}li.ui-timepicker-selected,.ui-timepicker-list li:hover,.ui-timepicker-list:hover .ui-timepicker-selected:hover{background:#404952}#relatedTabOrder .select2-input{min-width:200px}.alphabetSorting .alphabetSearch a{vertical-align:middle;display:inline-block;margin-bottom:2px}.alphabetSorting .alphabetSearch:hover{background:#eeeff2}.listViewActions .settingsIcon{display:inline-block;margin-left:5px}.listViewActions>.btn-group{min-width:105px}#listViewPageJumpDropDown,#relatedListPageJumpDropDown{left:-60px}.pageNumbers{display:inline-block;margin-right:5px;margin-top:6px;vertical-align:top}.pageNumbers .totalNumberOfRecords{margin:0 5px}.contents-topscroll,#reportDetails{overflow-x:auto!important;overflow-y:visible}.contents-bottomscroll{overflow-x:auto!important}.bottomscroll-div,.topscroll-div{display:table;min-width:100%}.listViewLoadingImageBlock{background:0;border-radius:0;box-shadow:none;text-align:center}.detailViewContainer{padding:0 20px}.userPreferences .contents{padding-left:0!important}.userPreferences .details{border-right:0!important}.detailViewTitle{padding:1% 0 0 1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .recordLabel{font-size:16px;font-weight:bold}.detailViewTitle .detailViewButtoncontainer{margin-top:8px}.detailViewTitle .detailViewPagingButton{margin-top:8px;padding-right:10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .btn-toolbar{margin:0}.detailview-table th,.detailview-table td{vertical-align:middle}.detailview-table th label,.detailview-table td label{margin-bottom:3px}.detailViewInfo{box-shadow:0 -4px 4px -4px #959595;margin-top:5px}.detailViewInfo .details{// min-height:600px;padding-right:1.5%;border-right:4px solid #404952;padding-bottom:10px;padding-top:10px}.detailViewInfo .related .nav-pills .active>a,.detailViewInfo .related .nav-pills .active>a:hover{background:#404952;border-radius:1px;margin-top:0;margin-bottom:2px}.fieldLabel{width:20%;background:#f7f7f9}.fieldLabel label.marginRight10px{text-align:right}.summaryView{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.summaryView .summary-table tr.summaryViewEntries:last-child .fieldValue,.summaryView .summary-table tr.summaryViewEntries:last-child .fieldLabel{border-bottom:1px solid #ddd}.summaryView .summaryViewEntries .fieldLabel{vertical-align:top;padding:5px 0 5px 5%;border-top:1px solid #ddd;border-right:1px solid #ddd}.summaryView .summaryViewEntries .fieldValue{vertical-align:top;padding:5px 0 5px 5px;border-top:1px solid #ddd}.summaryView .summaryViewEntries:hover .summaryViewEdit{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryView .summaryViewEntries .summaryViewEdit{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryView .toggleViewByMode{margin:8px 0;padding-right:0}.summaryView .toggleViewByMode .changeDetailViewMode{white-space:normal!important}.summaryWidgetContainer{border-radius:2px;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border:1px solid #eaeaea;background:#fff;margin-bottom:10px;padding:15px}.commentContainer .commentTitle{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;margin-bottom:10px}.commentContainer .commentTitle textarea{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordDetails .squeezedWell{padding:3% 0;min-height:105px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordEditView .contentHeader{padding:.5% 0 1% 0}.recordEditView .table .fieldLabel,.recordEditView .table .fieldValue{vertical-align:middle}.recordEditView .table tbody tr:hover td,.recordEditView .table tbody tr:hover th{background:#f7f7f9}.commentContainer{border-radius:2px}.commentContainer hr{margin:0!important}.commentContainer .addCommentBlock .commentsControls{display:inline-block}.commentContainer .commentsList>.liStyleNone>.commentDetails .commentDiv{width:100%}.commentContainer .commentDetails{background:#fff;border:1px solid #ddd;margin-bottom:5px;border-radius:2px;padding:10px 10px 5px;display:inline-block;min-width:354px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentContainer .commentorInfo p{margin-bottom:0}.commentContainer .addCommentBlock{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border:1px solid #ddd;padding:12px 12px 5px;min-height:115px;margin-top:15px;display:block}.commentContainer .addCommentBlock .commentcontent{padding:8px!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;resize:none}.commentContainer .commentInfoContent{padding:1px 0;word-wrap:break-word}.commentTitle .col-md-1{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentTitle .col-md-1 img{width:32px;height:32px}.commentsList>ul{margin-left:0}.singleComment .editedStatus{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:5px 0 5px 32px}.singleComment .editedStatus p{margin-bottom:0}.singleComment .commentActionsDiv{display:none}.singleComment .commentActionsDiv p{margin-bottom:0}.singleComment:hover .commentActionsDiv{display:block;margin-bottom:3px}.recentComments{margin:0;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recentComments .commentDiv{min-width:100%}.recentComments .addCommentBlock{border:0;margin-top:0;display:block}.recentComments .commentDetails{display:block}.singleComment:hover .commentActions .replyComment{display:inline-block}.commentActionsContainer a:hover{text-decoration:none}.commentActionsContainer .editStatus{padding:5px 2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentActionsContainer .editStatus p{margin-bottom:0}.table{background:#fff}.table-bordered{border-radius:1px;margin-bottom:0}.table-bordered th{border-top:1px solid #fff!important}.table th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;color:#444}.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td,.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td{border-left:0;border-right:0}.listViewEntriesTable tbody tr td:first-child{border-left:0 none}.equalSplit td:nth-child(odd){width:20%}.equalSplit td:nth-child(even){width:30%}td.fieldValue input,td.fieldValue .input-group{margin-bottom:0}.actionImage,.actionImages{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.listViewHeaders a{color:#444}.listViewEntriesDiv .listViewHeaders th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd}.listViewEntriesDiv,.listViewEntriesDiv td{overflow:visible}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues{color:#444}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues:hover{text-decoration:none}.listViewEntriesTable td.listViewEntryValue,.listViewEntries td{vertical-align:middle;cursor:pointer;overflow:visible;padding:5px}.listViewEntriesTable td.listViewEntryValue:hover .actionImages,.listViewEntries td:hover .actionImages,.listViewEntriesTable td.listViewEntryValue:hover .actions,.listViewEntries td:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryViewEntries .summaryViewEdit,.activityStatus .editStatus,.activityDescription .editDescription,.addedCalendars .actionImage{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryViewEntries:hover .fieldValue .summaryViewEdit,.activityStatus:hover .editStatus,.activityDescription:hover .editDescription,.addedCalendars:hover .actionImage{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewEntriesTable tr:hover td .actions .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewBasicAction.dropdown-menu{width:100%}.listViewBasicAction.dropdown-menu input{border-radius:2px;height:24px;margin-bottom:0;margin-top:-2px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.emptyRecordsDiv{width:100%;border:1px solid #ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.emptyRecordsDiv td{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.CustomFilterViewTitle{padding-top:1%}#CustomView .filterActions{padding-bottom:20px;overflow:hidden}.filterConditionsDiv{padding-bottom:0}.conditionGroup .header{margin-bottom:20px;font-size:1.2em}.conditionGroup .contents .conditionRow{margin-bottom:10px}.conditionGroup .contents .conditionRow select,.conditionGroup .contents .conditionRow input{width:90%}.conditionGroup .contents .conditionRow .chzn-results li{line-height:20px}.conditionGroup .deleteCondition{vertical-align:bottom}.searchUIBasic{border-collapse:separate!important;border-spacing:10px!important;margin:0 10%}.searchUIBasic .importContents{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.searchUIBasic .listRow .listViewHeaders>td{color:#404952}.searchUIBasic .listRow .defaultInputTextContainer{max-width:87%!important;margin-bottom:0!important}#lineItemTab.table tr:first-child:hover th ~ td{background-color:#f3f3f4;background-image:-moz-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-ms-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f3f3f4),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-o-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:linear-gradient(top,#f3f3f4,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f4',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}#lineItemTab.table tr:nth-child(2):hover td{background:0}.lineItemTable tr td{width:0}.lineItemTable tr td div.finalDiscountUI,.lineItemTable tr td div.discountUI,.lineItemTable tr td div#shipping_handling_div,.lineItemTable tr td div.taxUI,.lineItemTable tr td div.finalTaxUI{border:2px solid #c4c4c4;border-radius:2px}.lineItemTable tr td div.finalDiscountUI table tr td,.lineItemTable tr td div.discountUI table tr td,.lineItemTable tr td div#shipping_handling_div table tr td,.lineItemTable tr td div.taxUI table tr td,.lineItemTable tr td div.finalTaxUI table tr td,.lineItemTable tr td div.finalDiscountUI table tr th,.lineItemTable tr td div.discountUI table tr th,.lineItemTable tr td div#shipping_handling_div table tr th,.lineItemTable tr td div.taxUI table tr th,.lineItemTable tr td div.finalTaxUI table tr th{border-left:0}.lineItemTable tr:hover td{width:0}.lineItemTable tr:hover td div.finalDiscountUI table tr td{background:none!important}.lineItemTable tr:hover td div.discountUI table tr td{background:none!important}.lineItemTable tr:hover td div#shipping_handling_div table tr td{background:none!important}.lineItemTable tr:hover td span.taxDivContainer div table tr td{background:none!important}.lineItemTable tr:hover td div.finalTaxUI table tr td{background:none!important}.lineItemResult{width:70.5%!important}.lineItemResult a:hover{color:#404952}.lineItemInputBox{width:45%;float:right;text-align:right}.discountUI,.taxUI,.finalDiscountUI,.finalTaxUI,#shipping_handling_div{position:absolute;left:46%;width:30%;z-index:500;box-shadow:1px 0 7px #ddd;border-radius:6px}.discountUI table.table,.taxUI table.table,.finalDiscountUI table.table,.finalTaxUI table.table,#shipping_handling_div table.table{margin-bottom:0}.discountUI .table tbody tr:first-child th:first-child,.taxUI .table tbody tr:first-child th:first-child,.finalDiscountUI .table tbody tr:first-child th:first-child,.finalTaxUI .table tbody tr:first-child th:first-child,#shipping_handling_div .table tbody tr:first-child th:first-child{border-radius:4px 0 0 0!important}.discountUI .table tbody tr:first-child th:last-child,.taxUI .table tbody tr:first-child th:last-child,.finalDiscountUI .table tbody tr:first-child th:last-child,.finalTaxUI .table tbody tr:first-child th:last-child,#shipping_handling_div .table tbody tr:first-child th:last-child{border-radius:0 4px 0 0!important}.LineItemDirectPriceReduction{width:65%!important}th.htColHeader,.handsontable thead th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd;padding:6px 2px}.contentHeader{padding:15px;padding-left:5px;line-height:20px}.contentsDiv>div{padding:0 20px}#settingsQuickWidgetContainer .widgetContainer.accordion-body{border-bottom:none!important;border-bottom:3px solid #ddd}#settingsQuickWidgetContainer .widgetContainer.accordion-body>div:hover{background:#eeeff2}#settingsShortCutsContainer{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:1% 3%}#settingsShortCutsContainer .moduleBlock{min-height:60px}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin{display:inline-block;opacity:.4}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin:hover{opacity:.8}.settingsIndexPage .settingsSummary{text-align:center;margin-top:10px}.settingsIndexPage .settingsSummary a{display:inline-block;background:#f3f3f4;color:#444;border-radius:2px;min-width:200px;padding:20px 0 10px;border:1px solid #ddd}.settingsIndexPage .settingsSummary a .summaryText{display:inline-block;margin-top:20px;font-size:15px}.settingsIndexPage .settingsSummary a:hover .summaryText,.settingsIndexPage .settingsSummary a:hover .summaryCount{color:#404952}.settingsIndexPage .moduleBlock h5{font-size:1.2em;margin-bottom:5px}.settingsIndexPage .moduleBlock:hover{background:#f3f3f4}#userPageHeader{padding:8px 0 0}#userPageHeader #userHeading h3{margin-top:10px}.treeView li{border-left:4px solid #ddd;list-style:none;padding-top:15px}.treeView li .toolbar-handle{margin-left:10px;position:relative}.treeView li .toolbar-handle .btn{margin:0}.treeView li .toolbar-handle a:before{background:none repeat scroll 0 0 #ddd;content:" ";display:inline-block;height:4px;left:-10px;position:absolute;top:12px;width:10px}.treeView .btn{margin-bottom:10px}.profilesEditView tr.blockHeader th{text-align:center}.profilesEditView tr.blockHeader th:first-child{text-align:left}.profilesEditView input{margin-right:5px}.profilesEditView tr td.row table.table{border-left:none;margin-bottom:20px}.profilesEditView tr:hover td.row{background:0}.profilesEditView tr:hover td.row table.table tr td{background:0}.profilesEditView tr:hover td.row table.table tr:hover td{background:0}.profilesEditView tr:hover td.row table.table td{background:#f3f3f4}#s2id_memberList li>div,.groupMembersColors li>div{margin-left:10px}#s2id_memberList .Users,.groupMembersColors .Users{background-color:#f99984!important;padding:5px;margin-bottom:2px;background-image:none}#s2id_memberList .Groups,.groupMembersColors .Groups{background-color:#acd5ff!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .Roles,.groupMembersColors .Roles{background-color:#ffec98!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .RoleAndSubordinates,.groupMembersColors .RoleAndSubordinates{background-color:#c4dea2!important;background-image:none;padding:5px;margin-bottom:2px}.collectiveGroupMembers{border:1px solid #ddd;border-top:0}.collectiveGroupMembers ul{padding:0;margin:0}.collectiveGroupMembers ul li{padding:4px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.collectiveGroupMembers ul li a{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;margin:0}.collectiveGroupMembers ul li.groupLabel{background-color:#f3f3f4;border-bottom:1px solid #ddd;border-top:1px solid #ddd;padding:10px 5px;margin:0;color:#444}.mini-slider-control{width:50px}.mini-slider-control+div{margin-left:15px}.mini-slider-control .ui-slider-handle{border:0;border-radius:50%;height:16px;top:-2px;width:16px;cursor:pointer}.mini-slider-control .ui-slider-handle:focus{outline:0}.ui-widget-content{border-radius:6px;border-color:#fff;box-shadow:0 0 3px -1px inset;margin-top:2px;margin-left:5px;height:12px}.ui-slider-disabled{opacity:.5;border-color:#ddd;box-shadow:none;cursor:not-allowed}.ui-slider-disabled .ui-slider-handle{cursor:not-allowed}.ui-slider-disabled+div{opacity:.5;cursor:not-allowed}.mini-slider-control[data-value="0"] .ui-slider-handle{background:#7d7e7d;background:-moz-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#7d7e7d),color-stop(100%,#0e0e0e));background:-webkit-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-o-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-ms-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:linear-gradient(to bottom,#7d7e7d 0,#0e0e0e 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7d7e7d',endColorstr='#0e0e0e',GradientType=0)}.mini-slider-control[data-value="1"] .ui-slider-handle{background:#ffb76b;background:-moz-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ffb76b),color-stop(0%,#ffa73d),color-stop(49%,#ff7c00),color-stop(100%,#ff7f04));background:-webkit-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-o-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-ms-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:linear-gradient(to bottom,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffb76b',endColorstr='#ff7f04',GradientType=0)}.mini-slider-control[data-value="2"] .ui-slider-handle{background:#bfd255;background:-moz-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#bfd255),color-stop(79%,#8eb92a),color-stop(100%,#72aa00),color-stop(100%,#9ecb2d));background:-webkit-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-o-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-ms-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:linear-gradient(to bottom,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bfd255',endColorstr='#9ecb2d',GradientType=0)}#moduleManagerContents{padding-bottom:10px}#moduleManagerContents .moduleManagerBlock .btn-group.open .dropdown-menu{left:-144%}#moduleManagerContents .modulesTable td{width:50%}#importModules .contents .row{margin-bottom:2.2%}.extensionWidgetContainer{background-color:#fff;border:1px solid #ddd;min-height:200px;padding:2%;background:#fafafa;box-shadow:0 0 10px -4px #777}.extensionWidgetContainer .extension_contents{margin-top:2%;background:#fff;padding:10px;box-sizing:border-box;max-height:160px}.extension_contents:hover{border-radius:4px}.thumbnailImage{height:130px;width:130px;float:right}.extensionWidgetContainer .extension_contents .slimScrollDiv{padding-right:10px}.extensionWidgetContainer .extension_header .font-x-x-large{font-size:1.5em;padding-left:3px;font-weight:bold;color:#404952}.extensionWidgetContainer .extensionDescription{line-height:20px}.extensionWidgetContainer .extensionInfo{padding-top:5px}.extensionWidgetContainer .extensionInfo .rating,.extensionDetails .rating{vertical-align:middle;margin-top:2px;display:inline-block}.extensionDetails .authorInfo{margin:3px 0}.extensionDetails .extensionDetailActions{padding:15px 0}.extensionWidgetContainer .tab-pane .bx-wrapper .imageSlider{margin:0}.sliderImage{width:90%;height:360px}.opacity .actions{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.opacity:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.sharingAccessDetails{margin-bottom:30px}.sharingAccessDetails td,.sharingAccessDetails th{text-align:center;vertical-align:middle!important}.sharingAccessDetails tr td:first-child,.sharingAccessDetails tr th:first-child{text-align:left}.sharingAccessDetails td.row>div{display:block}.sharingAccessDetails .customRuleContainer:hover{background:0}.sharingAccessDetails hr{border-bottom:1px solid #bcbcbc}.sharingAccessDetails .title{padding:1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.sharingAccessDetails .title .rulehead{padding-top:5px}.sharingAccessDetails .customRuleEntries:hover .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.layoutContent{border-top:4px solid #404952}.layoutContent #moduleBlocks .editFieldsTable{margin-bottom:20px}.layoutContent #moduleBlocks .editFieldsTable .fieldLabel{background:0}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockLabel{padding-top:13px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group{margin-top:5px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group .dropdown-menu{left:-100%}.layoutContent .relatedTabModulesList{padding:2% 1%}.fieldDetailsForm .search-choice-close{padding:0}.border1px{border:1px solid #ddd}.blockFieldsList .opacity{margin-left:.5%!important}.blockFieldsList .opacity .dropdown-menu a{padding:0!important}.blockFieldsList .opacity a.dropdown-toggle.editFieldDetails{box-shadow:none}.blockFieldsList .editFields .dropdown-menu{z-index:1000003;padding:0;left:-215px;position:absolute}.blockFieldsList .editFieldsWidget .dropdown-menu{z-index:1000003;padding:0;left:-315px;position:absolute}.blockFieldsList .editFields .dropdown-menu .modal-header{border-width:0;border-bottom-width:1px}.blockFieldsList .editFields .dropdown-menu .modal-header .cancel{padding-right:0;font-weight:bold}.blockFieldsList .editFields:hover{background:#f3f3f4!important}#modulePickListValuesContainer .layoutContent{padding-left:2%}#modulePickListValuesContainer .layoutContent .selectedCell,#modulePickListValuesContainer .layoutContent .selectedListItem{background:#a5afb9;white-space:nowrap}#modulePickListValuesContainer .layoutContent .pickListValue{cursor:pointer}.nonEditableValuesDiv .nonEditablePicklistValues{margin-left:0}.nonEditableValuesDiv .nonEditablePicklistValues li{padding:3px 15px;margin-bottom:2px;background:#e0f2ff}.popover{z-index:1000023!important}.popover-content .fieldLabel{width:35%;white-space:normal}#dependencyGraph .tableHeading{text-align:center;padding-top:30px;font-size:1.2em;font-weight:bold}#dependencyGraph .depandencyTable{border:1px solid #ddd;background:#f3f3f4}#dependencyGraph .depandencyTable .blockHeader{border-bottom:1px solid #ddd}#dependencyGraph .depandencyTable .picklistValueMapping{border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping{text-align:center;border-left:1px solid #ddd;border-right:1px solid #ddd;background:#fff}#dependencyGraph .dependencyMapping .mCSB_container{margin-bottom:16px!important}#dependencyGraph .dependencyMapping .pickListDependencyTable{border:0}#dependencyGraph .dependencyMapping .pickListDependencyTable .blockHeader th{background:#f3f3f4;border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping .pickListDependencyTable .selectedCell{background:#a5afb9}.webformFieldInfo{margin-bottom:250px}.targetFieldsTableContainer input[type="text"]{min-width:100px}#customRecordNumbering.table thead th{vertical-align:middle}.addMailBoxBlock{margin-left:83px;padding:0!important;font-size:12px}.addMailBoxStep{background:#fff;padding:30px 0;border:1px solid #ddd;border-radius:1px;min-height:170px}.mailConveterDesc{height:350px;width:96%;border:1.5px solid;border-radius:2px;border-color:#ddd;font-size:11pt;margin-top:55px;margin-left:20px;background:#fff}#mailBoxLabel{margin-top:15px;margin-left:-18px;font-size:12pt;width:75px}.mailBoxDropdownWrapper{height:49px;width:70%;background:url('../images/mailbox-icon.png') no-repeat 5px 5px;overflow:hidden;border:1px solid #ddd}.mailBoxDropdown{background:transparent url('../images/downArrowBlue.png') no-repeat 236px 13px;width:110%;height:50px;font-size:14pt;color:#0065a6;padding:10px 55px;padding-right:0}#mailConverterDragIcon{margin-top:12px}#mailConverterBody{padding-top:20px;margin-left:0}.ruleHead{padding:6px 0;background:#d8d8dc}.mailConverterRuleBlock{font-size:14px;line-height:30px;border:1.5px solid;border-color:#ddd}.mailConverterRuleLegend{font-size:14px;color:#0065a6;margin-bottom:10px;background:#f3f3f4}#mailConverterStats{font-size:10pt;margin-top:5px;margin-left:-10px}.addMailBoxBlock{border-color:#ddd;margin-left:83px;margin-top:20px;padding-top:30px;padding-left:200px;padding-bottom:20px;padding-right:30px;font-size:11pt}.taskTypeUi>.row{margin:10px 0}#taskListContainer .listViewEntriesTable tr td:last-child{border-left:1px solid #ddd}#workflow_step2>.row{padding:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:400px}#open_email_con .detailViewTitle{padding:0}#open_email_con .detailViewTitle .detailViewPagingButton{margin-top:0;padding-right:0}#foldersList .list-group{padding-right:0}.massEditTable th+th,.massEditTable td+td,.massEditTable th+td,.massEditTable td+th{border-left:0}.nav.massEditTabs{margin-bottom:0;border-bottom:0}.nav.massEditTabs li.active a{background:#404952;color:#fff;margin-left:10px}.nav.massEditTabs li a:hover{border-bottom:1px solid #404952}.massEditContent{border-top:3px solid #404952}.calendarSettingsContainer{width:700px}.calendarSettingsContainer .control-label{width:26%}#calendarSettings{margin:1px 0 3px}.calendarMassEdit{min-width:400px}.fc-state-default .fc-button-effect{top:100%!important}.fc-event-style1,.fc-event-style1 .fc-event-skin{background:#17309a;border-color:#17309a;font-weight:normal;text-shadow:none}.fc-event-style2,.fc-event-style2 .fc-event-skin{background:#3a87ad;border-color:#3a87ad;font-weight:normal;text-shadow:none}.fc-event-style3,.fc-event-style3 .fc-event-skin{background:#aa6705;border-color:#aa6705;font-weight:normal;text-shadow:none}.fc-event-style4,.fc-event-style4 .fc-event-skin{background:#953b39;border-color:#953b39;font-weight:normal;text-shadow:none}.fc-event-style5,.fc-event-style5 .fc-event-skin{background:#545252;border-color:#545252;font-weight:normal;text-shadow:none}.fc-event-style6,.fc-event-style6 .fc-event-skin{background:#87865d;border-color:#87865d;font-weight:normal;text-shadow:none}.fc-event-style7,.fc-event-style7 .fc-event-calendarMassEditskin{background:#c71585;border-color:#c71585;font-weight:normal;text-shadow:none}.fc-event-style8,.fc-event-style8 .fc-event-skin{background:#006400;border-color:#006400;font-weight:normal;text-shadow:none}#calendarview th{color:#000}.fc-agenda-divider+div{overflow-y:visible!important}.fc-button{display:inline-block;padding:6px .4em!important;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.fc-button:active .fc-button-inner{background:transparent}.fc-button:active .fc-button-inner .fc-button-content{color:#fff}.fc-button.fc-state-active .fc-button-inner .fc-button-content,.fc-button:active .fc-button-inner .fc-button-content{color:#000!important;background:transparent;background-image:none}.fc-header-title h2{font-size:15px;line-height:20px}.fc-widget-header th{padding:4px 0!important}.fc-widget-header{color:#666;background:#eee;border-color:#ccc}.fc-content{background:#fff;margin-top:15px}.fc-content td:hover{background:#f3f3f3}.btn:focus{outline:0}.reminderPostpone.btn-primary{background:#404952}.reminderPostpone.btn-primary:hover{background:#1e2327}.saveButton{margin-right:5px}.addCustomRule{float:right}.importMore{background:#fff}.lastImport{background:#fff}.undoImport{background:#da4f49}.close{border:0;background:none repeat scroll 0 0 transparent;border:0 none;cursor:pointer}.resetButton{margin-top:0!important}.vtGlyph{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("../images/vtGlyph.png");background-position:0 0;background-repeat:no-repeat;*margin-right:.3em}.vticon-pageJump{background-position:0 0}.vticon-call-inbound{background-position:-14px 0}.vticon-call-outbound{background-position:-28px 0}#massEdit .cancelLinkContainer{padding:5px 0;margin-left:.5em}.ui-pnotify{z-index:1000023}.feedback{z-index:10002}.feedback .handle{z-index:10003;display:block;position:fixed;bottom:50px;left:-30px;left:0\9;bottom:100px\9;background:#2c2c2c;color:white;padding:7px 15px;border:1px solid gray;text-decoration:none;outline:0;-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-o-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg);-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.00000000, M12=1.00000000, M21=-1.00000000, M22=0.00000000,sizingMethod='auto expand')";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0,M12=1,M21=-1,M22=0,sizingMethod='auto expand')}.feedback .handle:hover{text-decoration:none}.vtFooter{text-align:center}.vtFooter p{background:#404952;color:#fff;border-top:1px solid #ddd;padding:1px 0;font-size:.9em;margin-bottom:0}.vtFooter p a{color:#fff}.imageHolder{background:url('../images/loadback.png') repeat-y;background-position:center;padding:10px 0}.breadcrumbContainer{padding:2% 2% 0 2%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;height:auto}.breadcrumb{display:inline-block;height:auto;height:40px}.crumbs{height:40px;margin:0;padding:0 20px 0 0;display:inline-block;font-family:sans-serif}.crumbs li:after{content:'\0000a0';width:0;height:0;border-left:18px solid #ececec;border-top:20px solid transparent;border-bottom:20px solid transparent;display:inline-block;position:relative;top:-20px;left:18px;zoom:1}.crumbs li{height:0;border-top:20px solid #ececec;border-bottom:20px solid #ececec;border-left:20px solid transparent;display:inline-block;box-shadow:0 1px #ddd;margin-right:5px}.crumbs li a{display:inline-block;float:left;margin-top:-13px;font-size:14px;font-weight:bold;color:#666;text-decoration:none}.crumbs li.active{height:0;border-top:20px solid #404952;border-bottom:20px solid #404952;box-shadow:0 1px #404952}.crumbs li.active:after{border-left:18px solid #404952!important}.stepText{display:inline-block;white-space:nowrap;overflow:hidden;font-size:13px;vertical-align:bottom}.active .stepText,.active .stepNum{color:#fff}.stepNum{display:inline-block;padding:0 5px;overflow:hidden;font-size:20px;vertical-align:top;margin-top:5px}.greyStar{background-image:url("../images/stars.png");background-position:20px 20px;height:20px;width:20px;display:inline-block}.yellowStar{background-image:url('../images/stars.png');background-position:0 20px;width:20px;height:20px;display:inline-block}.blockUI{border-radius:2px!important;border:0!important}textarea.col-md-11{width:100%!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.popover .popover-inner{border-radius:2px;font-size:.8em;box-shadow:0}.popover .popover-inner .popover-title{color:#444;font-size:15px}.popover .popover-inner .close{color:#000!important;margin-top:3px;opacity:.5!important}.popover .popover-inner .close:hover{opacity:1!important}.popover .popover-inner td{padding:3px 5px;overflow-wrap:break-word}.popover .popover-inner .detailViewInfo{margin-top:0;box-shadow:0}.popover .popover-inner .detailViewInfo .fieldLabel label{font-size:1em}#findDuplicate>.control-group{margin-bottom:0;width:400px}#moveReports .modal-body{padding:20px 40px}#composeEmailContainer{padding:0 20px}#composeEmailContainer .MultiFile-wrap{display:inline-block}#composeEmailContainer .MultiFile-intercepted .ui-wrapper{min-height:400px}#transferOwnershipContainer .select2-container.select2-container-multi{max-width:220px}.fieldInfo.in{overflow:visible!important;height:auto!important}.moduleSelection{border-radius:2px 2px 0 0!important;border:1px solid #ddd!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);color:#444}.convertLeadModules{margin-bottom:2%;border:1px none}.moduleBlock{border-radius:0!important}.overflowVisible{overflow:visible!important}.convertLeadError{border:3px solid #999;background-color:#fff;width:55%;position:relative;z-index:10000000}.convertLeadError table td{border-bottom:1px solid #ccc;nowrap:nowrap;width:70%}.bootbox,.alert{z-index:1000023}.chzn-container{vertical-align:middle}.chzn-container .chzn-results li{margin-right:7px}.chzn-container .chzn-results .highlighted{background:#404952}.select2-results .select2-highlighted{background:#404952}.select2-result-label i{background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.ui-autocomplete-loading{background:url('../images/load.gif') no-repeat right center}.ui-autocomplete{height:auto!important;border-radius:1px!important}.dropdown-menu.pull-right:after,.dropdown-menu.pull-right:before{right:3px;left:auto;top:-5px;border-bottom-width:6px}span.wrapper a{color:#08c!important;font-size:15px!important;font-weight:bold}a{color:#353c44}a:hover{color:#1e2327;text-decoration:none;cursor:pointer}a:active,a:focus{outline:0}.well{border-radius:2px;padding:15px}.verticalBottomSpacing{margin-bottom:10px}.mergeTables{margin-bottom:0}.font-x-x-large{font-size:18px;line-height:28px}form{margin:0}.fc-state-default .fc-button-effect span{background:0}.dateField{width:183px}.form-horizontal [class^="icon-"],.form-horizontal [class*=" icon-"]{vertical-align:baseline}.timePicker{width:8.5em!important;z-index:1000029!important}.datepicker{z-index:1000029!important}.colorpicker{z-index:1029!important}.colorpicker input{width:30px!important}.colorpicker input[type="text"],.colorpicker input{color:#898989!important}.colorpicker_hex input{width:45px!important}.modal-body.accordion{margin-bottom:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}//.modal-open{// overflow:hidden;//}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.removeNoFileChosen{color:transparent!important}.modelContainer .modal-header{border-radius:2px 2px 0 0}.modelContainer form{border-radius:0 0 2px 2px}.hide{display:none}i{cursor:pointer;text-decoration:none!important}.marginbottomZero{margin-bottom:0!important}.marginLeftZero{margin-left:0!important}.marginRightZero{margin-right:0!important}.clearfix{clear:both!important}textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%}.textOverflowEllipsis{overflow:hidden;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;//width:9em}.margin0px{margin:0!important}.padding10{padding:10px;padding-bottom:0}.padding20{padding:20px}.pushDown{margin-top:5px}.boxSizingBorderBox{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.boxSizingContentBox{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.cursorPointer{cursor:pointer;text-decoration:none!important}.zeroOpacity{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.dullOpacity{opacity:.8;-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80)}.fullOpacity{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.redColor{color:red}.highlightBackgroundColor{background:#eeeff2}.contentsBackground{background:#fff;border:1px solid #ddd}.textAlignCenter{text-align:center}.textAlignRight{text-align:right}.alignMiddle{vertical-align:middle}.alignTop{vertical-align:top}.padding1per{padding:1%}.paddingTop20{padding-top:20px}.padding20px{padding:20px}.padding-bottom1per{padding-bottom:1%}.marginBottom10px{margin-bottom:10px}.displayInlineBlock{display:inline-block}.backgroundImageNone{background-image:none}.liStyleNone{list-style:none outside none}.fontBold{font-weight:bold!important}.livesupport_tab,#userfeedback{display:none!important}#reportDetails table tr td.summary{border-bottom:0;border-top:0}#portalDetailViewHttpError{padding-bottom:7px;margin-top:50px;color:red;text-align:center}.slidesjs-pagination{list-style:none}.slidesjs-pagination li a{display:block;width:13px;height:0;padding-top:13px;background-image:url('../images/pagination.png');background-position:0 0;float:left;overflow:hidden}.slidesjs-pagination li a.active,.slidesjs-pagination li a:hover.active{background-position:0 -13px}.extensionStorebtn{background:#f08c39;background-image:-webkit-linear-gradient(top,#f08c39,#e68b3c);background-image:-moz-linear-gradient(top,#f08c39,#e68b3c);background-image:-ms-linear-gradient(top,#f08c39,#e68b3c);background-image:-o-linear-gradient(top,#f08c39,#e68b3c);background-image:linear-gradient(to bottom,#f08c39,#e68b3c);-webkit-border-radius:2;-moz-border-radius:2;border-radius:2px;text-shadow:0 0 1px #595959;color:#fff;font-size:14px;font-weight:bold;padding:8px 20px 8px 20px;text-decoration:none;border:0}.extensionStorebtn:hover{background:#fc9f3c;background-image:-webkit-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-moz-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-ms-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-o-linear-gradient(top,#fc9f3c,#f08a3c);background-image:linear-gradient(to bottom,#fc9f3c,#f08a3c);text-decoration:none}.extensionSearch{padding:8px 12px 8px 30px!important;margin:6px 0 14px 0;box-shadow:inset 2px 2px 10px #ddd;border-radius:2px!important;background:url('../images/search.png') no-repeat;background-position:5px 6px}.banner-container{border-bottom:1px solid #fff;box-sizing:border-box}.banner{margin:0 90px}.bx-wrapper{margin:0 auto 35px!important;padding-top:17px!important}.bx-wrapper li a{display:block}.bx-wrapper a img{height:100px;width:auto;margin:0 auto}.wide,.table td.wide,.listViewEntries td.wide,td.listViewEntryValue.wide{padding:8px!important}.medium,.table td.medium,.listViewEntries td.medium,td.listViewEntryValue.medium{padding:5px 6px!important}.narrow,.table td.narrow,.listViewEntries td.narrow,td.listViewEntryValue.narrow{padding:2px 4px!important}.table thead th.narrow{vertical-align:middle}td.listViewEntryValue .row input{padding:0;margin-bottom:0}.listViewContentDiv{position:relative}.fieldLabel .pull-right{text-align:right}#tagRecordText{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;width:80%!important}#tagRecord{margin-left:5px!important}.tag{float:right!important}.cut-string{text-overflow:ellipsis;-o-text-overflow:ellipsis;-webkit-text-overflow:ellipsis;width:200px;white-space:nowrap;overflow:hidden}.paddingLRZero{padding-left:0;padding-right:0}.paddingRightZero{padding-right:0}.detailViewToolbar{margin-top:5px}.input-group.input-group-sm>.input-group-addon img{width:15px}table tr td .input-sm{min-width:50px}.modal-footer.backgroundColor{background-color:#f5f5f5}.panel-title{font-size:14px}.quickWidgetContainer .panel-body{padding-bottom:0;padding-top:0}tr.summaryViewEntries,#detailView table{font-size:13px}table.listViewEntriesTable{font-size:13px;margin-top:5px}.no-margin{margin:0}.companyLogo img{max-height:200px;max-width:250px}.navbar-inverse .navbar-nav>li>a{color:#fff;padding:15px 12px}.navbar-inverse .navbar-nav .dropdown-menu>li>a{padding:3px 15px;font-size:12px}.headerCalendar .month h3{font-size:18px;font-weight:bold;margin:5px 0 0 0}.columnsSelect{width:100%!important}.marginBottom5{margin-bottom:5px}.editViewContainer .recordEditView table.blockContainer tr td.fieldValue{width:30%}.recordEditView[name=QuickCreate] .quickCreateContent table tr td.fieldValue,#massEditContainer .massEditContent table tr td.fieldValue,#tab_accounts td.functionList{width:30%}.btn{white-space:normal}.valuesAssignedToRole{border:1px solid #adadad;overflow:hidden;text-overflow:ellipsis;padding:6px}table.dataTable .form-control{width:100%!important}#breadcrumb .stepNum{margin-top:0}#breadcrumb .stepText{position:relative;top:-4px}.fc button{height:auto!important}.fc-toolbar{margin-bottom:0!important}.fc-center,.fc-left,.fc-right{margin-bottom:1em}.calendarRightPanel{padding-left:5px;padding-right:5px}.calendarRightPanel ul li{margin-bottom:2px;margin-left:5px}.calendarRightPanel ul li:hover{background-color:#eee!important;border-radius:5px}.square9{width:12px;height:12px;margin:4px}.panel-dark{border-color:#737373}.panel-dark>.panel-heading{color:#fff;background-color:#737373;border-color:#737373}.panel-dark>.panel-heading+.panel-collapse>.panel-body{border-top-color:#737373}.panel-dark>.panel-heading .badge{color:#737373;background-color:#fff}.panel-dark>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#737373}.calendarRightPanel .widgetContainer ul{margin-top:5px;margin-bottom:5px}.paddingLeft5px{padding-left:5px}.marginBottom5px{margin-bottom:5px}.detailview-table .fieldValue .summaryViewEdit{display:none}.detailview-table .fieldValue:hover .summaryViewEdit{display:inherit}.icon-in-history-widget{font-size:17px;padding:4px}#prefPageHeader .logo img{height:70px;width:70px}#myPrefHeading h3{margin-top:12px}.list-user-img{width:50px;height:40px}span[name=existingImages] img{height:200px;width:300px}.narrow.fieldValue .chosen-container-single .chosen-single{height:26px;line-height:26px}.narrow.fieldValue input{height:26px}.narrow.fieldValue .input-group-addon{padding:4px 10px}.narrow.fieldValue .chosen-container-single .chosen-single div b{background-position-y:4px}.image-in-button{width:18px}.fc-time-grid .fc-time-grid-event.fc-event{min-height:27px;min-width:100px}.fc-time-grid-event.fc-short .fc-title{font-size:1em}.paddingTBZero{padding-top:0;padding-bottom:0}.dashboardWidgetContent a .glyphicon{top:-3px}.detailViewTitle .popover{min-width:130px;text-align:center}.cursorDefault{cursor:default!important}.remindersNoticeContainer{position:fixed;right:0;top:109px;z-index:1029;width:0;height:100%;bottom:30px;overflow-y:auto;background:rgba(0,0,0,0.4);border-left:1px solid #797979;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;overflow-y:auto}.remindersNoticeContainer.toggled{width:380px}.remindersContent{margin:5px 8px 0 8px}.activityTypeIcon{height:20px}.remindersNoticeContainer .panel{margin-bottom:10px}.remindersNoticeContainer .panel-body{padding:10px}.remindersNoticeContainer .actionRow a.btn{margin-right:3%}.remindersNotice{color:#fff;padding:15px 12px}.remindersNotice .glyphicon{font-size:20px}.cancelLink.btn[type='reset'],.cancel.btn[type='reset']{float:right;margin-left:5px;margin-bottom:0}.activityWidgetContainer .popover{min-width:240px}.filterActionImage{margin-left:8px}#tagRecord{line-height:25px}#tagsList .btn-info{margin-left:5px}#tagRecordInput{padding-left:15px;padding-right:15px}.clearReferenceSelection,.createReferenceRecord{padding:0 6px}.relatedPopup{padding:0 4px}.popupContainer .popupModuleName{margin-top:0}.mailRows hr{margin:0}.paddingLeftMd{padding-left:15px}.widget_header div:nth-child(2).btn-toolbar,.editViewContainer .contentHeader.row div:nth-child(2){margin-top:20px}.fieldLabel .referenceMandatory{margin-right:-12px}.ui-widget-content{padding:.8em}.ui-autocomplete .ui-autocomplete-category{font-weight:bold;line-height:1.5}.ui-autocomplete .ui-autocomplete-category:first-child{margin:.8em 0 .2em}.ui-autocomplete .ui-menu-item{padding:.2em .8em}.ui-autocomplete .ui-state-focus{border:0;background:#ebebeb}.widgetHr{margin-top:0}.headerLinksMails .btn-group{margin-top:11px}.finalDiscountUI,.finalTaxUI{bottom:5px}.sideBarTitle{font-size:20px}.globalSearchInput{width:300px}#groupsDetailContainer strong{line-height:21px}#addTaskContainer #taskStatus{margin-left:10px}.scanerMailActionsButtons{min-width:96px}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#404040}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active,.ui-menu .ui-menu-item a.ui-widget-content{font-weight:bold;margin:0;background-color:#428bca;border-color:#357ebd;color:#fff;display:block}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style:none}#layoutEditorButtons{margin-bottom:10px;margin-top:-10px}.individualTaxContainer{text-align:left!important}.suppliesItemsTable .input-group{max-width:200px}.suppliesItemsTable .rowName .input-group{max-width:400px}.suppliesItemsTable td,.suppliesItemsTable th{border:1px solid #ddd}.suppliesItemsTable tfoot td.hideTd{border:0;background:#fafafb}.suppliesSummaryContainer .panel-body,.suppliesSummaryContainer .panel-footer{padding:0}.suppliesSummaryContainer .panel-body .form-group,.suppliesSummaryContainer .panel-footer .form-group{margin:0}.suppliesSummaryContainer .input-group .form-control{background-color:#f5f5f5}.suppliesSummaryContainer .panel-body .percent{min-width:55px}.suppliesItemsTable tfoot{font-weight:800}.suppliesSummaryContainer .panel-heading img{max-width:15px} \ No newline at end of file diff --git a/modules/Supplies/actions/Inventory.php b/modules/Supplies/actions/Inventory.php new file mode 100644 index 000000000000..a5c781cf74a6 --- /dev/null +++ b/modules/Supplies/actions/Inventory.php @@ -0,0 +1,46 @@ + + */ +class Supplies_Inventory_Action extends Vtiger_Action_Controller +{ + + function __construct() + { + $this->exposeMethod('getUnitPrice'); + } + + function checkPermission(Vtiger_Request $request) + { + return true; + } + + function process(Vtiger_Request $request) + { + $mode = $request->getMode(); + + if ($mode) { + $this->invokeExposedMethod($mode, $request); + } + } + + function getUnitPrice(Vtiger_Request $request) + { + $record = $request->get('record'); + $recordModule = $request->get('recordModule'); + $moduleName = $request->getModule(); + $unitPriceValues = false; + + if (in_array($recordModule, ['Products', 'Services'])) { + $recordModel = Vtiger_Record_Model::getInstanceById($record, $recordModule); + $unitPriceValues = $recordModel->getListPriceValues($record); + } + $response = new Vtiger_Response(); + $response->setResult($unitPriceValues); + $response->emit(); + } +} From 49af68667b4ee0acae1be6bfec56250955ebcfb2 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Wed, 26 Aug 2015 13:39:34 +0200 Subject: [PATCH 032/489] Added a function to truncate text --- modules/OSSMailView/models/Record.php | 19 +++---------------- vtlib/Vtiger/Functions.php | 21 ++++++++++++++++++--- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/modules/OSSMailView/models/Record.php b/modules/OSSMailView/models/Record.php index a36fe8a0bfd6..c1fd40df8677 100644 --- a/modules/OSSMailView/models/Record.php +++ b/modules/OSSMailView/models/Record.php @@ -82,10 +82,10 @@ public function showEmailsList($srecord, $smodule, $Config, $type) $to = $this->findRecordsById($row['to_id']); $return[$row['ossmailviewid']]['id'] = $row['ossmailviewid']; $return[$row['ossmailviewid']]['date'] = $row['date']; - $return[$row['ossmailviewid']]['subject'] = ' ' . $this->limit_text($row['subject']) . ''; + $return[$row['ossmailviewid']]['subject'] = ' ' . Vtiger_Functions::textLength($row['subject'],30) . ''; $return[$row['ossmailviewid']]['attachments'] = $row['attachments_exist']; - $return[$row['ossmailviewid']]['from'] = ($from == '' && $from) ? $from : $this->limit_text($row['from_email']); - $return[$row['ossmailviewid']]['to'] = ($to == '' && $to) ? $to : $this->limit_text($row['to_email']); + $return[$row['ossmailviewid']]['from'] = ($from == '' && $from) ? $from : Vtiger_Functions::textLength($row['from_email'],30); + $return[$row['ossmailviewid']]['to'] = ($to == '' && $to) ? $to : Vtiger_Functions::textLength($row['to_email'],30); $return[$row['ossmailviewid']]['type'] = $row['type']; $return[$row['ossmailviewid']]['body'] = Vtiger_Functions::removeHtmlTags(array('link', 'style', 'a', 'img', 'script', 'head', 'base'), decode_html($row['content'])); } @@ -145,19 +145,6 @@ public function findCrmRecordsByMessage_id($params, $metod) return $return; } - public function limit_text($text) - { - $limit = 30; - $count = strlen($text); - if ($count >= $limit) { - $limit_text = substr($text, 0, $limit); - $txt = $limit_text . "..."; - } else { - $txt = $text; - } - return $txt; - } - public function findCrm($text) { $limit = 45; diff --git a/vtlib/Vtiger/Functions.php b/vtlib/Vtiger/Functions.php index d292032ad774..e862345e0520 100644 --- a/vtlib/Vtiger/Functions.php +++ b/vtlib/Vtiger/Functions.php @@ -1327,16 +1327,31 @@ public function getBacktrace($ignore = 2) return $trace; } - public function getDiskSpace($dir = '') { - if($dir == ''){ + if ($dir == '') { $dir = vglobal('root_directory'); } $total = disk_total_space($dir); $free = disk_free_space($dir); $used = $total - $free; - return ['total' => $total,'free' => $free,'used' => $used]; + return ['total' => $total, 'free' => $free, 'used' => $used]; + } + + public function textLength($text, $length = false) + { + if (!$length) { + $length = vglobal('listview_max_textlength'); + } + $newText = preg_replace("/(<\/?)(\w+)([^>]*>)/i", "", $text); + if (function_exists('mb_strlen')) { + if (mb_strlen(html_entity_decode($newText)) > $length) { + $newText = mb_substr(preg_replace("/(<\/?)(\w+)([^>]*>)/i", "", $text), 0, $length, vglobal('default_charset')) . '...'; + } + } elseif (strlen(html_entity_decode($text)) > $length) { + $newText = substr(preg_replace("/(<\/?)(\w+)([^>]*>)/i", "", $text), 0, $length) . '...'; + } + return $newText; } } From 093e050d86d23e4f458bb11210412d8296c9a926 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Wed, 26 Aug 2015 14:20:56 +0200 Subject: [PATCH 033/489] Fix collapse and expand --- layouts/vlayout/modules/Vtiger/resources/Detail.js | 4 ++-- layouts/vlayout/modules/Vtiger/resources/Detail.min.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/vlayout/modules/Vtiger/resources/Detail.js b/layouts/vlayout/modules/Vtiger/resources/Detail.js index 69c39c6725aa..fe2f7c6585a7 100644 --- a/layouts/vlayout/modules/Vtiger/resources/Detail.js +++ b/layouts/vlayout/modules/Vtiger/resources/Detail.js @@ -901,8 +901,8 @@ jQuery.Class("Vtiger_Detail_Js", { }, registerBlockAnimationEvent: function () { var detailContentsHolder = this.getContentHolder(); - detailContentsHolder.on('click', '.blockHeader', function (e) { - var currentTarget = jQuery(e.currentTarget).find('.blockToggle').not('.hide'); + detailContentsHolder.find('.blockHeader').click(function() { + var currentTarget = $(this).find('.blockToggle').not('.hide'); var blockId = currentTarget.data('id'); var closestBlock = currentTarget.closest('.detailview-table'); var bodyContents = closestBlock.find('tbody'); diff --git a/layouts/vlayout/modules/Vtiger/resources/Detail.min.js b/layouts/vlayout/modules/Vtiger/resources/Detail.min.js index 54fcdb9a6e1e..498105b003dc 100644 --- a/layouts/vlayout/modules/Vtiger/resources/Detail.min.js +++ b/layouts/vlayout/modules/Vtiger/resources/Detail.min.js @@ -1,2 +1,2 @@ -jQuery.Class("Vtiger_Detail_Js",{detailInstance:false,SaveResultInstance:false,getInstance:function(){if(Vtiger_Detail_Js.detailInstance==false){var d=app.getModuleName();var b=app.getViewName();var c=d+"_"+b+"_Js";var e=Vtiger_Detail_Js;if(typeof window[c]!="undefined"){var a=new window[c]()}else{var a=new e()}Vtiger_Detail_Js.detailInstance=a}return Vtiger_Detail_Js.detailInstance},triggerSendEmail:function(b,a){Vtiger_Helper_Js.checkServerConfig(a).then(function(e){if(e==true){var d=Vtiger_Detail_Js.getInstance();var c=new Array();var f={};c.push(d.getRecordId());f.module=app.getModuleName();f.view="MassActionAjax";f.selected_ids=c;f.mode="showComposeEmailForm";f.step="step1";f.relatedLoad=true;Vtiger_Index_Js.showComposeEmailPopup(f)}else{alert(app.vtranslate("JS_EMAIL_SERVER_CONFIGURATION"))}})},triggerDetailViewAction:function(f,c){var e=Vtiger_Detail_Js.getInstance();var b=new Array();b.push(e.getRecordId());var a={selected_ids:JSON.stringify(b)};var d={type:"POST",url:f,dataType:"html",data:a};AppConnector.request(d).then(function(g){if(g){app.showModalWindow(g,{"text-align":"left"});if(typeof c=="function"){c(g)}}},function(g,h){})},triggerSendSms:function(b,a){Vtiger_Helper_Js.checkServerConfig(a).then(function(c){if(c==true){Vtiger_Detail_Js.triggerDetailViewAction(b)}else{alert(app.vtranslate("JS_SMS_SERVER_CONFIGURATION"))}})},triggerTransferOwnership:function(c){var b=this;b.getRelatedModulesContainer=false;var a={type:"POST",url:c,dataType:"html",data:{}};AppConnector.request(a).then(function(d){if(d){var e=function(f){var g=app.validationEngineOptions;g.onValidationComplete=function(i,h){if(h){if(i.attr("name")=="changeOwner"){b.transferOwnershipSave(i)}}return false};jQuery("#changeOwner").validationEngine(app.validationEngineOptions)};app.showModalWindow(d,function(g){var f=b.getRelatedModuleContainer();app.changeSelectElementView(f,"select2");if(typeof e=="function"){e(g)}})}})},transferOwnershipSave:function(c){var b=this;var f=jQuery("#transferOwnerId").val();var d=jQuery("#related_modules").val();var a=jQuery("#recordId").val();var e={module:app.getModuleName(),action:"TransferOwnership",record:a,transferOwnerId:f,related_modules:d};AppConnector.request(e).then(function(i){if(i.success){app.hideModalWindow();var k={title:app.vtranslate("JS_MESSAGE"),text:app.vtranslate("JS_RECORDS_TRANSFERRED_SUCCESSFULLY"),animation:"show",type:"info"};var j=jQuery(".assigned_user_id").val();var h=jQuery(".assigned_user_id ");h.find('option[value="'+j+'"]').removeAttr("selected");h.find('option[value="'+f+'"]').attr("selected","selected");h.trigger("liszt:updated");var g=h.find('option[value="'+f+'"]').data("picklistvalue");h.closest(".row-fluid").find(".value").html(''+g+"");Vtiger_Helper_Js.showPnotify(k)}})},getRelatedModuleContainer:function(){if(this.getRelatedModulesContainer==false){this.getRelatedModulesContainer=jQuery("#related_modules")}return this.getRelatedModulesContainer},deleteRecord:function(b){var a=app.vtranslate("LBL_DELETE_CONFIRMATION");Vtiger_Helper_Js.showConfirmationBox({message:a}).then(function(c){AppConnector.request(b+"&ajaxDelete=true").then(function(d){if(d.success==true){window.location.href=d.result}else{Vtiger_Helper_Js.showPnotify(d.error.message)}})},function(c,d){})},reloadRelatedList:function(){var a=jQuery('[name="currentPageNum"]').val();var b=Vtiger_Detail_Js.getInstance();b.loadRelatedList(a)},showWorkflowTriggerView:function(a){$(a).popover("hide");var b=Vtiger_Detail_Js.getInstance();var c={module:app.getModuleName(),view:"WorkflowTrigger",record:b.getRecordId()};var d=function(e){e.find('[type="submit"]').click(function(h){var g=[];e.find('input[type="checkbox"]:checked').each(function(j){g.push($(this).val())});if(g.length==0){var i={title:app.vtranslate("JS_INFORMATION"),text:app.vtranslate("JS_NOT_SELECTED_WORKFLOW_TRIGGER"),type:"error",animation:"show"};Vtiger_Helper_Js.showPnotify(i)}else{var i={title:app.vtranslate("JS_MESSAGE"),text:app.vtranslate("JS_STARTED_PERFORM_WORKFLOW"),type:"info",animation:"show"};Vtiger_Helper_Js.showPnotify(i);var f={module:app.getModuleName(),action:"Workflow",mode:"execute",record:b.getRecordId(),ids:g};AppConnector.request(f).then(function(j){var k={title:app.vtranslate("JS_MESSAGE"),text:app.vtranslate("JS_COMPLETED_PERFORM_WORKFLOW"),type:"success",animation:"show"};Vtiger_Helper_Js.showPnotify(k);app.hideModalWindow();b.loadWidgets()},function(j,k){var l={title:app.vtranslate("JS_ERROR"),text:app.vtranslate("JS_ERROR_DURING_TRIGGER_OF_WORKFLOW"),type:"error",animation:"show"};Vtiger_Helper_Js.showPnotify(l);app.hideModalWindow()})}})};AppConnector.request(c).then(function(e){if(e){app.showModalWindow(e,"",d)}},function(e,f){})},},{targetPicklistChange:false,targetPicklist:false,detailViewContentHolder:false,detailViewForm:false,detailViewDetailsTabLabel:"LBL_RECORD_DETAILS",detailViewSummaryTabLabel:"LBL_RECORD_SUMMARY",detailViewRecentCommentsTabLabel:"ModComments",detailViewRecentActivitiesTabLabel:"Activities",detailViewRecentUpdatesTabLabel:"LBL_UPDATES",detailViewRecentDocumentsTabLabel:"Documents",fieldUpdatedEvent:"Vtiger.Field.Updated",widgetPostLoad:"Vtiger.Widget.PostLoad",updatedFields:["company","designation","title"],fieldPreSave:"Vtiger.Field.PreSave",tempData:[],referenceFieldNames:{Calendar:{Accounts:"link",Leads:"link",Contacts:"link",Vendors:"link",OSSEmployees:"link",Campaigns:"process",HelpDesk:"process",Potentials:"process",Projects:"process",ServiceContracts:"process",},OutsourcedProducts:{Potentials:"potential",Leads:"parent_id",Accounts:"parent_id",Contacts:"parent_id"},Assets:{Potentials:"potential",Accounts:"parent_id",Contacts:"parent_id"},OSSOutsourcedServices:{Potentials:"potential",Leads:"parent_id",Accounts:"parent_id",Contacts:"parent_id"},OSSSoldServices:{Potentials:"potential",Accounts:"parent_id",Contacts:"parent_id"},},init:function(){},getDeleteMessageKey:function(){return"JS_DELETE_CONFIRMATION"},loadWidgets:function(){var a=this;var b=jQuery('[class^="widgetContainer_"]');b.each(function(c,e){var d=jQuery(e);a.loadWidget(d)})},loadWidget:function(f){var e=this;var b=jQuery.Deferred();var d=jQuery(".widget_header",f);var c=jQuery(".widget_contents",f);var a=f.data("url");var h=d.find('[name="relatedModule"]').val();var g={type:"GET",dataType:"html",data:a};c.progressIndicator({});AppConnector.request(g).then(function(i){c.progressIndicator({mode:"hide"});c.html(i);app.registerEventForTextAreaFields(jQuery(".commentcontent"));c.trigger(e.widgetPostLoad,{widgetName:h});app.showPopoverElementView(c.find(".popoverTooltip"));b.resolve(g)},function(i){c.progressIndicator({mode:"hide"});b.reject()});return b.promise()},loadCommentsWidget:function(){},loadContents:function(b,e){var d=this;var a=jQuery.Deferred();var c=this.getContentHolder();var f=b;if(typeof e!="undefined"){f={};f.url=b;f.data=e}AppConnector.requestPjax(f).then(function(g){c.html(g);g=c.html();d.registerBlockStatusCheckOnLoad();app.changeSelectElementView(c);app.registerEventForDatePickerFields(c);app.registerEventForTextAreaFields(jQuery(".commentcontent"));jQuery(".commentcontent").autosize();d.getForm().validationEngine();c.trigger(jQuery.Event("Detail.LoadContents.PostLoad"),g);a.resolve(g)},function(){});return a.promise()},getUpdatefFieldsArray:function(){return this.updatedFields},getTabByLabel:function(a){var c=this.getTabs();var b=false;c.each(function(e,f){var g=jQuery(f);var d=g.data("labelKey");if(d==a){b=g;return false}});return b},selectModuleTab:function(){var a=this.getTabContainer();var b=a.find("li.module-tab");this.deSelectAllrelatedTabs();this.markTabAsSelected(b)},deSelectAllrelatedTabs:function(){var a=this.getTabContainer();this.getTabs().removeClass("active")},markTabAsSelected:function(a){a.addClass("active")},getSelectedTab:function(){var a=this.getTabContainer();return a.find("li.active")},getTabContainer:function(){return jQuery("div.related")},getTabs:function(){return this.getTabContainer().find("li")},getContentHolder:function(){if(this.detailViewContentHolder==false){this.detailViewContentHolder=jQuery("div.details div.contents")}return this.detailViewContentHolder},getForm:function(){if(this.detailViewForm==false){this.detailViewForm=jQuery("#detailView")}return this.detailViewForm},getRecordId:function(){return jQuery("#recordId").val()},getRelatedModuleName:function(){if(jQuery(".relatedModuleName",this.getContentHolder()).length==1){return jQuery(".relatedModuleName",this.getContentHolder()).val()}},saveFieldValues:function(b){var a=jQuery.Deferred();var c=this.getRecordId();var d={};if(typeof b!="undefined"){d=b}d.record=c;d.module=app.getModuleName();d.action="SaveAjax";var e={};e.data=d;e.async=false;e.dataType="json";AppConnector.request(e).then(function(f){a.resolve(f)});return a.promise()},getRelatedListCurrentPageNum:function(){return jQuery('input[name="currentPageNum"]',this.getContentHolder()).val()},removeCommentBlockIfExists:function(){var a=this.getContentHolder();var b=jQuery(".commentsBody",a);jQuery(".addCommentBlock",b).remove()},getCommentThread:function(b){var a=jQuery.Deferred();AppConnector.request(b).then(function(c){a.resolve(c)},function(c,d){});return a.promise()},saveComment:function(k){var p=this;var j=jQuery.Deferred();var b=jQuery(k.currentTarget);var g=b.data("mode");var o=b.closest(".addCommentBlock");var q=o.find(".commentcontent");var l=q.val();var i;if(l==""){i=app.vtranslate("JS_LBL_COMMENT_VALUE_CANT_BE_EMPTY");q.validationEngine("showPrompt",i,"error","bottomLeft",true);j.reject();return j.promise()}if(g=="edit"){var n=o.find('[name="reasonToEdit"]').val()}var d=jQuery.progressIndicator({});var f=jQuery(k.currentTarget);f.attr("disabled","disabled");var m=o.closest(".commentDetails").find(".commentInfoHeader");var h=m.data("commentid");var c=m.data("parentcommentid");var a={commentcontent:l,related_to:p.getRecordId(),module:"ModComments"};if(g=="edit"){a.record=h;a.reasontoedit=n;a.parent_comments=c;a.mode="edit";a.action="Save"}else{if(g=="add"){a.parent_comments=h;a.action="SaveAjax"}}AppConnector.request(a).then(function(e){d.progressIndicator({mode:"hide"});j.resolve(e)},function(r,e){d.progressIndicator({mode:"hide"});f.removeAttr("disabled");j.reject(r,e)});return j.promise()},getCommentUI:function(c){var b=jQuery.Deferred();var a={view:"DetailAjax",module:"ModComments",record:c};AppConnector.request(a).then(function(d){b.resolve(d)},function(d,e){});return b.promise()},getCommentBlock:function(){var b=this.getContentHolder();var a=jQuery(".basicAddCommentBlock",b).clone(true,true).removeClass("basicAddCommentBlock hide").addClass("addCommentBlock");a.find(".commentcontenthidden").removeClass("commentcontenthidden").addClass("commentcontent");return a},getEditCommentBlock:function(){var b=this.getContentHolder();var a=jQuery(".basicEditCommentBlock",b).clone(true,true).removeClass("basicEditCommentBlock hide").addClass("addCommentBlock");a.find(".commentcontenthidden").removeClass("commentcontenthidden").addClass("commentcontent");return a},registerSendSmsSubmitEvent:function(){var a=this;jQuery("body").on("submit","#massSave",function(f){var d=jQuery(f.currentTarget);var b=d.find("#message").val().length;if(b>160){var g={title:app.vtranslate("JS_MESSAGE"),text:app.vtranslate("LBL_SMS_MAX_CHARACTERS_ALLOWED"),animation:"show",type:"error"};Vtiger_Helper_Js.showPnotify(g);return false}var c=d.find(":submit");c.attr("disabled","disabled");a.SendSmsSave(d);f.preventDefault()})},SendSmsSave:function(b){var c=jQuery.progressIndicator({position:"html",blockInfo:{enabled:true}});var a=b.serializeFormData();AppConnector.request(a).then(function(d){app.hideModalWindow();c.progressIndicator({mode:"hide"})},function(d,e){})},registerNameAjaxEditEvent:function(){var b=this;var a=b.getContentHolder();a.on(b.fieldUpdatedEvent,".nameField",function(i,j){var h=b.getForm();var f=h.data("nameFields");var d="";for(var g in f){if(g!=0){d+=" "}var k=f[g];d+=h.find('[name="'+k+'"]').val()}var c=a.closest(".contentsDiv").find(".recordLabel");c.text(d)})},updateHeaderNameFields:function(){var k=this;var a=k.getContentHolder();var c=k.getForm();var b=c.data("nameFields");var l=a.closest(".contentsDiv").find(".recordLabel");var i="";for(var g in b){var f=b[g];var j=c.find('[name="'+f+'"]');if(j.length>0){var h=j.val();i+=h+" ";l.find('[class="'+f+'"]').text(h)}}var d=l.find(".salutation");if(d.length>0){var e=d.text();i=e+i}l.attr("title",i)},registerAjaxEditEvent:function(){var b=this;var a=b.getContentHolder();a.on(b.fieldUpdatedEvent,"input,select,textarea",function(c){b.updateHeaderValues(jQuery(c.currentTarget))})},updateHeaderValues:function(d){var f=this;if(d.hasClass("nameField")){f.updateHeaderNameFields();return true}var c=d.attr("name");var g=this.getUpdatefFieldsArray();var e=f.getContentHolder();if(jQuery.inArray(c,g)!="-1"){var b=d.val();var a=e.closest(".contentsDiv").find("."+c+"_label");a.text(b)}},registerEmailFieldClickEvent:function(){var a=this.getContentHolder();a.on("click",".emailField",function(b){b.stopPropagation()})},registerPhoneFieldClickEvent:function(){var a=this.getContentHolder();a.on("click",".phoneField",function(b){b.stopPropagation()})},registerUrlFieldClickEvent:function(){var a=this.getContentHolder();a.on("click",".urlField",function(b){b.stopPropagation()})},registerRelatedRowClickEvent:function(){var a=this.getContentHolder();a.on("click",".listViewEntries",function(d){var b=jQuery(d.target,jQuery(d.currentTarget));if(b.is("td:first-child")&&(b.children('input[type="checkbox"]').length>0)){return}if(jQuery(d.target).is('input[type="checkbox"]')){return}var c=jQuery(d.currentTarget);var f=c.data("recordurl");if(typeof f!="undefined"){window.location.href=f}})},loadRelatedList:function(a){var b=new Vtiger_RelatedList_Js(this.getRecordId(),app.getModuleName(),this.getSelectedTab(),this.getRelatedModuleName());var c={page:a};b.loadRelatedList(c)},registerEventForRelatedListPagination:function(){var b=this;var a=this.getContentHolder();a.on("click","#relatedListNextPageButton",function(g){var d=jQuery(g.currentTarget);if(d.attr("disabled")=="disabled"){return}var c=b.getSelectedTab();var h=b.getRelatedModuleName();var f=new Vtiger_RelatedList_Js(b.getRecordId(),app.getModuleName(),c,h);f.nextPageHandler()});a.on("click","#relatedListPreviousPageButton",function(){var c=b.getSelectedTab();var e=b.getRelatedModuleName();var d=new Vtiger_RelatedList_Js(b.getRecordId(),app.getModuleName(),c,e);d.previousPageHandler()});a.on("click","#relatedListPageJump",function(f){var c=b.getSelectedTab();var g=b.getRelatedModuleName();var d=new Vtiger_RelatedList_Js(b.getRecordId(),app.getModuleName(),c,g);d.getRelatedPageCount()});a.on("click","#relatedListPageJumpDropDown > li",function(c){c.stopImmediatePropagation()}).on("keypress","#pageToJump",function(f){var c=b.getSelectedTab();var g=b.getRelatedModuleName();var d=new Vtiger_RelatedList_Js(b.getRecordId(),app.getModuleName(),c,g);d.pageJumpHandler(f)})},registerEventForRelatedList:function(){var b=this;var a=this.getContentHolder();b.registerEventForAddingRelatedRecord(a);a.on("click",".relatedListHeaderValues",function(g){var d=jQuery(g.currentTarget);var c=b.getSelectedTab();var h=b.getRelatedModuleName();var f=new Vtiger_RelatedList_Js(b.getRecordId(),app.getModuleName(),c,h);f.sortHandler(d)});a.on("click","button.selectRelation",function(g){var c=b.getSelectedTab();var i=b.getRelatedModuleName();if(i==undefined){i=jQuery(g.currentTarget).data("modulename")}var d=jQuery(g.currentTarget).data("rf");var h={};if(d&&Object.keys(d).length>0){h={search_key:d.key,search_value:d.name}}var f=new Vtiger_RelatedList_Js(b.getRecordId(),app.getModuleName(),c,i);f.showSelectRelationPopup(h).then(function(j){var e=jQuery(j).find('[name="emailEnabledModules"]').val();if(e){b.registerEventToEditRelatedStatus()}})});a.on("click","a.relationDelete",function(h){h.stopImmediatePropagation();var f=jQuery(h.currentTarget);var c=Vtiger_Detail_Js.getInstance();var d=c.getDeleteMessageKey();var g=app.vtranslate(d);Vtiger_Helper_Js.showConfirmationBox({message:g}).then(function(m){var o=f.closest("tr");var k=o.data("id");var i=f.closest(".widget_contents");var j=b.getSelectedTab();var n=b.getRelatedModuleName();if(n==undefined){n=i.find(".relatedModuleName").val()}var l=new Vtiger_RelatedList_Js(b.getRecordId(),app.getModuleName(),j,n);l.deleteRelation([k]).then(function(e){l.loadRelatedList()})},function(e,i){})})},registerBlockAnimationEvent:function(){var a=this.getContentHolder();a.on("click",".blockHeader",function(h){var c=jQuery(h.currentTarget).find(".blockToggle").not(".hide");var f=c.data("id");var i=c.closest(".detailview-table");var b=i.find("tbody");var g=c.data();var d=app.getModuleName();var j=function(){b.addClass("hide");app.cacheSet(d+"."+f,0)};var k=function(){b.removeClass("hide");app.cacheSet(d+"."+f,1)};var g=c.data();if(g.mode=="show"){j();c.addClass("hide");i.find('[data-mode="hide"]').removeClass("hide")}else{k();c.addClass("hide");i.find("[data-mode='show']").removeClass("hide")}})},registerBlockStatusCheckOnLoad:function(){var b=this.getContentHolder().find(".detailview-table");var a=app.getModuleName();b.each(function(d,j){var g=jQuery(j);var f=g.find(".blockToggle").not(".hide");var i=g.find("tbody");var c=f.data("id");var h=a+"."+c;var e=app.cacheGet(h,null);if(e!=null){if(e==1){f.addClass("hide");g.find("[data-mode='show']").removeClass("hide");i.removeClass("hide")}else{f.addClass("hide");g.find("[data-mode='hide']").removeClass("hide");i.addClass("hide")}}})},registerEventForAddingRelatedRecord:function(){var b=this;var a=this.getContentHolder();a.on("click",'[name="addButton"]',function(g){var d=jQuery(g.currentTarget);var c=b.getSelectedTab();var h=b.getRelatedModuleName();if(d.hasClass("quickCreateSupported")!=true){window.location.href=d.data("url");return}var f=new Vtiger_RelatedList_Js(b.getRecordId(),app.getModuleName(),c,h);f.addRelatedRecord(d)})},ajaxEditHandling:function(d){var c=this;var b=jQuery(".value",d);var f=jQuery(".edit",d);var e=jQuery(".summaryViewEdit",d);var a=jQuery(".fieldname",f);jQuery(a).each(function(l,k){var n=jQuery(k).val();var j=jQuery(k);var g=jQuery('[name="'+n+'"]',f);if(g.attr("disabled")=="disabled"){return}if(f.length<=0){return}if(f.is(":visible")){return}g.inputmask();var i=false;if(g.inputmask("hasMaskedValue")){i=true}b.addClass("hide");e.addClass("hide");f.removeClass("hide").children().filter('input[type!="hidden"]input[type!="image"],select').filter(":first").focus();var o=false;var m=false;var h=function(x){var w=jQuery(x.target);if((w.closest("td").is(d))){return}g.inputmask("remove");d.removeAttr("tabindex");var u=j.data("prevValue");var z=c.getForm();var t=z.serializeFormData();var A=t[n];var s=A;var q=Vtiger_Field_Js.getInstance(g.data("fieldinfo"));var v=[];var C=false;if(f.find("[data-fieldinfo]").length==2){f.find("[data-fieldinfo]").each(function(){var D=[];D.name=jQuery(this).attr("name");D.type=jQuery(this).data("fieldinfo").type;if(D.type=="datetime"){C=true}v.push(D)})}if(g.is("input:checkbox")){if(g.is(":checked")){A="1"}else{A="0"}g=g.filter('[type="checkbox"]')}var y=g.validationEngine("validate");if(y){if(i){g.inputmask()}return}g.validationEngine("hide");if(u==A){f.addClass("hide");b.removeClass("hide");e.removeClass("hide");jQuery(document).off("click","*",h)}else{var p=jQuery.Event(c.fieldPreSave);g.trigger(p,{fieldValue:s,recordId:c.getRecordId()});if(p.isDefaultPrevented()){o=false;m=true;return}m=false;jQuery(document).off("click","*",h);if(!o&&!m){o=true;if(Vtiger_Detail_Js.SaveResultInstance==false){Vtiger_Detail_Js.SaveResultInstance=new SaveResult()}t.record=c.getRecordId();t.module=app.getModuleName();t.view="quick_edit";if(Vtiger_Detail_Js.SaveResultInstance.checkData(t)==false){f.addClass("hide");b.removeClass("hide");e.removeClass("hide");jQuery(document).off("click","*",h);return}}else{return}d.progressIndicator();f.addClass("hide");var B={};if(q.getType()=="multipicklist"||q.getType()=="sharedOwner"){var r=n.split("[]");n=r[0]}B.value=s;B.field=n;B=c.getCustomFieldNameValueMap(B);c.saveFieldValues(B).then(function(D){var H=D.result;d.progressIndicator({mode:"hide"});b.removeClass("hide");e.removeClass("hide");var G=H[n].display_value;if(v.length&&C){G=H[v[0].name].display_value+" "+H[v[1].name].display_value}b.html(G);g.trigger(c.fieldUpdatedEvent,{old:u,"new":s});j.data("prevValue",A);g.data("selectedValue",A);if(c.targetPicklistChange){if(jQuery(".summaryView",c.getForm()).length>0){c.targetPicklist.find(".summaryViewEdit").trigger("click")}else{c.targetPicklist.trigger("click")}c.targetPicklistChange=false;c.targetPicklist=false}var F=c.getSelectedTab();if(F.data("linkKey")==c.detailViewSummaryTabLabel){var E=c.getContentHolder();jQuery(".detailViewInfo .related li.active").trigger("click");c.registerSummaryViewContainerEvents(E);c.registerEventForPicklistDependencySetup(c.getForm());c.registerEventForRelatedList()}else{if(F.data("linkKey")==c.detailViewDetailsTabLabel){c.registerEventForPicklistDependencySetup(c.getForm())}}},function(D){d.progressIndicator({mode:"hide"})})}};jQuery(document).on("click","*",h)})},triggerDisplayTypeEvent:function(){var a=app.cacheGet("widthType","narrowWidthType");if(a){var b=jQuery("#detailView").find("td");b.addClass(a)}},addElementsToQuickCreateForCreatingRelation:function(a,b){jQuery('').appendTo(a);jQuery.each(b,function(c,d){jQuery('').appendTo(a)})},registerEventForActivityWidget:function(){var a=this;jQuery(".createActivity").on("click",function(j){var b="Calendar";var f=a.getRecordId();var c=app.getModuleName();var h=jQuery(j.currentTarget);var d={};d.sourceModule=c;d.sourceRecord=f;if(c!=""&&b!=""&&typeof a.referenceFieldNames[b]!="undefined"&&typeof a.referenceFieldNames[b][c]!="undefined"){var l=a.referenceFieldNames[b][c];d[l]=f}var k=h.data("url");var m=function(q){a.addElementsToQuickCreateForCreatingRelation(q,d);var o=q.find('[class^="CalendarQuikcCreateContents"]').find("#goToFullForm");var p=q.find('[class^="EventsQuikcCreateContents"]').find("#goToFullForm");var e=o.data("edit-view-url")+"&"+k;var n=p.data("edit-view-url")+"&"+k;o.data("editViewUrl",e);p.data("editViewUrl",n)};var i=function(){var o=h.closest(".summaryWidgetContainer");var e=o.find(".widgetContentBlock");var n=e.data("url");var p={type:"GET",dataType:"html",data:n};AppConnector.request(p).then(function(r){var q=o.find(".widget_contents");q.html(r);app.changeSelectElementView(q);a.registerEventForActivityWidget()});a.loadWidgets()};var g={};g.callbackPostShown=m;g.callbackFunction=i;g.data=d;g.noCache=false;Vtiger_Header_Js.getInstance().quickCreateModule(b,g)})},getEndDate:function(a){var d=a.split("-");var c=new Date(d[0],d[1],d[2]);var b=new Date();b.setDate(c.getDate()+2);return app.getStringDate(b)},getSingleEventType:function(e,b,g){var f=jQuery('[name="date_start"]');var c=jQuery(f).val();var h=jQuery(f).data("date-format");var j=Vtiger_Helper_Js.convertToDateString(c,h,e,g);var a=jQuery.extend({},["#b6a996,black"]);var i=this;var d={module:"Calendar",action:"Feed",start:j,end:this.getEndDate(j),type:g,mapping:a};AppConnector.request(d).then(function(m){var k=Vtiger_Helper_Js.convertToDateString(c,h,e);if(!jQuery.isEmptyObject(m)){if(m[0]["activitytype"]==="Task"){for(var n in m){if(m[n]["start"].indexOf(k)>-1){jQuery("#"+b+" .table").append(''+m[n]["title"]+"")}}}else{for(var l=0;l-1){jQuery("#"+b+" .table").append(''+m[0][l]["title"]+"")}}}}})},registerFilterForAddingModuleRelatedRecordFromSummaryWidget:function(){var a=this;jQuery(".createRecordFromFilter").on("click",function(o){var m=jQuery(o.currentTarget);var n=m.closest(".summaryWidgetContainer");var g=n.find(".widget_contents");var h=g.find('[name="relatedModule"]').val();var q=m.data("url");var k=a.getRecordId();var i={};var f=m.data("prf");var l=m.data("acf");var c=m.closest(".widget_header").find('[name="relatedModule"]').val();var j={};var d=function(e){a.postSummaryWidgetAddRecord(e,m);if(h=="ProjectTask"){a.loadModuleSummary()}};if(typeof f!="undefined"){j[f]=k}if(typeof l!="undefined"){$.each(l,function(e,r){j[e]=r})}if(Object.keys(j).length>0){i.data=j}i.noCache=true;i.callbackFunction=d;var b=jQuery.progressIndicator();var p=new Vtiger_Header_Js();p.getQuickCreateForm(q,c,i).then(function(e){p.handleQuickCreateData(e,i);b.progressIndicator({mode:"hide"})})})},registerChangeFilterForWidget:function(){var a=this;jQuery(".widget_header .filterField").on("change",function(m){var n=this.name;var j={};var i={};var k=jQuery(m.currentTarget);var l=k.closest(".summaryWidgetContainer");var b=l.find(".widget_contents");b.progressIndicator();var f=b.find('[name="relatedModule"]').val();var h=a.getRecordId();var d=app.getModuleName();var o=k.find("option:selected").val();var c=k.data("fieldlable");var g=l.find('[name="filter_data"]').val();if(o!=c){j[g]=o;i.whereCondition=j}i.record=h;i.view="Detail";i.module=d;i.page=b.find('[name="page"]').val();i.limit=b.find('[name="pageLimit"]').val();i.col=b.find('[name="col"]').val();i.relatedModule=f;i.mode="showRelatedRecords";AppConnector.request(i).then(function(e){b.html(e);currentDiv.progressIndicator({mode:"hide"})})})},registerChangeSwitchForWidget:function(){var a=this;$(".summaryWidgetContainer .widget_header .switchBtnReload").on("switchChange.bootstrapSwitch",function(j,c){var h=jQuery(j.currentTarget);var i=h.closest(".summaryWidgetContainer");var g=i.find(".widgetContentBlock");var d=g.data("url");var f=h.data("urlparams");if(f!=""){var l=h.data("on-val");var k=h.data("off-val");d=d.replace("&"+f+"="+l,"");d=d.replace("&"+f+"="+k,"");if(c){var b=l}else{var b=k}if(b!=""){d+="&"+f+"="+b}g.data("url",d);a.loadWidget($(g))}});$(".activityWidgetContainer .switchBtn").on("switchChange.bootstrapSwitch",function(h,g){var d=jQuery(h.currentTarget);var b=d.closest(".summaryWidgetContainer");var f=b.find(".widgetContentBlock");var c=f.data("url");c=c.replace("&type=current","");c+="&type=";if(g){c+="current"}else{c+="history"}f.data("url",c);a.loadWidget($(f))});$(".calculationsWidgetContainer .calculationsSwitch").on("switchChange.bootstrapSwitch",function(h,g){var d=jQuery(h.currentTarget);var b=d.closest(".summaryWidgetContainer");var f=b.find(".widgetContentBlock");var c=f.data("url");c=c.replace("&showtype=open","");c=c.replace("&showtype=archive","");c+="&showtype=";if(g){c+="open"}else{c+="archive"}f.data("url",c);a.loadWidget($(f))});$(".potentialsWidgetContainer .potentialsSwitch").on("switchChange.bootstrapSwitch",function(h,g){var d=jQuery(h.currentTarget);var b=d.closest(".summaryWidgetContainer");var f=b.find(".widgetContentBlock");var c=f.data("url");c=c.replace("&showtype=open","");c=c.replace("&showtype=archive","");c+="&showtype=";if(g){c+="open"}else{c+="archive"}f.data("url",c);a.loadWidget($(f))})},registerSummaryViewContainerEvents:function(d){var b=this;this.registerEventForActivityWidget();this.registerChangeFilterForWidget();this.registerChangeSwitchForWidget();this.registerFilterForAddingModuleRelatedRecordFromSummaryWidget();if(Vtiger_Detail_Js.SaveResultInstance==false){Vtiger_Detail_Js.SaveResultInstance=new SaveResult()}var a=b.getForm();var c=a.serializeFormData();d.off("click").on("click",".row .summaryViewEdit",function(h){var g=jQuery(h.currentTarget);g.addClass("hide");var f=g.closest("td.fieldValue");b.ajaxEditHandling(f);Vtiger_Detail_Js.SaveResultInstance.loadFormData(c)});Vtiger_Detail_Js.SaveResultInstance.loadFormData(c);d.on(b.fieldUpdatedEvent,".recordDetails",function(g,h){var f=d.find("[data-type='Updates']");b.loadWidget(f)});d.on("click",".editDefaultStatus",function(m){var l=jQuery(m.currentTarget);l.popover("hide");var h=l.closest(".activityStatus");var k=l.closest(".activityEntries");var f=k.find(".activityId").val();var j=h.find(".edit");var i=jQuery('[name="'+l.data("field")+'"]',j);var g=h.find(".editStatus");if(b.tempData.indexOf(f)<0){b.tempData.push(f);g.trigger("click");i.val(l.data("status")).trigger("chosen:updated");g.trigger("clickoutside")}});d.on("click",".editStatus",function(k){var j=jQuery(k.currentTarget);var g=j.closest(".activityStatus");var h=g.find(".edit");var i=g.find(".value");j.hide();i.addClass("hide");h.removeClass("hide").show();var f=function(){var t=jQuery(".fieldname",h);var w=t.val();var m=jQuery('[name="'+w+'"]',h);var o=t.data("prevValue");var u=m.find("option:selected").val();var s=m.find("option:selected").text();var n=g.closest(".activityEntries");var l=n.find(".activityId").val();var e=n.find(".activityModule").val();var v=n.find(".activityType").val();if(Vtiger_Detail_Js.SaveResultInstance==false){Vtiger_Detail_Js.SaveResultInstance=new SaveResult()}var q={};q.record=l;q.module=e;q.view="quick_edit";q[w]=u;q["p_"+w]=o;if(Vtiger_Detail_Js.SaveResultInstance.checkData(q)==false){return}if(o==u){h.addClass("hide");i.removeClass("hide");j.show()}else{var r=m.validationEngine("validate");if(r){Vtiger_Helper_Js.addClickOutSideEvent(g,f);return}h.addClass("hide");var p={action:"SaveAjax",record:l,field:w,value:u,module:e,activitytype:v};AppConnector.request(p).then(function(z){i.removeClass("hide");j.show();i.html(s);t.data("prevValue",u);if("Held"==u||"Completed"==u){var A=j.closest(".activityEntries");A.find("popoverTooltip").popover("hide");var y=j.closest(".widgetContentBlock");var x=jQuery(y);b.loadWidget(x)}})}};Vtiger_Helper_Js.addClickOutSideEvent(g,f)});d.on("click",".editDescription",function(k){var j=jQuery(k.currentTarget);var g=j.closest(".activityDescription");var h=g.find(".edit");var i=g.find(".value");j.hide();i.addClass("hide");h.removeClass("hide").show();var f=function(){var t=jQuery(".fieldname",h);var w=t.val();var m=jQuery('[name="'+w+'"]',h);var o=t.data("prevValue");var u=m.val();var s=m.val();var n=g.closest(".activityEntries");var l=n.find(".activityId").val();var e=n.find(".activityModule").val();var v=n.find(".activityType").val();if(Vtiger_Detail_Js.SaveResultInstance==false){Vtiger_Detail_Js.SaveResultInstance=new SaveResult()}var q={};q.record=l;q.module=e;q.view="quick_edit";q[w]=u;q["p_"+w]=o;if(Vtiger_Detail_Js.SaveResultInstance.checkData(q)==false){return}if(o==u){h.addClass("hide");i.removeClass("hide");j.show()}else{var r=m.validationEngine("validate");if(r){Vtiger_Helper_Js.addClickOutSideEvent(g,f);return}g.progressIndicator();h.addClass("hide");var p={action:"SaveAjax",record:l,field:w,value:u,module:e,activitytype:v};AppConnector.request(p).then(function(x){g.progressIndicator({mode:"hide"});i.removeClass("hide");j.show();i.html(s);t.data("prevValue",u)})}};Vtiger_Helper_Js.addClickOutSideEvent(g,f)});jQuery(".changeDetailViewMode").on("click",function(g){var f=jQuery(".detailViewContainer");f.find('.nav li[data-link-key="LBL_RECORD_DETAILS"]').trigger("click")});jQuery(".createRecord").on("click",function(p){var n=jQuery(p.currentTarget);var o=n.closest(".summaryWidgetContainer");var l=o.find(".widget_header");var g=l.find('[name="relatedModule"]').val();var k=b.getRecordId();var h=app.getModuleName();var j={};j.sourceModule=h;j.sourceRecord=k;if(h!=""&&g!=""&&typeof b.referenceFieldNames[g]!="undefined"&&typeof b.referenceFieldNames[g][h]!="undefined"){var q=b.referenceFieldNames[g][h];j[q]=k}var f=function(e){b.postSummaryWidgetAddRecord(e,n)};var i=function(e){b.addElementsToQuickCreateForCreatingRelation(e,j)};var m={};m.callbackFunction=f;m.goToFullFormcallback=i;m.data=j;m.noCache=false;Vtiger_Header_Js.getInstance().quickCreateModule(g,m)});this.registerFastEditingFiels()},addRelationBetweenRecords:function(e,a){var b=jQuery.Deferred();var d=this;var c=d.getSelectedTab();var f=new Vtiger_RelatedList_Js(d.getRecordId(),app.getModuleName(),c,e);f.addRelations(a).then(function(h){var i=d.getContentHolder();var g=i.find("[data-type='Updates']");if(g.length>0){d.loadWidget(g)}b.resolve(h)},function(h,g){b.reject(h,g)});return b.promise()},postSummaryWidgetAddRecord:function(f,h){var i=h.closest(".summaryWidgetContainer");var e=i.find(".widget_header");var a=i.find(".widget_contents");var b=e.find('[name="relatedModule"]').val();var d=this.getRecordId();var c=app.getModuleName();var g=new Array();g.push(f.result._recordId);a.progressIndicator({});this.addRelationBetweenRecords(b,g).then(function(j){var k={};k.record=d;k.view="Detail";k.module=c;k.page=a.find('[name="page"]').val();k.limit=a.find('[name="pageLimit"]').val();k.col=a.find('[name="col"]').val();k.relatedModule=b;k.mode="showRelatedRecords";AppConnector.request(k).then(function(m){var l=jQuery("#relatedDocuments");a.progressIndicator({mode:"hide"});a.html(m);app.changeSelectElementView(l)})})},registerEventForEmailsRelatedRecord:function(){var a=this.getContentHolder();var c=a.find('[name="emailsRelatedRecord"]');var d=this.getRecordId();var b=Vtiger_Popup_Js.getInstance();a.on("click",'[name="emailsRelatedRecord"]',function(h){var g=jQuery(h.currentTarget);var f=g.data("id");var i={};i.module="Emails";i.view="ComposeEmail";i.mode="emailPreview";i.record=f;i.parentId=d;i.relatedLoad=true;b.show(i)});a.on("click",'[name="emailsEditView"]',function(g){g.stopPropagation();var f="Emails";Vtiger_Helper_Js.checkServerConfig(f).then(function(k){if(k==true){var i=jQuery(g.currentTarget);var e=i.closest("tr");var h=e.data("id");var j=new Array();j.push(d);var l={};l.module="Emails";l.view="ComposeEmail";l.mode="emailEdit";l.record=h;l.selected_ids=j;l.parentId=d;l.relatedLoad=true;b.show(l)}else{Vtiger_Helper_Js.showPnotify(app.vtranslate("JS_EMAIL_SERVER_CONFIGURATION"))}})})},registerEventForAddingEmailFromRelatedList:function(){var a=this.getContentHolder();var b=this.getRecordId();a.on("click",'[name="composeEmail"]',function(f){f.stopPropagation();var c=jQuery(f.currentTarget);var d=new Array();var g={};d.push(b);g.module=app.getModuleName();g.view="MassActionAjax";g.selected_ids=d;g.mode="showComposeEmailForm";g.step="step1";g.relatedLoad=true;Vtiger_Index_Js.showComposeEmailPopup(g)})},registerEnterClickEventForTagRecord:function(){jQuery("#tagRecordText").keypress(function(a){if(a.which==13){jQuery("#tagRecord").trigger("click")}})},checkTagExists:function(e){var b=e.split(" ");for(var d=0;d0){b.splice(d,1);d--}}var c=b.join(" ");if(c==""){return true}else{return c}},addTagsToList:function(d){for(var b in d.result[1]){var c=d.result[1][b];var a=jQuery("#tagsList").find("[data-tagid='"+c+"']");if(a.length==0){jQuery("#tagsList").prepend('')}}},checkTagMaxLengthExceeds:function(d){var a=d.split(" ");var c=jQuery("#maxTagLength").val();for(var b=0;bparseInt(c)){return true}}return false},registerClickEventForAddingTagRecord:function(){var a=this;jQuery("#tagRecord").on("click",function(){var d=jQuery("#tagRecordText");var h=d.val();tagTextSplit=h.split(" ");if((tagTextSplit.length+$("#tagsList").children().length)>$("#maxTag").val()){var c=jQuery("#maxTag").val();d.validationEngine("showPrompt",app.vtranslate("JS_MAX_TAG_EXCEEDS")+" "+c,"error","bottomLeft",true);return}if(h==""){d.validationEngine("showPrompt",app.vtranslate("JS_PLEASE_ENTER_A_TAG"),"error","bottomLeft",true);return}var e=a.checkTagMaxLengthExceeds(h);if(e==true){var b=jQuery("#maxTagLength").val();d.validationEngine("showPrompt",app.vtranslate("JS_MAX_TAG_LENGTH_EXCEEDS")+" "+b,"error","bottomLeft",true);return}var g=a.checkTagExists(h);if(g==true){d.validationEngine("showPrompt",app.vtranslate("JS_TAG_NAME_ALREADY_EXIST"),"error","bottomLeft",true);return}else{h=g}var f={module:app.getModuleName(),action:"TagCloud",mode:"save",tagname:h,record:a.getRecordId()};AppConnector.request(f).then(function(i){a.addTagsToList(i);d.val("")})})},registerRemovePromptEventForTagCloud:function(a){jQuery("#tagRecordText").on("focus",function(c){var b=jQuery(".formError",a);if(b.length>0){b.remove()}})},registerDeleteEventForTag:function(b){var a=this;jQuery(b).on("click",".deleteTag",function(f){var c=jQuery(f.currentTarget).closest(".tag");var d=c.data("tagid");c.fadeOut("slow",function(){c.remove()});var g={module:app.getModuleName(),action:"TagCloud",mode:"delete",tag_id:d,record:a.getRecordId()};AppConnector.request(g).then(function(e){})})},registerTagClickEvent:function(b){var a=this;jQuery(b).on("click",".tagName",function(f){var c=jQuery(f.currentTarget);var d=c.closest(".tag").data("tagid");var g={module:app.getModuleName(),view:"TagCloudSearchAjax",tag_id:d,tag_name:c.find("a").text()};AppConnector.request(g).then(function(e){var h={data:e};app.showModalWindow(h);a.registerChangeEventForModulesList()})})},registerChangeEventForModulesList:function(){jQuery("#tagSearchModulesList").on("change",function(c){var a=jQuery(c.currentTarget);if(a.val()=="all"){jQuery('[name="tagSearchModuleResults"]').removeClass("hide")}else{jQuery('[name="tagSearchModuleResults"]').removeClass("hide");var b=a.val();jQuery('[name="tagSearchModuleResults"]').filter(":not(#"+b+")").addClass("hide")}})},registerPostTagCloudWidgetLoad:function(){var a=this;app.getContentsContainer().on("Vtiger.Widget.Load.LBL_TAG_CLOUD",function(c,b){a.registerClickEventForAddingTagRecord();a.registerEnterClickEventForTagRecord();a.registerDeleteEventForTag(b);a.registerRemovePromptEventForTagCloud(b);a.registerTagClickEvent(b)})},registerGetAllTagCloudWidgetLoad:function(){var a=this;var b={module:app.getModuleName(),mode:"showTags",source_module:app.getModuleName(),record:this.getRecordId(),view:"ShowTagCloudTop"};AppConnector.request(b).then(function(c){if(c.length>0){c=$(c);$(".detailViewTitle .detailViewToolbar").append(c);a.registerDeleteEventForTag(c);a.registerRemovePromptEventForTagCloud(c);a.registerTagClickEvent(c);a.registerClickEventForAddingTagRecord();a.registerEnterClickEventForTagRecord()}})},registerEventForRelatedTabClick:function(){var c=this;var b=c.getContentHolder();var a=b.closest("div.detailViewInfo");jQuery(".related",a).on("click","li",function(j,i){var g=jQuery(j.currentTarget);var f=jQuery("
    ");f.progressIndicator({position:"html",blockInfo:{enabled:true,elementToBlock:a}});var d=g.data("url");if(typeof i!="undefined"){var h=i.callback;delete i.callback}c.loadContents(d,i).then(function(e){c.deSelectAllrelatedTabs();c.markTabAsSelected(g);app.showBtnSwitch(b.find(".switchBtn"));Vtiger_Helper_Js.showHorizontalTopScrollBar();f.progressIndicator({mode:"hide"});c.registerHelpInfo();if(typeof h=="function"){h(e)}if(g.data("linkKey")==c.detailViewSummaryTabLabel){c.loadWidgets()}c.registerBasicEvents();app.notifyPostAjaxReady()},function(){f.progressIndicator({mode:"hide"})})})},registerEventForPicklistDependencySetup:function(a){var e=this;var c=jQuery('[name="picklistDependency"]',a);if(c.length<=0){return}var d=JSON.parse(c.val());var f=Object.keys(d);if(f.length<=0){return}var h=[];for(var b=0;b0||d.length>0){Vtiger_Helper_Js.showPnotify(app.vtranslate("JS_CAN_NOT_REMOVE_COMMENT"))}else{Vtiger_Helper_Js.showConfirmationBox({message:app.vtranslate("JS_DELETE_COMMENT_CONFIRMATION")}).then(function(e){AppConnector.request(i).then(function(l){if(l.success==true){f.fadeOut(400,function(){f.remove()})}else{Vtiger_Helper_Js.showPnotify(l.error.message)}})},function(e,l){})}});a.on("click",".detailViewSaveComment",function(f){var d=jQuery(f.currentTarget);if(!d.is(":disabled")){var c=b.saveComment(f);c.then(function(){var e=a.find("[data-type='Comments']");b.loadWidget(e).then(function(){d.removeAttr("disabled")})})}});a.on("click",".saveComment",function(g){var d=jQuery(g.currentTarget);if(!d.is(":disabled")){var f=jQuery(g.currentTarget);var h=f.data("mode");var c=b.saveComment(g);c.then(function(l){var j=f.closest(".addCommentBlock");var i=j.find(".commentcontent");var p=f.closest(".singleComment");i.val("");if(h=="add"){var n=l.result["id"];var m=b.getCommentUI(n);m.then(function(t){var w=j.closest(".commentDetails");var s=b.getContentHolder();var v=jQuery(".noCommentsMsgContainer",s);v.remove();if(w.length>0){j.remove();var r=w.find("ul");if(r.length<=0){var u=p.find(".viewThreadBlock").data("childCommentsCount");var y=u+1;p.find(".childCommentsCount").text(y);var x=p.find(".commentInfoHeader").data("commentid");b.getChildComments(x).then(function(z){jQuery(z).appendTo(w);p.find(".viewThreadBlock").hide();p.find(".hideThreadBlock").show()})}else{jQuery('
    • '+t+"
    ").appendTo(w)}}else{jQuery('
    • '+t+"
    ").prependTo(j.closest(".commentContainer").find(".commentsList"));i.css({height:"71px"})}p.find(".commentActionsContainer").show()})}else{if(h=="edit"){var k=p.find(".commentModifiedTime");var o=p.find(".commentInfoContent");var e=p.find('[name="editStatus"]');var q=p.find('[name="editReason"]');o.html(l.result.commentcontent);q.html(l.result.reasontoedit);k.text(l.result.modifiedtime);k.attr("title",l.result.modifiedtimetitle);if(e.hasClass("hide")){e.removeClass("hide")}if(l.result.reasontoedit!=""){p.find(".editReason").removeClass("hide")}o.show();p.find(".commentActionsContainer").show();j.remove()}}d.removeAttr("disabled")})}});a.on("click",".moreRecentComments",function(){var c=b.getTabByLabel(b.detailViewRecentCommentsTabLabel);c.trigger("click")})},registerBasicEvents:function(){var b=this;var a=b.getContentHolder();this.registerSummaryViewContainerEvents(a);b.registerCommentEvents(a);app.registerEventForDatePickerFields(a);app.registerEventForTimeFields(a);a.on("click","#detailViewNextRecordButton",function(g){var d=b.getSelectedTab();var c=d.data("url");var f=b.getRelatedListCurrentPageNum();var i=parseInt(f)+1;var h=c+"&page="+i;b.loadContents(h)});a.on("click","#detailViewPreviousRecordButton",function(g){var d=b.getSelectedTab();var c=d.data("url");var f=b.getRelatedListCurrentPageNum();var j=parseInt(f)-1;var i={};var h=c+"&page="+j;b.loadContents(h)});a.on("click","table.detailview-table td.fieldValue",function(d){if(jQuery(d.target).closest("a").hasClass("btnNoFastEdit")){return}var c=jQuery(d.currentTarget);b.ajaxEditHandling(c)});a.on("click","div.recordDetails span.squeezedWell",function(f){var d=jQuery(f.currentTarget);var c=d.data("reference");jQuery('.detailViewInfo .related li[data-reference="'+c+'"]').trigger("click")});a.on("click",".relatedPopup",function(d){var c=new Vtiger_Edit_Js();c.openPopUp(d);return false});a.on("click",".viewThread",function(i){var h=jQuery(i.currentTarget);var g=h.parent();var c=h.closest(".commentActions");var d=h.closest(".commentDetails");var j=d.find("ul");if(j.length>0){j.show();c.find(".hideThreadBlock").show();g.hide();return}var f=h.closest(".commentDiv").find(".commentInfoHeader").data("commentid");b.getChildComments(f).then(function(e){jQuery(e).appendTo(jQuery(i.currentTarget).closest(".commentDetails"));c.find(".hideThreadBlock").show();g.hide()})});a.on("click",".hideThread",function(h){var g=jQuery(h.currentTarget);var f=g.parent();var c=g.closest(".commentActions");var d=g.closest(".commentDetails");d.find("ul").hide();f.hide();c.find(".viewThreadBlock").show()});a.on("click",".detailViewThread",function(g){var f=b.getTabByLabel(b.detailViewRecentCommentsTabLabel);var d=jQuery(g.currentTarget).closest(".singleComment").find(".commentInfoHeader").data("commentid");var c=function(e){window.location.href=window.location.href+"#"+d};f.trigger("click",{commentid:d,callback:c})});a.on("click",".moreRecentRecords",function(f){f.preventDefault();var c=jQuery(f.currentTarget);var d=b.getTabByLabel(c.data("label-key"));d.trigger("click")});a.on("click",".moreRecentUpdates",function(){var f=jQuery("#updatesCurrentPage").val();var e=jQuery("#recordId").val();var c=parseInt(f)+1;var d="index.php?module="+app.getModuleName()+"&view=Detail&record="+e+"&mode=showRecentActivities&page="+c+"&tab_label=LBL_UPDATES";AppConnector.request(d).then(function(g){jQuery("#updatesCurrentPage").remove();jQuery("#moreLink").remove();jQuery("#updates").append(g)},function(g,h){})});a.on("click",".moreRecentDocuments",function(){var c=b.getTabByLabel(b.detailViewRecentDocumentsTabLabel);c.trigger("click")});a.on("click",".moreRecentActivities",function(){var c=b.getTabByLabel(b.detailViewRecentActivitiesTabLabel);c.trigger("click")});a.on("switchChange.bootstrapSwitch",".relatedContainer .switchBtn",function(g,f){var c=b.getTabByLabel(b.detailViewRecentActivitiesTabLabel);var d=c.data("url");d=d.replace("&time=current","");d=d.replace("&time=history","");d+="&time=";if(f){d+="current"}else{d+="history"}c.data("url",d);c.trigger("click")});b.registerEventForRelatedList();b.registerEventForRelatedListPagination()},registerEvents:function(){var b=this;this.registerHelpInfo();b.registerSendSmsSubmitEvent();b.registerAjaxEditEvent();this.registerRelatedRowClickEvent();this.registerBlockAnimationEvent();this.registerBlockStatusCheckOnLoad();this.registerEmailFieldClickEvent();this.registerPhoneFieldClickEvent();this.registerEventForActivityFollowupClickEvent();this.registerEventForMarkAsCompletedClick();this.registerEventForEmailsRelatedRecord();this.registerEventForAddingEmailFromRelatedList();this.registerPostTagCloudWidgetLoad();this.registerEventForRelatedTabClick();Vtiger_Helper_Js.showHorizontalTopScrollBar();this.registerUrlFieldClickEvent();var a=jQuery("div.detailViewContainer");if(a.length<=0){return}this.registerBasicEvents();this.registerSetReadRecord(a);b.registerEventForPicklistDependencySetup(b.getForm());b.getForm().validationEngine(app.validationEngineOptions);b.loadWidgets();app.registerEventForTextAreaFields(jQuery(".commentcontent"));this.registerEventForTotalRecordsCount();this.registerGetAllTagCloudWidgetLoad();this.registerRelatedModulesRecordCount();var c=Vtiger_Header_Js.getInstance();c.registerQuickCreateCallBack(this.registerRelatedModulesRecordCount)}}); \ No newline at end of file +jQuery.Class("Vtiger_Detail_Js",{detailInstance:false,SaveResultInstance:false,getInstance:function(){if(Vtiger_Detail_Js.detailInstance==false){var d=app.getModuleName();var b=app.getViewName();var c=d+"_"+b+"_Js";var e=Vtiger_Detail_Js;if(typeof window[c]!="undefined"){var a=new window[c]()}else{var a=new e()}Vtiger_Detail_Js.detailInstance=a}return Vtiger_Detail_Js.detailInstance},triggerSendEmail:function(b,a){Vtiger_Helper_Js.checkServerConfig(a).then(function(e){if(e==true){var d=Vtiger_Detail_Js.getInstance();var c=new Array();var f={};c.push(d.getRecordId());f.module=app.getModuleName();f.view="MassActionAjax";f.selected_ids=c;f.mode="showComposeEmailForm";f.step="step1";f.relatedLoad=true;Vtiger_Index_Js.showComposeEmailPopup(f)}else{alert(app.vtranslate("JS_EMAIL_SERVER_CONFIGURATION"))}})},triggerDetailViewAction:function(f,c){var e=Vtiger_Detail_Js.getInstance();var b=new Array();b.push(e.getRecordId());var a={selected_ids:JSON.stringify(b)};var d={type:"POST",url:f,dataType:"html",data:a};AppConnector.request(d).then(function(g){if(g){app.showModalWindow(g,{"text-align":"left"});if(typeof c=="function"){c(g)}}},function(g,h){})},triggerSendSms:function(b,a){Vtiger_Helper_Js.checkServerConfig(a).then(function(c){if(c==true){Vtiger_Detail_Js.triggerDetailViewAction(b)}else{alert(app.vtranslate("JS_SMS_SERVER_CONFIGURATION"))}})},triggerTransferOwnership:function(c){var b=this;b.getRelatedModulesContainer=false;var a={type:"POST",url:c,dataType:"html",data:{}};AppConnector.request(a).then(function(d){if(d){var e=function(f){var g=app.validationEngineOptions;g.onValidationComplete=function(i,h){if(h){if(i.attr("name")=="changeOwner"){b.transferOwnershipSave(i)}}return false};jQuery("#changeOwner").validationEngine(app.validationEngineOptions)};app.showModalWindow(d,function(g){var f=b.getRelatedModuleContainer();app.changeSelectElementView(f,"select2");if(typeof e=="function"){e(g)}})}})},transferOwnershipSave:function(c){var b=this;var f=jQuery("#transferOwnerId").val();var d=jQuery("#related_modules").val();var a=jQuery("#recordId").val();var e={module:app.getModuleName(),action:"TransferOwnership",record:a,transferOwnerId:f,related_modules:d};AppConnector.request(e).then(function(i){if(i.success){app.hideModalWindow();var k={title:app.vtranslate("JS_MESSAGE"),text:app.vtranslate("JS_RECORDS_TRANSFERRED_SUCCESSFULLY"),animation:"show",type:"info"};var j=jQuery(".assigned_user_id").val();var h=jQuery(".assigned_user_id ");h.find('option[value="'+j+'"]').removeAttr("selected");h.find('option[value="'+f+'"]').attr("selected","selected");h.trigger("liszt:updated");var g=h.find('option[value="'+f+'"]').data("picklistvalue");h.closest(".row-fluid").find(".value").html(''+g+"");Vtiger_Helper_Js.showPnotify(k)}})},getRelatedModuleContainer:function(){if(this.getRelatedModulesContainer==false){this.getRelatedModulesContainer=jQuery("#related_modules")}return this.getRelatedModulesContainer},deleteRecord:function(b){var a=app.vtranslate("LBL_DELETE_CONFIRMATION");Vtiger_Helper_Js.showConfirmationBox({message:a}).then(function(c){AppConnector.request(b+"&ajaxDelete=true").then(function(d){if(d.success==true){window.location.href=d.result}else{Vtiger_Helper_Js.showPnotify(d.error.message)}})},function(c,d){})},reloadRelatedList:function(){var a=jQuery('[name="currentPageNum"]').val();var b=Vtiger_Detail_Js.getInstance();b.loadRelatedList(a)},showWorkflowTriggerView:function(a){$(a).popover("hide");var b=Vtiger_Detail_Js.getInstance();var c={module:app.getModuleName(),view:"WorkflowTrigger",record:b.getRecordId()};var d=function(e){e.find('[type="submit"]').click(function(h){var g=[];e.find('input[type="checkbox"]:checked').each(function(j){g.push($(this).val())});if(g.length==0){var i={title:app.vtranslate("JS_INFORMATION"),text:app.vtranslate("JS_NOT_SELECTED_WORKFLOW_TRIGGER"),type:"error",animation:"show"};Vtiger_Helper_Js.showPnotify(i)}else{var i={title:app.vtranslate("JS_MESSAGE"),text:app.vtranslate("JS_STARTED_PERFORM_WORKFLOW"),type:"info",animation:"show"};Vtiger_Helper_Js.showPnotify(i);var f={module:app.getModuleName(),action:"Workflow",mode:"execute",record:b.getRecordId(),ids:g};AppConnector.request(f).then(function(j){var k={title:app.vtranslate("JS_MESSAGE"),text:app.vtranslate("JS_COMPLETED_PERFORM_WORKFLOW"),type:"success",animation:"show"};Vtiger_Helper_Js.showPnotify(k);app.hideModalWindow();b.loadWidgets()},function(j,k){var l={title:app.vtranslate("JS_ERROR"),text:app.vtranslate("JS_ERROR_DURING_TRIGGER_OF_WORKFLOW"),type:"error",animation:"show"};Vtiger_Helper_Js.showPnotify(l);app.hideModalWindow()})}})};AppConnector.request(c).then(function(e){if(e){app.showModalWindow(e,"",d)}},function(e,f){})},},{targetPicklistChange:false,targetPicklist:false,detailViewContentHolder:false,detailViewForm:false,detailViewDetailsTabLabel:"LBL_RECORD_DETAILS",detailViewSummaryTabLabel:"LBL_RECORD_SUMMARY",detailViewRecentCommentsTabLabel:"ModComments",detailViewRecentActivitiesTabLabel:"Activities",detailViewRecentUpdatesTabLabel:"LBL_UPDATES",detailViewRecentDocumentsTabLabel:"Documents",fieldUpdatedEvent:"Vtiger.Field.Updated",widgetPostLoad:"Vtiger.Widget.PostLoad",updatedFields:["company","designation","title"],fieldPreSave:"Vtiger.Field.PreSave",tempData:[],referenceFieldNames:{Calendar:{Accounts:"link",Leads:"link",Contacts:"link",Vendors:"link",OSSEmployees:"link",Campaigns:"process",HelpDesk:"process",Potentials:"process",Projects:"process",ServiceContracts:"process",},OutsourcedProducts:{Potentials:"potential",Leads:"parent_id",Accounts:"parent_id",Contacts:"parent_id"},Assets:{Potentials:"potential",Accounts:"parent_id",Contacts:"parent_id"},OSSOutsourcedServices:{Potentials:"potential",Leads:"parent_id",Accounts:"parent_id",Contacts:"parent_id"},OSSSoldServices:{Potentials:"potential",Accounts:"parent_id",Contacts:"parent_id"},},init:function(){},getDeleteMessageKey:function(){return"JS_DELETE_CONFIRMATION"},loadWidgets:function(){var a=this;var b=jQuery('[class^="widgetContainer_"]');b.each(function(c,e){var d=jQuery(e);a.loadWidget(d)})},loadWidget:function(f){var e=this;var b=jQuery.Deferred();var d=jQuery(".widget_header",f);var c=jQuery(".widget_contents",f);var a=f.data("url");var h=d.find('[name="relatedModule"]').val();var g={type:"GET",dataType:"html",data:a};c.progressIndicator({});AppConnector.request(g).then(function(i){c.progressIndicator({mode:"hide"});c.html(i);app.registerEventForTextAreaFields(jQuery(".commentcontent"));c.trigger(e.widgetPostLoad,{widgetName:h});app.showPopoverElementView(c.find(".popoverTooltip"));b.resolve(g)},function(i){c.progressIndicator({mode:"hide"});b.reject()});return b.promise()},loadCommentsWidget:function(){},loadContents:function(b,e){var d=this;var a=jQuery.Deferred();var c=this.getContentHolder();var f=b;if(typeof e!="undefined"){f={};f.url=b;f.data=e}AppConnector.requestPjax(f).then(function(g){c.html(g);g=c.html();d.registerBlockStatusCheckOnLoad();app.changeSelectElementView(c);app.registerEventForDatePickerFields(c);app.registerEventForTextAreaFields(jQuery(".commentcontent"));jQuery(".commentcontent").autosize();d.getForm().validationEngine();c.trigger(jQuery.Event("Detail.LoadContents.PostLoad"),g);a.resolve(g)},function(){});return a.promise()},getUpdatefFieldsArray:function(){return this.updatedFields},getTabByLabel:function(a){var c=this.getTabs();var b=false;c.each(function(e,f){var g=jQuery(f);var d=g.data("labelKey");if(d==a){b=g;return false}});return b},selectModuleTab:function(){var a=this.getTabContainer();var b=a.find("li.module-tab");this.deSelectAllrelatedTabs();this.markTabAsSelected(b)},deSelectAllrelatedTabs:function(){var a=this.getTabContainer();this.getTabs().removeClass("active")},markTabAsSelected:function(a){a.addClass("active")},getSelectedTab:function(){var a=this.getTabContainer();return a.find("li.active")},getTabContainer:function(){return jQuery("div.related")},getTabs:function(){return this.getTabContainer().find("li")},getContentHolder:function(){if(this.detailViewContentHolder==false){this.detailViewContentHolder=jQuery("div.details div.contents")}return this.detailViewContentHolder},getForm:function(){if(this.detailViewForm==false){this.detailViewForm=jQuery("#detailView")}return this.detailViewForm},getRecordId:function(){return jQuery("#recordId").val()},getRelatedModuleName:function(){if(jQuery(".relatedModuleName",this.getContentHolder()).length==1){return jQuery(".relatedModuleName",this.getContentHolder()).val()}},saveFieldValues:function(b){var a=jQuery.Deferred();var c=this.getRecordId();var d={};if(typeof b!="undefined"){d=b}d.record=c;d.module=app.getModuleName();d.action="SaveAjax";var e={};e.data=d;e.async=false;e.dataType="json";AppConnector.request(e).then(function(f){a.resolve(f)});return a.promise()},getRelatedListCurrentPageNum:function(){return jQuery('input[name="currentPageNum"]',this.getContentHolder()).val()},removeCommentBlockIfExists:function(){var a=this.getContentHolder();var b=jQuery(".commentsBody",a);jQuery(".addCommentBlock",b).remove()},getCommentThread:function(b){var a=jQuery.Deferred();AppConnector.request(b).then(function(c){a.resolve(c)},function(c,d){});return a.promise()},saveComment:function(k){var p=this;var j=jQuery.Deferred();var b=jQuery(k.currentTarget);var g=b.data("mode");var o=b.closest(".addCommentBlock");var q=o.find(".commentcontent");var l=q.val();var i;if(l==""){i=app.vtranslate("JS_LBL_COMMENT_VALUE_CANT_BE_EMPTY");q.validationEngine("showPrompt",i,"error","bottomLeft",true);j.reject();return j.promise()}if(g=="edit"){var n=o.find('[name="reasonToEdit"]').val()}var d=jQuery.progressIndicator({});var f=jQuery(k.currentTarget);f.attr("disabled","disabled");var m=o.closest(".commentDetails").find(".commentInfoHeader");var h=m.data("commentid");var c=m.data("parentcommentid");var a={commentcontent:l,related_to:p.getRecordId(),module:"ModComments"};if(g=="edit"){a.record=h;a.reasontoedit=n;a.parent_comments=c;a.mode="edit";a.action="Save"}else{if(g=="add"){a.parent_comments=h;a.action="SaveAjax"}}AppConnector.request(a).then(function(e){d.progressIndicator({mode:"hide"});j.resolve(e)},function(r,e){d.progressIndicator({mode:"hide"});f.removeAttr("disabled");j.reject(r,e)});return j.promise()},getCommentUI:function(c){var b=jQuery.Deferred();var a={view:"DetailAjax",module:"ModComments",record:c};AppConnector.request(a).then(function(d){b.resolve(d)},function(d,e){});return b.promise()},getCommentBlock:function(){var b=this.getContentHolder();var a=jQuery(".basicAddCommentBlock",b).clone(true,true).removeClass("basicAddCommentBlock hide").addClass("addCommentBlock");a.find(".commentcontenthidden").removeClass("commentcontenthidden").addClass("commentcontent");return a},getEditCommentBlock:function(){var b=this.getContentHolder();var a=jQuery(".basicEditCommentBlock",b).clone(true,true).removeClass("basicEditCommentBlock hide").addClass("addCommentBlock");a.find(".commentcontenthidden").removeClass("commentcontenthidden").addClass("commentcontent");return a},registerSendSmsSubmitEvent:function(){var a=this;jQuery("body").on("submit","#massSave",function(f){var d=jQuery(f.currentTarget);var b=d.find("#message").val().length;if(b>160){var g={title:app.vtranslate("JS_MESSAGE"),text:app.vtranslate("LBL_SMS_MAX_CHARACTERS_ALLOWED"),animation:"show",type:"error"};Vtiger_Helper_Js.showPnotify(g);return false}var c=d.find(":submit");c.attr("disabled","disabled");a.SendSmsSave(d);f.preventDefault()})},SendSmsSave:function(b){var c=jQuery.progressIndicator({position:"html",blockInfo:{enabled:true}});var a=b.serializeFormData();AppConnector.request(a).then(function(d){app.hideModalWindow();c.progressIndicator({mode:"hide"})},function(d,e){})},registerNameAjaxEditEvent:function(){var b=this;var a=b.getContentHolder();a.on(b.fieldUpdatedEvent,".nameField",function(i,j){var h=b.getForm();var f=h.data("nameFields");var d="";for(var g in f){if(g!=0){d+=" "}var k=f[g];d+=h.find('[name="'+k+'"]').val()}var c=a.closest(".contentsDiv").find(".recordLabel");c.text(d)})},updateHeaderNameFields:function(){var k=this;var a=k.getContentHolder();var c=k.getForm();var b=c.data("nameFields");var l=a.closest(".contentsDiv").find(".recordLabel");var i="";for(var g in b){var f=b[g];var j=c.find('[name="'+f+'"]');if(j.length>0){var h=j.val();i+=h+" ";l.find('[class="'+f+'"]').text(h)}}var d=l.find(".salutation");if(d.length>0){var e=d.text();i=e+i}l.attr("title",i)},registerAjaxEditEvent:function(){var b=this;var a=b.getContentHolder();a.on(b.fieldUpdatedEvent,"input,select,textarea",function(c){b.updateHeaderValues(jQuery(c.currentTarget))})},updateHeaderValues:function(d){var f=this;if(d.hasClass("nameField")){f.updateHeaderNameFields();return true}var c=d.attr("name");var g=this.getUpdatefFieldsArray();var e=f.getContentHolder();if(jQuery.inArray(c,g)!="-1"){var b=d.val();var a=e.closest(".contentsDiv").find("."+c+"_label");a.text(b)}},registerEmailFieldClickEvent:function(){var a=this.getContentHolder();a.on("click",".emailField",function(b){b.stopPropagation()})},registerPhoneFieldClickEvent:function(){var a=this.getContentHolder();a.on("click",".phoneField",function(b){b.stopPropagation()})},registerUrlFieldClickEvent:function(){var a=this.getContentHolder();a.on("click",".urlField",function(b){b.stopPropagation()})},registerRelatedRowClickEvent:function(){var a=this.getContentHolder();a.on("click",".listViewEntries",function(d){var b=jQuery(d.target,jQuery(d.currentTarget));if(b.is("td:first-child")&&(b.children('input[type="checkbox"]').length>0)){return}if(jQuery(d.target).is('input[type="checkbox"]')){return}var c=jQuery(d.currentTarget);var f=c.data("recordurl");if(typeof f!="undefined"){window.location.href=f}})},loadRelatedList:function(a){var b=new Vtiger_RelatedList_Js(this.getRecordId(),app.getModuleName(),this.getSelectedTab(),this.getRelatedModuleName());var c={page:a};b.loadRelatedList(c)},registerEventForRelatedListPagination:function(){var b=this;var a=this.getContentHolder();a.on("click","#relatedListNextPageButton",function(g){var d=jQuery(g.currentTarget);if(d.attr("disabled")=="disabled"){return}var c=b.getSelectedTab();var h=b.getRelatedModuleName();var f=new Vtiger_RelatedList_Js(b.getRecordId(),app.getModuleName(),c,h);f.nextPageHandler()});a.on("click","#relatedListPreviousPageButton",function(){var c=b.getSelectedTab();var e=b.getRelatedModuleName();var d=new Vtiger_RelatedList_Js(b.getRecordId(),app.getModuleName(),c,e);d.previousPageHandler()});a.on("click","#relatedListPageJump",function(f){var c=b.getSelectedTab();var g=b.getRelatedModuleName();var d=new Vtiger_RelatedList_Js(b.getRecordId(),app.getModuleName(),c,g);d.getRelatedPageCount()});a.on("click","#relatedListPageJumpDropDown > li",function(c){c.stopImmediatePropagation()}).on("keypress","#pageToJump",function(f){var c=b.getSelectedTab();var g=b.getRelatedModuleName();var d=new Vtiger_RelatedList_Js(b.getRecordId(),app.getModuleName(),c,g);d.pageJumpHandler(f)})},registerEventForRelatedList:function(){var b=this;var a=this.getContentHolder();b.registerEventForAddingRelatedRecord(a);a.on("click",".relatedListHeaderValues",function(g){var d=jQuery(g.currentTarget);var c=b.getSelectedTab();var h=b.getRelatedModuleName();var f=new Vtiger_RelatedList_Js(b.getRecordId(),app.getModuleName(),c,h);f.sortHandler(d)});a.on("click","button.selectRelation",function(g){var c=b.getSelectedTab();var i=b.getRelatedModuleName();if(i==undefined){i=jQuery(g.currentTarget).data("modulename")}var d=jQuery(g.currentTarget).data("rf");var h={};if(d&&Object.keys(d).length>0){h={search_key:d.key,search_value:d.name}}var f=new Vtiger_RelatedList_Js(b.getRecordId(),app.getModuleName(),c,i);f.showSelectRelationPopup(h).then(function(j){var e=jQuery(j).find('[name="emailEnabledModules"]').val();if(e){b.registerEventToEditRelatedStatus()}})});a.on("click","a.relationDelete",function(h){h.stopImmediatePropagation();var f=jQuery(h.currentTarget);var c=Vtiger_Detail_Js.getInstance();var d=c.getDeleteMessageKey();var g=app.vtranslate(d);Vtiger_Helper_Js.showConfirmationBox({message:g}).then(function(m){var o=f.closest("tr");var k=o.data("id");var i=f.closest(".widget_contents");var j=b.getSelectedTab();var n=b.getRelatedModuleName();if(n==undefined){n=i.find(".relatedModuleName").val()}var l=new Vtiger_RelatedList_Js(b.getRecordId(),app.getModuleName(),j,n);l.deleteRelation([k]).then(function(e){l.loadRelatedList()})},function(e,i){})})},registerBlockAnimationEvent:function(){var a=this.getContentHolder();a.find(".blockHeader").click(function(){var f=$(this).find(".blockToggle").not(".hide");var b=f.data("id");var i=f.closest(".detailview-table");var h=i.find("tbody");var d=f.data();var c=app.getModuleName();var g=function(){h.addClass("hide");app.cacheSet(c+"."+b,0)};var e=function(){h.removeClass("hide");app.cacheSet(c+"."+b,1)};var d=f.data();if(d.mode=="show"){g();f.addClass("hide");i.find('[data-mode="hide"]').removeClass("hide")}else{e();f.addClass("hide");i.find("[data-mode='show']").removeClass("hide")}})},registerBlockStatusCheckOnLoad:function(){var b=this.getContentHolder().find(".detailview-table");var a=app.getModuleName();b.each(function(d,j){var g=jQuery(j);var f=g.find(".blockToggle").not(".hide");var i=g.find("tbody");var c=f.data("id");var h=a+"."+c;var e=app.cacheGet(h,null);if(e!=null){if(e==1){f.addClass("hide");g.find("[data-mode='show']").removeClass("hide");i.removeClass("hide")}else{f.addClass("hide");g.find("[data-mode='hide']").removeClass("hide");i.addClass("hide")}}})},registerEventForAddingRelatedRecord:function(){var b=this;var a=this.getContentHolder();a.on("click",'[name="addButton"]',function(g){var d=jQuery(g.currentTarget);var c=b.getSelectedTab();var h=b.getRelatedModuleName();if(d.hasClass("quickCreateSupported")!=true){window.location.href=d.data("url");return}var f=new Vtiger_RelatedList_Js(b.getRecordId(),app.getModuleName(),c,h);f.addRelatedRecord(d)})},ajaxEditHandling:function(d){var c=this;var b=jQuery(".value",d);var f=jQuery(".edit",d);var e=jQuery(".summaryViewEdit",d);var a=jQuery(".fieldname",f);jQuery(a).each(function(l,k){var n=jQuery(k).val();var j=jQuery(k);var g=jQuery('[name="'+n+'"]',f);if(g.attr("disabled")=="disabled"){return}if(f.length<=0){return}if(f.is(":visible")){return}g.inputmask();var i=false;if(g.inputmask("hasMaskedValue")){i=true}b.addClass("hide");e.addClass("hide");f.removeClass("hide").children().filter('input[type!="hidden"]input[type!="image"],select').filter(":first").focus();var o=false;var m=false;var h=function(x){var w=jQuery(x.target);if((w.closest("td").is(d))){return}g.inputmask("remove");d.removeAttr("tabindex");var u=j.data("prevValue");var z=c.getForm();var t=z.serializeFormData();var A=t[n];var s=A;var q=Vtiger_Field_Js.getInstance(g.data("fieldinfo"));var v=[];var C=false;if(f.find("[data-fieldinfo]").length==2){f.find("[data-fieldinfo]").each(function(){var D=[];D.name=jQuery(this).attr("name");D.type=jQuery(this).data("fieldinfo").type;if(D.type=="datetime"){C=true}v.push(D)})}if(g.is("input:checkbox")){if(g.is(":checked")){A="1"}else{A="0"}g=g.filter('[type="checkbox"]')}var y=g.validationEngine("validate");if(y){if(i){g.inputmask()}return}g.validationEngine("hide");if(u==A){f.addClass("hide");b.removeClass("hide");e.removeClass("hide");jQuery(document).off("click","*",h)}else{var p=jQuery.Event(c.fieldPreSave);g.trigger(p,{fieldValue:s,recordId:c.getRecordId()});if(p.isDefaultPrevented()){o=false;m=true;return}m=false;jQuery(document).off("click","*",h);if(!o&&!m){o=true;if(Vtiger_Detail_Js.SaveResultInstance==false){Vtiger_Detail_Js.SaveResultInstance=new SaveResult()}t.record=c.getRecordId();t.module=app.getModuleName();t.view="quick_edit";if(Vtiger_Detail_Js.SaveResultInstance.checkData(t)==false){f.addClass("hide");b.removeClass("hide");e.removeClass("hide");jQuery(document).off("click","*",h);return}}else{return}d.progressIndicator();f.addClass("hide");var B={};if(q.getType()=="multipicklist"||q.getType()=="sharedOwner"){var r=n.split("[]");n=r[0]}B.value=s;B.field=n;B=c.getCustomFieldNameValueMap(B);c.saveFieldValues(B).then(function(D){var H=D.result;d.progressIndicator({mode:"hide"});b.removeClass("hide");e.removeClass("hide");var G=H[n].display_value;if(v.length&&C){G=H[v[0].name].display_value+" "+H[v[1].name].display_value}b.html(G);g.trigger(c.fieldUpdatedEvent,{old:u,"new":s});j.data("prevValue",A);g.data("selectedValue",A);if(c.targetPicklistChange){if(jQuery(".summaryView",c.getForm()).length>0){c.targetPicklist.find(".summaryViewEdit").trigger("click")}else{c.targetPicklist.trigger("click")}c.targetPicklistChange=false;c.targetPicklist=false}var F=c.getSelectedTab();if(F.data("linkKey")==c.detailViewSummaryTabLabel){var E=c.getContentHolder();jQuery(".detailViewInfo .related li.active").trigger("click");c.registerSummaryViewContainerEvents(E);c.registerEventForPicklistDependencySetup(c.getForm());c.registerEventForRelatedList()}else{if(F.data("linkKey")==c.detailViewDetailsTabLabel){c.registerEventForPicklistDependencySetup(c.getForm())}}},function(D){d.progressIndicator({mode:"hide"})})}};jQuery(document).on("click","*",h)})},triggerDisplayTypeEvent:function(){var a=app.cacheGet("widthType","narrowWidthType");if(a){var b=jQuery("#detailView").find("td");b.addClass(a)}},addElementsToQuickCreateForCreatingRelation:function(a,b){jQuery('').appendTo(a);jQuery.each(b,function(c,d){jQuery('').appendTo(a)})},registerEventForActivityWidget:function(){var a=this;jQuery(".createActivity").on("click",function(j){var b="Calendar";var f=a.getRecordId();var c=app.getModuleName();var h=jQuery(j.currentTarget);var d={};d.sourceModule=c;d.sourceRecord=f;if(c!=""&&b!=""&&typeof a.referenceFieldNames[b]!="undefined"&&typeof a.referenceFieldNames[b][c]!="undefined"){var l=a.referenceFieldNames[b][c];d[l]=f}var k=h.data("url");var m=function(q){a.addElementsToQuickCreateForCreatingRelation(q,d);var o=q.find('[class^="CalendarQuikcCreateContents"]').find("#goToFullForm");var p=q.find('[class^="EventsQuikcCreateContents"]').find("#goToFullForm");var e=o.data("edit-view-url")+"&"+k;var n=p.data("edit-view-url")+"&"+k;o.data("editViewUrl",e);p.data("editViewUrl",n)};var i=function(){var o=h.closest(".summaryWidgetContainer");var e=o.find(".widgetContentBlock");var n=e.data("url");var p={type:"GET",dataType:"html",data:n};AppConnector.request(p).then(function(r){var q=o.find(".widget_contents");q.html(r);app.changeSelectElementView(q);a.registerEventForActivityWidget()});a.loadWidgets()};var g={};g.callbackPostShown=m;g.callbackFunction=i;g.data=d;g.noCache=false;Vtiger_Header_Js.getInstance().quickCreateModule(b,g)})},getEndDate:function(a){var d=a.split("-");var c=new Date(d[0],d[1],d[2]);var b=new Date();b.setDate(c.getDate()+2);return app.getStringDate(b)},getSingleEventType:function(e,b,g){var f=jQuery('[name="date_start"]');var c=jQuery(f).val();var h=jQuery(f).data("date-format");var j=Vtiger_Helper_Js.convertToDateString(c,h,e,g);var a=jQuery.extend({},["#b6a996,black"]);var i=this;var d={module:"Calendar",action:"Feed",start:j,end:this.getEndDate(j),type:g,mapping:a};AppConnector.request(d).then(function(m){var k=Vtiger_Helper_Js.convertToDateString(c,h,e);if(!jQuery.isEmptyObject(m)){if(m[0]["activitytype"]==="Task"){for(var n in m){if(m[n]["start"].indexOf(k)>-1){jQuery("#"+b+" .table").append(''+m[n]["title"]+"")}}}else{for(var l=0;l-1){jQuery("#"+b+" .table").append(''+m[0][l]["title"]+"")}}}}})},registerFilterForAddingModuleRelatedRecordFromSummaryWidget:function(){var a=this;jQuery(".createRecordFromFilter").on("click",function(o){var m=jQuery(o.currentTarget);var n=m.closest(".summaryWidgetContainer");var g=n.find(".widget_contents");var h=g.find('[name="relatedModule"]').val();var q=m.data("url");var k=a.getRecordId();var i={};var f=m.data("prf");var l=m.data("acf");var c=m.closest(".widget_header").find('[name="relatedModule"]').val();var j={};var d=function(e){a.postSummaryWidgetAddRecord(e,m);if(h=="ProjectTask"){a.loadModuleSummary()}};if(typeof f!="undefined"){j[f]=k}if(typeof l!="undefined"){$.each(l,function(e,r){j[e]=r})}if(Object.keys(j).length>0){i.data=j}i.noCache=true;i.callbackFunction=d;var b=jQuery.progressIndicator();var p=new Vtiger_Header_Js();p.getQuickCreateForm(q,c,i).then(function(e){p.handleQuickCreateData(e,i);b.progressIndicator({mode:"hide"})})})},registerChangeFilterForWidget:function(){var a=this;jQuery(".widget_header .filterField").on("change",function(m){var n=this.name;var j={};var i={};var k=jQuery(m.currentTarget);var l=k.closest(".summaryWidgetContainer");var b=l.find(".widget_contents");b.progressIndicator();var f=b.find('[name="relatedModule"]').val();var h=a.getRecordId();var d=app.getModuleName();var o=k.find("option:selected").val();var c=k.data("fieldlable");var g=l.find('[name="filter_data"]').val();if(o!=c){j[g]=o;i.whereCondition=j}i.record=h;i.view="Detail";i.module=d;i.page=b.find('[name="page"]').val();i.limit=b.find('[name="pageLimit"]').val();i.col=b.find('[name="col"]').val();i.relatedModule=f;i.mode="showRelatedRecords";AppConnector.request(i).then(function(e){b.html(e);currentDiv.progressIndicator({mode:"hide"})})})},registerChangeSwitchForWidget:function(){var a=this;$(".summaryWidgetContainer .widget_header .switchBtnReload").on("switchChange.bootstrapSwitch",function(j,c){var h=jQuery(j.currentTarget);var i=h.closest(".summaryWidgetContainer");var g=i.find(".widgetContentBlock");var d=g.data("url");var f=h.data("urlparams");if(f!=""){var l=h.data("on-val");var k=h.data("off-val");d=d.replace("&"+f+"="+l,"");d=d.replace("&"+f+"="+k,"");if(c){var b=l}else{var b=k}if(b!=""){d+="&"+f+"="+b}g.data("url",d);a.loadWidget($(g))}});$(".activityWidgetContainer .switchBtn").on("switchChange.bootstrapSwitch",function(h,g){var d=jQuery(h.currentTarget);var b=d.closest(".summaryWidgetContainer");var f=b.find(".widgetContentBlock");var c=f.data("url");c=c.replace("&type=current","");c+="&type=";if(g){c+="current"}else{c+="history"}f.data("url",c);a.loadWidget($(f))});$(".calculationsWidgetContainer .calculationsSwitch").on("switchChange.bootstrapSwitch",function(h,g){var d=jQuery(h.currentTarget);var b=d.closest(".summaryWidgetContainer");var f=b.find(".widgetContentBlock");var c=f.data("url");c=c.replace("&showtype=open","");c=c.replace("&showtype=archive","");c+="&showtype=";if(g){c+="open"}else{c+="archive"}f.data("url",c);a.loadWidget($(f))});$(".potentialsWidgetContainer .potentialsSwitch").on("switchChange.bootstrapSwitch",function(h,g){var d=jQuery(h.currentTarget);var b=d.closest(".summaryWidgetContainer");var f=b.find(".widgetContentBlock");var c=f.data("url");c=c.replace("&showtype=open","");c=c.replace("&showtype=archive","");c+="&showtype=";if(g){c+="open"}else{c+="archive"}f.data("url",c);a.loadWidget($(f))})},registerSummaryViewContainerEvents:function(d){var b=this;this.registerEventForActivityWidget();this.registerChangeFilterForWidget();this.registerChangeSwitchForWidget();this.registerFilterForAddingModuleRelatedRecordFromSummaryWidget();if(Vtiger_Detail_Js.SaveResultInstance==false){Vtiger_Detail_Js.SaveResultInstance=new SaveResult()}var a=b.getForm();var c=a.serializeFormData();d.off("click").on("click",".row .summaryViewEdit",function(h){var g=jQuery(h.currentTarget);g.addClass("hide");var f=g.closest("td.fieldValue");b.ajaxEditHandling(f);Vtiger_Detail_Js.SaveResultInstance.loadFormData(c)});Vtiger_Detail_Js.SaveResultInstance.loadFormData(c);d.on(b.fieldUpdatedEvent,".recordDetails",function(g,h){var f=d.find("[data-type='Updates']");b.loadWidget(f)});d.on("click",".editDefaultStatus",function(m){var l=jQuery(m.currentTarget);l.popover("hide");var h=l.closest(".activityStatus");var k=l.closest(".activityEntries");var f=k.find(".activityId").val();var j=h.find(".edit");var i=jQuery('[name="'+l.data("field")+'"]',j);var g=h.find(".editStatus");if(b.tempData.indexOf(f)<0){b.tempData.push(f);g.trigger("click");i.val(l.data("status")).trigger("chosen:updated");g.trigger("clickoutside")}});d.on("click",".editStatus",function(k){var j=jQuery(k.currentTarget);var g=j.closest(".activityStatus");var h=g.find(".edit");var i=g.find(".value");j.hide();i.addClass("hide");h.removeClass("hide").show();var f=function(){var t=jQuery(".fieldname",h);var w=t.val();var m=jQuery('[name="'+w+'"]',h);var o=t.data("prevValue");var u=m.find("option:selected").val();var s=m.find("option:selected").text();var n=g.closest(".activityEntries");var l=n.find(".activityId").val();var e=n.find(".activityModule").val();var v=n.find(".activityType").val();if(Vtiger_Detail_Js.SaveResultInstance==false){Vtiger_Detail_Js.SaveResultInstance=new SaveResult()}var q={};q.record=l;q.module=e;q.view="quick_edit";q[w]=u;q["p_"+w]=o;if(Vtiger_Detail_Js.SaveResultInstance.checkData(q)==false){return}if(o==u){h.addClass("hide");i.removeClass("hide");j.show()}else{var r=m.validationEngine("validate");if(r){Vtiger_Helper_Js.addClickOutSideEvent(g,f);return}h.addClass("hide");var p={action:"SaveAjax",record:l,field:w,value:u,module:e,activitytype:v};AppConnector.request(p).then(function(z){i.removeClass("hide");j.show();i.html(s);t.data("prevValue",u);if("Held"==u||"Completed"==u){var A=j.closest(".activityEntries");A.find("popoverTooltip").popover("hide");var y=j.closest(".widgetContentBlock");var x=jQuery(y);b.loadWidget(x)}})}};Vtiger_Helper_Js.addClickOutSideEvent(g,f)});d.on("click",".editDescription",function(k){var j=jQuery(k.currentTarget);var g=j.closest(".activityDescription");var h=g.find(".edit");var i=g.find(".value");j.hide();i.addClass("hide");h.removeClass("hide").show();var f=function(){var t=jQuery(".fieldname",h);var w=t.val();var m=jQuery('[name="'+w+'"]',h);var o=t.data("prevValue");var u=m.val();var s=m.val();var n=g.closest(".activityEntries");var l=n.find(".activityId").val();var e=n.find(".activityModule").val();var v=n.find(".activityType").val();if(Vtiger_Detail_Js.SaveResultInstance==false){Vtiger_Detail_Js.SaveResultInstance=new SaveResult()}var q={};q.record=l;q.module=e;q.view="quick_edit";q[w]=u;q["p_"+w]=o;if(Vtiger_Detail_Js.SaveResultInstance.checkData(q)==false){return}if(o==u){h.addClass("hide");i.removeClass("hide");j.show()}else{var r=m.validationEngine("validate");if(r){Vtiger_Helper_Js.addClickOutSideEvent(g,f);return}g.progressIndicator();h.addClass("hide");var p={action:"SaveAjax",record:l,field:w,value:u,module:e,activitytype:v};AppConnector.request(p).then(function(x){g.progressIndicator({mode:"hide"});i.removeClass("hide");j.show();i.html(s);t.data("prevValue",u)})}};Vtiger_Helper_Js.addClickOutSideEvent(g,f)});jQuery(".changeDetailViewMode").on("click",function(g){var f=jQuery(".detailViewContainer");f.find('.nav li[data-link-key="LBL_RECORD_DETAILS"]').trigger("click")});jQuery(".createRecord").on("click",function(p){var n=jQuery(p.currentTarget);var o=n.closest(".summaryWidgetContainer");var l=o.find(".widget_header");var g=l.find('[name="relatedModule"]').val();var k=b.getRecordId();var h=app.getModuleName();var j={};j.sourceModule=h;j.sourceRecord=k;if(h!=""&&g!=""&&typeof b.referenceFieldNames[g]!="undefined"&&typeof b.referenceFieldNames[g][h]!="undefined"){var q=b.referenceFieldNames[g][h];j[q]=k}var f=function(e){b.postSummaryWidgetAddRecord(e,n)};var i=function(e){b.addElementsToQuickCreateForCreatingRelation(e,j)};var m={};m.callbackFunction=f;m.goToFullFormcallback=i;m.data=j;m.noCache=false;Vtiger_Header_Js.getInstance().quickCreateModule(g,m)});this.registerFastEditingFiels()},addRelationBetweenRecords:function(e,a){var b=jQuery.Deferred();var d=this;var c=d.getSelectedTab();var f=new Vtiger_RelatedList_Js(d.getRecordId(),app.getModuleName(),c,e);f.addRelations(a).then(function(h){var i=d.getContentHolder();var g=i.find("[data-type='Updates']");if(g.length>0){d.loadWidget(g)}b.resolve(h)},function(h,g){b.reject(h,g)});return b.promise()},postSummaryWidgetAddRecord:function(f,h){var i=h.closest(".summaryWidgetContainer");var e=i.find(".widget_header");var a=i.find(".widget_contents");var b=e.find('[name="relatedModule"]').val();var d=this.getRecordId();var c=app.getModuleName();var g=new Array();g.push(f.result._recordId);a.progressIndicator({});this.addRelationBetweenRecords(b,g).then(function(j){var k={};k.record=d;k.view="Detail";k.module=c;k.page=a.find('[name="page"]').val();k.limit=a.find('[name="pageLimit"]').val();k.col=a.find('[name="col"]').val();k.relatedModule=b;k.mode="showRelatedRecords";AppConnector.request(k).then(function(m){var l=jQuery("#relatedDocuments");a.progressIndicator({mode:"hide"});a.html(m);app.changeSelectElementView(l)})})},registerEventForEmailsRelatedRecord:function(){var a=this.getContentHolder();var c=a.find('[name="emailsRelatedRecord"]');var d=this.getRecordId();var b=Vtiger_Popup_Js.getInstance();a.on("click",'[name="emailsRelatedRecord"]',function(h){var g=jQuery(h.currentTarget);var f=g.data("id");var i={};i.module="Emails";i.view="ComposeEmail";i.mode="emailPreview";i.record=f;i.parentId=d;i.relatedLoad=true;b.show(i)});a.on("click",'[name="emailsEditView"]',function(g){g.stopPropagation();var f="Emails";Vtiger_Helper_Js.checkServerConfig(f).then(function(k){if(k==true){var i=jQuery(g.currentTarget);var e=i.closest("tr");var h=e.data("id");var j=new Array();j.push(d);var l={};l.module="Emails";l.view="ComposeEmail";l.mode="emailEdit";l.record=h;l.selected_ids=j;l.parentId=d;l.relatedLoad=true;b.show(l)}else{Vtiger_Helper_Js.showPnotify(app.vtranslate("JS_EMAIL_SERVER_CONFIGURATION"))}})})},registerEventForAddingEmailFromRelatedList:function(){var a=this.getContentHolder();var b=this.getRecordId();a.on("click",'[name="composeEmail"]',function(f){f.stopPropagation();var c=jQuery(f.currentTarget);var d=new Array();var g={};d.push(b);g.module=app.getModuleName();g.view="MassActionAjax";g.selected_ids=d;g.mode="showComposeEmailForm";g.step="step1";g.relatedLoad=true;Vtiger_Index_Js.showComposeEmailPopup(g)})},registerEnterClickEventForTagRecord:function(){jQuery("#tagRecordText").keypress(function(a){if(a.which==13){jQuery("#tagRecord").trigger("click")}})},checkTagExists:function(e){var b=e.split(" ");for(var d=0;d0){b.splice(d,1);d--}}var c=b.join(" ");if(c==""){return true}else{return c}},addTagsToList:function(d){for(var b in d.result[1]){var c=d.result[1][b];var a=jQuery("#tagsList").find("[data-tagid='"+c+"']");if(a.length==0){jQuery("#tagsList").prepend('')}}},checkTagMaxLengthExceeds:function(d){var a=d.split(" ");var c=jQuery("#maxTagLength").val();for(var b=0;bparseInt(c)){return true}}return false},registerClickEventForAddingTagRecord:function(){var a=this;jQuery("#tagRecord").on("click",function(){var d=jQuery("#tagRecordText");var h=d.val();tagTextSplit=h.split(" ");if((tagTextSplit.length+$("#tagsList").children().length)>$("#maxTag").val()){var c=jQuery("#maxTag").val();d.validationEngine("showPrompt",app.vtranslate("JS_MAX_TAG_EXCEEDS")+" "+c,"error","bottomLeft",true);return}if(h==""){d.validationEngine("showPrompt",app.vtranslate("JS_PLEASE_ENTER_A_TAG"),"error","bottomLeft",true);return}var e=a.checkTagMaxLengthExceeds(h);if(e==true){var b=jQuery("#maxTagLength").val();d.validationEngine("showPrompt",app.vtranslate("JS_MAX_TAG_LENGTH_EXCEEDS")+" "+b,"error","bottomLeft",true);return}var g=a.checkTagExists(h);if(g==true){d.validationEngine("showPrompt",app.vtranslate("JS_TAG_NAME_ALREADY_EXIST"),"error","bottomLeft",true);return}else{h=g}var f={module:app.getModuleName(),action:"TagCloud",mode:"save",tagname:h,record:a.getRecordId()};AppConnector.request(f).then(function(i){a.addTagsToList(i);d.val("")})})},registerRemovePromptEventForTagCloud:function(a){jQuery("#tagRecordText").on("focus",function(c){var b=jQuery(".formError",a);if(b.length>0){b.remove()}})},registerDeleteEventForTag:function(b){var a=this;jQuery(b).on("click",".deleteTag",function(f){var c=jQuery(f.currentTarget).closest(".tag");var d=c.data("tagid");c.fadeOut("slow",function(){c.remove()});var g={module:app.getModuleName(),action:"TagCloud",mode:"delete",tag_id:d,record:a.getRecordId()};AppConnector.request(g).then(function(e){})})},registerTagClickEvent:function(b){var a=this;jQuery(b).on("click",".tagName",function(f){var c=jQuery(f.currentTarget);var d=c.closest(".tag").data("tagid");var g={module:app.getModuleName(),view:"TagCloudSearchAjax",tag_id:d,tag_name:c.find("a").text()};AppConnector.request(g).then(function(e){var h={data:e};app.showModalWindow(h);a.registerChangeEventForModulesList()})})},registerChangeEventForModulesList:function(){jQuery("#tagSearchModulesList").on("change",function(c){var a=jQuery(c.currentTarget);if(a.val()=="all"){jQuery('[name="tagSearchModuleResults"]').removeClass("hide")}else{jQuery('[name="tagSearchModuleResults"]').removeClass("hide");var b=a.val();jQuery('[name="tagSearchModuleResults"]').filter(":not(#"+b+")").addClass("hide")}})},registerPostTagCloudWidgetLoad:function(){var a=this;app.getContentsContainer().on("Vtiger.Widget.Load.LBL_TAG_CLOUD",function(c,b){a.registerClickEventForAddingTagRecord();a.registerEnterClickEventForTagRecord();a.registerDeleteEventForTag(b);a.registerRemovePromptEventForTagCloud(b);a.registerTagClickEvent(b)})},registerGetAllTagCloudWidgetLoad:function(){var a=this;var b={module:app.getModuleName(),mode:"showTags",source_module:app.getModuleName(),record:this.getRecordId(),view:"ShowTagCloudTop"};AppConnector.request(b).then(function(c){if(c.length>0){c=$(c);$(".detailViewTitle .detailViewToolbar").append(c);a.registerDeleteEventForTag(c);a.registerRemovePromptEventForTagCloud(c);a.registerTagClickEvent(c);a.registerClickEventForAddingTagRecord();a.registerEnterClickEventForTagRecord()}})},registerEventForRelatedTabClick:function(){var c=this;var b=c.getContentHolder();var a=b.closest("div.detailViewInfo");jQuery(".related",a).on("click","li",function(j,i){var g=jQuery(j.currentTarget);var f=jQuery("
    ");f.progressIndicator({position:"html",blockInfo:{enabled:true,elementToBlock:a}});var d=g.data("url");if(typeof i!="undefined"){var h=i.callback;delete i.callback}c.loadContents(d,i).then(function(e){c.deSelectAllrelatedTabs();c.markTabAsSelected(g);app.showBtnSwitch(b.find(".switchBtn"));Vtiger_Helper_Js.showHorizontalTopScrollBar();f.progressIndicator({mode:"hide"});c.registerHelpInfo();if(typeof h=="function"){h(e)}if(g.data("linkKey")==c.detailViewSummaryTabLabel){c.loadWidgets()}c.registerBasicEvents();app.notifyPostAjaxReady()},function(){f.progressIndicator({mode:"hide"})})})},registerEventForPicklistDependencySetup:function(a){var e=this;var c=jQuery('[name="picklistDependency"]',a);if(c.length<=0){return}var d=JSON.parse(c.val());var f=Object.keys(d);if(f.length<=0){return}var h=[];for(var b=0;b0||d.length>0){Vtiger_Helper_Js.showPnotify(app.vtranslate("JS_CAN_NOT_REMOVE_COMMENT"))}else{Vtiger_Helper_Js.showConfirmationBox({message:app.vtranslate("JS_DELETE_COMMENT_CONFIRMATION")}).then(function(e){AppConnector.request(i).then(function(l){if(l.success==true){f.fadeOut(400,function(){f.remove()})}else{Vtiger_Helper_Js.showPnotify(l.error.message)}})},function(e,l){})}});a.on("click",".detailViewSaveComment",function(f){var d=jQuery(f.currentTarget);if(!d.is(":disabled")){var c=b.saveComment(f);c.then(function(){var e=a.find("[data-type='Comments']");b.loadWidget(e).then(function(){d.removeAttr("disabled")})})}});a.on("click",".saveComment",function(g){var d=jQuery(g.currentTarget);if(!d.is(":disabled")){var f=jQuery(g.currentTarget);var h=f.data("mode");var c=b.saveComment(g);c.then(function(l){var j=f.closest(".addCommentBlock");var i=j.find(".commentcontent");var p=f.closest(".singleComment");i.val("");if(h=="add"){var n=l.result["id"];var m=b.getCommentUI(n);m.then(function(t){var w=j.closest(".commentDetails");var s=b.getContentHolder();var v=jQuery(".noCommentsMsgContainer",s);v.remove();if(w.length>0){j.remove();var r=w.find("ul");if(r.length<=0){var u=p.find(".viewThreadBlock").data("childCommentsCount");var y=u+1;p.find(".childCommentsCount").text(y);var x=p.find(".commentInfoHeader").data("commentid");b.getChildComments(x).then(function(z){jQuery(z).appendTo(w);p.find(".viewThreadBlock").hide();p.find(".hideThreadBlock").show()})}else{jQuery('
    • '+t+"
    ").appendTo(w)}}else{jQuery('
    • '+t+"
    ").prependTo(j.closest(".commentContainer").find(".commentsList"));i.css({height:"71px"})}p.find(".commentActionsContainer").show()})}else{if(h=="edit"){var k=p.find(".commentModifiedTime");var o=p.find(".commentInfoContent");var e=p.find('[name="editStatus"]');var q=p.find('[name="editReason"]');o.html(l.result.commentcontent);q.html(l.result.reasontoedit);k.text(l.result.modifiedtime);k.attr("title",l.result.modifiedtimetitle);if(e.hasClass("hide")){e.removeClass("hide")}if(l.result.reasontoedit!=""){p.find(".editReason").removeClass("hide")}o.show();p.find(".commentActionsContainer").show();j.remove()}}d.removeAttr("disabled")})}});a.on("click",".moreRecentComments",function(){var c=b.getTabByLabel(b.detailViewRecentCommentsTabLabel);c.trigger("click")})},registerBasicEvents:function(){var b=this;var a=b.getContentHolder();this.registerSummaryViewContainerEvents(a);b.registerCommentEvents(a);app.registerEventForDatePickerFields(a);app.registerEventForTimeFields(a);a.on("click","#detailViewNextRecordButton",function(g){var d=b.getSelectedTab();var c=d.data("url");var f=b.getRelatedListCurrentPageNum();var i=parseInt(f)+1;var h=c+"&page="+i;b.loadContents(h)});a.on("click","#detailViewPreviousRecordButton",function(g){var d=b.getSelectedTab();var c=d.data("url");var f=b.getRelatedListCurrentPageNum();var j=parseInt(f)-1;var i={};var h=c+"&page="+j;b.loadContents(h)});a.on("click","table.detailview-table td.fieldValue",function(d){if(jQuery(d.target).closest("a").hasClass("btnNoFastEdit")){return}var c=jQuery(d.currentTarget);b.ajaxEditHandling(c)});a.on("click","div.recordDetails span.squeezedWell",function(f){var d=jQuery(f.currentTarget);var c=d.data("reference");jQuery('.detailViewInfo .related li[data-reference="'+c+'"]').trigger("click")});a.on("click",".relatedPopup",function(d){var c=new Vtiger_Edit_Js();c.openPopUp(d);return false});a.on("click",".viewThread",function(i){var h=jQuery(i.currentTarget);var g=h.parent();var c=h.closest(".commentActions");var d=h.closest(".commentDetails");var j=d.find("ul");if(j.length>0){j.show();c.find(".hideThreadBlock").show();g.hide();return}var f=h.closest(".commentDiv").find(".commentInfoHeader").data("commentid");b.getChildComments(f).then(function(e){jQuery(e).appendTo(jQuery(i.currentTarget).closest(".commentDetails"));c.find(".hideThreadBlock").show();g.hide()})});a.on("click",".hideThread",function(h){var g=jQuery(h.currentTarget);var f=g.parent();var c=g.closest(".commentActions");var d=g.closest(".commentDetails");d.find("ul").hide();f.hide();c.find(".viewThreadBlock").show()});a.on("click",".detailViewThread",function(g){var f=b.getTabByLabel(b.detailViewRecentCommentsTabLabel);var d=jQuery(g.currentTarget).closest(".singleComment").find(".commentInfoHeader").data("commentid");var c=function(e){window.location.href=window.location.href+"#"+d};f.trigger("click",{commentid:d,callback:c})});a.on("click",".moreRecentRecords",function(f){f.preventDefault();var c=jQuery(f.currentTarget);var d=b.getTabByLabel(c.data("label-key"));d.trigger("click")});a.on("click",".moreRecentUpdates",function(){var f=jQuery("#updatesCurrentPage").val();var e=jQuery("#recordId").val();var c=parseInt(f)+1;var d="index.php?module="+app.getModuleName()+"&view=Detail&record="+e+"&mode=showRecentActivities&page="+c+"&tab_label=LBL_UPDATES";AppConnector.request(d).then(function(g){jQuery("#updatesCurrentPage").remove();jQuery("#moreLink").remove();jQuery("#updates").append(g)},function(g,h){})});a.on("click",".moreRecentDocuments",function(){var c=b.getTabByLabel(b.detailViewRecentDocumentsTabLabel);c.trigger("click")});a.on("click",".moreRecentActivities",function(){var c=b.getTabByLabel(b.detailViewRecentActivitiesTabLabel);c.trigger("click")});a.on("switchChange.bootstrapSwitch",".relatedContainer .switchBtn",function(g,f){var c=b.getTabByLabel(b.detailViewRecentActivitiesTabLabel);var d=c.data("url");d=d.replace("&time=current","");d=d.replace("&time=history","");d+="&time=";if(f){d+="current"}else{d+="history"}c.data("url",d);c.trigger("click")});b.registerEventForRelatedList();b.registerEventForRelatedListPagination()},registerEvents:function(){var b=this;this.registerHelpInfo();b.registerSendSmsSubmitEvent();b.registerAjaxEditEvent();this.registerRelatedRowClickEvent();this.registerBlockAnimationEvent();this.registerBlockStatusCheckOnLoad();this.registerEmailFieldClickEvent();this.registerPhoneFieldClickEvent();this.registerEventForActivityFollowupClickEvent();this.registerEventForMarkAsCompletedClick();this.registerEventForEmailsRelatedRecord();this.registerEventForAddingEmailFromRelatedList();this.registerPostTagCloudWidgetLoad();this.registerEventForRelatedTabClick();Vtiger_Helper_Js.showHorizontalTopScrollBar();this.registerUrlFieldClickEvent();var a=jQuery("div.detailViewContainer");if(a.length<=0){return}this.registerBasicEvents();this.registerSetReadRecord(a);b.registerEventForPicklistDependencySetup(b.getForm());b.getForm().validationEngine(app.validationEngineOptions);b.loadWidgets();app.registerEventForTextAreaFields(jQuery(".commentcontent"));this.registerEventForTotalRecordsCount();this.registerGetAllTagCloudWidgetLoad();this.registerRelatedModulesRecordCount();var c=Vtiger_Header_Js.getInstance();c.registerQuickCreateCallBack(this.registerRelatedModulesRecordCount)}}); \ No newline at end of file From ed6fb319b142a448c4793ea806001afbabf43472 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Fri, 28 Aug 2015 16:11:21 +0200 Subject: [PATCH 034/489] Added summary to the preview --- languages/pl_pl/Supplies.php | 5 +- .../vlayout/modules/Products/Discounts.tpl | 2 +- .../modules/Products/DiscountsType2.tpl | 58 ++++----- layouts/vlayout/modules/Products/Taxs.tpl | 2 +- .../vlayout/modules/Products/TaxsType1.tpl | 2 +- .../modules/Supplies/DetailViewSupplies.tpl | 10 ++ .../Supplies/DetailViewSuppliesSummary.tpl | 96 ++++++++++++++ .../modules/Supplies/EditViewSupplies.tpl | 3 +- .../Supplies/EditViewSuppliesSummary.tpl | 16 +-- .../modules/Supplies/resources/Edit.js | 119 ++++++++++++------ .../modules/Supplies/resources/Edit.min.js | 2 +- layouts/vlayout/skins/twilight/style.css | 2 +- layouts/vlayout/skins/twilight/style.min.css | 2 +- modules/Products/views/Discounts.php | 3 +- modules/Products/views/Taxs.php | 3 +- modules/Supplies/fields/Discount.php | 8 -- modules/Supplies/fields/Tax.php | 8 -- modules/Supplies/models/EditView.php | 3 + modules/Supplies/models/SupField.php | 18 +++ 19 files changed, 260 insertions(+), 102 deletions(-) create mode 100644 layouts/vlayout/modules/Supplies/DetailViewSuppliesSummary.tpl diff --git a/languages/pl_pl/Supplies.php b/languages/pl_pl/Supplies.php index f2f8054adb10..16930481c330 100644 --- a/languages/pl_pl/Supplies.php +++ b/languages/pl_pl/Supplies.php @@ -58,7 +58,6 @@ 'LBL_CHANGE_CURRENCY_INFO' => 'Zmiana waluty spowoduje przeliczenie wszystkich wartości.
    Czy jesteś pewien czy chcesz to zroić?', 'LBL_SUMMARY' => 'Podsumowanie', 'LBL_AMOUNT' => 'Suma', - - 'LBL_GROUP_TsAXS' => 'Grupowy', - 'LBL_GROUP_TsAXS' => 'Grupowy', + 'LBL_SET_GLOBAL_TAX' => 'Ustaw', + 'LBL_SET_GLOBAL_DISCOUNT' => 'Ustaw', ]; diff --git a/layouts/vlayout/modules/Products/Discounts.tpl b/layouts/vlayout/modules/Products/Discounts.tpl index 18d74eaf98d1..028aad39c5c4 100644 --- a/layouts/vlayout/modules/Products/Discounts.tpl +++ b/layouts/vlayout/modules/Products/Discounts.tpl @@ -17,7 +17,7 @@
    {vtranslate('LBL_PRICE_BEFORE_DISCOUNT', $SUPMODULE)}:
    -
    {CurrencyField::convertToUserFormat($TOTAL_PRICE, null, true)} {$CURRENCY_SYMBOL}
    +
    {CurrencyField::convertToUserFormat($TOTAL_PRICE, null, true)} {$CURRENCY_SYMBOL}
    {vtranslate('LBL_DISCOUNT_IN_TOTAL', $SUPMODULE)}:
    diff --git a/layouts/vlayout/modules/Products/DiscountsType2.tpl b/layouts/vlayout/modules/Products/DiscountsType2.tpl index cae76d39bcde..b245656f40c8 100644 --- a/layouts/vlayout/modules/Products/DiscountsType2.tpl +++ b/layouts/vlayout/modules/Products/DiscountsType2.tpl @@ -1,38 +1,40 @@ {strip} -
    -
    - {vtranslate('LBL_INDIVIDUAL_DISCOUNTS', $SUPMODULE)} -
    - + {if $DISCOUNT_TYPE == '0'} +
    +
    + {vtranslate('LBL_INDIVIDUAL_DISCOUNTS', $SUPMODULE)} +
    + +
    -
    -
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,c){var i=this;for(var b in c){var a=c[b];var j=a.description;var e=a.unitPriceValues;var d=JSON.stringify(e);for(var g in a.autoFields){k.find("input."+g).val(a.autoFields[g])}var h=i.getCurrency();if(typeof e[h]!=="undefined"){i.setUnitPrice(k,e[h])}$("input.unitPrice",k).attr("list-info",d);$("textarea.commentTextarea",k).val(j);i.showIndividualTax(k)}if(f==="Products"){i.loadSubProducts(k,true)}this.quantityChangeActions(k)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".discountParam").val(JSON.stringify(c))},saveTaxsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(b.taxMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});d.find(".taxParam").val(JSON.stringify(c))},showExpandedRow:function(e){var d=this;var c=d.getSupTableContainer();var b=c.find('[numrowex="'+e.attr("numrow")+'"]');var a=e.find(".toggleVisibility");a.data("status","1");a.find(".glyphicon").removeClass("glyphicon-menu-down");a.find(".glyphicon").addClass("glyphicon-menu-up");b.removeClass("hide");d.loadCkEditorElement(b.find(".ckEditorSource"))},hideExpandedRow:function(f){var e=this;var d=e.getSupTableContainer();var c=d.find('[numrowex="'+f.attr("numrow")+'"]');var b=f.find(".toggleVisibility");b.data("status","0");b.find(".glyphicon").removeClass("glyphicon-menu-up");b.find(".glyphicon").addClass("glyphicon-menu-down");c.addClass("hide");var a=CKEDITOR.instances[c.find(".ckEditorSource").attr("id")];if(a){a.destroy()}},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},initTaxParameters:function(d,a){var c=this;var b=d.find(".taxParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.taxMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateTax(d,a)},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#suppliesLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"CheckLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#suppliesLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide();console.error(f,g)});return a},currencyChangeActions:function(a,b){var c=this;if(b.data("baseCurrency")==0){c.showCurrencyChangeMondal(a)}else{c.currencyConvertValues(a);a.data("oldValue",a.val())}},showCurrencyChangeMondal:function(a){var c=this;if(c.lockCurrencyChange==true){return}c.lockCurrencyChange=true;var b=a.closest("th").find(".modelContainer").clone();app.showModalWindow(b,function(e){var d=$(e);d.on("click",'button[type="submit"]',function(f){c.currencyConvertValues(a);a.data("oldValue",a.val());app.hideModalWindow();c.lockCurrencyChange=false});d.on("click",'button[type="reset"]',function(f){a.val(a.data("oldValue")).change();c.lockCurrencyChange=false})})},currencyConvertValues:function(a){var d=this;var b=a.find("option:selected");var c=a.find('option[value="'+a.data("oldValue")+'"]');if(b.data("baseCurrency")=="1"){}this.getSupTableContainer().find(d.rowClass).each(function(f){var h=$(this);var e=b.data("conversionRate");var g=c.data("conversionRate");e=parseFloat(e)/parseFloat(g);d.setUnitPrice(h,app.parseNumberToFloat(d.getUnitPriceValue(h)*e));d.setDiscount(h,app.parseNumberToFloat(d.getDiscount(h)*e));d.setTax(h,app.parseNumberToFloat(d.getTax(h)*e));d.quantityChangeActions(h)})},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackSuppliesTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.find("tr").appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.registerAutoCompleteFields(m);c.initRow(m)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(c,d){a.find(b.rowClass).each(function(e,f){var g=$(f);b.hideExpandedRow(g)});d.item.startPos=d.item.index()},stop:function(d,e){var c=$(e.item.context).attr("numrow");var f=a.find(".numRow"+c).remove().clone();a.find('[numrow="'+c+'"]').after(f);if(e.item.startPos1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackSuppliesTable tbody").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},getTaxModeSelectElement:function(b){var a=this.getSupTableHeadContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(d){var c=this;var a=c.getSupSummaryTaxesContainer().find(".groupTax");var b=c.getSupTableContainer();if(c.isIndividualTaxMode()){a.addClass("hide");b.find(".changeTax").removeClass("hide")}else{a.removeClass("hide");b.find(".changeTax").addClass("hide")}c.setTax(b,0);c.setTaxParam(b,[]);c.rowsCalculations()},getDiscountModeSelectElement:function(b){var a=this.getSupTableHeadContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(d){var c=this;var a=c.getSupSummaryDiscountContainer().find(".groupDiscount");var b=c.getSupTableContainer();if(c.isIndividualDiscountMode()){a.addClass("hide");b.find(".changeDiscount").removeClass("hide")}else{a.removeClass("hide");b.find(".changeDiscount").addClass("hide")}c.setDiscount(b,0);c.setDiscountParam(b,[]);c.rowsCalculations()},getCurrency:function(){var a=$('[name="currency"]',this.getSupTableHeadContainer());return a.find("option:selected").val()},getTax:function(a){return app.parseNumberToFloat($(".tax",a).val())},getQuantityValue:function(a){return app.parseNumberToFloat($(".qty",a).val())},getUnitPriceValue:function(a){return app.parseNumberToFloat($(".unitPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return app.parseNumberToFloat(b)},getNetPrice:function(a){return app.parseNumberToFloat($(".netPrice",a).val())},getTotalPrice:function(a){return app.parseNumberToFloat($(".totalPrice",a).val())},getGrossPrice:function(a){return app.parseNumberToFloat($(".grossPrice",a).val())},getPurchase:function(a){var b=this.getQuantityValue(a);return app.parseNumberToFloat($(".purchase",a).val())*b},getSummaryGrossPrice:function(){var b=this;var a=0;this.getSupTableContainer().find(this.rowClass).each(function(c){a+=b.getGrossPrice($(this))});return app.parseNumberToFloat(a)},setUnitPrice:function(b,a){a=app.parseNumberToShow(a);b.find(".unitPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=app.parseNumberToShow(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=app.parseNumberToShow(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=app.parseNumberToShow(a);$(".totalPriceText",b).text(a);$(".totalPrice",b).val(a)},setMargin:function(b,a){a=app.parseNumberToShow(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=app.parseNumberToShow(a);$(".marginp",b).val(a)},setDiscount:function(b,a){a=app.parseNumberToShow(a);$(".discount",b).val(a)},setDiscountParam:function(b,a){$(".discountParam",b).val(JSON.stringify(a))},setTax:function(b,a){a=app.parseNumberToShow(a);$(".tax",b).val(a)},setTaxParam:function(b,a){$(".taxParam",b).val(JSON.stringify(a))},quantityChangeActions:function(a){this.rowCalculations(a);this.summaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getSupTableContainer().find(a.rowClass).each(function(b){a.quantityChangeActions($(this))})},summaryCalculations:function(){var a=this;a.getSupTableContainer().find("tfoot .wisableTd").each(function(b){a.calculatSummary($(this),$(this).data("sumfield"))});a.calculatDiscountSummary();a.calculatTaxSummary();a.calculatCurrenciesSummary()},calculatSummary:function(a,d){var c=this;var b=0;this.getSupTableContainer().find(c.rowClass).each(function(e){b+=app.parseNumberToFloat($(this).find("."+d).val())});a.text(app.parseNumberToShow(b))},calculatDiscountSummary:function(){var b=this;var c=b.getAllDiscount();var a=b.getSupSummaryDiscountContainer();a.find("input").val(app.parseNumberToShow(c))},getAllDiscount:function(){var a=this;var b=0;this.getSupTableContainer().find(a.rowClass).each(function(d){var e=$(this);var c=a.getDiscount(e);b+=c});return b},calculatCurrenciesSummary:function(){var g=this;var a=g.getSupSummaryCurrenciesContainer();var f=$('[name="currency"] option:selected',g.getSupTableHeadContainer());var h=$('[name="currency"] option[data-base-currency="1"]',g.getSupTableHeadContainer());var b=f.data("conversionRate");var e=h.data("conversionRate");if(b==e){a.addClass("hide");return}b=parseFloat(e)/parseFloat(b);a.removeClass("hide");var c=g.getAllTaxs();var d=0;a.find(".panel-body").html("");$.each(c,function(i,j){if(j!=undefined){j=j*b;var k=a.find(".hide .form-group").clone();k.find(".percent").text(i+"%");k.find("input").val(app.parseNumberToShow(j));k.appendTo(a.find(".panel-body"));d+=j}});a.find(".panel-footer input").val(app.parseNumberToShow(d))},calculatTaxSummary:function(){var d=this;var b=d.getAllTaxs();var a=d.getSupSummaryTaxesContainer();a.find(".panel-body").html("");var c=0;$.each(b,function(e,f){if(f!=undefined){var g=a.find(".hide .form-group").clone();g.find(".percent").text(e+"%");g.find("input").val(app.parseNumberToShow(f));g.appendTo(a.find(".panel-body"));c+=f}});a.find(".panel-footer input").val(app.parseNumberToShow(c))},getAllTaxs:function(){var b=this;var a=[];this.getSupTableContainer().find(b.rowClass).each(function(c){var f=$(this);var g=b.getNetPrice(f);var e=f.find(".taxParam").val();if(e!=""&&e!="[]"){var d=$.parseJSON(e);if(typeof d.aggregationType=="string"){d.aggregationType=[d.aggregationType]}$.each(d.aggregationType,function(k,j){var j=j+"Tax";var i=d[j];var h=0;if(a[i]!=undefined){h=parseFloat(a[i])}a[i]=h+g*(i/100)})}});return a},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getUnitPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,c){var e=app.parseNumberToFloat(c.find(".valueTotalPrice").text()),b=e,k=0,f=0,g=0,a=0;var i=c.find(".discountsType").val();if(i=="0"||i=="1"){if(c.find(".activepanel .globalDiscount").length>0){var k=app.parseNumberToFloat(c.find(".activepanel .globalDiscount").val())}if(c.find(".activepanel .individualDiscountType").length>0){var d=c.find(".activepanel .individualDiscountType:checked").val();var h=c.find(".activepanel .individualDiscountValue").val();if(d=="percentage"){g=e*(h/100)}else{g=h}}if(c.find(".activepanel .groupCheckbox").length>0&&c.find(".activepanel .groupCheckbox").prop("checked")==true){var f=app.parseNumberToFloat(c.find(".groupValue").val());f=e*(f/100)}b=b*((100-k)/100);b=b-app.parseNumberToFloat(g);b=b-f}else{if(i=="2"){c.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=app.parseNumberToFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=app.parseNumberToFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=app.parseNumberToFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}c.find(".valuePrices").text(app.parseNumberToShow(b));c.find(".valueDiscount").text(app.parseNumberToShow(e-b))},calculateTax:function(k,g){var h=app.parseNumberToFloat(g.find(".valueNetPrice").text()),b=h,c=0,f=0,a=0,i=0,e=0;var d=g.find(".taxsType").val();if(d=="0"||d=="1"){if(g.find(".activepanel .globalTax").length>0){var c=g.find(".activepanel .globalTax").val()}if(g.find(".activepanel .individualTaxValue").length>0){var j=app.parseNumberToFloat(g.find(".activepanel .individualTaxValue").val());i=(j/100)*b}if(g.find(".activepanel .groupTax").length>0){var f=app.parseNumberToFloat(g.find(".groupTax").val());f=h*(app.parseNumberToFloat(f)/100)}if(g.find(".activepanel .regionalTax").length>0){var a=app.parseNumberToFloat(g.find(".regionalTax").val());a=h*(app.parseNumberToFloat(a)/100)}b=b*((100+app.parseNumberToFloat(c))/100);b=b+app.parseNumberToFloat(i);b=b+app.parseNumberToFloat(f);b=b+app.parseNumberToFloat(a)}else{if(d=="2"){g.find(".activepanel").each(function(p){var l=$(this);if(l.find(".globalTax").length>0){var o=app.parseNumberToFloat(l.find(".globalTax").val());b=b*((100+o)/100)}else{if(l.find(".groupTax").length>0){var n=app.parseNumberToFloat(l.find(".groupTax").val());b=b*((100+n)/100)}else{if(l.find(".regionalTax").length>0){var m=app.parseNumberToFloat(l.find(".regionalTax").val());b=b*((100+m)/100)}else{if(l.find(".individualTaxValue").length>0){var q=app.parseNumberToFloat(l.find(".individualTaxValue").val());b=((q+100)/100)*b}}}}})}}g.find(".valuePrices").text(app.parseNumberToShow(b));g.find(".valueTax").text(app.parseNumberToShow(b-h))},updateRowSequence:function(){var a=this.getSupTableContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerSuppliesSaveData:function(a){var b=this;a.on(Vtiger_Edit_Js.recordPreSave,function(f,d){if(!b.checkLimits(a)){return false}var c=a.find("#blackSuppliesTable");c.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductUnitPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setUnitPrice(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(g,a){var d=this;var c=jQuery("input.sourceField",g).val();var e=g.find('.rowName input[name="popupReferenceModule"]').val();d.removeSubProducts(g);if(c=="0"||$.inArray(e,["Products","Services"])<0){return false}if(d.subProductsCashe[c]){d.addSubProducts(g,d.subProductsCashe[c]);return false}var f={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(f).then(function(i){var h=i.result;d.subProductsCashe[c]=h;d.addSubProducts(g,h);if(b){b.hide()}},function(h,i){if(b){b.hide()}console.error(h,i)})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,c){var i=this;for(var b in c){var a=c[b];var j=a.description;var e=a.unitPriceValues;var d=JSON.stringify(e);for(var g in a.autoFields){k.find("input."+g).val(a.autoFields[g])}var h=i.getCurrency();if(typeof e[h]!=="undefined"){i.setUnitPrice(k,e[h])}$("input.unitPrice",k).attr("list-info",d);$("textarea.commentTextarea",k).val(j);i.showIndividualTax(k)}if(f==="Products"){i.loadSubProducts(k,true)}i.quantityChangeActions(k)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});b.setDiscountParam(d,c)},saveTaxsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(b.taxMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});b.setTaxParam(d,c)},showExpandedRow:function(e){var d=this;var c=d.getSupTableContainer();var b=c.find('[numrowex="'+e.attr("numrow")+'"]');var a=e.find(".toggleVisibility");a.data("status","1");a.find(".glyphicon").removeClass("glyphicon-menu-down");a.find(".glyphicon").addClass("glyphicon-menu-up");b.removeClass("hide");d.loadCkEditorElement(b.find(".ckEditorSource"))},hideExpandedRow:function(f){var e=this;var d=e.getSupTableContainer();var c=d.find('[numrowex="'+f.attr("numrow")+'"]');var b=f.find(".toggleVisibility");b.data("status","0");b.find(".glyphicon").removeClass("glyphicon-menu-up");b.find(".glyphicon").addClass("glyphicon-menu-down");c.addClass("hide");var a=CKEDITOR.instances[c.find(".ckEditorSource").attr("id")];if(a){a.destroy()}},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},initTaxParameters:function(d,a){var c=this;var b=d.find(".taxParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.taxMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateTax(d,a)},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#suppliesLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"CheckLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#suppliesLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide();console.error(f,g)});return a},currencyChangeActions:function(a,b){var c=this;if(b.data("baseCurrency")==0){c.showCurrencyChangeMondal(a)}else{c.currencyConvertValues(a);a.data("oldValue",a.val())}},showCurrencyChangeMondal:function(a){var c=this;if(c.lockCurrencyChange==true){return}c.lockCurrencyChange=true;var b=a.closest("th").find(".modelContainer").clone();app.showModalWindow(b,function(e){var d=$(e);d.on("click",'button[type="submit"]',function(f){c.currencyConvertValues(a);a.data("oldValue",a.val());app.hideModalWindow();c.lockCurrencyChange=false});d.on("click",'button[type="reset"]',function(f){a.val(a.data("oldValue")).change();c.lockCurrencyChange=false})})},currencyConvertValues:function(a){var f=this;var d=a.find("option:selected");var e=a.find('option[value="'+a.data("oldValue")+'"]');var b=d.data("conversionRate");var c=e.data("conversionRate");b=parseFloat(b)/parseFloat(c);this.getSupTableContainer().find(f.rowClass).each(function(g){var h=$(this);f.setUnitPrice(h,app.parseNumberToFloat(f.getUnitPriceValue(h)*b));f.setDiscount(h,app.parseNumberToFloat(f.getDiscount(h)*b));f.setTax(h,app.parseNumberToFloat(f.getTax(h)*b));f.quantityChangeActions(h)})},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackSuppliesTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.find("tr").appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.registerAutoCompleteFields(m);c.initRow(m)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(c,d){a.find(b.rowClass).each(function(e,f){var g=$(f);b.hideExpandedRow(g)});d.item.startPos=d.item.index()},stop:function(d,e){var c=$(e.item.context).attr("numrow");var f=a.find(".numRow"+c).remove().clone();a.find('[numrow="'+c+'"]').after(f);if(e.item.startPos.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background:0}.navbar-default .navbar-nav>li:hover{background:#e7e7e7}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background:0}.navbar-inverse .navbar-nav>li:hover{background:#080808}.navbar-nav .hovernav:hover>.dropdown-menu{display:block}#collapsedMenu{display:block;position:relative}#collapsedMenu a{color:#fff}#collapsedMenu .dropdown-menu .shortDropdown{max-height:300px;overflow-y:scroll;padding:10px;position:relative;z-index:10000;-webkit-overflow-scrolling:touch;-webkit-transform:translateZ(0)}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames{margin-bottom:2px}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a{font-size:.9em;padding:3%!important;color:#2b2b2b!important}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a:hover{text-decoration:none;background:#404952;color:#fff!important}.moreMenus{width:52em;padding:24%;left:0;border-radius:2px}.moreMenus.leftAligned:after,.moreMenus.leftAligned:before{left:21px!important}.moreMenus strong{font-size:1.1em;color:#2b2b2b}.moreMenus:after,.moreMenus:before{left:292px!important}.announcement{// display:none;background:#fafad2;// padding:2px 0;// border-bottom:1px solid #ccc;// max-height:24px;// width:100%}.announcement .marStyle{// width:100%}#headerLinks{padding:10px 0 7px;min-width:240px;float:right!important}#headerLinks .headerLinksContainer{margin-right:10px}#headerLinks .headerLinksContainer>[class*="span"]{float:left;margin-left:15px}#headerLinks .headerLinksContainer .dropdown.open .dropdown-toggle{background:transparent}#headerLinks .headerLinksContainer ul.dropdown-menu{top:30px}#headerLinks .headerLinksContainer ul.dropdown-menu:after,#headerLinks .headerLinksContainer ul.dropdown-menu:before{right:15px;left:auto}#headerLinks .headerLinksContainer>span a img,#headerLinks .headerLinksContainer>span a.userName{color:#fff;cursor:pointer;text-decoration:none!important}#headerLinks .headerLinksContainer>span a img .caret,#headerLinks .headerLinksContainer>span a.userName .caret{border-top:4px solid #fff}.dropdown-menu.pull-right{right:0;left:auto;cursor:pointer}.themeMenuContainer{min-width:110px;width:110px;left:-84px!important;padding:10px 0}.themeMenuContainer .themeMenu{padding:0 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement{cursor:pointer;margin:5px;height:20px;width:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement:hover{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}.themeMenuContainer .themeMenu .themeSelected{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}@media screen and (min-width:1161px){#mediumNav,#shortNav,#headerLinksCompact{display:none}#largeNav{margin-left:10px;margin-right:0}}@media screen and (max-width:1160px) and (min-width:960px){.companyLogo{width:100%}.customFilterMainSpan .select2-container{width:300px!important}*{zoom:1!important}}@media screen and (max-width:960px){.bodyContents{margin:0!important}#centerPanel{width:100%!important}.col-md-3#headerLinks{padding:5px 5px 0}.menuBar .col-md-9,.col-md-3#headerLinks{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-width:80px}.menuBar .col-md-9 .qCreate,.col-md-3#headerLinks .qCreate{display:inline-block;margin:0}.menuBar .col-md-9 .qCreate img,.col-md-3#headerLinks .qCreate img{margin-bottom:3px;margin-right:5px}.menuBar .col-md-9 .qCreate ul li.title,.col-md-3#headerLinks .qCreate ul li.title{padding:5px 0 0 15px}.menuBar .col-md-9 li.tabs:first-child>a,.col-md-3#headerLinks li.tabs:first-child>a{padding:10px 12px 9px}.customFilterMainSpan .select2-container{width:300px!important}#quickCreateModules{width:100%!important;padding:0!important}.CompactQC{max-height:300px;overflow-y:scroll;overflow-x:hidden}.CompactQC a:hover{text-decoration:none}}.commonActionsContainer .quickActions{height:3em}.commonActionsContainer .quickActions img{height:60%;margin:40% auto}.commonActionsContainer .quickActions #companyLogo-container img{height:98%;margin:0 auto}.commonActionsContainer .actionsContainer{background:#f3f3f3}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown{min-width:715px;top:28px;margin:0;padding-top:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a{padding:2px;border:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mainContainer{min-height:500px;margin-top:103px;background:#eeeff2;min-width:1200px}.mainContainer>.col-md-2{// padding:0 1.06383%;height:auto!important;// min-width:174px}.mainContainer .contentsDiv{min-height:500px;background:#fafafb;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;border-left:1px solid #e6e6e6;position:relative}.mainContainer #leftPanel{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.toggleButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;left:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-left:0;display:inline-block}.toggleButton .glyphicon-chevron-left{background-position:-434px -72px!important}.toggleButton .glyphicon-chevron-right{background-position:-460px -72px!important}.toggleRightPanelButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;right:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-right:0;display:inline-block}.quickLinksDiv{margin:10px 0}.quickLinksDiv p{font-size:1.2em;padding:3% 0 0 6%;height:40px;cursor:pointer;box-shadow:0 0 0 1px #ddd;border-top:1px solid #fff!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);position:relative;border-radius:2px}.quickLinksDiv p a{color:#2b2b2b}.quickLinksDiv p a:hover{text-decoration:none}.quickLinksDiv p.selectedQuickLink{background-color:#2a2f35;background-image:-moz-linear-gradient(top,#2a2f35,#2a2f35);background-image:-ms-linear-gradient(top,#2a2f35,#2a2f35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#2a2f35),to(#2a2f35));background-image:-webkit-linear-gradient(top,#2a2f35,#2a2f35);background-image:-o-linear-gradient(top,#2a2f35,#2a2f35);background-image:linear-gradient(top,#2a2f35,#2a2f35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2a2f35',endColorstr='#2a2f35',GradientType=0);border-color:#2a2f35 #2a2f35 #08090a;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);background-image:none;position:relative;border:1px solid #fff;box-shadow:4px 0 3px -4px #000 inset}.quickLinksDiv p.selectedQuickLink a{color:#fff}.quickLinksDiv p.selectedQuickLink a:after{border-bottom:19px solid rgba(0,0,0,0);border-left:10px solid #2a2f35;border-top:19px solid rgba(0,0,0,0);content:" ";display:inline-block;position:absolute;left:100%;top:0}.quickWidgetContainer li a{overflow:hidden;white-space:normal;padding:5px;margin:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.quickWidgetContainer .quickWidget{margin-bottom:10px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.sidebarTitleBlock{padding:12px 0}.sidebarTitleBlock a{color:#373737!important}.sidebarTitleBlock a:hover{text-decoration:none}#selectAllMsgDiv,#deSelectAllMsgDiv{display:none;background-color:#fafad2;padding:.01%;text-align:center}.blockUI form,#globalmodal form{margin:0}.dashboardHeading h2{padding-bottom:8px}.dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardHeading .dropdown-menu{left:-70px;right:0}.dashboardContainer{padding:0}.dashboardContainer .dashboardHeading{padding:10px 0 0;background:#f5f5f5}.dashboardContainer .dashboardHeading h2{padding:0 0 8px 20px}.dashboardContainer .dashboardHeading .btn-toolbar{padding:3px 20px 0 0}.dashboardContainer .dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardContainer .dashboardHeading .dropdown-menu{left:-82px}.widgetsList{max-height:400px;overflow-y:auto;overflow-x:hidden}.widgetsList li{display:block}.widgetsList li a{white-space:normal;word-wrap:break-word}.dashboard_notebookWidget_view .row{margin-bottom:5px}.gridster{margin-left:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.gridster ul{width:auto;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:460px}.gridster ul{list-style:none}.gridster ul li.dashboardWidget{background:#fff;border-radius:1px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.gridster ul li.dashboardWidget .dashboardWidgetHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd;color:#444;cursor:move;padding:5px}.gridster ul li.dashboardWidget .dashboardWidgetHeader table{height:28px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .dashboardTitle{text-align:left;padding-left:10px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .widgeticons{opacity:.5;padding-right:6px}.gridster ul li.dashboardWidget .filterContainer{position:absolute;border:1px solid #ddd;background:#fff;margin-left:-7px;margin-right:3px;margin-top:4px;padding:8px 0;border-radius:0 0 5px 5px;box-shadow:0 5px 8px -5px #888}.gridster ul li.dashboardWidget .filterContainer div span{margin-top:6px}.gridster ul li.dashboardWidget .filterContainer .col-md-5{margin-top:3px}.gridster ul li.dashboardWidget .dashboardWidgetContent{padding:10px 0;line-height:20px}.gridster ul li.dashboardWidget .dashboardWidgetContent .dashboard_notebookWidget_viewarea{height:200px}.gridster ul li.dashboardWidget .widgeticons{min-width:50px;height:30px;margin-right:30px}.gridster ul li.dashboardWidget .widgeticons a{cursor:pointer;text-decoration:none}.gridster ul .widgetChartContainer{margin-left:10px}.listViewPageDiv{margin:11px 0}.customFilterMainSpan{width:100%}.customFilterMainSpan .select2-container{width:95%!important}.select2-container .select2-choice{border-radius:2px;background:#fff;border-color:#ddd;font-size:14px;letter-spacing:.01em;color:#2b2b2b}.select2-container .select2-choice div{border-radius:0;border-left:0;background:#fff}.select2-drop{border-color:#ddd}.select2-dropdown ul.filterActions{list-style:none!important;padding-left:15px}.select2-dropdown ul.filterActions li{cursor:pointer}.ui-autocomplete .ui-menu-item #ui-active-menuitem{background:#404952;border-radius:0}li.ui-timepicker-selected,.ui-timepicker-list li:hover,.ui-timepicker-list:hover .ui-timepicker-selected:hover{background:#404952}#relatedTabOrder .select2-input{min-width:200px}.alphabetSorting .alphabetSearch a{vertical-align:middle;display:inline-block;margin-bottom:2px}.alphabetSorting .alphabetSearch:hover{background:#eeeff2}.listViewActions .settingsIcon{display:inline-block;margin-left:5px}.listViewActions>.btn-group{min-width:105px}#listViewPageJumpDropDown,#relatedListPageJumpDropDown{left:-60px}.pageNumbers{display:inline-block;margin-right:5px;margin-top:6px;vertical-align:top}.pageNumbers .totalNumberOfRecords{margin:0 5px}.contents-topscroll,#reportDetails{overflow-x:auto!important;overflow-y:visible}.contents-bottomscroll{overflow-x:auto!important}.bottomscroll-div,.topscroll-div{display:table;min-width:100%}.listViewLoadingImageBlock{background:0;border-radius:0;box-shadow:none;text-align:center}.detailViewContainer{padding:0 20px}.userPreferences .contents{padding-left:0!important}.userPreferences .details{border-right:0!important}.detailViewTitle{padding:1% 0 0 1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .recordLabel{font-size:16px;font-weight:bold}.detailViewTitle .detailViewButtoncontainer{margin-top:8px}.detailViewTitle .detailViewPagingButton{margin-top:8px;padding-right:10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .btn-toolbar{margin:0}.detailview-table th,.detailview-table td{vertical-align:middle}.detailview-table th label,.detailview-table td label{margin-bottom:3px}.detailViewInfo{box-shadow:0 -4px 4px -4px #959595;margin-top:5px}.detailViewInfo .details{// min-height:600px;padding-right:1.5%;border-right:4px solid #404952;padding-bottom:10px;padding-top:10px}.detailViewInfo .related .nav-pills .active>a,.detailViewInfo .related .nav-pills .active>a:hover{background:#404952;border-radius:1px;margin-top:0;margin-bottom:2px}.fieldLabel{width:20%;background:#f7f7f9}.fieldLabel label.marginRight10px{text-align:right}.summaryView{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.summaryView .summary-table tr.summaryViewEntries:last-child .fieldValue,.summaryView .summary-table tr.summaryViewEntries:last-child .fieldLabel{border-bottom:1px solid #ddd}.summaryView .summaryViewEntries .fieldLabel{vertical-align:top;padding:5px 0 5px 5%;border-top:1px solid #ddd;border-right:1px solid #ddd}.summaryView .summaryViewEntries .fieldValue{vertical-align:top;padding:5px 0 5px 5px;border-top:1px solid #ddd}.summaryView .summaryViewEntries:hover .summaryViewEdit{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryView .summaryViewEntries .summaryViewEdit{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryView .toggleViewByMode{margin:8px 0;padding-right:0}.summaryView .toggleViewByMode .changeDetailViewMode{white-space:normal!important}.summaryWidgetContainer{border-radius:2px;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border:1px solid #eaeaea;background:#fff;margin-bottom:10px;padding:15px}.commentContainer .commentTitle{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;margin-bottom:10px}.commentContainer .commentTitle textarea{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordDetails .squeezedWell{padding:3% 0;min-height:105px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordEditView .contentHeader{padding:.5% 0 1% 0}.recordEditView .table .fieldLabel,.recordEditView .table .fieldValue{vertical-align:middle}.recordEditView .table tbody tr:hover td,.recordEditView .table tbody tr:hover th{background:#f7f7f9}.commentContainer{border-radius:2px}.commentContainer hr{margin:0!important}.commentContainer .addCommentBlock .commentsControls{display:inline-block}.commentContainer .commentsList>.liStyleNone>.commentDetails .commentDiv{width:100%}.commentContainer .commentDetails{background:#fff;border:1px solid #ddd;margin-bottom:5px;border-radius:2px;padding:10px 10px 5px;display:inline-block;min-width:354px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentContainer .commentorInfo p{margin-bottom:0}.commentContainer .addCommentBlock{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border:1px solid #ddd;padding:12px 12px 5px;min-height:115px;margin-top:15px;display:block}.commentContainer .addCommentBlock .commentcontent{padding:8px!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;resize:none}.commentContainer .commentInfoContent{padding:1px 0;word-wrap:break-word}.commentTitle .col-md-1{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentTitle .col-md-1 img{width:32px;height:32px}.commentsList>ul{margin-left:0}.singleComment .editedStatus{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:5px 0 5px 32px}.singleComment .editedStatus p{margin-bottom:0}.singleComment .commentActionsDiv{display:none}.singleComment .commentActionsDiv p{margin-bottom:0}.singleComment:hover .commentActionsDiv{display:block;margin-bottom:3px}.recentComments{margin:0;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recentComments .commentDiv{min-width:100%}.recentComments .addCommentBlock{border:0;margin-top:0;display:block}.recentComments .commentDetails{display:block}.singleComment:hover .commentActions .replyComment{display:inline-block}.commentActionsContainer a:hover{text-decoration:none}.commentActionsContainer .editStatus{padding:5px 2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentActionsContainer .editStatus p{margin-bottom:0}.table{background:#fff}.table-bordered{border-radius:1px;margin-bottom:0}.table-bordered th{border-top:1px solid #fff!important}.table th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;color:#444}.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td,.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td{border-left:0;border-right:0}.listViewEntriesTable tbody tr td:first-child{border-left:0 none}.equalSplit td:nth-child(odd){width:20%}.equalSplit td:nth-child(even){width:30%}td.fieldValue input,td.fieldValue .input-group{margin-bottom:0}.actionImage,.actionImages{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.listViewHeaders a{color:#444}.listViewEntriesDiv .listViewHeaders th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd}.listViewEntriesDiv,.listViewEntriesDiv td{overflow:visible}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues{color:#444}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues:hover{text-decoration:none}.listViewEntriesTable td.listViewEntryValue,.listViewEntries td{vertical-align:middle;cursor:pointer;overflow:visible;padding:5px}.listViewEntriesTable td.listViewEntryValue:hover .actionImages,.listViewEntries td:hover .actionImages,.listViewEntriesTable td.listViewEntryValue:hover .actions,.listViewEntries td:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryViewEntries .summaryViewEdit,.activityStatus .editStatus,.activityDescription .editDescription,.addedCalendars .actionImage{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryViewEntries:hover .fieldValue .summaryViewEdit,.activityStatus:hover .editStatus,.activityDescription:hover .editDescription,.addedCalendars:hover .actionImage{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewEntriesTable tr:hover td .actions .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewBasicAction.dropdown-menu{width:100%}.listViewBasicAction.dropdown-menu input{border-radius:2px;height:24px;margin-bottom:0;margin-top:-2px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.emptyRecordsDiv{width:100%;border:1px solid #ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.emptyRecordsDiv td{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.CustomFilterViewTitle{padding-top:1%}#CustomView .filterActions{padding-bottom:20px;overflow:hidden}.filterConditionsDiv{padding-bottom:0}.conditionGroup .header{margin-bottom:20px;font-size:1.2em}.conditionGroup .contents .conditionRow{margin-bottom:10px}.conditionGroup .contents .conditionRow select,.conditionGroup .contents .conditionRow input{width:90%}.conditionGroup .contents .conditionRow .chzn-results li{line-height:20px}.conditionGroup .deleteCondition{vertical-align:bottom}.searchUIBasic{border-collapse:separate!important;border-spacing:10px!important;margin:0 10%}.searchUIBasic .importContents{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.searchUIBasic .listRow .listViewHeaders>td{color:#404952}.searchUIBasic .listRow .defaultInputTextContainer{max-width:87%!important;margin-bottom:0!important}#lineItemTab.table tr:first-child:hover th ~ td{background-color:#f3f3f4;background-image:-moz-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-ms-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f3f3f4),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-o-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:linear-gradient(top,#f3f3f4,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f4',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}#lineItemTab.table tr:nth-child(2):hover td{background:0}.lineItemTable tr td{width:0}.lineItemTable tr td div.finalDiscountUI,.lineItemTable tr td div.discountUI,.lineItemTable tr td div#shipping_handling_div,.lineItemTable tr td div.taxUI,.lineItemTable tr td div.finalTaxUI{border:2px solid #c4c4c4;border-radius:2px}.lineItemTable tr td div.finalDiscountUI table tr td,.lineItemTable tr td div.discountUI table tr td,.lineItemTable tr td div#shipping_handling_div table tr td,.lineItemTable tr td div.taxUI table tr td,.lineItemTable tr td div.finalTaxUI table tr td,.lineItemTable tr td div.finalDiscountUI table tr th,.lineItemTable tr td div.discountUI table tr th,.lineItemTable tr td div#shipping_handling_div table tr th,.lineItemTable tr td div.taxUI table tr th,.lineItemTable tr td div.finalTaxUI table tr th{border-left:0}.lineItemTable tr:hover td{width:0}.lineItemTable tr:hover td div.finalDiscountUI table tr td{background:none!important}.lineItemTable tr:hover td div.discountUI table tr td{background:none!important}.lineItemTable tr:hover td div#shipping_handling_div table tr td{background:none!important}.lineItemTable tr:hover td span.taxDivContainer div table tr td{background:none!important}.lineItemTable tr:hover td div.finalTaxUI table tr td{background:none!important}.lineItemResult{width:70.5%!important}.lineItemResult a:hover{color:#404952}.lineItemInputBox{width:45%;float:right;text-align:right}.discountUI,.taxUI,.finalDiscountUI,.finalTaxUI,#shipping_handling_div{position:absolute;left:46%;width:30%;z-index:500;box-shadow:1px 0 7px #ddd;border-radius:6px}.discountUI table.table,.taxUI table.table,.finalDiscountUI table.table,.finalTaxUI table.table,#shipping_handling_div table.table{margin-bottom:0}.discountUI .table tbody tr:first-child th:first-child,.taxUI .table tbody tr:first-child th:first-child,.finalDiscountUI .table tbody tr:first-child th:first-child,.finalTaxUI .table tbody tr:first-child th:first-child,#shipping_handling_div .table tbody tr:first-child th:first-child{border-radius:4px 0 0 0!important}.discountUI .table tbody tr:first-child th:last-child,.taxUI .table tbody tr:first-child th:last-child,.finalDiscountUI .table tbody tr:first-child th:last-child,.finalTaxUI .table tbody tr:first-child th:last-child,#shipping_handling_div .table tbody tr:first-child th:last-child{border-radius:0 4px 0 0!important}.LineItemDirectPriceReduction{width:65%!important}th.htColHeader,.handsontable thead th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd;padding:6px 2px}.contentHeader{padding:15px;padding-left:5px;line-height:20px}.contentsDiv>div{padding:0 20px}#settingsQuickWidgetContainer .widgetContainer.accordion-body{border-bottom:none!important;border-bottom:3px solid #ddd}#settingsQuickWidgetContainer .widgetContainer.accordion-body>div:hover{background:#eeeff2}#settingsShortCutsContainer{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:1% 3%}#settingsShortCutsContainer .moduleBlock{min-height:60px}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin{display:inline-block;opacity:.4}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin:hover{opacity:.8}.settingsIndexPage .settingsSummary{text-align:center;margin-top:10px}.settingsIndexPage .settingsSummary a{display:inline-block;background:#f3f3f4;color:#444;border-radius:2px;min-width:200px;padding:20px 0 10px;border:1px solid #ddd}.settingsIndexPage .settingsSummary a .summaryText{display:inline-block;margin-top:20px;font-size:15px}.settingsIndexPage .settingsSummary a:hover .summaryText,.settingsIndexPage .settingsSummary a:hover .summaryCount{color:#404952}.settingsIndexPage .moduleBlock h5{font-size:1.2em;margin-bottom:5px}.settingsIndexPage .moduleBlock:hover{background:#f3f3f4}#userPageHeader{padding:8px 0 0}#userPageHeader #userHeading h3{margin-top:10px}.treeView li{border-left:4px solid #ddd;list-style:none;padding-top:15px}.treeView li .toolbar-handle{margin-left:10px;position:relative}.treeView li .toolbar-handle .btn{margin:0}.treeView li .toolbar-handle a:before{background:none repeat scroll 0 0 #ddd;content:" ";display:inline-block;height:4px;left:-10px;position:absolute;top:12px;width:10px}.treeView .btn{margin-bottom:10px}.profilesEditView tr.blockHeader th{text-align:center}.profilesEditView tr.blockHeader th:first-child{text-align:left}.profilesEditView input{margin-right:5px}.profilesEditView tr td.row table.table{border-left:none;margin-bottom:20px}.profilesEditView tr:hover td.row{background:0}.profilesEditView tr:hover td.row table.table tr td{background:0}.profilesEditView tr:hover td.row table.table tr:hover td{background:0}.profilesEditView tr:hover td.row table.table td{background:#f3f3f4}#s2id_memberList li>div,.groupMembersColors li>div{margin-left:10px}#s2id_memberList .Users,.groupMembersColors .Users{background-color:#f99984!important;padding:5px;margin-bottom:2px;background-image:none}#s2id_memberList .Groups,.groupMembersColors .Groups{background-color:#acd5ff!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .Roles,.groupMembersColors .Roles{background-color:#ffec98!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .RoleAndSubordinates,.groupMembersColors .RoleAndSubordinates{background-color:#c4dea2!important;background-image:none;padding:5px;margin-bottom:2px}.collectiveGroupMembers{border:1px solid #ddd;border-top:0}.collectiveGroupMembers ul{padding:0;margin:0}.collectiveGroupMembers ul li{padding:4px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.collectiveGroupMembers ul li a{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;margin:0}.collectiveGroupMembers ul li.groupLabel{background-color:#f3f3f4;border-bottom:1px solid #ddd;border-top:1px solid #ddd;padding:10px 5px;margin:0;color:#444}.mini-slider-control{width:50px}.mini-slider-control+div{margin-left:15px}.mini-slider-control .ui-slider-handle{border:0;border-radius:50%;height:16px;top:-2px;width:16px;cursor:pointer}.mini-slider-control .ui-slider-handle:focus{outline:0}.ui-widget-content{border-radius:6px;border-color:#fff;box-shadow:0 0 3px -1px inset;margin-top:2px;margin-left:5px;height:12px}.ui-slider-disabled{opacity:.5;border-color:#ddd;box-shadow:none;cursor:not-allowed}.ui-slider-disabled .ui-slider-handle{cursor:not-allowed}.ui-slider-disabled+div{opacity:.5;cursor:not-allowed}.mini-slider-control[data-value="0"] .ui-slider-handle{background:#7d7e7d;background:-moz-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#7d7e7d),color-stop(100%,#0e0e0e));background:-webkit-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-o-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-ms-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:linear-gradient(to bottom,#7d7e7d 0,#0e0e0e 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7d7e7d',endColorstr='#0e0e0e',GradientType=0)}.mini-slider-control[data-value="1"] .ui-slider-handle{background:#ffb76b;background:-moz-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ffb76b),color-stop(0%,#ffa73d),color-stop(49%,#ff7c00),color-stop(100%,#ff7f04));background:-webkit-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-o-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-ms-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:linear-gradient(to bottom,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffb76b',endColorstr='#ff7f04',GradientType=0)}.mini-slider-control[data-value="2"] .ui-slider-handle{background:#bfd255;background:-moz-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#bfd255),color-stop(79%,#8eb92a),color-stop(100%,#72aa00),color-stop(100%,#9ecb2d));background:-webkit-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-o-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-ms-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:linear-gradient(to bottom,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bfd255',endColorstr='#9ecb2d',GradientType=0)}#moduleManagerContents{padding-bottom:10px}#moduleManagerContents .moduleManagerBlock .btn-group.open .dropdown-menu{left:-144%}#moduleManagerContents .modulesTable td{width:50%}#importModules .contents .row{margin-bottom:2.2%}.extensionWidgetContainer{background-color:#fff;border:1px solid #ddd;min-height:200px;padding:2%;background:#fafafa;box-shadow:0 0 10px -4px #777}.extensionWidgetContainer .extension_contents{margin-top:2%;background:#fff;padding:10px;box-sizing:border-box;max-height:160px}.extension_contents:hover{border-radius:4px}.thumbnailImage{height:130px;width:130px;float:right}.extensionWidgetContainer .extension_contents .slimScrollDiv{padding-right:10px}.extensionWidgetContainer .extension_header .font-x-x-large{font-size:1.5em;padding-left:3px;font-weight:bold;color:#404952}.extensionWidgetContainer .extensionDescription{line-height:20px}.extensionWidgetContainer .extensionInfo{padding-top:5px}.extensionWidgetContainer .extensionInfo .rating,.extensionDetails .rating{vertical-align:middle;margin-top:2px;display:inline-block}.extensionDetails .authorInfo{margin:3px 0}.extensionDetails .extensionDetailActions{padding:15px 0}.extensionWidgetContainer .tab-pane .bx-wrapper .imageSlider{margin:0}.sliderImage{width:90%;height:360px}.opacity .actions{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.opacity:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.sharingAccessDetails{margin-bottom:30px}.sharingAccessDetails td,.sharingAccessDetails th{text-align:center;vertical-align:middle!important}.sharingAccessDetails tr td:first-child,.sharingAccessDetails tr th:first-child{text-align:left}.sharingAccessDetails td.row>div{display:block}.sharingAccessDetails .customRuleContainer:hover{background:0}.sharingAccessDetails hr{border-bottom:1px solid #bcbcbc}.sharingAccessDetails .title{padding:1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.sharingAccessDetails .title .rulehead{padding-top:5px}.sharingAccessDetails .customRuleEntries:hover .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.layoutContent{border-top:4px solid #404952}.layoutContent #moduleBlocks .editFieldsTable{margin-bottom:20px}.layoutContent #moduleBlocks .editFieldsTable .fieldLabel{background:0}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockLabel{padding-top:13px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group{margin-top:5px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group .dropdown-menu{left:-100%}.layoutContent .relatedTabModulesList{padding:2% 1%}.fieldDetailsForm .search-choice-close{padding:0}.border1px{border:1px solid #ddd}.blockFieldsList .opacity{margin-left:.5%!important}.blockFieldsList .opacity .dropdown-menu a{padding:0!important}.blockFieldsList .opacity a.dropdown-toggle.editFieldDetails{box-shadow:none}.blockFieldsList .editFields .dropdown-menu{z-index:1000003;padding:0;left:-215px;position:absolute}.blockFieldsList .editFieldsWidget .dropdown-menu{z-index:1000003;padding:0;left:-315px;position:absolute}.blockFieldsList .editFields .dropdown-menu .modal-header{border-width:0;border-bottom-width:1px}.blockFieldsList .editFields .dropdown-menu .modal-header .cancel{padding-right:0;font-weight:bold}.blockFieldsList .editFields:hover{background:#f3f3f4!important}#modulePickListValuesContainer .layoutContent{padding-left:2%}#modulePickListValuesContainer .layoutContent .selectedCell,#modulePickListValuesContainer .layoutContent .selectedListItem{background:#a5afb9;white-space:nowrap}#modulePickListValuesContainer .layoutContent .pickListValue{cursor:pointer}.nonEditableValuesDiv .nonEditablePicklistValues{margin-left:0}.nonEditableValuesDiv .nonEditablePicklistValues li{padding:3px 15px;margin-bottom:2px;background:#e0f2ff}.popover{z-index:1000023!important}.popover-content .fieldLabel{width:35%;white-space:normal}#dependencyGraph .tableHeading{text-align:center;padding-top:30px;font-size:1.2em;font-weight:bold}#dependencyGraph .depandencyTable{border:1px solid #ddd;background:#f3f3f4}#dependencyGraph .depandencyTable .blockHeader{border-bottom:1px solid #ddd}#dependencyGraph .depandencyTable .picklistValueMapping{border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping{text-align:center;border-left:1px solid #ddd;border-right:1px solid #ddd;background:#fff}#dependencyGraph .dependencyMapping .mCSB_container{margin-bottom:16px!important}#dependencyGraph .dependencyMapping .pickListDependencyTable{border:0}#dependencyGraph .dependencyMapping .pickListDependencyTable .blockHeader th{background:#f3f3f4;border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping .pickListDependencyTable .selectedCell{background:#a5afb9}.webformFieldInfo{margin-bottom:250px}.targetFieldsTableContainer input[type="text"]{min-width:100px}#customRecordNumbering.table thead th{vertical-align:middle}.addMailBoxBlock{margin-left:83px;padding:0!important;font-size:12px}.addMailBoxStep{background:#fff;padding:30px 0;border:1px solid #ddd;border-radius:1px;min-height:170px}.mailConveterDesc{height:350px;width:96%;border:1.5px solid;border-radius:2px;border-color:#ddd;font-size:11pt;margin-top:55px;margin-left:20px;background:#fff}#mailBoxLabel{margin-top:15px;margin-left:-18px;font-size:12pt;width:75px}.mailBoxDropdownWrapper{height:49px;width:70%;background:url('../images/mailbox-icon.png') no-repeat 5px 5px;overflow:hidden;border:1px solid #ddd}.mailBoxDropdown{background:transparent url('../images/downArrowBlue.png') no-repeat 236px 13px;width:110%;height:50px;font-size:14pt;color:#0065a6;padding:10px 55px;padding-right:0}#mailConverterDragIcon{margin-top:12px}#mailConverterBody{padding-top:20px;margin-left:0}.ruleHead{padding:6px 0;background:#d8d8dc}.mailConverterRuleBlock{font-size:14px;line-height:30px;border:1.5px solid;border-color:#ddd}.mailConverterRuleLegend{font-size:14px;color:#0065a6;margin-bottom:10px;background:#f3f3f4}#mailConverterStats{font-size:10pt;margin-top:5px;margin-left:-10px}.addMailBoxBlock{border-color:#ddd;margin-left:83px;margin-top:20px;padding-top:30px;padding-left:200px;padding-bottom:20px;padding-right:30px;font-size:11pt}.taskTypeUi>.row{margin:10px 0}#taskListContainer .listViewEntriesTable tr td:last-child{border-left:1px solid #ddd}#workflow_step2>.row{padding:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:400px}#open_email_con .detailViewTitle{padding:0}#open_email_con .detailViewTitle .detailViewPagingButton{margin-top:0;padding-right:0}#foldersList .list-group{padding-right:0}.massEditTable th+th,.massEditTable td+td,.massEditTable th+td,.massEditTable td+th{border-left:0}.nav.massEditTabs{margin-bottom:0;border-bottom:0}.nav.massEditTabs li.active a{background:#404952;color:#fff;margin-left:10px}.nav.massEditTabs li a:hover{border-bottom:1px solid #404952}.massEditContent{border-top:3px solid #404952}.calendarSettingsContainer{width:700px}.calendarSettingsContainer .control-label{width:26%}#calendarSettings{margin:1px 0 3px}.calendarMassEdit{min-width:400px}.fc-state-default .fc-button-effect{top:100%!important}.fc-event-style1,.fc-event-style1 .fc-event-skin{background:#17309a;border-color:#17309a;font-weight:normal;text-shadow:none}.fc-event-style2,.fc-event-style2 .fc-event-skin{background:#3a87ad;border-color:#3a87ad;font-weight:normal;text-shadow:none}.fc-event-style3,.fc-event-style3 .fc-event-skin{background:#aa6705;border-color:#aa6705;font-weight:normal;text-shadow:none}.fc-event-style4,.fc-event-style4 .fc-event-skin{background:#953b39;border-color:#953b39;font-weight:normal;text-shadow:none}.fc-event-style5,.fc-event-style5 .fc-event-skin{background:#545252;border-color:#545252;font-weight:normal;text-shadow:none}.fc-event-style6,.fc-event-style6 .fc-event-skin{background:#87865d;border-color:#87865d;font-weight:normal;text-shadow:none}.fc-event-style7,.fc-event-style7 .fc-event-calendarMassEditskin{background:#c71585;border-color:#c71585;font-weight:normal;text-shadow:none}.fc-event-style8,.fc-event-style8 .fc-event-skin{background:#006400;border-color:#006400;font-weight:normal;text-shadow:none}#calendarview th{color:#000}.fc-agenda-divider+div{overflow-y:visible!important}.fc-button{display:inline-block;padding:6px .4em!important;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.fc-button:active .fc-button-inner{background:transparent}.fc-button:active .fc-button-inner .fc-button-content{color:#fff}.fc-button.fc-state-active .fc-button-inner .fc-button-content,.fc-button:active .fc-button-inner .fc-button-content{color:#000!important;background:transparent;background-image:none}.fc-header-title h2{font-size:15px;line-height:20px}.fc-widget-header th{padding:4px 0!important}.fc-widget-header{color:#666;background:#eee;border-color:#ccc}.fc-content{background:#fff;margin-top:15px}.fc-content td:hover{background:#f3f3f3}.btn:focus{outline:0}.reminderPostpone.btn-primary{background:#404952}.reminderPostpone.btn-primary:hover{background:#1e2327}.saveButton{margin-right:5px}.addCustomRule{float:right}.importMore{background:#fff}.lastImport{background:#fff}.undoImport{background:#da4f49}.close{border:0;background:none repeat scroll 0 0 transparent;border:0 none;cursor:pointer}.resetButton{margin-top:0!important}.vtGlyph{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("../images/vtGlyph.png");background-position:0 0;background-repeat:no-repeat;*margin-right:.3em}.vticon-pageJump{background-position:0 0}.vticon-call-inbound{background-position:-14px 0}.vticon-call-outbound{background-position:-28px 0}#massEdit .cancelLinkContainer{padding:5px 0;margin-left:.5em}.ui-pnotify{z-index:1000023}.feedback{z-index:10002}.feedback .handle{z-index:10003;display:block;position:fixed;bottom:50px;left:-30px;left:0\9;bottom:100px\9;background:#2c2c2c;color:white;padding:7px 15px;border:1px solid gray;text-decoration:none;outline:0;-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-o-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg);-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.00000000, M12=1.00000000, M21=-1.00000000, M22=0.00000000,sizingMethod='auto expand')";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0,M12=1,M21=-1,M22=0,sizingMethod='auto expand')}.feedback .handle:hover{text-decoration:none}.vtFooter{text-align:center}.vtFooter p{background:#404952;color:#fff;border-top:1px solid #ddd;padding:1px 0;font-size:.9em;margin-bottom:0}.vtFooter p a{color:#fff}.imageHolder{background:url('../images/loadback.png') repeat-y;background-position:center;padding:10px 0}.breadcrumbContainer{padding:2% 2% 0 2%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;height:auto}.breadcrumb{display:inline-block;height:auto;height:40px}.crumbs{height:40px;margin:0;padding:0 20px 0 0;display:inline-block;font-family:sans-serif}.crumbs li:after{content:'\0000a0';width:0;height:0;border-left:18px solid #ececec;border-top:20px solid transparent;border-bottom:20px solid transparent;display:inline-block;position:relative;top:-20px;left:18px;zoom:1}.crumbs li{height:0;border-top:20px solid #ececec;border-bottom:20px solid #ececec;border-left:20px solid transparent;display:inline-block;box-shadow:0 1px #ddd;margin-right:5px}.crumbs li a{display:inline-block;float:left;margin-top:-13px;font-size:14px;font-weight:bold;color:#666;text-decoration:none}.crumbs li.active{height:0;border-top:20px solid #404952;border-bottom:20px solid #404952;box-shadow:0 1px #404952}.crumbs li.active:after{border-left:18px solid #404952!important}.stepText{display:inline-block;white-space:nowrap;overflow:hidden;font-size:13px;vertical-align:bottom}.active .stepText,.active .stepNum{color:#fff}.stepNum{display:inline-block;padding:0 5px;overflow:hidden;font-size:20px;vertical-align:top;margin-top:5px}.greyStar{background-image:url("../images/stars.png");background-position:20px 20px;height:20px;width:20px;display:inline-block}.yellowStar{background-image:url('../images/stars.png');background-position:0 20px;width:20px;height:20px;display:inline-block}.blockUI{border-radius:2px!important;border:0!important}textarea.col-md-11{width:100%!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.popover .popover-inner{border-radius:2px;font-size:.8em;box-shadow:0}.popover .popover-inner .popover-title{color:#444;font-size:15px}.popover .popover-inner .close{color:#000!important;margin-top:3px;opacity:.5!important}.popover .popover-inner .close:hover{opacity:1!important}.popover .popover-inner td{padding:3px 5px;overflow-wrap:break-word}.popover .popover-inner .detailViewInfo{margin-top:0;box-shadow:0}.popover .popover-inner .detailViewInfo .fieldLabel label{font-size:1em}#findDuplicate>.control-group{margin-bottom:0;width:400px}#moveReports .modal-body{padding:20px 40px}#composeEmailContainer{padding:0 20px}#composeEmailContainer .MultiFile-wrap{display:inline-block}#composeEmailContainer .MultiFile-intercepted .ui-wrapper{min-height:400px}#transferOwnershipContainer .select2-container.select2-container-multi{max-width:220px}.fieldInfo.in{overflow:visible!important;height:auto!important}.moduleSelection{border-radius:2px 2px 0 0!important;border:1px solid #ddd!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);color:#444}.convertLeadModules{margin-bottom:2%;border:1px none}.moduleBlock{border-radius:0!important}.overflowVisible{overflow:visible!important}.convertLeadError{border:3px solid #999;background-color:#fff;width:55%;position:relative;z-index:10000000}.convertLeadError table td{border-bottom:1px solid #ccc;nowrap:nowrap;width:70%}.bootbox,.alert{z-index:1000023}.chzn-container{vertical-align:middle}.chzn-container .chzn-results li{margin-right:7px}.chzn-container .chzn-results .highlighted{background:#404952}.select2-results .select2-highlighted{background:#404952}.select2-result-label i{background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.ui-autocomplete-loading{background:url('../images/load.gif') no-repeat right center}.ui-autocomplete{height:auto!important;border-radius:1px!important}.dropdown-menu.pull-right:after,.dropdown-menu.pull-right:before{right:3px;left:auto;top:-5px;border-bottom-width:6px}span.wrapper a{color:#08c!important;font-size:15px!important;font-weight:bold}a{color:#353c44}a:hover{color:#1e2327;text-decoration:none;cursor:pointer}a:active,a:focus{outline:0}.well{border-radius:2px;padding:15px}.verticalBottomSpacing{margin-bottom:10px}.mergeTables{margin-bottom:0}.font-x-x-large{font-size:18px;line-height:28px}form{margin:0}.fc-state-default .fc-button-effect span{background:0}.dateField{width:183px}.form-horizontal [class^="icon-"],.form-horizontal [class*=" icon-"]{vertical-align:baseline}.timePicker{width:8.5em!important;z-index:1000029!important}.datepicker{z-index:1000029!important}.colorpicker{z-index:1029!important}.colorpicker input{width:30px!important}.colorpicker input[type="text"],.colorpicker input{color:#898989!important}.colorpicker_hex input{width:45px!important}.modal-body.accordion{margin-bottom:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}//.modal-open{// overflow:hidden;//}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.removeNoFileChosen{color:transparent!important}.modelContainer .modal-header{border-radius:2px 2px 0 0}.modelContainer form{border-radius:0 0 2px 2px}.hide{display:none}i{cursor:pointer;text-decoration:none!important}.marginbottomZero{margin-bottom:0!important}.marginLeftZero{margin-left:0!important}.marginRightZero{margin-right:0!important}.clearfix{clear:both!important}textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%}.textOverflowEllipsis{overflow:hidden;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;//width:9em}.margin0px{margin:0!important}.padding10{padding:10px;padding-bottom:0}.padding20{padding:20px}.pushDown{margin-top:5px}.boxSizingBorderBox{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.boxSizingContentBox{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.cursorPointer{cursor:pointer;text-decoration:none!important}.zeroOpacity{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.dullOpacity{opacity:.8;-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80)}.fullOpacity{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.redColor{color:red}.highlightBackgroundColor{background:#eeeff2}.contentsBackground{background:#fff;border:1px solid #ddd}.textAlignCenter{text-align:center}.textAlignRight{text-align:right}.alignMiddle{vertical-align:middle}.alignTop{vertical-align:top}.padding1per{padding:1%}.paddingTop20{padding-top:20px}.padding20px{padding:20px}.padding-bottom1per{padding-bottom:1%}.marginBottom10px{margin-bottom:10px}.displayInlineBlock{display:inline-block}.backgroundImageNone{background-image:none}.liStyleNone{list-style:none outside none}.fontBold{font-weight:bold!important}.livesupport_tab,#userfeedback{display:none!important}#reportDetails table tr td.summary{border-bottom:0;border-top:0}#portalDetailViewHttpError{padding-bottom:7px;margin-top:50px;color:red;text-align:center}.slidesjs-pagination{list-style:none}.slidesjs-pagination li a{display:block;width:13px;height:0;padding-top:13px;background-image:url('../images/pagination.png');background-position:0 0;float:left;overflow:hidden}.slidesjs-pagination li a.active,.slidesjs-pagination li a:hover.active{background-position:0 -13px}.extensionStorebtn{background:#f08c39;background-image:-webkit-linear-gradient(top,#f08c39,#e68b3c);background-image:-moz-linear-gradient(top,#f08c39,#e68b3c);background-image:-ms-linear-gradient(top,#f08c39,#e68b3c);background-image:-o-linear-gradient(top,#f08c39,#e68b3c);background-image:linear-gradient(to bottom,#f08c39,#e68b3c);-webkit-border-radius:2;-moz-border-radius:2;border-radius:2px;text-shadow:0 0 1px #595959;color:#fff;font-size:14px;font-weight:bold;padding:8px 20px 8px 20px;text-decoration:none;border:0}.extensionStorebtn:hover{background:#fc9f3c;background-image:-webkit-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-moz-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-ms-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-o-linear-gradient(top,#fc9f3c,#f08a3c);background-image:linear-gradient(to bottom,#fc9f3c,#f08a3c);text-decoration:none}.extensionSearch{padding:8px 12px 8px 30px!important;margin:6px 0 14px 0;box-shadow:inset 2px 2px 10px #ddd;border-radius:2px!important;background:url('../images/search.png') no-repeat;background-position:5px 6px}.banner-container{border-bottom:1px solid #fff;box-sizing:border-box}.banner{margin:0 90px}.bx-wrapper{margin:0 auto 35px!important;padding-top:17px!important}.bx-wrapper li a{display:block}.bx-wrapper a img{height:100px;width:auto;margin:0 auto}.wide,.table td.wide,.listViewEntries td.wide,td.listViewEntryValue.wide{padding:8px!important}.medium,.table td.medium,.listViewEntries td.medium,td.listViewEntryValue.medium{padding:5px 6px!important}.narrow,.table td.narrow,.listViewEntries td.narrow,td.listViewEntryValue.narrow{padding:2px 4px!important}.table thead th.narrow{vertical-align:middle}td.listViewEntryValue .row input{padding:0;margin-bottom:0}.listViewContentDiv{position:relative}.fieldLabel .pull-right{text-align:right}#tagRecordText{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;width:80%!important}#tagRecord{margin-left:5px!important}.tag{float:right!important}.cut-string{text-overflow:ellipsis;-o-text-overflow:ellipsis;-webkit-text-overflow:ellipsis;width:200px;white-space:nowrap;overflow:hidden}.paddingLRZero{padding-left:0;padding-right:0}.paddingRightZero{padding-right:0}.detailViewToolbar{margin-top:5px}.input-group.input-group-sm>.input-group-addon img{width:15px}table tr td .input-sm{min-width:50px}.modal-footer.backgroundColor{background-color:#f5f5f5}.panel-title{font-size:14px}.quickWidgetContainer .panel-body{padding-bottom:0;padding-top:0}tr.summaryViewEntries,#detailView table{font-size:13px}table.listViewEntriesTable{font-size:13px;margin-top:5px}.no-margin{margin:0}.companyLogo img{max-height:200px;max-width:250px}.navbar-inverse .navbar-nav>li>a{color:#fff;padding:15px 12px}.navbar-inverse .navbar-nav .dropdown-menu>li>a{padding:3px 15px;font-size:12px}.headerCalendar .month h3{font-size:18px;font-weight:bold;margin:5px 0 0 0}.columnsSelect{width:100%!important}.marginBottom5{margin-bottom:5px}.editViewContainer .recordEditView table.blockContainer tr td.fieldValue{width:30%}.recordEditView[name=QuickCreate] .quickCreateContent table tr td.fieldValue,#massEditContainer .massEditContent table tr td.fieldValue,#tab_accounts td.functionList{width:30%}.btn{white-space:normal}.valuesAssignedToRole{border:1px solid #adadad;overflow:hidden;text-overflow:ellipsis;padding:6px}table.dataTable .form-control{width:100%!important}#breadcrumb .stepNum{margin-top:0}#breadcrumb .stepText{position:relative;top:-4px}.fc button{height:auto!important}.fc-toolbar{margin-bottom:0!important}.fc-center,.fc-left,.fc-right{margin-bottom:1em}.calendarRightPanel{padding-left:5px;padding-right:5px}.calendarRightPanel ul li{margin-bottom:2px;margin-left:5px}.calendarRightPanel ul li:hover{background-color:#eee!important;border-radius:5px}.square9{width:12px;height:12px;margin:4px}.panel-dark{border-color:#737373}.panel-dark>.panel-heading{color:#fff;background-color:#737373;border-color:#737373}.panel-dark>.panel-heading+.panel-collapse>.panel-body{border-top-color:#737373}.panel-dark>.panel-heading .badge{color:#737373;background-color:#fff}.panel-dark>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#737373}.calendarRightPanel .widgetContainer ul{margin-top:5px;margin-bottom:5px}.paddingLeft5px{padding-left:5px}.marginBottom5px{margin-bottom:5px}.detailview-table .fieldValue .summaryViewEdit{display:none}.detailview-table .fieldValue:hover .summaryViewEdit{display:inherit}.icon-in-history-widget{font-size:17px;padding:4px}#prefPageHeader .logo img{height:70px;width:70px}#myPrefHeading h3{margin-top:12px}.list-user-img{width:50px;height:40px}span[name=existingImages] img{height:200px;width:300px}.narrow.fieldValue .chosen-container-single .chosen-single{height:26px;line-height:26px}.narrow.fieldValue input{height:26px}.narrow.fieldValue .input-group-addon{padding:4px 10px}.narrow.fieldValue .chosen-container-single .chosen-single div b{background-position-y:4px}.image-in-button{width:18px}.fc-time-grid .fc-time-grid-event.fc-event{min-height:27px;min-width:100px}.fc-time-grid-event.fc-short .fc-title{font-size:1em}.paddingTBZero{padding-top:0;padding-bottom:0}.dashboardWidgetContent a .glyphicon{top:-3px}.detailViewTitle .popover{min-width:130px;text-align:center}.cursorDefault{cursor:default!important}.remindersNoticeContainer{position:fixed;right:0;top:109px;z-index:1029;width:0;height:100%;bottom:30px;overflow-y:auto;background:rgba(0,0,0,0.4);border-left:1px solid #797979;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;overflow-y:auto}.remindersNoticeContainer.toggled{width:380px}.remindersContent{margin:5px 8px 0 8px}.activityTypeIcon{height:20px}.remindersNoticeContainer .panel{margin-bottom:10px}.remindersNoticeContainer .panel-body{padding:10px}.remindersNoticeContainer .actionRow a.btn{margin-right:3%}.remindersNotice{color:#fff;padding:15px 12px}.remindersNotice .glyphicon{font-size:20px}.cancelLink.btn[type='reset'],.cancel.btn[type='reset']{float:right;margin-left:5px;margin-bottom:0}.activityWidgetContainer .popover{min-width:240px}.filterActionImage{margin-left:8px}#tagRecord{line-height:25px}#tagsList .btn-info{margin-left:5px}#tagRecordInput{padding-left:15px;padding-right:15px}.clearReferenceSelection,.createReferenceRecord{padding:0 6px}.relatedPopup{padding:0 4px}.popupContainer .popupModuleName{margin-top:0}.mailRows hr{margin:0}.paddingLeftMd{padding-left:15px}.widget_header div:nth-child(2).btn-toolbar,.editViewContainer .contentHeader.row div:nth-child(2){margin-top:20px}.fieldLabel .referenceMandatory{margin-right:-12px}.ui-widget-content{padding:.8em}.ui-autocomplete .ui-autocomplete-category{font-weight:bold;line-height:1.5}.ui-autocomplete .ui-autocomplete-category:first-child{margin:.8em 0 .2em}.ui-autocomplete .ui-menu-item{padding:.2em .8em}.ui-autocomplete .ui-state-focus{border:0;background:#ebebeb}.widgetHr{margin-top:0}.headerLinksMails .btn-group{margin-top:11px}.finalDiscountUI,.finalTaxUI{bottom:5px}.sideBarTitle{font-size:20px}.globalSearchInput{width:300px}#groupsDetailContainer strong{line-height:21px}#addTaskContainer #taskStatus{margin-left:10px}.scanerMailActionsButtons{min-width:96px}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#404040}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active,.ui-menu .ui-menu-item a.ui-widget-content{font-weight:bold;margin:0;background-color:#428bca;border-color:#357ebd;color:#fff;display:block}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style:none}#layoutEditorButtons{margin-bottom:10px;margin-top:-10px}.individualTaxContainer{text-align:left!important}.suppliesItemsTable .input-group{max-width:200px}.suppliesItemsTable .rowName .input-group{max-width:400px}.suppliesItemsTable td,.suppliesItemsTable th{border:1px solid #ddd}.suppliesItemsTable tfoot td.hideTd{border:0;background:#fafafb}.suppliesSummaryContainer .panel-body,.suppliesSummaryContainer .panel-footer{padding:0}.suppliesSummaryContainer .panel-body .form-group,.suppliesSummaryContainer .panel-footer .form-group{margin:0}.suppliesSummaryContainer .input-group .form-control{background-color:#f5f5f5}.suppliesSummaryContainer .panel-body .percent{min-width:55px}.suppliesItemsTable tfoot{font-weight:800}.suppliesSummaryContainer .panel-heading img{max-width:15px} \ No newline at end of file +@media print{.noprint{display:none}}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}.hide-text{overflow:hidden;text-indent:100%;white-space:nowrap}.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot');src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.woff') format('woff'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.ttf') format('truetype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg')}body{width:100%;font-family:'Open Sans','Lucida Grande',Verdana,Tahoma,Arial,sans-serif!important;font-size:12px!important;background:#fff;color:#2b2b2b}hr{margin:8px 0;border-bottom:1px solid #ddd}.navbar.navbar-fixed-top .navbar-collapse{padding-right:15px!important}.navbar-nav.navbar-left .open ul{display:none}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background:0}.navbar-default .navbar-nav>li:hover{background:#e7e7e7}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background:0}.navbar-inverse .navbar-nav>li:hover{background:#080808}.navbar-nav .hovernav:hover>.dropdown-menu{display:block}#collapsedMenu{display:block;position:relative}#collapsedMenu a{color:#fff}#collapsedMenu .dropdown-menu .shortDropdown{max-height:300px;overflow-y:scroll;padding:10px;position:relative;z-index:10000;-webkit-overflow-scrolling:touch;-webkit-transform:translateZ(0)}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames{margin-bottom:2px}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a{font-size:.9em;padding:3%!important;color:#2b2b2b!important}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a:hover{text-decoration:none;background:#404952;color:#fff!important}.moreMenus{width:52em;padding:24%;left:0;border-radius:2px}.moreMenus.leftAligned:after,.moreMenus.leftAligned:before{left:21px!important}.moreMenus strong{font-size:1.1em;color:#2b2b2b}.moreMenus:after,.moreMenus:before{left:292px!important}.announcement{// display:none;background:#fafad2;// padding:2px 0;// border-bottom:1px solid #ccc;// max-height:24px;// width:100%}.announcement .marStyle{// width:100%}#headerLinks{padding:10px 0 7px;min-width:240px;float:right!important}#headerLinks .headerLinksContainer{margin-right:10px}#headerLinks .headerLinksContainer>[class*="span"]{float:left;margin-left:15px}#headerLinks .headerLinksContainer .dropdown.open .dropdown-toggle{background:transparent}#headerLinks .headerLinksContainer ul.dropdown-menu{top:30px}#headerLinks .headerLinksContainer ul.dropdown-menu:after,#headerLinks .headerLinksContainer ul.dropdown-menu:before{right:15px;left:auto}#headerLinks .headerLinksContainer>span a img,#headerLinks .headerLinksContainer>span a.userName{color:#fff;cursor:pointer;text-decoration:none!important}#headerLinks .headerLinksContainer>span a img .caret,#headerLinks .headerLinksContainer>span a.userName .caret{border-top:4px solid #fff}.dropdown-menu.pull-right{right:0;left:auto;cursor:pointer}.themeMenuContainer{min-width:110px;width:110px;left:-84px!important;padding:10px 0}.themeMenuContainer .themeMenu{padding:0 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement{cursor:pointer;margin:5px;height:20px;width:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement:hover{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}.themeMenuContainer .themeMenu .themeSelected{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}@media screen and (min-width:1161px){#mediumNav,#shortNav,#headerLinksCompact{display:none}#largeNav{margin-left:10px;margin-right:0}}@media screen and (max-width:1160px) and (min-width:960px){.companyLogo{width:100%}.customFilterMainSpan .select2-container{width:300px!important}*{zoom:1!important}}@media screen and (max-width:960px){.bodyContents{margin:0!important}#centerPanel{width:100%!important}.col-md-3#headerLinks{padding:5px 5px 0}.menuBar .col-md-9,.col-md-3#headerLinks{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-width:80px}.menuBar .col-md-9 .qCreate,.col-md-3#headerLinks .qCreate{display:inline-block;margin:0}.menuBar .col-md-9 .qCreate img,.col-md-3#headerLinks .qCreate img{margin-bottom:3px;margin-right:5px}.menuBar .col-md-9 .qCreate ul li.title,.col-md-3#headerLinks .qCreate ul li.title{padding:5px 0 0 15px}.menuBar .col-md-9 li.tabs:first-child>a,.col-md-3#headerLinks li.tabs:first-child>a{padding:10px 12px 9px}.customFilterMainSpan .select2-container{width:300px!important}#quickCreateModules{width:100%!important;padding:0!important}.CompactQC{max-height:300px;overflow-y:scroll;overflow-x:hidden}.CompactQC a:hover{text-decoration:none}}.commonActionsContainer .quickActions{height:3em}.commonActionsContainer .quickActions img{height:60%;margin:40% auto}.commonActionsContainer .quickActions #companyLogo-container img{height:98%;margin:0 auto}.commonActionsContainer .actionsContainer{background:#f3f3f3}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown{min-width:715px;top:28px;margin:0;padding-top:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a{padding:2px;border:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mainContainer{min-height:500px;margin-top:103px;background:#eeeff2;min-width:1200px}.mainContainer>.col-md-2{// padding:0 1.06383%;height:auto!important;// min-width:174px}.mainContainer .contentsDiv{min-height:500px;background:#fafafb;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;border-left:1px solid #e6e6e6;position:relative}.mainContainer #leftPanel{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.toggleButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;left:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-left:0;display:inline-block}.toggleButton .glyphicon-chevron-left{background-position:-434px -72px!important}.toggleButton .glyphicon-chevron-right{background-position:-460px -72px!important}.toggleRightPanelButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;right:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-right:0;display:inline-block}.quickLinksDiv{margin:10px 0}.quickLinksDiv p{font-size:1.2em;padding:3% 0 0 6%;height:40px;cursor:pointer;box-shadow:0 0 0 1px #ddd;border-top:1px solid #fff!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);position:relative;border-radius:2px}.quickLinksDiv p a{color:#2b2b2b}.quickLinksDiv p a:hover{text-decoration:none}.quickLinksDiv p.selectedQuickLink{background-color:#2a2f35;background-image:-moz-linear-gradient(top,#2a2f35,#2a2f35);background-image:-ms-linear-gradient(top,#2a2f35,#2a2f35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#2a2f35),to(#2a2f35));background-image:-webkit-linear-gradient(top,#2a2f35,#2a2f35);background-image:-o-linear-gradient(top,#2a2f35,#2a2f35);background-image:linear-gradient(top,#2a2f35,#2a2f35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2a2f35',endColorstr='#2a2f35',GradientType=0);border-color:#2a2f35 #2a2f35 #08090a;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);background-image:none;position:relative;border:1px solid #fff;box-shadow:4px 0 3px -4px #000 inset}.quickLinksDiv p.selectedQuickLink a{color:#fff}.quickLinksDiv p.selectedQuickLink a:after{border-bottom:19px solid rgba(0,0,0,0);border-left:10px solid #2a2f35;border-top:19px solid rgba(0,0,0,0);content:" ";display:inline-block;position:absolute;left:100%;top:0}.quickWidgetContainer li a{overflow:hidden;white-space:normal;padding:5px;margin:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.quickWidgetContainer .quickWidget{margin-bottom:10px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.sidebarTitleBlock{padding:12px 0}.sidebarTitleBlock a{color:#373737!important}.sidebarTitleBlock a:hover{text-decoration:none}#selectAllMsgDiv,#deSelectAllMsgDiv{display:none;background-color:#fafad2;padding:.01%;text-align:center}.blockUI form,#globalmodal form{margin:0}.dashboardHeading h2{padding-bottom:8px}.dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardHeading .dropdown-menu{left:-70px;right:0}.dashboardContainer{padding:0}.dashboardContainer .dashboardHeading{padding:10px 0 0;background:#f5f5f5}.dashboardContainer .dashboardHeading h2{padding:0 0 8px 20px}.dashboardContainer .dashboardHeading .btn-toolbar{padding:3px 20px 0 0}.dashboardContainer .dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardContainer .dashboardHeading .dropdown-menu{left:-82px}.widgetsList{max-height:400px;overflow-y:auto;overflow-x:hidden}.widgetsList li{display:block}.widgetsList li a{white-space:normal;word-wrap:break-word}.dashboard_notebookWidget_view .row{margin-bottom:5px}.gridster{margin-left:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.gridster ul{width:auto;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:460px}.gridster ul{list-style:none}.gridster ul li.dashboardWidget{background:#fff;border-radius:1px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.gridster ul li.dashboardWidget .dashboardWidgetHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd;color:#444;cursor:move;padding:5px}.gridster ul li.dashboardWidget .dashboardWidgetHeader table{height:28px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .dashboardTitle{text-align:left;padding-left:10px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .widgeticons{opacity:.5;padding-right:6px}.gridster ul li.dashboardWidget .filterContainer{position:absolute;border:1px solid #ddd;background:#fff;margin-left:-7px;margin-right:3px;margin-top:4px;padding:8px 0;border-radius:0 0 5px 5px;box-shadow:0 5px 8px -5px #888}.gridster ul li.dashboardWidget .filterContainer div span{margin-top:6px}.gridster ul li.dashboardWidget .filterContainer .col-md-5{margin-top:3px}.gridster ul li.dashboardWidget .dashboardWidgetContent{padding:10px 0;line-height:20px}.gridster ul li.dashboardWidget .dashboardWidgetContent .dashboard_notebookWidget_viewarea{height:200px}.gridster ul li.dashboardWidget .widgeticons{min-width:50px;height:30px;margin-right:30px}.gridster ul li.dashboardWidget .widgeticons a{cursor:pointer;text-decoration:none}.gridster ul .widgetChartContainer{margin-left:10px}.listViewPageDiv{margin:11px 0}.customFilterMainSpan{width:100%}.customFilterMainSpan .select2-container{width:95%!important}.select2-container .select2-choice{border-radius:2px;background:#fff;border-color:#ddd;font-size:14px;letter-spacing:.01em;color:#2b2b2b}.select2-container .select2-choice div{border-radius:0;border-left:0;background:#fff}.select2-drop{border-color:#ddd}.select2-dropdown ul.filterActions{list-style:none!important;padding-left:15px}.select2-dropdown ul.filterActions li{cursor:pointer}.ui-autocomplete .ui-menu-item #ui-active-menuitem{background:#404952;border-radius:0}li.ui-timepicker-selected,.ui-timepicker-list li:hover,.ui-timepicker-list:hover .ui-timepicker-selected:hover{background:#404952}#relatedTabOrder .select2-input{min-width:200px}.alphabetSorting .alphabetSearch a{vertical-align:middle;display:inline-block;margin-bottom:2px}.alphabetSorting .alphabetSearch:hover{background:#eeeff2}.listViewActions .settingsIcon{display:inline-block;margin-left:5px}.listViewActions>.btn-group{min-width:105px}#listViewPageJumpDropDown,#relatedListPageJumpDropDown{left:-60px}.pageNumbers{display:inline-block;margin-right:5px;margin-top:6px;vertical-align:top}.pageNumbers .totalNumberOfRecords{margin:0 5px}.contents-topscroll,#reportDetails{overflow-x:auto!important;overflow-y:visible}.contents-bottomscroll{overflow-x:auto!important}.bottomscroll-div,.topscroll-div{display:table;min-width:100%}.listViewLoadingImageBlock{background:0;border-radius:0;box-shadow:none;text-align:center}.detailViewContainer{padding:0 20px}.userPreferences .contents{padding-left:0!important}.userPreferences .details{border-right:0!important}.detailViewTitle{padding:1% 0 0 1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .recordLabel{font-size:16px;font-weight:bold}.detailViewTitle .detailViewButtoncontainer{margin-top:8px}.detailViewTitle .detailViewPagingButton{margin-top:8px;padding-right:10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .btn-toolbar{margin:0}.detailview-table th,.detailview-table td{vertical-align:middle}.detailview-table th label,.detailview-table td label{margin-bottom:3px}.detailViewInfo{box-shadow:0 -4px 4px -4px #959595;margin-top:5px}.detailViewInfo .details{// min-height:600px;padding-right:1.5%;border-right:4px solid #404952;padding-bottom:10px;padding-top:10px}.detailViewInfo .related .nav-pills .active>a,.detailViewInfo .related .nav-pills .active>a:hover{background:#404952;border-radius:1px;margin-top:0;margin-bottom:2px}.fieldLabel{width:20%;background:#f7f7f9}.fieldLabel label.marginRight10px{text-align:right}.summaryView{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.summaryView .summary-table tr.summaryViewEntries:last-child .fieldValue,.summaryView .summary-table tr.summaryViewEntries:last-child .fieldLabel{border-bottom:1px solid #ddd}.summaryView .summaryViewEntries .fieldLabel{vertical-align:top;padding:5px 0 5px 5%;border-top:1px solid #ddd;border-right:1px solid #ddd}.summaryView .summaryViewEntries .fieldValue{vertical-align:top;padding:5px 0 5px 5px;border-top:1px solid #ddd}.summaryView .summaryViewEntries:hover .summaryViewEdit{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryView .summaryViewEntries .summaryViewEdit{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryView .toggleViewByMode{margin:8px 0;padding-right:0}.summaryView .toggleViewByMode .changeDetailViewMode{white-space:normal!important}.summaryWidgetContainer{border-radius:2px;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border:1px solid #eaeaea;background:#fff;margin-bottom:10px;padding:15px}.commentContainer .commentTitle{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;margin-bottom:10px}.commentContainer .commentTitle textarea{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordDetails .squeezedWell{padding:3% 0;min-height:105px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordEditView .contentHeader{padding:.5% 0 1% 0}.recordEditView .table .fieldLabel,.recordEditView .table .fieldValue{vertical-align:middle}.recordEditView .table tbody tr:hover td,.recordEditView .table tbody tr:hover th{background:#f7f7f9}.commentContainer{border-radius:2px}.commentContainer hr{margin:0!important}.commentContainer .addCommentBlock .commentsControls{display:inline-block}.commentContainer .commentsList>.liStyleNone>.commentDetails .commentDiv{width:100%}.commentContainer .commentDetails{background:#fff;border:1px solid #ddd;margin-bottom:5px;border-radius:2px;padding:10px 10px 5px;display:inline-block;min-width:354px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentContainer .commentorInfo p{margin-bottom:0}.commentContainer .addCommentBlock{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border:1px solid #ddd;padding:12px 12px 5px;min-height:115px;margin-top:15px;display:block}.commentContainer .addCommentBlock .commentcontent{padding:8px!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;resize:none}.commentContainer .commentInfoContent{padding:1px 0;word-wrap:break-word}.commentTitle .col-md-1{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentTitle .col-md-1 img{width:32px;height:32px}.commentsList>ul{margin-left:0}.singleComment .editedStatus{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:5px 0 5px 32px}.singleComment .editedStatus p{margin-bottom:0}.singleComment .commentActionsDiv{display:none}.singleComment .commentActionsDiv p{margin-bottom:0}.singleComment:hover .commentActionsDiv{display:block;margin-bottom:3px}.recentComments{margin:0;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recentComments .commentDiv{min-width:100%}.recentComments .addCommentBlock{border:0;margin-top:0;display:block}.recentComments .commentDetails{display:block}.singleComment:hover .commentActions .replyComment{display:inline-block}.commentActionsContainer a:hover{text-decoration:none}.commentActionsContainer .editStatus{padding:5px 2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentActionsContainer .editStatus p{margin-bottom:0}.table{background:#fff}.table-bordered{border-radius:1px;margin-bottom:0}.table-bordered th{border-top:1px solid #fff!important}.table th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;color:#444}.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td,.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td{border-left:0;border-right:0}.listViewEntriesTable tbody tr td:first-child{border-left:0 none}.equalSplit td:nth-child(odd){width:20%}.equalSplit td:nth-child(even){width:30%}td.fieldValue input,td.fieldValue .input-group{margin-bottom:0}.actionImage,.actionImages{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.listViewHeaders a{color:#444}.listViewEntriesDiv .listViewHeaders th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd}.listViewEntriesDiv,.listViewEntriesDiv td{overflow:visible}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues{color:#444}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues:hover{text-decoration:none}.listViewEntriesTable td.listViewEntryValue,.listViewEntries td{vertical-align:middle;cursor:pointer;overflow:visible;padding:5px}.listViewEntriesTable td.listViewEntryValue:hover .actionImages,.listViewEntries td:hover .actionImages,.listViewEntriesTable td.listViewEntryValue:hover .actions,.listViewEntries td:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryViewEntries .summaryViewEdit,.activityStatus .editStatus,.activityDescription .editDescription,.addedCalendars .actionImage{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryViewEntries:hover .fieldValue .summaryViewEdit,.activityStatus:hover .editStatus,.activityDescription:hover .editDescription,.addedCalendars:hover .actionImage{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewEntriesTable tr:hover td .actions .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewBasicAction.dropdown-menu{width:100%}.listViewBasicAction.dropdown-menu input{border-radius:2px;height:24px;margin-bottom:0;margin-top:-2px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.emptyRecordsDiv{width:100%;border:1px solid #ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.emptyRecordsDiv td{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.CustomFilterViewTitle{padding-top:1%}#CustomView .filterActions{padding-bottom:20px;overflow:hidden}.filterConditionsDiv{padding-bottom:0}.conditionGroup .header{margin-bottom:20px;font-size:1.2em}.conditionGroup .contents .conditionRow{margin-bottom:10px}.conditionGroup .contents .conditionRow select,.conditionGroup .contents .conditionRow input{width:90%}.conditionGroup .contents .conditionRow .chzn-results li{line-height:20px}.conditionGroup .deleteCondition{vertical-align:bottom}.searchUIBasic{border-collapse:separate!important;border-spacing:10px!important;margin:0 10%}.searchUIBasic .importContents{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.searchUIBasic .listRow .listViewHeaders>td{color:#404952}.searchUIBasic .listRow .defaultInputTextContainer{max-width:87%!important;margin-bottom:0!important}#lineItemTab.table tr:first-child:hover th ~ td{background-color:#f3f3f4;background-image:-moz-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-ms-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f3f3f4),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-o-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:linear-gradient(top,#f3f3f4,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f4',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}#lineItemTab.table tr:nth-child(2):hover td{background:0}.lineItemTable tr td{width:0}.lineItemTable tr td div.finalDiscountUI,.lineItemTable tr td div.discountUI,.lineItemTable tr td div#shipping_handling_div,.lineItemTable tr td div.taxUI,.lineItemTable tr td div.finalTaxUI{border:2px solid #c4c4c4;border-radius:2px}.lineItemTable tr td div.finalDiscountUI table tr td,.lineItemTable tr td div.discountUI table tr td,.lineItemTable tr td div#shipping_handling_div table tr td,.lineItemTable tr td div.taxUI table tr td,.lineItemTable tr td div.finalTaxUI table tr td,.lineItemTable tr td div.finalDiscountUI table tr th,.lineItemTable tr td div.discountUI table tr th,.lineItemTable tr td div#shipping_handling_div table tr th,.lineItemTable tr td div.taxUI table tr th,.lineItemTable tr td div.finalTaxUI table tr th{border-left:0}.lineItemTable tr:hover td{width:0}.lineItemTable tr:hover td div.finalDiscountUI table tr td{background:none!important}.lineItemTable tr:hover td div.discountUI table tr td{background:none!important}.lineItemTable tr:hover td div#shipping_handling_div table tr td{background:none!important}.lineItemTable tr:hover td span.taxDivContainer div table tr td{background:none!important}.lineItemTable tr:hover td div.finalTaxUI table tr td{background:none!important}.lineItemResult{width:70.5%!important}.lineItemResult a:hover{color:#404952}.lineItemInputBox{width:45%;float:right;text-align:right}.discountUI,.taxUI,.finalDiscountUI,.finalTaxUI,#shipping_handling_div{position:absolute;left:46%;width:30%;z-index:500;box-shadow:1px 0 7px #ddd;border-radius:6px}.discountUI table.table,.taxUI table.table,.finalDiscountUI table.table,.finalTaxUI table.table,#shipping_handling_div table.table{margin-bottom:0}.discountUI .table tbody tr:first-child th:first-child,.taxUI .table tbody tr:first-child th:first-child,.finalDiscountUI .table tbody tr:first-child th:first-child,.finalTaxUI .table tbody tr:first-child th:first-child,#shipping_handling_div .table tbody tr:first-child th:first-child{border-radius:4px 0 0 0!important}.discountUI .table tbody tr:first-child th:last-child,.taxUI .table tbody tr:first-child th:last-child,.finalDiscountUI .table tbody tr:first-child th:last-child,.finalTaxUI .table tbody tr:first-child th:last-child,#shipping_handling_div .table tbody tr:first-child th:last-child{border-radius:0 4px 0 0!important}.LineItemDirectPriceReduction{width:65%!important}th.htColHeader,.handsontable thead th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd;padding:6px 2px}.contentHeader{padding:15px;padding-left:5px;line-height:20px}.contentsDiv>div{padding:0 20px}#settingsQuickWidgetContainer .widgetContainer.accordion-body{border-bottom:none!important;border-bottom:3px solid #ddd}#settingsQuickWidgetContainer .widgetContainer.accordion-body>div:hover{background:#eeeff2}#settingsShortCutsContainer{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:1% 3%}#settingsShortCutsContainer .moduleBlock{min-height:60px}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin{display:inline-block;opacity:.4}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin:hover{opacity:.8}.settingsIndexPage .settingsSummary{text-align:center;margin-top:10px}.settingsIndexPage .settingsSummary a{display:inline-block;background:#f3f3f4;color:#444;border-radius:2px;min-width:200px;padding:20px 0 10px;border:1px solid #ddd}.settingsIndexPage .settingsSummary a .summaryText{display:inline-block;margin-top:20px;font-size:15px}.settingsIndexPage .settingsSummary a:hover .summaryText,.settingsIndexPage .settingsSummary a:hover .summaryCount{color:#404952}.settingsIndexPage .moduleBlock h5{font-size:1.2em;margin-bottom:5px}.settingsIndexPage .moduleBlock:hover{background:#f3f3f4}#userPageHeader{padding:8px 0 0}#userPageHeader #userHeading h3{margin-top:10px}.treeView li{border-left:4px solid #ddd;list-style:none;padding-top:15px}.treeView li .toolbar-handle{margin-left:10px;position:relative}.treeView li .toolbar-handle .btn{margin:0}.treeView li .toolbar-handle a:before{background:none repeat scroll 0 0 #ddd;content:" ";display:inline-block;height:4px;left:-10px;position:absolute;top:12px;width:10px}.treeView .btn{margin-bottom:10px}.profilesEditView tr.blockHeader th{text-align:center}.profilesEditView tr.blockHeader th:first-child{text-align:left}.profilesEditView input{margin-right:5px}.profilesEditView tr td.row table.table{border-left:none;margin-bottom:20px}.profilesEditView tr:hover td.row{background:0}.profilesEditView tr:hover td.row table.table tr td{background:0}.profilesEditView tr:hover td.row table.table tr:hover td{background:0}.profilesEditView tr:hover td.row table.table td{background:#f3f3f4}#s2id_memberList li>div,.groupMembersColors li>div{margin-left:10px}#s2id_memberList .Users,.groupMembersColors .Users{background-color:#f99984!important;padding:5px;margin-bottom:2px;background-image:none}#s2id_memberList .Groups,.groupMembersColors .Groups{background-color:#acd5ff!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .Roles,.groupMembersColors .Roles{background-color:#ffec98!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .RoleAndSubordinates,.groupMembersColors .RoleAndSubordinates{background-color:#c4dea2!important;background-image:none;padding:5px;margin-bottom:2px}.collectiveGroupMembers{border:1px solid #ddd;border-top:0}.collectiveGroupMembers ul{padding:0;margin:0}.collectiveGroupMembers ul li{padding:4px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.collectiveGroupMembers ul li a{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;margin:0}.collectiveGroupMembers ul li.groupLabel{background-color:#f3f3f4;border-bottom:1px solid #ddd;border-top:1px solid #ddd;padding:10px 5px;margin:0;color:#444}.mini-slider-control{width:50px}.mini-slider-control+div{margin-left:15px}.mini-slider-control .ui-slider-handle{border:0;border-radius:50%;height:16px;top:-2px;width:16px;cursor:pointer}.mini-slider-control .ui-slider-handle:focus{outline:0}.ui-widget-content{border-radius:6px;border-color:#fff;box-shadow:0 0 3px -1px inset;margin-top:2px;margin-left:5px;height:12px}.ui-slider-disabled{opacity:.5;border-color:#ddd;box-shadow:none;cursor:not-allowed}.ui-slider-disabled .ui-slider-handle{cursor:not-allowed}.ui-slider-disabled+div{opacity:.5;cursor:not-allowed}.mini-slider-control[data-value="0"] .ui-slider-handle{background:#7d7e7d;background:-moz-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#7d7e7d),color-stop(100%,#0e0e0e));background:-webkit-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-o-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-ms-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:linear-gradient(to bottom,#7d7e7d 0,#0e0e0e 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7d7e7d',endColorstr='#0e0e0e',GradientType=0)}.mini-slider-control[data-value="1"] .ui-slider-handle{background:#ffb76b;background:-moz-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ffb76b),color-stop(0%,#ffa73d),color-stop(49%,#ff7c00),color-stop(100%,#ff7f04));background:-webkit-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-o-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-ms-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:linear-gradient(to bottom,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffb76b',endColorstr='#ff7f04',GradientType=0)}.mini-slider-control[data-value="2"] .ui-slider-handle{background:#bfd255;background:-moz-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#bfd255),color-stop(79%,#8eb92a),color-stop(100%,#72aa00),color-stop(100%,#9ecb2d));background:-webkit-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-o-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-ms-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:linear-gradient(to bottom,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bfd255',endColorstr='#9ecb2d',GradientType=0)}#moduleManagerContents{padding-bottom:10px}#moduleManagerContents .moduleManagerBlock .btn-group.open .dropdown-menu{left:-144%}#moduleManagerContents .modulesTable td{width:50%}#importModules .contents .row{margin-bottom:2.2%}.extensionWidgetContainer{background-color:#fff;border:1px solid #ddd;min-height:200px;padding:2%;background:#fafafa;box-shadow:0 0 10px -4px #777}.extensionWidgetContainer .extension_contents{margin-top:2%;background:#fff;padding:10px;box-sizing:border-box;max-height:160px}.extension_contents:hover{border-radius:4px}.thumbnailImage{height:130px;width:130px;float:right}.extensionWidgetContainer .extension_contents .slimScrollDiv{padding-right:10px}.extensionWidgetContainer .extension_header .font-x-x-large{font-size:1.5em;padding-left:3px;font-weight:bold;color:#404952}.extensionWidgetContainer .extensionDescription{line-height:20px}.extensionWidgetContainer .extensionInfo{padding-top:5px}.extensionWidgetContainer .extensionInfo .rating,.extensionDetails .rating{vertical-align:middle;margin-top:2px;display:inline-block}.extensionDetails .authorInfo{margin:3px 0}.extensionDetails .extensionDetailActions{padding:15px 0}.extensionWidgetContainer .tab-pane .bx-wrapper .imageSlider{margin:0}.sliderImage{width:90%;height:360px}.opacity .actions{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.opacity:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.sharingAccessDetails{margin-bottom:30px}.sharingAccessDetails td,.sharingAccessDetails th{text-align:center;vertical-align:middle!important}.sharingAccessDetails tr td:first-child,.sharingAccessDetails tr th:first-child{text-align:left}.sharingAccessDetails td.row>div{display:block}.sharingAccessDetails .customRuleContainer:hover{background:0}.sharingAccessDetails hr{border-bottom:1px solid #bcbcbc}.sharingAccessDetails .title{padding:1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.sharingAccessDetails .title .rulehead{padding-top:5px}.sharingAccessDetails .customRuleEntries:hover .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.layoutContent{border-top:4px solid #404952}.layoutContent #moduleBlocks .editFieldsTable{margin-bottom:20px}.layoutContent #moduleBlocks .editFieldsTable .fieldLabel{background:0}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockLabel{padding-top:13px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group{margin-top:5px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group .dropdown-menu{left:-100%}.layoutContent .relatedTabModulesList{padding:2% 1%}.fieldDetailsForm .search-choice-close{padding:0}.border1px{border:1px solid #ddd}.blockFieldsList .opacity{margin-left:.5%!important}.blockFieldsList .opacity .dropdown-menu a{padding:0!important}.blockFieldsList .opacity a.dropdown-toggle.editFieldDetails{box-shadow:none}.blockFieldsList .editFields .dropdown-menu{z-index:1000003;padding:0;left:-215px;position:absolute}.blockFieldsList .editFieldsWidget .dropdown-menu{z-index:1000003;padding:0;left:-315px;position:absolute}.blockFieldsList .editFields .dropdown-menu .modal-header{border-width:0;border-bottom-width:1px}.blockFieldsList .editFields .dropdown-menu .modal-header .cancel{padding-right:0;font-weight:bold}.blockFieldsList .editFields:hover{background:#f3f3f4!important}#modulePickListValuesContainer .layoutContent{padding-left:2%}#modulePickListValuesContainer .layoutContent .selectedCell,#modulePickListValuesContainer .layoutContent .selectedListItem{background:#a5afb9;white-space:nowrap}#modulePickListValuesContainer .layoutContent .pickListValue{cursor:pointer}.nonEditableValuesDiv .nonEditablePicklistValues{margin-left:0}.nonEditableValuesDiv .nonEditablePicklistValues li{padding:3px 15px;margin-bottom:2px;background:#e0f2ff}.popover{z-index:1000023!important}.popover-content .fieldLabel{width:35%;white-space:normal}#dependencyGraph .tableHeading{text-align:center;padding-top:30px;font-size:1.2em;font-weight:bold}#dependencyGraph .depandencyTable{border:1px solid #ddd;background:#f3f3f4}#dependencyGraph .depandencyTable .blockHeader{border-bottom:1px solid #ddd}#dependencyGraph .depandencyTable .picklistValueMapping{border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping{text-align:center;border-left:1px solid #ddd;border-right:1px solid #ddd;background:#fff}#dependencyGraph .dependencyMapping .mCSB_container{margin-bottom:16px!important}#dependencyGraph .dependencyMapping .pickListDependencyTable{border:0}#dependencyGraph .dependencyMapping .pickListDependencyTable .blockHeader th{background:#f3f3f4;border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping .pickListDependencyTable .selectedCell{background:#a5afb9}.webformFieldInfo{margin-bottom:250px}.targetFieldsTableContainer input[type="text"]{min-width:100px}#customRecordNumbering.table thead th{vertical-align:middle}.addMailBoxBlock{margin-left:83px;padding:0!important;font-size:12px}.addMailBoxStep{background:#fff;padding:30px 0;border:1px solid #ddd;border-radius:1px;min-height:170px}.mailConveterDesc{height:350px;width:96%;border:1.5px solid;border-radius:2px;border-color:#ddd;font-size:11pt;margin-top:55px;margin-left:20px;background:#fff}#mailBoxLabel{margin-top:15px;margin-left:-18px;font-size:12pt;width:75px}.mailBoxDropdownWrapper{height:49px;width:70%;background:url('../images/mailbox-icon.png') no-repeat 5px 5px;overflow:hidden;border:1px solid #ddd}.mailBoxDropdown{background:transparent url('../images/downArrowBlue.png') no-repeat 236px 13px;width:110%;height:50px;font-size:14pt;color:#0065a6;padding:10px 55px;padding-right:0}#mailConverterDragIcon{margin-top:12px}#mailConverterBody{padding-top:20px;margin-left:0}.ruleHead{padding:6px 0;background:#d8d8dc}.mailConverterRuleBlock{font-size:14px;line-height:30px;border:1.5px solid;border-color:#ddd}.mailConverterRuleLegend{font-size:14px;color:#0065a6;margin-bottom:10px;background:#f3f3f4}#mailConverterStats{font-size:10pt;margin-top:5px;margin-left:-10px}.addMailBoxBlock{border-color:#ddd;margin-left:83px;margin-top:20px;padding-top:30px;padding-left:200px;padding-bottom:20px;padding-right:30px;font-size:11pt}.taskTypeUi>.row{margin:10px 0}#taskListContainer .listViewEntriesTable tr td:last-child{border-left:1px solid #ddd}#workflow_step2>.row{padding:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:400px}#open_email_con .detailViewTitle{padding:0}#open_email_con .detailViewTitle .detailViewPagingButton{margin-top:0;padding-right:0}#foldersList .list-group{padding-right:0}.massEditTable th+th,.massEditTable td+td,.massEditTable th+td,.massEditTable td+th{border-left:0}.nav.massEditTabs{margin-bottom:0;border-bottom:0}.nav.massEditTabs li.active a{background:#404952;color:#fff;margin-left:10px}.nav.massEditTabs li a:hover{border-bottom:1px solid #404952}.massEditContent{border-top:3px solid #404952}.calendarSettingsContainer{width:700px}.calendarSettingsContainer .control-label{width:26%}#calendarSettings{margin:1px 0 3px}.calendarMassEdit{min-width:400px}.fc-state-default .fc-button-effect{top:100%!important}.fc-event-style1,.fc-event-style1 .fc-event-skin{background:#17309a;border-color:#17309a;font-weight:normal;text-shadow:none}.fc-event-style2,.fc-event-style2 .fc-event-skin{background:#3a87ad;border-color:#3a87ad;font-weight:normal;text-shadow:none}.fc-event-style3,.fc-event-style3 .fc-event-skin{background:#aa6705;border-color:#aa6705;font-weight:normal;text-shadow:none}.fc-event-style4,.fc-event-style4 .fc-event-skin{background:#953b39;border-color:#953b39;font-weight:normal;text-shadow:none}.fc-event-style5,.fc-event-style5 .fc-event-skin{background:#545252;border-color:#545252;font-weight:normal;text-shadow:none}.fc-event-style6,.fc-event-style6 .fc-event-skin{background:#87865d;border-color:#87865d;font-weight:normal;text-shadow:none}.fc-event-style7,.fc-event-style7 .fc-event-calendarMassEditskin{background:#c71585;border-color:#c71585;font-weight:normal;text-shadow:none}.fc-event-style8,.fc-event-style8 .fc-event-skin{background:#006400;border-color:#006400;font-weight:normal;text-shadow:none}#calendarview th{color:#000}.fc-agenda-divider+div{overflow-y:visible!important}.fc-button{display:inline-block;padding:6px .4em!important;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.fc-button:active .fc-button-inner{background:transparent}.fc-button:active .fc-button-inner .fc-button-content{color:#fff}.fc-button.fc-state-active .fc-button-inner .fc-button-content,.fc-button:active .fc-button-inner .fc-button-content{color:#000!important;background:transparent;background-image:none}.fc-header-title h2{font-size:15px;line-height:20px}.fc-widget-header th{padding:4px 0!important}.fc-widget-header{color:#666;background:#eee;border-color:#ccc}.fc-content{background:#fff;margin-top:15px}.fc-content td:hover{background:#f3f3f3}.btn:focus{outline:0}.reminderPostpone.btn-primary{background:#404952}.reminderPostpone.btn-primary:hover{background:#1e2327}.saveButton{margin-right:5px}.addCustomRule{float:right}.importMore{background:#fff}.lastImport{background:#fff}.undoImport{background:#da4f49}.close{border:0;background:none repeat scroll 0 0 transparent;border:0 none;cursor:pointer}.resetButton{margin-top:0!important}.vtGlyph{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("../images/vtGlyph.png");background-position:0 0;background-repeat:no-repeat;*margin-right:.3em}.vticon-pageJump{background-position:0 0}.vticon-call-inbound{background-position:-14px 0}.vticon-call-outbound{background-position:-28px 0}#massEdit .cancelLinkContainer{padding:5px 0;margin-left:.5em}.ui-pnotify{z-index:1000023}.feedback{z-index:10002}.feedback .handle{z-index:10003;display:block;position:fixed;bottom:50px;left:-30px;left:0\9;bottom:100px\9;background:#2c2c2c;color:white;padding:7px 15px;border:1px solid gray;text-decoration:none;outline:0;-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-o-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg);-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.00000000, M12=1.00000000, M21=-1.00000000, M22=0.00000000,sizingMethod='auto expand')";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0,M12=1,M21=-1,M22=0,sizingMethod='auto expand')}.feedback .handle:hover{text-decoration:none}.vtFooter{text-align:center}.vtFooter p{background:#404952;color:#fff;border-top:1px solid #ddd;padding:1px 0;font-size:.9em;margin-bottom:0}.vtFooter p a{color:#fff}.imageHolder{background:url('../images/loadback.png') repeat-y;background-position:center;padding:10px 0}.breadcrumbContainer{padding:2% 2% 0 2%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;height:auto}.breadcrumb{display:inline-block;height:auto;height:40px}.crumbs{height:40px;margin:0;padding:0 20px 0 0;display:inline-block;font-family:sans-serif}.crumbs li:after{content:'\0000a0';width:0;height:0;border-left:18px solid #ececec;border-top:20px solid transparent;border-bottom:20px solid transparent;display:inline-block;position:relative;top:-20px;left:18px;zoom:1}.crumbs li{height:0;border-top:20px solid #ececec;border-bottom:20px solid #ececec;border-left:20px solid transparent;display:inline-block;box-shadow:0 1px #ddd;margin-right:5px}.crumbs li a{display:inline-block;float:left;margin-top:-13px;font-size:14px;font-weight:bold;color:#666;text-decoration:none}.crumbs li.active{height:0;border-top:20px solid #404952;border-bottom:20px solid #404952;box-shadow:0 1px #404952}.crumbs li.active:after{border-left:18px solid #404952!important}.stepText{display:inline-block;white-space:nowrap;overflow:hidden;font-size:13px;vertical-align:bottom}.active .stepText,.active .stepNum{color:#fff}.stepNum{display:inline-block;padding:0 5px;overflow:hidden;font-size:20px;vertical-align:top;margin-top:5px}.greyStar{background-image:url("../images/stars.png");background-position:20px 20px;height:20px;width:20px;display:inline-block}.yellowStar{background-image:url('../images/stars.png');background-position:0 20px;width:20px;height:20px;display:inline-block}.blockUI{border-radius:2px!important;border:0!important}textarea.col-md-11{width:100%!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.popover .popover-inner{border-radius:2px;font-size:.8em;box-shadow:0}.popover .popover-inner .popover-title{color:#444;font-size:15px}.popover .popover-inner .close{color:#000!important;margin-top:3px;opacity:.5!important}.popover .popover-inner .close:hover{opacity:1!important}.popover .popover-inner td{padding:3px 5px;overflow-wrap:break-word}.popover .popover-inner .detailViewInfo{margin-top:0;box-shadow:0}.popover .popover-inner .detailViewInfo .fieldLabel label{font-size:1em}#findDuplicate>.control-group{margin-bottom:0;width:400px}#moveReports .modal-body{padding:20px 40px}#composeEmailContainer{padding:0 20px}#composeEmailContainer .MultiFile-wrap{display:inline-block}#composeEmailContainer .MultiFile-intercepted .ui-wrapper{min-height:400px}#transferOwnershipContainer .select2-container.select2-container-multi{max-width:220px}.fieldInfo.in{overflow:visible!important;height:auto!important}.moduleSelection{border-radius:2px 2px 0 0!important;border:1px solid #ddd!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);color:#444}.convertLeadModules{margin-bottom:2%;border:1px none}.moduleBlock{border-radius:0!important}.overflowVisible{overflow:visible!important}.convertLeadError{border:3px solid #999;background-color:#fff;width:55%;position:relative;z-index:10000000}.convertLeadError table td{border-bottom:1px solid #ccc;nowrap:nowrap;width:70%}.bootbox,.alert{z-index:1000023}.chzn-container{vertical-align:middle}.chzn-container .chzn-results li{margin-right:7px}.chzn-container .chzn-results .highlighted{background:#404952}.select2-results .select2-highlighted{background:#404952}.select2-result-label i{background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.ui-autocomplete-loading{background:url('../images/load.gif') no-repeat right center}.ui-autocomplete{height:auto!important;border-radius:1px!important}.dropdown-menu.pull-right:after,.dropdown-menu.pull-right:before{right:3px;left:auto;top:-5px;border-bottom-width:6px}span.wrapper a{color:#08c!important;font-size:15px!important;font-weight:bold}a{color:#353c44}a:hover{color:#1e2327;text-decoration:none;cursor:pointer}a:active,a:focus{outline:0}.well{border-radius:2px;padding:15px}.verticalBottomSpacing{margin-bottom:10px}.mergeTables{margin-bottom:0}.font-x-x-large{font-size:18px;line-height:28px}form{margin:0}.fc-state-default .fc-button-effect span{background:0}.dateField{width:183px}.form-horizontal [class^="icon-"],.form-horizontal [class*=" icon-"]{vertical-align:baseline}.timePicker{width:8.5em!important;z-index:1000029!important}.datepicker{z-index:1000029!important}.colorpicker{z-index:1029!important}.colorpicker input{width:30px!important}.colorpicker input[type="text"],.colorpicker input{color:#898989!important}.colorpicker_hex input{width:45px!important}.modal-body.accordion{margin-bottom:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}//.modal-open{// overflow:hidden;//}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.removeNoFileChosen{color:transparent!important}.modelContainer .modal-header{border-radius:2px 2px 0 0}.modelContainer form{border-radius:0 0 2px 2px}.hide{display:none}i{cursor:pointer;text-decoration:none!important}.marginbottomZero{margin-bottom:0!important}.marginLeftZero{margin-left:0!important}.marginRightZero{margin-right:0!important}.clearfix{clear:both!important}textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%}.textOverflowEllipsis{overflow:hidden;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;//width:9em}.margin0px{margin:0!important}.padding10{padding:10px;padding-bottom:0}.padding20{padding:20px}.pushDown{margin-top:5px}.boxSizingBorderBox{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.boxSizingContentBox{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.cursorPointer{cursor:pointer;text-decoration:none!important}.zeroOpacity{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.dullOpacity{opacity:.8;-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80)}.fullOpacity{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.redColor{color:red}.highlightBackgroundColor{background:#eeeff2}.contentsBackground{background:#fff;border:1px solid #ddd}.textAlignCenter{text-align:center}.textAlignRight{text-align:right}.alignMiddle{vertical-align:middle}.alignTop{vertical-align:top}.padding1per{padding:1%}.paddingTop20{padding-top:20px}.padding20px{padding:20px}.padding-bottom1per{padding-bottom:1%}.marginBottom10px{margin-bottom:10px}.displayInlineBlock{display:inline-block}.backgroundImageNone{background-image:none}.liStyleNone{list-style:none outside none}.fontBold{font-weight:bold!important}.livesupport_tab,#userfeedback{display:none!important}#reportDetails table tr td.summary{border-bottom:0;border-top:0}#portalDetailViewHttpError{padding-bottom:7px;margin-top:50px;color:red;text-align:center}.slidesjs-pagination{list-style:none}.slidesjs-pagination li a{display:block;width:13px;height:0;padding-top:13px;background-image:url('../images/pagination.png');background-position:0 0;float:left;overflow:hidden}.slidesjs-pagination li a.active,.slidesjs-pagination li a:hover.active{background-position:0 -13px}.extensionStorebtn{background:#f08c39;background-image:-webkit-linear-gradient(top,#f08c39,#e68b3c);background-image:-moz-linear-gradient(top,#f08c39,#e68b3c);background-image:-ms-linear-gradient(top,#f08c39,#e68b3c);background-image:-o-linear-gradient(top,#f08c39,#e68b3c);background-image:linear-gradient(to bottom,#f08c39,#e68b3c);-webkit-border-radius:2;-moz-border-radius:2;border-radius:2px;text-shadow:0 0 1px #595959;color:#fff;font-size:14px;font-weight:bold;padding:8px 20px 8px 20px;text-decoration:none;border:0}.extensionStorebtn:hover{background:#fc9f3c;background-image:-webkit-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-moz-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-ms-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-o-linear-gradient(top,#fc9f3c,#f08a3c);background-image:linear-gradient(to bottom,#fc9f3c,#f08a3c);text-decoration:none}.extensionSearch{padding:8px 12px 8px 30px!important;margin:6px 0 14px 0;box-shadow:inset 2px 2px 10px #ddd;border-radius:2px!important;background:url('../images/search.png') no-repeat;background-position:5px 6px}.banner-container{border-bottom:1px solid #fff;box-sizing:border-box}.banner{margin:0 90px}.bx-wrapper{margin:0 auto 35px!important;padding-top:17px!important}.bx-wrapper li a{display:block}.bx-wrapper a img{height:100px;width:auto;margin:0 auto}.wide,.table td.wide,.listViewEntries td.wide,td.listViewEntryValue.wide{padding:8px!important}.medium,.table td.medium,.listViewEntries td.medium,td.listViewEntryValue.medium{padding:5px 6px!important}.narrow,.table td.narrow,.listViewEntries td.narrow,td.listViewEntryValue.narrow{padding:2px 4px!important}.table thead th.narrow{vertical-align:middle}td.listViewEntryValue .row input{padding:0;margin-bottom:0}.listViewContentDiv{position:relative}.fieldLabel .pull-right{text-align:right}#tagRecordText{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;width:80%!important}#tagRecord{margin-left:5px!important}.tag{float:right!important}.cut-string{text-overflow:ellipsis;-o-text-overflow:ellipsis;-webkit-text-overflow:ellipsis;width:200px;white-space:nowrap;overflow:hidden}.paddingLRZero{padding-left:0;padding-right:0}.paddingRightZero{padding-right:0}.detailViewToolbar{margin-top:5px}.input-group.input-group-sm>.input-group-addon img{width:15px}table tr td .input-sm{min-width:50px}.modal-footer.backgroundColor{background-color:#f5f5f5}.panel-title{font-size:14px}.quickWidgetContainer .panel-body{padding-bottom:0;padding-top:0}tr.summaryViewEntries,#detailView table{font-size:13px}table.listViewEntriesTable{font-size:13px;margin-top:5px}.no-margin{margin:0}.companyLogo img{max-height:200px;max-width:250px}.navbar-inverse .navbar-nav>li>a{color:#fff;padding:15px 12px}.navbar-inverse .navbar-nav .dropdown-menu>li>a{padding:3px 15px;font-size:12px}.headerCalendar .month h3{font-size:18px;font-weight:bold;margin:5px 0 0 0}.columnsSelect{width:100%!important}.marginBottom5{margin-bottom:5px}.editViewContainer .recordEditView table.blockContainer tr td.fieldValue{width:30%}.recordEditView[name=QuickCreate] .quickCreateContent table tr td.fieldValue,#massEditContainer .massEditContent table tr td.fieldValue,#tab_accounts td.functionList{width:30%}.btn{white-space:normal}.valuesAssignedToRole{border:1px solid #adadad;overflow:hidden;text-overflow:ellipsis;padding:6px}table.dataTable .form-control{width:100%!important}#breadcrumb .stepNum{margin-top:0}#breadcrumb .stepText{position:relative;top:-4px}.fc button{height:auto!important}.fc-toolbar{margin-bottom:0!important}.fc-center,.fc-left,.fc-right{margin-bottom:1em}.calendarRightPanel{padding-left:5px;padding-right:5px}.calendarRightPanel ul li{margin-bottom:2px;margin-left:5px}.calendarRightPanel ul li:hover{background-color:#eee!important;border-radius:5px}.square9{width:12px;height:12px;margin:4px}.panel-dark{border-color:#737373}.panel-dark>.panel-heading{color:#fff;background-color:#737373;border-color:#737373}.panel-dark>.panel-heading+.panel-collapse>.panel-body{border-top-color:#737373}.panel-dark>.panel-heading .badge{color:#737373;background-color:#fff}.panel-dark>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#737373}.calendarRightPanel .widgetContainer ul{margin-top:5px;margin-bottom:5px}.paddingLeft5px{padding-left:5px}.marginBottom5px{margin-bottom:5px}.detailview-table .fieldValue .summaryViewEdit{display:none}.detailview-table .fieldValue:hover .summaryViewEdit{display:inherit}.icon-in-history-widget{font-size:17px;padding:4px}#prefPageHeader .logo img{height:70px;width:70px}#myPrefHeading h3{margin-top:12px}.list-user-img{width:50px;height:40px}span[name=existingImages] img{height:200px;width:300px}.narrow.fieldValue .chosen-container-single .chosen-single{height:26px;line-height:26px}.narrow.fieldValue input{height:26px}.narrow.fieldValue .input-group-addon{padding:4px 10px}.narrow.fieldValue .chosen-container-single .chosen-single div b{background-position-y:4px}.image-in-button{width:18px}.fc-time-grid .fc-time-grid-event.fc-event{min-height:27px;min-width:100px}.fc-time-grid-event.fc-short .fc-title{font-size:1em}.paddingTBZero{padding-top:0;padding-bottom:0}.dashboardWidgetContent a .glyphicon{top:-3px}.detailViewTitle .popover{min-width:130px;text-align:center}.cursorDefault{cursor:default!important}.remindersNoticeContainer{position:fixed;right:0;top:109px;z-index:1029;width:0;height:100%;bottom:30px;overflow-y:auto;background:rgba(0,0,0,0.4);border-left:1px solid #797979;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;overflow-y:auto}.remindersNoticeContainer.toggled{width:380px}.remindersContent{margin:5px 8px 0 8px}.activityTypeIcon{height:20px}.remindersNoticeContainer .panel{margin-bottom:10px}.remindersNoticeContainer .panel-body{padding:10px}.remindersNoticeContainer .actionRow a.btn{margin-right:3%}.remindersNotice{color:#fff;padding:15px 12px}.remindersNotice .glyphicon{font-size:20px}.cancelLink.btn[type='reset'],.cancel.btn[type='reset']{float:right;margin-left:5px;margin-bottom:0}.activityWidgetContainer .popover{min-width:240px}.filterActionImage{margin-left:8px}#tagRecord{line-height:25px}#tagsList .btn-info{margin-left:5px}#tagRecordInput{padding-left:15px;padding-right:15px}.clearReferenceSelection,.createReferenceRecord{padding:0 6px}.relatedPopup{padding:0 4px}.popupContainer .popupModuleName{margin-top:0}.mailRows hr{margin:0}.paddingLeftMd{padding-left:15px}.widget_header div:nth-child(2).btn-toolbar,.editViewContainer .contentHeader.row div:nth-child(2){margin-top:20px}.fieldLabel .referenceMandatory{margin-right:-12px}.ui-widget-content{padding:.8em}.ui-autocomplete .ui-autocomplete-category{font-weight:bold;line-height:1.5}.ui-autocomplete .ui-autocomplete-category:first-child{margin:.8em 0 .2em}.ui-autocomplete .ui-menu-item{padding:.2em .8em}.ui-autocomplete .ui-state-focus{border:0;background:#ebebeb}.widgetHr{margin-top:0}.headerLinksMails .btn-group{margin-top:11px}.finalDiscountUI,.finalTaxUI{bottom:5px}.sideBarTitle{font-size:20px}.globalSearchInput{width:300px}#groupsDetailContainer strong{line-height:21px}#addTaskContainer #taskStatus{margin-left:10px}.scanerMailActionsButtons{min-width:96px}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#404040}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active,.ui-menu .ui-menu-item a.ui-widget-content{font-weight:bold;margin:0;background-color:#428bca;border-color:#357ebd;color:#fff;display:block}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style:none}#layoutEditorButtons{margin-bottom:10px;margin-top:-10px}.individualTaxContainer{text-align:left!important}.suppliesItemsTable .input-group{max-width:200px}.suppliesItemsTable .rowName .input-group{max-width:400px}.suppliesItemsTable td,.suppliesItemsTable th{border:1px solid #ddd}.suppliesItemsTable tfoot td.hideTd{border:0;background:#fafafb}.suppliesSummaryContainer .panel-body,.suppliesSummaryContainer .panel-footer{padding:0}.suppliesSummaryContainer .panel-body .form-group,.suppliesSummaryContainer .panel-footer .form-group{margin:0}.suppliesSummaryContainer .input-group .form-control{background-color:#f5f5f5}.suppliesSummaryContainer .panel-body .percent{min-width:55px}.suppliesItemsTable tfoot{font-weight:800}.suppliesSummaryContainer img{max-width:15px} \ No newline at end of file diff --git a/modules/Products/views/Discounts.php b/modules/Products/views/Discounts.php index cbde8ff5a8af..af2e3177560c 100644 --- a/modules/Products/views/Discounts.php +++ b/modules/Products/views/Discounts.php @@ -6,7 +6,7 @@ class Products_Discounts_View extends Vtiger_Index_View public function process(Vtiger_Request $request) { $moduleName = $request->getModule(); - $record = $request->get('record'); + $discountType = $request->get('discountType'); $currency = $request->get('currency'); $sourceModule = $request->get('sourceModule'); $sourceRecord = $request->get('sourceRecord'); @@ -24,6 +24,7 @@ public function process(Vtiger_Request $request) $viewer->assign('CURRENCY_SYMBOL', Vtiger_Functions::getCurrencySymbolandRate($currency)['symbol']); $viewer->assign('TOTAL_PRICE', $totalPrice); $viewer->assign('CONFIG', $config); + $viewer->assign('DISCOUNT_TYPE', $discountType); $viewer->assign('AGGREGATION_TYPE', $config['aggregation']); $viewer->assign('AGGREGATION_INPUT_TYPE', $config['aggregation'] == 0 ? 'radio' : 'checkbox'); $viewer->assign('GROUP_DISCOUNT', $groupDiscount['discount']); diff --git a/modules/Products/views/Taxs.php b/modules/Products/views/Taxs.php index fb0f37a0227f..ab4dbb6e15d6 100644 --- a/modules/Products/views/Taxs.php +++ b/modules/Products/views/Taxs.php @@ -11,7 +11,7 @@ public function process(Vtiger_Request $request) $currency = $request->get('currency'); $sourceModule = $request->get('sourceModule'); $sourceRecord = $request->get('sourceRecord'); - $isIndividual = $request->get('isIndividual'); + $taxType = $request->get('taxType'); $totalPrice = $request->get('totalPrice'); $accountField = $request->get('accountField'); @@ -27,6 +27,7 @@ public function process(Vtiger_Request $request) $viewer->assign('CURRENCY_SYMBOL', Vtiger_Functions::getCurrencySymbolandRate($currency)['symbol']); $viewer->assign('TOTAL_PRICE', $totalPrice); $viewer->assign('CONFIG', $config); + $viewer->assign('TAX_TYPE', $taxType); $viewer->assign('TAX_FIELD', Supplies_EditView_Model::getTaxField($recordModule)); $viewer->assign('AGGREGATION_TYPE', $config['aggregation']); $viewer->assign('AGGREGATION_INPUT_TYPE', $config['aggregation'] == 0 ? 'radio' : 'checkbox'); diff --git a/modules/Supplies/fields/Discount.php b/modules/Supplies/fields/Discount.php index 48fe28f60c36..d5afe2d9def7 100644 --- a/modules/Supplies/fields/Discount.php +++ b/modules/Supplies/fields/Discount.php @@ -27,12 +27,4 @@ public function getDisplayValue($value) { return CurrencyField::convertToUserFormat($value, null, true); } - - public function isVisible($data) - { - if (count($data) > 0 && $data[0]['discountmode'] == 0) { - return false; - } - return true; - } } diff --git a/modules/Supplies/fields/Tax.php b/modules/Supplies/fields/Tax.php index 3586af1506dd..d3f8192dd86f 100644 --- a/modules/Supplies/fields/Tax.php +++ b/modules/Supplies/fields/Tax.php @@ -35,12 +35,4 @@ public function getClassName($data) } return ''; } - - public function isVisible($data) - { - if (count($data) > 0 && $data[0]['taxmode'] == 0) { - return false; - } - return true; - } } diff --git a/modules/Supplies/models/EditView.php b/modules/Supplies/models/EditView.php index 8e177f3684e8..2a56f92adfe0 100644 --- a/modules/Supplies/models/EditView.php +++ b/modules/Supplies/models/EditView.php @@ -35,6 +35,9 @@ public function getTaxField($moduleName) return $cache; } $return = false; + if($moduleName == ''){ + return $return; + } $moduleModel = Vtiger_Module_Model::getInstance($moduleName); foreach ($moduleModel->getFields() as $fieldName => $fieldModel) { if ($fieldModel->get('uitype') == 303) { diff --git a/modules/Supplies/models/SupField.php b/modules/Supplies/models/SupField.php index e6d3cd50a285..008064b6746e 100644 --- a/modules/Supplies/models/SupField.php +++ b/modules/Supplies/models/SupField.php @@ -203,4 +203,22 @@ public static function getAutoCompleteField($recordModuleName, $moduleName) } return $fields; } + public static function getTaxParam($taxParam, $net, $return = false) + { + $taxParam = json_decode($taxParam,true); + if(count($taxParam) == 0){ + return []; + } + if(is_string($taxParam['aggregationType'])){ + $taxParam['aggregationType'] = [$taxParam['aggregationType']]; + } + if(!$return){ + $return = []; + } + foreach ($taxParam['aggregationType'] as $aggregationType) { + $precent = $taxParam[$aggregationType.'Tax']; + $return[$precent] += $net * ($precent/100); + } + return $return; + } } From 4093812e35999bd26d33f962d7f308e97276f9d6 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Fri, 28 Aug 2015 18:00:35 +0200 Subject: [PATCH 035/489] Added new module inventory to the engine (detail view) --- .../modules/Vtiger/DetailViewFullContents.tpl | 3 + .../Vtiger/DetailViewInventorySummary.tpl | 96 +++++++ .../Vtiger/DetailViewInventoryView.tpl | 84 ++++++ .../innventoryFields/DetailViewBase.tpl | 4 + .../DetailViewDiscountMode.tpl | 4 + .../innventoryFields/DetailViewTaxMode.tpl | 4 + .../innventoryFields/EditViewComment.tpl | 8 + .../innventoryFields/EditViewCurrency.tpl | 38 +++ .../innventoryFields/EditViewDiscount.tpl | 15 ++ .../innventoryFields/EditViewDiscountMode.tpl | 7 + .../innventoryFields/EditViewGrossPrice.tpl | 6 + .../innventoryFields/EditViewMargin.tpl | 5 + .../innventoryFields/EditViewMarginP.tpl | 8 + .../Vtiger/innventoryFields/EditViewName.tpl | 41 +++ .../innventoryFields/EditViewNetPrice.tpl | 6 + .../innventoryFields/EditViewPurchase.tpl | 7 + .../innventoryFields/EditViewQuantity.tpl | 5 + .../innventoryFields/EditViewReference.tpl | 33 +++ .../Vtiger/innventoryFields/EditViewTax.tpl | 13 + .../innventoryFields/EditViewTaxMode.tpl | 7 + .../innventoryFields/EditViewTotalPrice.tpl | 6 + .../innventoryFields/EditViewUnitPrice.tpl | 16 ++ .../Vtiger/innventoryFields/EditViewValue.tpl | 10 + layouts/vlayout/skins/twilight/style.css | 22 +- layouts/vlayout/skins/twilight/style.min.css | 2 +- modules/Vtiger/innventoryFields/Basic.php | 139 ++++++++++ modules/Vtiger/innventoryFields/Comment.php | 17 ++ modules/Vtiger/innventoryFields/Currency.php | 26 ++ modules/Vtiger/innventoryFields/Discount.php | 30 +++ .../Vtiger/innventoryFields/DiscountMode.php | 28 ++ .../Vtiger/innventoryFields/GrossPrice.php | 27 ++ modules/Vtiger/innventoryFields/Margin.php | 26 ++ modules/Vtiger/innventoryFields/MarginP.php | 26 ++ modules/Vtiger/innventoryFields/Name.php | 28 ++ modules/Vtiger/innventoryFields/NetPrice.php | 27 ++ modules/Vtiger/innventoryFields/Purchase.php | 26 ++ modules/Vtiger/innventoryFields/Quantity.php | 27 ++ modules/Vtiger/innventoryFields/Reference.php | 28 ++ modules/Vtiger/innventoryFields/Tax.php | 38 +++ modules/Vtiger/innventoryFields/TaxMode.php | 28 ++ .../Vtiger/innventoryFields/TotalPrice.php | 27 ++ modules/Vtiger/innventoryFields/UnitPrice.php | 27 ++ modules/Vtiger/innventoryFields/Value.php | 16 ++ modules/Vtiger/models/InventoryField.php | 239 ++++++++++++++++++ modules/Vtiger/models/Record.php | 28 ++ modules/Vtiger/views/Detail.php | 2 +- 46 files changed, 1297 insertions(+), 13 deletions(-) create mode 100644 layouts/vlayout/modules/Vtiger/DetailViewInventorySummary.tpl create mode 100644 layouts/vlayout/modules/Vtiger/DetailViewInventoryView.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/DetailViewBase.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/DetailViewDiscountMode.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/DetailViewTaxMode.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/EditViewComment.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/EditViewCurrency.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/EditViewDiscount.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/EditViewDiscountMode.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/EditViewGrossPrice.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/EditViewMargin.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/EditViewMarginP.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/EditViewName.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/EditViewNetPrice.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/EditViewPurchase.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/EditViewQuantity.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/EditViewReference.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/EditViewTax.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/EditViewTaxMode.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/EditViewTotalPrice.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/EditViewUnitPrice.tpl create mode 100644 layouts/vlayout/modules/Vtiger/innventoryFields/EditViewValue.tpl create mode 100644 modules/Vtiger/innventoryFields/Basic.php create mode 100644 modules/Vtiger/innventoryFields/Comment.php create mode 100644 modules/Vtiger/innventoryFields/Currency.php create mode 100644 modules/Vtiger/innventoryFields/Discount.php create mode 100644 modules/Vtiger/innventoryFields/DiscountMode.php create mode 100644 modules/Vtiger/innventoryFields/GrossPrice.php create mode 100644 modules/Vtiger/innventoryFields/Margin.php create mode 100644 modules/Vtiger/innventoryFields/MarginP.php create mode 100644 modules/Vtiger/innventoryFields/Name.php create mode 100644 modules/Vtiger/innventoryFields/NetPrice.php create mode 100644 modules/Vtiger/innventoryFields/Purchase.php create mode 100644 modules/Vtiger/innventoryFields/Quantity.php create mode 100644 modules/Vtiger/innventoryFields/Reference.php create mode 100644 modules/Vtiger/innventoryFields/Tax.php create mode 100644 modules/Vtiger/innventoryFields/TaxMode.php create mode 100644 modules/Vtiger/innventoryFields/TotalPrice.php create mode 100644 modules/Vtiger/innventoryFields/UnitPrice.php create mode 100644 modules/Vtiger/innventoryFields/Value.php create mode 100644 modules/Vtiger/models/InventoryField.php diff --git a/layouts/vlayout/modules/Vtiger/DetailViewFullContents.tpl b/layouts/vlayout/modules/Vtiger/DetailViewFullContents.tpl index a90d59574d3c..6b2a47ac1d00 100644 --- a/layouts/vlayout/modules/Vtiger/DetailViewFullContents.tpl +++ b/layouts/vlayout/modules/Vtiger/DetailViewFullContents.tpl @@ -11,4 +11,7 @@ -->*} {strip} {include file='DetailViewBlockView.tpl'|@vtemplate_path:$MODULE_NAME RECORD_STRUCTURE=$RECORD_STRUCTURE MODULE_NAME=$MODULE_NAME} + {if $MODULE_TYPE == 'Inventory'} + {include file='DetailViewInventoryView.tpl'|@vtemplate_path:$MODULE_NAME MODULE_NAME=$MODULE_NAME} + {/if} {/strip} diff --git a/layouts/vlayout/modules/Vtiger/DetailViewInventorySummary.tpl b/layouts/vlayout/modules/Vtiger/DetailViewInventorySummary.tpl new file mode 100644 index 000000000000..18a251bc56fc --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/DetailViewInventorySummary.tpl @@ -0,0 +1,96 @@ +{**} +{strip} + {foreach key=KEY item=INVENTORY_ROW from=$INVENTORY_ROWS} + {assign var="DISCOUNT" value=$DISCOUNT + $INVENTORY_ROW['discount']} + {assign var="TAXS" value=$INVENTORY_FIELD->getTaxParam($INVENTORY_ROW['taxparam'],$INVENTORY_ROW['net'], $TAXS)} + {/foreach} +
    +
    + + + + + + + + + + + +
    + {vtranslate('LBL_DISCOUNT', $MODULE_NAME)}   + {vtranslate('LBL_DISCOUNTS_SUMMARY',$MODULE_NAME)} +
    + {CurrencyField::convertToUserFormat($DISCOUNT, null, true)} {$CURRENCY_SYMBOLAND['symbol']} +
    +
    +
    + + + + + + + + {foreach item=TAX key=KEY from=$TAXS} + {assign var="TAX_AMOUNT" value=$TAX_AMOUNT + $TAX} + + + + + {/foreach} + + + + + +
    + {vtranslate('LBL_TAX', $MODULE_NAME)}   + {vtranslate('LBL_TAX_SUMMARY',$MODULE_NAME)} +
    + {$KEY}% + + {CurrencyField::convertToUserFormat($TAX, null, true)} {$CURRENCY_SYMBOLAND['symbol']} +
    + {vtranslate('LBL_AMOUNT',$MODULE_NAME)} + + {CurrencyField::convertToUserFormat($TAX_AMOUNT, null, true)} {$CURRENCY_SYMBOLAND['symbol']} +
    +
    + {if $BASE_CURRENCY['id'] != $CURRENCY} + {assign var="RATE" value=$BASE_CURRENCY['conversion_rate']/$CURRENCY_SYMBOLAND['rate']} +
    + + + + + + + + {foreach item=TAX key=KEY from=$TAXS} + {assign var="CURRENY_AMOUNT" value=$CURRENY_AMOUNT + $TAX} + + + + + {/foreach} + + + + + +
    + {vtranslate('LBL_CURRENCIES_SUMMARY',$MODULE_NAME)} +
    + {$KEY}% + + {CurrencyField::convertToUserFormat($TAX * $RATE, null, true)} {$BASE_CURRENCY['currency_symbol']} +
    + {vtranslate('LBL_AMOUNT',$MODULE_NAME)} + + {CurrencyField::convertToUserFormat($CURRENY_AMOUNT * $RATE, null, true)} {$BASE_CURRENCY['currency_symbol']} +
    +
    + {/if} +
    +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/DetailViewInventoryView.tpl b/layouts/vlayout/modules/Vtiger/DetailViewInventoryView.tpl new file mode 100644 index 000000000000..2fd401f50c03 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/DetailViewInventoryView.tpl @@ -0,0 +1,84 @@ +{**} +{strip} + {assign var="INVENTORY_FIELD" value=Vtiger_InventoryField_Model::getInstance($MODULE_NAME)} + {assign var="FIELDS" value=$INVENTORY_FIELD->getFields(true)} + + {if count($FIELDS) neq 0} + {assign var="COLUMNS" value=$INVENTORY_FIELD->getColumns()} + {assign var="INVENTORY_ROWS" value=$RECORD->getInventoryData()} + {assign var="MAIN_PARAMS" value=$INVENTORY_FIELD->getMainParams($FIELDS[1])} + {assign var="COUNT_FIELDS0" value=count($FIELDS[0])} + {assign var="COUNT_FIELDS1" value=count($FIELDS[1])} + {assign var="COUNT_FIELDS2" value=count($FIELDS[2])} + {assign var="BASE_CURRENCY" value=Vtiger_Util_Helper::getBaseCurrency()} + {if in_array("currency",$COLUMNS)} + {if count($INVENTORY_ROWS) > 0} + {assign var="CURRENCY" value=$INVENTORY_ROWS[0]['currency']} + {else} + {assign var="CURRENCY" value=$BASE_CURRENCY['id']} + {/if} + {assign var="CURRENCY_SYMBOLAND" value=Vtiger_Functions::getCurrencySymbolandRate($CURRENCY)} + {/if} + + + + + {foreach item=FIELD from=$FIELDS[0]} + + {/foreach} + + +
    + {vtranslate($FIELD->get('label'), $MODULE_NAME)}:  + {assign var="FIELD_TPL_NAME" value="innventoryFields/"|cat:$FIELD->getTemplateName('DetailView',$MODULE_NAME)} + {include file=$FIELD_TPL_NAME|@vtemplate_path:$MODULE_NAME SUP_VALUE=$INVENTORY_ROWS[0][$FIELD->get('columnname')]} +
    + {assign var="FIELDS_TEXT_ALIGN_RIGHT" value=['TotalPrice','Tax','MarginP','Margin','Purchase','Discount','NetPrice','GrossPrice','UnitPrice','Quantity']} + + + + {foreach item=FIELD from=$FIELDS[1]} + {if $FIELD->isVisible($INVENTORY_ROWS)} + + {/if} + {/foreach} + + + + {foreach key=KEY item=INVENTORY_ROW from=$INVENTORY_ROWS} + {assign var="ROW_NO" value=$KEY+1} + + {foreach item=FIELD from=$FIELDS[1]} + {if $FIELD->isVisible($INVENTORY_ROWS)} + + {/if} + {/foreach} + + {/foreach} + + + + {foreach item=FIELD from=$FIELDS[1]} + {if $FIELD->isVisible($INVENTORY_ROWS)} + + {/if} + {/foreach} + + +
    + {vtranslate($FIELD->get('label'), $MODULE_NAME)} +
    getName(), $FIELDS_TEXT_ALIGN_RIGHT)}class="textAlignRight"{/if}> + {assign var="FIELD_TPL_NAME" value="innventoryFields/"|cat:$FIELD->getTemplateName('DetailView',$MODULE_NAME)} + {include file=$FIELD_TPL_NAME|@vtemplate_path:$MODULE_NAME SUP_VALUE=$INVENTORY_ROW[$FIELD->get('columnname')]} +
    + {if $FIELD->isSummary()} + {assign var="SUM" value=0} + {foreach key=KEY item=INVENTORY_ROW from=$INVENTORY_ROWS} + {assign var="SUM" value=($SUM + $INVENTORY_ROW[$FIELD->get('columnname')])} + {/foreach} + {CurrencyField::convertToUserFormat($SUM, null, true)} + {/if} +
    + {include file='DetailViewInventorySummary.tpl'|@vtemplate_path:$MODULE_NAME} + {/if} +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/DetailViewBase.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/DetailViewBase.tpl new file mode 100644 index 000000000000..46bc023508e4 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/DetailViewBase.tpl @@ -0,0 +1,4 @@ +{**} +{strip} + {$FIELD->getDisplayValue($SUP_VALUE)} +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/DetailViewDiscountMode.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/DetailViewDiscountMode.tpl new file mode 100644 index 000000000000..7009f01922e4 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/DetailViewDiscountMode.tpl @@ -0,0 +1,4 @@ +{**} +{strip} + {vtranslate($FIELD->getDisplayValue($SUP_VALUE), $SUPMODULE)} +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/DetailViewTaxMode.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/DetailViewTaxMode.tpl new file mode 100644 index 000000000000..7009f01922e4 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/DetailViewTaxMode.tpl @@ -0,0 +1,4 @@ +{**} +{strip} + {vtranslate($FIELD->getDisplayValue($SUP_VALUE), $SUPMODULE)} +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewComment.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewComment.tpl new file mode 100644 index 000000000000..7ab2ce6ad4e5 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewComment.tpl @@ -0,0 +1,8 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} + +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewCurrency.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewCurrency.tpl new file mode 100644 index 000000000000..6606f438a42e --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewCurrency.tpl @@ -0,0 +1,38 @@ +{**} +{strip} + {assign var=CURRENCIES value=Vtiger_Functions::getAllCurrency(true)} + {assign var=SELECTED_CURRENCY value=$SUP_VALUE} + {if $SELECTED_CURRENCY eq ''} + {assign var=USER_CURRENCY_ID value=$USER_MODEL->get('currency_id')} + {foreach item=CURRENCY from=$CURRENCIES} + {if $CURRENCY.id eq $USER_CURRENCY_ID} + {assign var=SELECTED_CURRENCY value=$CURRENCY.id} + {/if} + {/foreach} + {/if} + + +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewDiscount.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewDiscount.tpl new file mode 100644 index 000000000000..d327a3294d74 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewDiscount.tpl @@ -0,0 +1,15 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} +
    +
    + + {if $DISCOUNTS_CONFIG['discounts'][0] != ''} + + + {vtranslate('LBL_DISCOUNT', $SUPMODULE)} + + {/if} +
    +
    +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewDiscountMode.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewDiscountMode.tpl new file mode 100644 index 000000000000..2a7380456234 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewDiscountMode.tpl @@ -0,0 +1,7 @@ +{**} +{strip} + +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewGrossPrice.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewGrossPrice.tpl new file mode 100644 index 000000000000..bcf08b2f32a3 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewGrossPrice.tpl @@ -0,0 +1,6 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} + + {$FIELD->getEditValue($VALUE)} +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewMargin.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewMargin.tpl new file mode 100644 index 000000000000..bf74711ee292 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewMargin.tpl @@ -0,0 +1,5 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} + +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewMarginP.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewMarginP.tpl new file mode 100644 index 000000000000..2b03eedc619a --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewMarginP.tpl @@ -0,0 +1,8 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} +
    + + % +
    +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewName.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewName.tpl new file mode 100644 index 000000000000..97b1a332843c --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewName.tpl @@ -0,0 +1,41 @@ +{**} +{strip} +
    + {assign var="FIELD_NAME" value={$FIELD->getColumnName()}|cat:$ROW_NO} + {assign var="FIELD_INFO" value=Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode(['mandatory'=>true]))} + {assign var="CRMEntity" value=CRMEntity::getInstance($REFERENCE_MODULE)} +
    + + get('displaytype') == 10}readonly="readonly"{/if} /> + + {assign var="displayId" value=$SUP_VALUE} + {if $FIELD->get('displaytype') != 10} + + + + {/if} + + get('displaytype') != 10}placeholder="{vtranslate('LBL_TYPE_SEARCH',$SUPMODULE)}"{/if} + {if $FIELD->get('displaytype') == 10}readonly="readonly"{/if}/> + + {if $FIELD->get('displaytype') != 10} + + + + {/if} + + {assign var=REFERENCE_MODULE_MODEL value=Vtiger_Module_Model::getInstance($REFERENCE_MODULE)} + {if $REFERENCE_MODULE_MODEL->isQuickCreateSupported() && $FIELD->get('displaytype') != 10} + + + + {/if} +
    +
    +
      +
    +
    +
    +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewNetPrice.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewNetPrice.tpl new file mode 100644 index 000000000000..7fa910152a90 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewNetPrice.tpl @@ -0,0 +1,6 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} + + {$FIELD->getEditValue($VALUE)} +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewPurchase.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewPurchase.tpl new file mode 100644 index 000000000000..a060bfe0583a --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewPurchase.tpl @@ -0,0 +1,7 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} + +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewQuantity.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewQuantity.tpl new file mode 100644 index 000000000000..06dd7bdfe097 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewQuantity.tpl @@ -0,0 +1,5 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} + get('displaytype') == 10}readonly="readonly"{/if}/> +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewReference.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewReference.tpl new file mode 100644 index 000000000000..ea4fce9ff0b5 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewReference.tpl @@ -0,0 +1,33 @@ +{**} +{strip} + {assign var="REFERENCE_MODULE" value=$FIELD->get('params')} + {assign var="FIELD_NAME" value={$FIELD->getColumnName()}|cat:$ROW_NO} + {assign var="FIELD_INFO" value=Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode(['mandatory'=>true]))} + +
    + + get('displaytype') == 10}readonly="readonly"{/if} /> + {assign var="displayId" value=$SUP_VALUE} + {if $FIELD->get('displaytype') != 10} + + + + {/if} + get('displaytype') != 10}placeholder="{vtranslate('LBL_TYPE_SEARCH',$SUPMODULE)}"{/if} + {if $FIELD->get('displaytype') == 10}readonly="readonly"{/if}/> + {if $FIELD->get('displaytype') != 10} + + + + {/if} + {assign var=REFERENCE_MODULE_MODEL value=Vtiger_Module_Model::getInstance($REFERENCE_MODULE)} + + {if $smarty.request.view eq 'Edit' && $REFERENCE_MODULE_MODEL->isQuickCreateSupported() && $FIELD->get('displaytype') != 10} + + + + {/if} +
    +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewTax.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewTax.tpl new file mode 100644 index 000000000000..d5453dbccdaf --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewTax.tpl @@ -0,0 +1,13 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} +
    + + {if $TAXS_CONFIG['taxs'][0] != ''} + + + {vtranslate('LBL_TAX', $SUPMODULE)} + + {/if} +
    +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewTaxMode.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewTaxMode.tpl new file mode 100644 index 000000000000..7bd99c8fa44a --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewTaxMode.tpl @@ -0,0 +1,7 @@ +{**} +{strip} + +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewTotalPrice.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewTotalPrice.tpl new file mode 100644 index 000000000000..37c50e4c0320 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewTotalPrice.tpl @@ -0,0 +1,6 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} + + {$FIELD->getEditValue($VALUE)} +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewUnitPrice.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewUnitPrice.tpl new file mode 100644 index 000000000000..eae8cc666a1d --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewUnitPrice.tpl @@ -0,0 +1,16 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} +
    + + + {assign var=PRICEBOOK_MODULE_MODEL value=Vtiger_Module_Model::getInstance('PriceBooks')} + {if in_array('3',$DISCOUNTS_CONFIG['discounts']) && $PRICEBOOK_MODULE_MODEL->isPermitted('DetailView')} + + {vtranslate('PriceBooks',$SUPMODULE)} + + {/if} +
    +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewValue.tpl b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewValue.tpl new file mode 100644 index 000000000000..ffb123e36404 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/innventoryFields/EditViewValue.tpl @@ -0,0 +1,10 @@ +{**} +{strip} + {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} + {assign var="INPUT_TYPE" value='text'} + {if $FIELD->get('displaytype') == 10} + {assign var="INPUT_TYPE" value='hidden'} + {$SUP_VALUE} + {/if} + +{/strip} diff --git a/layouts/vlayout/skins/twilight/style.css b/layouts/vlayout/skins/twilight/style.css index c7967f6762dc..c6a409d93080 100644 --- a/layouts/vlayout/skins/twilight/style.css +++ b/layouts/vlayout/skins/twilight/style.css @@ -3469,35 +3469,35 @@ span[name=existingImages] img{ .individualTaxContainer { text-align: left !important; } -.suppliesItemsTable .input-group{ +.inventoryItems .input-group{ max-width: 200px; } -.suppliesItemsTable .rowName .input-group{ +.inventoryItems .rowName .input-group{ max-width: 400px; } -.suppliesItemsTable td, -.suppliesItemsTable th{ +.inventoryItems td, +.inventoryItems th{ border: 1px solid #ddd; } -.suppliesItemsTable tfoot td.hideTd{ +.inventoryItems tfoot td.hideTd{ border: 0; background: #fafafb; } -.suppliesSummaryContainer .panel-body,.suppliesSummaryContainer .panel-footer{ +.inventorySummaryContainer .panel-body,.inventorySummaryContainer .panel-footer{ padding: 0; } -.suppliesSummaryContainer .panel-body .form-group, .suppliesSummaryContainer .panel-footer .form-group{ +.inventorySummaryContainer .panel-body .form-group, .inventorySummaryContainer .panel-footer .form-group{ margin: 0; } -.suppliesSummaryContainer .input-group .form-control{ +.inventorySummaryContainer .input-group .form-control{ background-color: #F5F5F5; } -.suppliesSummaryContainer .panel-body .percent{ +.inventorySummaryContainer .panel-body .percent{ min-width: 55px; } -.suppliesItemsTable tfoot{ +.inventoryItems tfoot{ font-weight: 800; } -.suppliesSummaryContainer img{ +.inventorySummaryContainer img{ max-width: 15px; } diff --git a/layouts/vlayout/skins/twilight/style.min.css b/layouts/vlayout/skins/twilight/style.min.css index 0ae67182f576..0eec67907879 100644 --- a/layouts/vlayout/skins/twilight/style.min.css +++ b/layouts/vlayout/skins/twilight/style.min.css @@ -1,2 +1,2 @@ -@media print{.noprint{display:none}}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}.hide-text{overflow:hidden;text-indent:100%;white-space:nowrap}.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot');src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.woff') format('woff'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.ttf') format('truetype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg')}body{width:100%;font-family:'Open Sans','Lucida Grande',Verdana,Tahoma,Arial,sans-serif!important;font-size:12px!important;background:#fff;color:#2b2b2b}hr{margin:8px 0;border-bottom:1px solid #ddd}.navbar.navbar-fixed-top .navbar-collapse{padding-right:15px!important}.navbar-nav.navbar-left .open ul{display:none}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background:0}.navbar-default .navbar-nav>li:hover{background:#e7e7e7}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background:0}.navbar-inverse .navbar-nav>li:hover{background:#080808}.navbar-nav .hovernav:hover>.dropdown-menu{display:block}#collapsedMenu{display:block;position:relative}#collapsedMenu a{color:#fff}#collapsedMenu .dropdown-menu .shortDropdown{max-height:300px;overflow-y:scroll;padding:10px;position:relative;z-index:10000;-webkit-overflow-scrolling:touch;-webkit-transform:translateZ(0)}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames{margin-bottom:2px}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a{font-size:.9em;padding:3%!important;color:#2b2b2b!important}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a:hover{text-decoration:none;background:#404952;color:#fff!important}.moreMenus{width:52em;padding:24%;left:0;border-radius:2px}.moreMenus.leftAligned:after,.moreMenus.leftAligned:before{left:21px!important}.moreMenus strong{font-size:1.1em;color:#2b2b2b}.moreMenus:after,.moreMenus:before{left:292px!important}.announcement{// display:none;background:#fafad2;// padding:2px 0;// border-bottom:1px solid #ccc;// max-height:24px;// width:100%}.announcement .marStyle{// width:100%}#headerLinks{padding:10px 0 7px;min-width:240px;float:right!important}#headerLinks .headerLinksContainer{margin-right:10px}#headerLinks .headerLinksContainer>[class*="span"]{float:left;margin-left:15px}#headerLinks .headerLinksContainer .dropdown.open .dropdown-toggle{background:transparent}#headerLinks .headerLinksContainer ul.dropdown-menu{top:30px}#headerLinks .headerLinksContainer ul.dropdown-menu:after,#headerLinks .headerLinksContainer ul.dropdown-menu:before{right:15px;left:auto}#headerLinks .headerLinksContainer>span a img,#headerLinks .headerLinksContainer>span a.userName{color:#fff;cursor:pointer;text-decoration:none!important}#headerLinks .headerLinksContainer>span a img .caret,#headerLinks .headerLinksContainer>span a.userName .caret{border-top:4px solid #fff}.dropdown-menu.pull-right{right:0;left:auto;cursor:pointer}.themeMenuContainer{min-width:110px;width:110px;left:-84px!important;padding:10px 0}.themeMenuContainer .themeMenu{padding:0 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement{cursor:pointer;margin:5px;height:20px;width:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement:hover{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}.themeMenuContainer .themeMenu .themeSelected{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}@media screen and (min-width:1161px){#mediumNav,#shortNav,#headerLinksCompact{display:none}#largeNav{margin-left:10px;margin-right:0}}@media screen and (max-width:1160px) and (min-width:960px){.companyLogo{width:100%}.customFilterMainSpan .select2-container{width:300px!important}*{zoom:1!important}}@media screen and (max-width:960px){.bodyContents{margin:0!important}#centerPanel{width:100%!important}.col-md-3#headerLinks{padding:5px 5px 0}.menuBar .col-md-9,.col-md-3#headerLinks{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-width:80px}.menuBar .col-md-9 .qCreate,.col-md-3#headerLinks .qCreate{display:inline-block;margin:0}.menuBar .col-md-9 .qCreate img,.col-md-3#headerLinks .qCreate img{margin-bottom:3px;margin-right:5px}.menuBar .col-md-9 .qCreate ul li.title,.col-md-3#headerLinks .qCreate ul li.title{padding:5px 0 0 15px}.menuBar .col-md-9 li.tabs:first-child>a,.col-md-3#headerLinks li.tabs:first-child>a{padding:10px 12px 9px}.customFilterMainSpan .select2-container{width:300px!important}#quickCreateModules{width:100%!important;padding:0!important}.CompactQC{max-height:300px;overflow-y:scroll;overflow-x:hidden}.CompactQC a:hover{text-decoration:none}}.commonActionsContainer .quickActions{height:3em}.commonActionsContainer .quickActions img{height:60%;margin:40% auto}.commonActionsContainer .quickActions #companyLogo-container img{height:98%;margin:0 auto}.commonActionsContainer .actionsContainer{background:#f3f3f3}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown{min-width:715px;top:28px;margin:0;padding-top:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a{padding:2px;border:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mainContainer{min-height:500px;margin-top:103px;background:#eeeff2;min-width:1200px}.mainContainer>.col-md-2{// padding:0 1.06383%;height:auto!important;// min-width:174px}.mainContainer .contentsDiv{min-height:500px;background:#fafafb;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;border-left:1px solid #e6e6e6;position:relative}.mainContainer #leftPanel{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.toggleButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;left:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-left:0;display:inline-block}.toggleButton .glyphicon-chevron-left{background-position:-434px -72px!important}.toggleButton .glyphicon-chevron-right{background-position:-460px -72px!important}.toggleRightPanelButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;right:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-right:0;display:inline-block}.quickLinksDiv{margin:10px 0}.quickLinksDiv p{font-size:1.2em;padding:3% 0 0 6%;height:40px;cursor:pointer;box-shadow:0 0 0 1px #ddd;border-top:1px solid #fff!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);position:relative;border-radius:2px}.quickLinksDiv p a{color:#2b2b2b}.quickLinksDiv p a:hover{text-decoration:none}.quickLinksDiv p.selectedQuickLink{background-color:#2a2f35;background-image:-moz-linear-gradient(top,#2a2f35,#2a2f35);background-image:-ms-linear-gradient(top,#2a2f35,#2a2f35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#2a2f35),to(#2a2f35));background-image:-webkit-linear-gradient(top,#2a2f35,#2a2f35);background-image:-o-linear-gradient(top,#2a2f35,#2a2f35);background-image:linear-gradient(top,#2a2f35,#2a2f35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2a2f35',endColorstr='#2a2f35',GradientType=0);border-color:#2a2f35 #2a2f35 #08090a;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);background-image:none;position:relative;border:1px solid #fff;box-shadow:4px 0 3px -4px #000 inset}.quickLinksDiv p.selectedQuickLink a{color:#fff}.quickLinksDiv p.selectedQuickLink a:after{border-bottom:19px solid rgba(0,0,0,0);border-left:10px solid #2a2f35;border-top:19px solid rgba(0,0,0,0);content:" ";display:inline-block;position:absolute;left:100%;top:0}.quickWidgetContainer li a{overflow:hidden;white-space:normal;padding:5px;margin:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.quickWidgetContainer .quickWidget{margin-bottom:10px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.sidebarTitleBlock{padding:12px 0}.sidebarTitleBlock a{color:#373737!important}.sidebarTitleBlock a:hover{text-decoration:none}#selectAllMsgDiv,#deSelectAllMsgDiv{display:none;background-color:#fafad2;padding:.01%;text-align:center}.blockUI form,#globalmodal form{margin:0}.dashboardHeading h2{padding-bottom:8px}.dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardHeading .dropdown-menu{left:-70px;right:0}.dashboardContainer{padding:0}.dashboardContainer .dashboardHeading{padding:10px 0 0;background:#f5f5f5}.dashboardContainer .dashboardHeading h2{padding:0 0 8px 20px}.dashboardContainer .dashboardHeading .btn-toolbar{padding:3px 20px 0 0}.dashboardContainer .dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardContainer .dashboardHeading .dropdown-menu{left:-82px}.widgetsList{max-height:400px;overflow-y:auto;overflow-x:hidden}.widgetsList li{display:block}.widgetsList li a{white-space:normal;word-wrap:break-word}.dashboard_notebookWidget_view .row{margin-bottom:5px}.gridster{margin-left:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.gridster ul{width:auto;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:460px}.gridster ul{list-style:none}.gridster ul li.dashboardWidget{background:#fff;border-radius:1px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.gridster ul li.dashboardWidget .dashboardWidgetHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd;color:#444;cursor:move;padding:5px}.gridster ul li.dashboardWidget .dashboardWidgetHeader table{height:28px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .dashboardTitle{text-align:left;padding-left:10px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .widgeticons{opacity:.5;padding-right:6px}.gridster ul li.dashboardWidget .filterContainer{position:absolute;border:1px solid #ddd;background:#fff;margin-left:-7px;margin-right:3px;margin-top:4px;padding:8px 0;border-radius:0 0 5px 5px;box-shadow:0 5px 8px -5px #888}.gridster ul li.dashboardWidget .filterContainer div span{margin-top:6px}.gridster ul li.dashboardWidget .filterContainer .col-md-5{margin-top:3px}.gridster ul li.dashboardWidget .dashboardWidgetContent{padding:10px 0;line-height:20px}.gridster ul li.dashboardWidget .dashboardWidgetContent .dashboard_notebookWidget_viewarea{height:200px}.gridster ul li.dashboardWidget .widgeticons{min-width:50px;height:30px;margin-right:30px}.gridster ul li.dashboardWidget .widgeticons a{cursor:pointer;text-decoration:none}.gridster ul .widgetChartContainer{margin-left:10px}.listViewPageDiv{margin:11px 0}.customFilterMainSpan{width:100%}.customFilterMainSpan .select2-container{width:95%!important}.select2-container .select2-choice{border-radius:2px;background:#fff;border-color:#ddd;font-size:14px;letter-spacing:.01em;color:#2b2b2b}.select2-container .select2-choice div{border-radius:0;border-left:0;background:#fff}.select2-drop{border-color:#ddd}.select2-dropdown ul.filterActions{list-style:none!important;padding-left:15px}.select2-dropdown ul.filterActions li{cursor:pointer}.ui-autocomplete .ui-menu-item #ui-active-menuitem{background:#404952;border-radius:0}li.ui-timepicker-selected,.ui-timepicker-list li:hover,.ui-timepicker-list:hover .ui-timepicker-selected:hover{background:#404952}#relatedTabOrder .select2-input{min-width:200px}.alphabetSorting .alphabetSearch a{vertical-align:middle;display:inline-block;margin-bottom:2px}.alphabetSorting .alphabetSearch:hover{background:#eeeff2}.listViewActions .settingsIcon{display:inline-block;margin-left:5px}.listViewActions>.btn-group{min-width:105px}#listViewPageJumpDropDown,#relatedListPageJumpDropDown{left:-60px}.pageNumbers{display:inline-block;margin-right:5px;margin-top:6px;vertical-align:top}.pageNumbers .totalNumberOfRecords{margin:0 5px}.contents-topscroll,#reportDetails{overflow-x:auto!important;overflow-y:visible}.contents-bottomscroll{overflow-x:auto!important}.bottomscroll-div,.topscroll-div{display:table;min-width:100%}.listViewLoadingImageBlock{background:0;border-radius:0;box-shadow:none;text-align:center}.detailViewContainer{padding:0 20px}.userPreferences .contents{padding-left:0!important}.userPreferences .details{border-right:0!important}.detailViewTitle{padding:1% 0 0 1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .recordLabel{font-size:16px;font-weight:bold}.detailViewTitle .detailViewButtoncontainer{margin-top:8px}.detailViewTitle .detailViewPagingButton{margin-top:8px;padding-right:10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .btn-toolbar{margin:0}.detailview-table th,.detailview-table td{vertical-align:middle}.detailview-table th label,.detailview-table td label{margin-bottom:3px}.detailViewInfo{box-shadow:0 -4px 4px -4px #959595;margin-top:5px}.detailViewInfo .details{// min-height:600px;padding-right:1.5%;border-right:4px solid #404952;padding-bottom:10px;padding-top:10px}.detailViewInfo .related .nav-pills .active>a,.detailViewInfo .related .nav-pills .active>a:hover{background:#404952;border-radius:1px;margin-top:0;margin-bottom:2px}.fieldLabel{width:20%;background:#f7f7f9}.fieldLabel label.marginRight10px{text-align:right}.summaryView{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.summaryView .summary-table tr.summaryViewEntries:last-child .fieldValue,.summaryView .summary-table tr.summaryViewEntries:last-child .fieldLabel{border-bottom:1px solid #ddd}.summaryView .summaryViewEntries .fieldLabel{vertical-align:top;padding:5px 0 5px 5%;border-top:1px solid #ddd;border-right:1px solid #ddd}.summaryView .summaryViewEntries .fieldValue{vertical-align:top;padding:5px 0 5px 5px;border-top:1px solid #ddd}.summaryView .summaryViewEntries:hover .summaryViewEdit{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryView .summaryViewEntries .summaryViewEdit{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryView .toggleViewByMode{margin:8px 0;padding-right:0}.summaryView .toggleViewByMode .changeDetailViewMode{white-space:normal!important}.summaryWidgetContainer{border-radius:2px;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border:1px solid #eaeaea;background:#fff;margin-bottom:10px;padding:15px}.commentContainer .commentTitle{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;margin-bottom:10px}.commentContainer .commentTitle textarea{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordDetails .squeezedWell{padding:3% 0;min-height:105px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordEditView .contentHeader{padding:.5% 0 1% 0}.recordEditView .table .fieldLabel,.recordEditView .table .fieldValue{vertical-align:middle}.recordEditView .table tbody tr:hover td,.recordEditView .table tbody tr:hover th{background:#f7f7f9}.commentContainer{border-radius:2px}.commentContainer hr{margin:0!important}.commentContainer .addCommentBlock .commentsControls{display:inline-block}.commentContainer .commentsList>.liStyleNone>.commentDetails .commentDiv{width:100%}.commentContainer .commentDetails{background:#fff;border:1px solid #ddd;margin-bottom:5px;border-radius:2px;padding:10px 10px 5px;display:inline-block;min-width:354px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentContainer .commentorInfo p{margin-bottom:0}.commentContainer .addCommentBlock{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border:1px solid #ddd;padding:12px 12px 5px;min-height:115px;margin-top:15px;display:block}.commentContainer .addCommentBlock .commentcontent{padding:8px!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;resize:none}.commentContainer .commentInfoContent{padding:1px 0;word-wrap:break-word}.commentTitle .col-md-1{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentTitle .col-md-1 img{width:32px;height:32px}.commentsList>ul{margin-left:0}.singleComment .editedStatus{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:5px 0 5px 32px}.singleComment .editedStatus p{margin-bottom:0}.singleComment .commentActionsDiv{display:none}.singleComment .commentActionsDiv p{margin-bottom:0}.singleComment:hover .commentActionsDiv{display:block;margin-bottom:3px}.recentComments{margin:0;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recentComments .commentDiv{min-width:100%}.recentComments .addCommentBlock{border:0;margin-top:0;display:block}.recentComments .commentDetails{display:block}.singleComment:hover .commentActions .replyComment{display:inline-block}.commentActionsContainer a:hover{text-decoration:none}.commentActionsContainer .editStatus{padding:5px 2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentActionsContainer .editStatus p{margin-bottom:0}.table{background:#fff}.table-bordered{border-radius:1px;margin-bottom:0}.table-bordered th{border-top:1px solid #fff!important}.table th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;color:#444}.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td,.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td{border-left:0;border-right:0}.listViewEntriesTable tbody tr td:first-child{border-left:0 none}.equalSplit td:nth-child(odd){width:20%}.equalSplit td:nth-child(even){width:30%}td.fieldValue input,td.fieldValue .input-group{margin-bottom:0}.actionImage,.actionImages{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.listViewHeaders a{color:#444}.listViewEntriesDiv .listViewHeaders th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd}.listViewEntriesDiv,.listViewEntriesDiv td{overflow:visible}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues{color:#444}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues:hover{text-decoration:none}.listViewEntriesTable td.listViewEntryValue,.listViewEntries td{vertical-align:middle;cursor:pointer;overflow:visible;padding:5px}.listViewEntriesTable td.listViewEntryValue:hover .actionImages,.listViewEntries td:hover .actionImages,.listViewEntriesTable td.listViewEntryValue:hover .actions,.listViewEntries td:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryViewEntries .summaryViewEdit,.activityStatus .editStatus,.activityDescription .editDescription,.addedCalendars .actionImage{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryViewEntries:hover .fieldValue .summaryViewEdit,.activityStatus:hover .editStatus,.activityDescription:hover .editDescription,.addedCalendars:hover .actionImage{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewEntriesTable tr:hover td .actions .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewBasicAction.dropdown-menu{width:100%}.listViewBasicAction.dropdown-menu input{border-radius:2px;height:24px;margin-bottom:0;margin-top:-2px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.emptyRecordsDiv{width:100%;border:1px solid #ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.emptyRecordsDiv td{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.CustomFilterViewTitle{padding-top:1%}#CustomView .filterActions{padding-bottom:20px;overflow:hidden}.filterConditionsDiv{padding-bottom:0}.conditionGroup .header{margin-bottom:20px;font-size:1.2em}.conditionGroup .contents .conditionRow{margin-bottom:10px}.conditionGroup .contents .conditionRow select,.conditionGroup .contents .conditionRow input{width:90%}.conditionGroup .contents .conditionRow .chzn-results li{line-height:20px}.conditionGroup .deleteCondition{vertical-align:bottom}.searchUIBasic{border-collapse:separate!important;border-spacing:10px!important;margin:0 10%}.searchUIBasic .importContents{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.searchUIBasic .listRow .listViewHeaders>td{color:#404952}.searchUIBasic .listRow .defaultInputTextContainer{max-width:87%!important;margin-bottom:0!important}#lineItemTab.table tr:first-child:hover th ~ td{background-color:#f3f3f4;background-image:-moz-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-ms-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f3f3f4),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-o-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:linear-gradient(top,#f3f3f4,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f4',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}#lineItemTab.table tr:nth-child(2):hover td{background:0}.lineItemTable tr td{width:0}.lineItemTable tr td div.finalDiscountUI,.lineItemTable tr td div.discountUI,.lineItemTable tr td div#shipping_handling_div,.lineItemTable tr td div.taxUI,.lineItemTable tr td div.finalTaxUI{border:2px solid #c4c4c4;border-radius:2px}.lineItemTable tr td div.finalDiscountUI table tr td,.lineItemTable tr td div.discountUI table tr td,.lineItemTable tr td div#shipping_handling_div table tr td,.lineItemTable tr td div.taxUI table tr td,.lineItemTable tr td div.finalTaxUI table tr td,.lineItemTable tr td div.finalDiscountUI table tr th,.lineItemTable tr td div.discountUI table tr th,.lineItemTable tr td div#shipping_handling_div table tr th,.lineItemTable tr td div.taxUI table tr th,.lineItemTable tr td div.finalTaxUI table tr th{border-left:0}.lineItemTable tr:hover td{width:0}.lineItemTable tr:hover td div.finalDiscountUI table tr td{background:none!important}.lineItemTable tr:hover td div.discountUI table tr td{background:none!important}.lineItemTable tr:hover td div#shipping_handling_div table tr td{background:none!important}.lineItemTable tr:hover td span.taxDivContainer div table tr td{background:none!important}.lineItemTable tr:hover td div.finalTaxUI table tr td{background:none!important}.lineItemResult{width:70.5%!important}.lineItemResult a:hover{color:#404952}.lineItemInputBox{width:45%;float:right;text-align:right}.discountUI,.taxUI,.finalDiscountUI,.finalTaxUI,#shipping_handling_div{position:absolute;left:46%;width:30%;z-index:500;box-shadow:1px 0 7px #ddd;border-radius:6px}.discountUI table.table,.taxUI table.table,.finalDiscountUI table.table,.finalTaxUI table.table,#shipping_handling_div table.table{margin-bottom:0}.discountUI .table tbody tr:first-child th:first-child,.taxUI .table tbody tr:first-child th:first-child,.finalDiscountUI .table tbody tr:first-child th:first-child,.finalTaxUI .table tbody tr:first-child th:first-child,#shipping_handling_div .table tbody tr:first-child th:first-child{border-radius:4px 0 0 0!important}.discountUI .table tbody tr:first-child th:last-child,.taxUI .table tbody tr:first-child th:last-child,.finalDiscountUI .table tbody tr:first-child th:last-child,.finalTaxUI .table tbody tr:first-child th:last-child,#shipping_handling_div .table tbody tr:first-child th:last-child{border-radius:0 4px 0 0!important}.LineItemDirectPriceReduction{width:65%!important}th.htColHeader,.handsontable thead th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd;padding:6px 2px}.contentHeader{padding:15px;padding-left:5px;line-height:20px}.contentsDiv>div{padding:0 20px}#settingsQuickWidgetContainer .widgetContainer.accordion-body{border-bottom:none!important;border-bottom:3px solid #ddd}#settingsQuickWidgetContainer .widgetContainer.accordion-body>div:hover{background:#eeeff2}#settingsShortCutsContainer{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:1% 3%}#settingsShortCutsContainer .moduleBlock{min-height:60px}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin{display:inline-block;opacity:.4}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin:hover{opacity:.8}.settingsIndexPage .settingsSummary{text-align:center;margin-top:10px}.settingsIndexPage .settingsSummary a{display:inline-block;background:#f3f3f4;color:#444;border-radius:2px;min-width:200px;padding:20px 0 10px;border:1px solid #ddd}.settingsIndexPage .settingsSummary a .summaryText{display:inline-block;margin-top:20px;font-size:15px}.settingsIndexPage .settingsSummary a:hover .summaryText,.settingsIndexPage .settingsSummary a:hover .summaryCount{color:#404952}.settingsIndexPage .moduleBlock h5{font-size:1.2em;margin-bottom:5px}.settingsIndexPage .moduleBlock:hover{background:#f3f3f4}#userPageHeader{padding:8px 0 0}#userPageHeader #userHeading h3{margin-top:10px}.treeView li{border-left:4px solid #ddd;list-style:none;padding-top:15px}.treeView li .toolbar-handle{margin-left:10px;position:relative}.treeView li .toolbar-handle .btn{margin:0}.treeView li .toolbar-handle a:before{background:none repeat scroll 0 0 #ddd;content:" ";display:inline-block;height:4px;left:-10px;position:absolute;top:12px;width:10px}.treeView .btn{margin-bottom:10px}.profilesEditView tr.blockHeader th{text-align:center}.profilesEditView tr.blockHeader th:first-child{text-align:left}.profilesEditView input{margin-right:5px}.profilesEditView tr td.row table.table{border-left:none;margin-bottom:20px}.profilesEditView tr:hover td.row{background:0}.profilesEditView tr:hover td.row table.table tr td{background:0}.profilesEditView tr:hover td.row table.table tr:hover td{background:0}.profilesEditView tr:hover td.row table.table td{background:#f3f3f4}#s2id_memberList li>div,.groupMembersColors li>div{margin-left:10px}#s2id_memberList .Users,.groupMembersColors .Users{background-color:#f99984!important;padding:5px;margin-bottom:2px;background-image:none}#s2id_memberList .Groups,.groupMembersColors .Groups{background-color:#acd5ff!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .Roles,.groupMembersColors .Roles{background-color:#ffec98!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .RoleAndSubordinates,.groupMembersColors .RoleAndSubordinates{background-color:#c4dea2!important;background-image:none;padding:5px;margin-bottom:2px}.collectiveGroupMembers{border:1px solid #ddd;border-top:0}.collectiveGroupMembers ul{padding:0;margin:0}.collectiveGroupMembers ul li{padding:4px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.collectiveGroupMembers ul li a{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;margin:0}.collectiveGroupMembers ul li.groupLabel{background-color:#f3f3f4;border-bottom:1px solid #ddd;border-top:1px solid #ddd;padding:10px 5px;margin:0;color:#444}.mini-slider-control{width:50px}.mini-slider-control+div{margin-left:15px}.mini-slider-control .ui-slider-handle{border:0;border-radius:50%;height:16px;top:-2px;width:16px;cursor:pointer}.mini-slider-control .ui-slider-handle:focus{outline:0}.ui-widget-content{border-radius:6px;border-color:#fff;box-shadow:0 0 3px -1px inset;margin-top:2px;margin-left:5px;height:12px}.ui-slider-disabled{opacity:.5;border-color:#ddd;box-shadow:none;cursor:not-allowed}.ui-slider-disabled .ui-slider-handle{cursor:not-allowed}.ui-slider-disabled+div{opacity:.5;cursor:not-allowed}.mini-slider-control[data-value="0"] .ui-slider-handle{background:#7d7e7d;background:-moz-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#7d7e7d),color-stop(100%,#0e0e0e));background:-webkit-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-o-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-ms-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:linear-gradient(to bottom,#7d7e7d 0,#0e0e0e 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7d7e7d',endColorstr='#0e0e0e',GradientType=0)}.mini-slider-control[data-value="1"] .ui-slider-handle{background:#ffb76b;background:-moz-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ffb76b),color-stop(0%,#ffa73d),color-stop(49%,#ff7c00),color-stop(100%,#ff7f04));background:-webkit-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-o-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-ms-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:linear-gradient(to bottom,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffb76b',endColorstr='#ff7f04',GradientType=0)}.mini-slider-control[data-value="2"] .ui-slider-handle{background:#bfd255;background:-moz-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#bfd255),color-stop(79%,#8eb92a),color-stop(100%,#72aa00),color-stop(100%,#9ecb2d));background:-webkit-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-o-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-ms-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:linear-gradient(to bottom,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bfd255',endColorstr='#9ecb2d',GradientType=0)}#moduleManagerContents{padding-bottom:10px}#moduleManagerContents .moduleManagerBlock .btn-group.open .dropdown-menu{left:-144%}#moduleManagerContents .modulesTable td{width:50%}#importModules .contents .row{margin-bottom:2.2%}.extensionWidgetContainer{background-color:#fff;border:1px solid #ddd;min-height:200px;padding:2%;background:#fafafa;box-shadow:0 0 10px -4px #777}.extensionWidgetContainer .extension_contents{margin-top:2%;background:#fff;padding:10px;box-sizing:border-box;max-height:160px}.extension_contents:hover{border-radius:4px}.thumbnailImage{height:130px;width:130px;float:right}.extensionWidgetContainer .extension_contents .slimScrollDiv{padding-right:10px}.extensionWidgetContainer .extension_header .font-x-x-large{font-size:1.5em;padding-left:3px;font-weight:bold;color:#404952}.extensionWidgetContainer .extensionDescription{line-height:20px}.extensionWidgetContainer .extensionInfo{padding-top:5px}.extensionWidgetContainer .extensionInfo .rating,.extensionDetails .rating{vertical-align:middle;margin-top:2px;display:inline-block}.extensionDetails .authorInfo{margin:3px 0}.extensionDetails .extensionDetailActions{padding:15px 0}.extensionWidgetContainer .tab-pane .bx-wrapper .imageSlider{margin:0}.sliderImage{width:90%;height:360px}.opacity .actions{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.opacity:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.sharingAccessDetails{margin-bottom:30px}.sharingAccessDetails td,.sharingAccessDetails th{text-align:center;vertical-align:middle!important}.sharingAccessDetails tr td:first-child,.sharingAccessDetails tr th:first-child{text-align:left}.sharingAccessDetails td.row>div{display:block}.sharingAccessDetails .customRuleContainer:hover{background:0}.sharingAccessDetails hr{border-bottom:1px solid #bcbcbc}.sharingAccessDetails .title{padding:1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.sharingAccessDetails .title .rulehead{padding-top:5px}.sharingAccessDetails .customRuleEntries:hover .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.layoutContent{border-top:4px solid #404952}.layoutContent #moduleBlocks .editFieldsTable{margin-bottom:20px}.layoutContent #moduleBlocks .editFieldsTable .fieldLabel{background:0}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockLabel{padding-top:13px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group{margin-top:5px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group .dropdown-menu{left:-100%}.layoutContent .relatedTabModulesList{padding:2% 1%}.fieldDetailsForm .search-choice-close{padding:0}.border1px{border:1px solid #ddd}.blockFieldsList .opacity{margin-left:.5%!important}.blockFieldsList .opacity .dropdown-menu a{padding:0!important}.blockFieldsList .opacity a.dropdown-toggle.editFieldDetails{box-shadow:none}.blockFieldsList .editFields .dropdown-menu{z-index:1000003;padding:0;left:-215px;position:absolute}.blockFieldsList .editFieldsWidget .dropdown-menu{z-index:1000003;padding:0;left:-315px;position:absolute}.blockFieldsList .editFields .dropdown-menu .modal-header{border-width:0;border-bottom-width:1px}.blockFieldsList .editFields .dropdown-menu .modal-header .cancel{padding-right:0;font-weight:bold}.blockFieldsList .editFields:hover{background:#f3f3f4!important}#modulePickListValuesContainer .layoutContent{padding-left:2%}#modulePickListValuesContainer .layoutContent .selectedCell,#modulePickListValuesContainer .layoutContent .selectedListItem{background:#a5afb9;white-space:nowrap}#modulePickListValuesContainer .layoutContent .pickListValue{cursor:pointer}.nonEditableValuesDiv .nonEditablePicklistValues{margin-left:0}.nonEditableValuesDiv .nonEditablePicklistValues li{padding:3px 15px;margin-bottom:2px;background:#e0f2ff}.popover{z-index:1000023!important}.popover-content .fieldLabel{width:35%;white-space:normal}#dependencyGraph .tableHeading{text-align:center;padding-top:30px;font-size:1.2em;font-weight:bold}#dependencyGraph .depandencyTable{border:1px solid #ddd;background:#f3f3f4}#dependencyGraph .depandencyTable .blockHeader{border-bottom:1px solid #ddd}#dependencyGraph .depandencyTable .picklistValueMapping{border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping{text-align:center;border-left:1px solid #ddd;border-right:1px solid #ddd;background:#fff}#dependencyGraph .dependencyMapping .mCSB_container{margin-bottom:16px!important}#dependencyGraph .dependencyMapping .pickListDependencyTable{border:0}#dependencyGraph .dependencyMapping .pickListDependencyTable .blockHeader th{background:#f3f3f4;border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping .pickListDependencyTable .selectedCell{background:#a5afb9}.webformFieldInfo{margin-bottom:250px}.targetFieldsTableContainer input[type="text"]{min-width:100px}#customRecordNumbering.table thead th{vertical-align:middle}.addMailBoxBlock{margin-left:83px;padding:0!important;font-size:12px}.addMailBoxStep{background:#fff;padding:30px 0;border:1px solid #ddd;border-radius:1px;min-height:170px}.mailConveterDesc{height:350px;width:96%;border:1.5px solid;border-radius:2px;border-color:#ddd;font-size:11pt;margin-top:55px;margin-left:20px;background:#fff}#mailBoxLabel{margin-top:15px;margin-left:-18px;font-size:12pt;width:75px}.mailBoxDropdownWrapper{height:49px;width:70%;background:url('../images/mailbox-icon.png') no-repeat 5px 5px;overflow:hidden;border:1px solid #ddd}.mailBoxDropdown{background:transparent url('../images/downArrowBlue.png') no-repeat 236px 13px;width:110%;height:50px;font-size:14pt;color:#0065a6;padding:10px 55px;padding-right:0}#mailConverterDragIcon{margin-top:12px}#mailConverterBody{padding-top:20px;margin-left:0}.ruleHead{padding:6px 0;background:#d8d8dc}.mailConverterRuleBlock{font-size:14px;line-height:30px;border:1.5px solid;border-color:#ddd}.mailConverterRuleLegend{font-size:14px;color:#0065a6;margin-bottom:10px;background:#f3f3f4}#mailConverterStats{font-size:10pt;margin-top:5px;margin-left:-10px}.addMailBoxBlock{border-color:#ddd;margin-left:83px;margin-top:20px;padding-top:30px;padding-left:200px;padding-bottom:20px;padding-right:30px;font-size:11pt}.taskTypeUi>.row{margin:10px 0}#taskListContainer .listViewEntriesTable tr td:last-child{border-left:1px solid #ddd}#workflow_step2>.row{padding:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:400px}#open_email_con .detailViewTitle{padding:0}#open_email_con .detailViewTitle .detailViewPagingButton{margin-top:0;padding-right:0}#foldersList .list-group{padding-right:0}.massEditTable th+th,.massEditTable td+td,.massEditTable th+td,.massEditTable td+th{border-left:0}.nav.massEditTabs{margin-bottom:0;border-bottom:0}.nav.massEditTabs li.active a{background:#404952;color:#fff;margin-left:10px}.nav.massEditTabs li a:hover{border-bottom:1px solid #404952}.massEditContent{border-top:3px solid #404952}.calendarSettingsContainer{width:700px}.calendarSettingsContainer .control-label{width:26%}#calendarSettings{margin:1px 0 3px}.calendarMassEdit{min-width:400px}.fc-state-default .fc-button-effect{top:100%!important}.fc-event-style1,.fc-event-style1 .fc-event-skin{background:#17309a;border-color:#17309a;font-weight:normal;text-shadow:none}.fc-event-style2,.fc-event-style2 .fc-event-skin{background:#3a87ad;border-color:#3a87ad;font-weight:normal;text-shadow:none}.fc-event-style3,.fc-event-style3 .fc-event-skin{background:#aa6705;border-color:#aa6705;font-weight:normal;text-shadow:none}.fc-event-style4,.fc-event-style4 .fc-event-skin{background:#953b39;border-color:#953b39;font-weight:normal;text-shadow:none}.fc-event-style5,.fc-event-style5 .fc-event-skin{background:#545252;border-color:#545252;font-weight:normal;text-shadow:none}.fc-event-style6,.fc-event-style6 .fc-event-skin{background:#87865d;border-color:#87865d;font-weight:normal;text-shadow:none}.fc-event-style7,.fc-event-style7 .fc-event-calendarMassEditskin{background:#c71585;border-color:#c71585;font-weight:normal;text-shadow:none}.fc-event-style8,.fc-event-style8 .fc-event-skin{background:#006400;border-color:#006400;font-weight:normal;text-shadow:none}#calendarview th{color:#000}.fc-agenda-divider+div{overflow-y:visible!important}.fc-button{display:inline-block;padding:6px .4em!important;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.fc-button:active .fc-button-inner{background:transparent}.fc-button:active .fc-button-inner .fc-button-content{color:#fff}.fc-button.fc-state-active .fc-button-inner .fc-button-content,.fc-button:active .fc-button-inner .fc-button-content{color:#000!important;background:transparent;background-image:none}.fc-header-title h2{font-size:15px;line-height:20px}.fc-widget-header th{padding:4px 0!important}.fc-widget-header{color:#666;background:#eee;border-color:#ccc}.fc-content{background:#fff;margin-top:15px}.fc-content td:hover{background:#f3f3f3}.btn:focus{outline:0}.reminderPostpone.btn-primary{background:#404952}.reminderPostpone.btn-primary:hover{background:#1e2327}.saveButton{margin-right:5px}.addCustomRule{float:right}.importMore{background:#fff}.lastImport{background:#fff}.undoImport{background:#da4f49}.close{border:0;background:none repeat scroll 0 0 transparent;border:0 none;cursor:pointer}.resetButton{margin-top:0!important}.vtGlyph{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("../images/vtGlyph.png");background-position:0 0;background-repeat:no-repeat;*margin-right:.3em}.vticon-pageJump{background-position:0 0}.vticon-call-inbound{background-position:-14px 0}.vticon-call-outbound{background-position:-28px 0}#massEdit .cancelLinkContainer{padding:5px 0;margin-left:.5em}.ui-pnotify{z-index:1000023}.feedback{z-index:10002}.feedback .handle{z-index:10003;display:block;position:fixed;bottom:50px;left:-30px;left:0\9;bottom:100px\9;background:#2c2c2c;color:white;padding:7px 15px;border:1px solid gray;text-decoration:none;outline:0;-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-o-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg);-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.00000000, M12=1.00000000, M21=-1.00000000, M22=0.00000000,sizingMethod='auto expand')";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0,M12=1,M21=-1,M22=0,sizingMethod='auto expand')}.feedback .handle:hover{text-decoration:none}.vtFooter{text-align:center}.vtFooter p{background:#404952;color:#fff;border-top:1px solid #ddd;padding:1px 0;font-size:.9em;margin-bottom:0}.vtFooter p a{color:#fff}.imageHolder{background:url('../images/loadback.png') repeat-y;background-position:center;padding:10px 0}.breadcrumbContainer{padding:2% 2% 0 2%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;height:auto}.breadcrumb{display:inline-block;height:auto;height:40px}.crumbs{height:40px;margin:0;padding:0 20px 0 0;display:inline-block;font-family:sans-serif}.crumbs li:after{content:'\0000a0';width:0;height:0;border-left:18px solid #ececec;border-top:20px solid transparent;border-bottom:20px solid transparent;display:inline-block;position:relative;top:-20px;left:18px;zoom:1}.crumbs li{height:0;border-top:20px solid #ececec;border-bottom:20px solid #ececec;border-left:20px solid transparent;display:inline-block;box-shadow:0 1px #ddd;margin-right:5px}.crumbs li a{display:inline-block;float:left;margin-top:-13px;font-size:14px;font-weight:bold;color:#666;text-decoration:none}.crumbs li.active{height:0;border-top:20px solid #404952;border-bottom:20px solid #404952;box-shadow:0 1px #404952}.crumbs li.active:after{border-left:18px solid #404952!important}.stepText{display:inline-block;white-space:nowrap;overflow:hidden;font-size:13px;vertical-align:bottom}.active .stepText,.active .stepNum{color:#fff}.stepNum{display:inline-block;padding:0 5px;overflow:hidden;font-size:20px;vertical-align:top;margin-top:5px}.greyStar{background-image:url("../images/stars.png");background-position:20px 20px;height:20px;width:20px;display:inline-block}.yellowStar{background-image:url('../images/stars.png');background-position:0 20px;width:20px;height:20px;display:inline-block}.blockUI{border-radius:2px!important;border:0!important}textarea.col-md-11{width:100%!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.popover .popover-inner{border-radius:2px;font-size:.8em;box-shadow:0}.popover .popover-inner .popover-title{color:#444;font-size:15px}.popover .popover-inner .close{color:#000!important;margin-top:3px;opacity:.5!important}.popover .popover-inner .close:hover{opacity:1!important}.popover .popover-inner td{padding:3px 5px;overflow-wrap:break-word}.popover .popover-inner .detailViewInfo{margin-top:0;box-shadow:0}.popover .popover-inner .detailViewInfo .fieldLabel label{font-size:1em}#findDuplicate>.control-group{margin-bottom:0;width:400px}#moveReports .modal-body{padding:20px 40px}#composeEmailContainer{padding:0 20px}#composeEmailContainer .MultiFile-wrap{display:inline-block}#composeEmailContainer .MultiFile-intercepted .ui-wrapper{min-height:400px}#transferOwnershipContainer .select2-container.select2-container-multi{max-width:220px}.fieldInfo.in{overflow:visible!important;height:auto!important}.moduleSelection{border-radius:2px 2px 0 0!important;border:1px solid #ddd!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);color:#444}.convertLeadModules{margin-bottom:2%;border:1px none}.moduleBlock{border-radius:0!important}.overflowVisible{overflow:visible!important}.convertLeadError{border:3px solid #999;background-color:#fff;width:55%;position:relative;z-index:10000000}.convertLeadError table td{border-bottom:1px solid #ccc;nowrap:nowrap;width:70%}.bootbox,.alert{z-index:1000023}.chzn-container{vertical-align:middle}.chzn-container .chzn-results li{margin-right:7px}.chzn-container .chzn-results .highlighted{background:#404952}.select2-results .select2-highlighted{background:#404952}.select2-result-label i{background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.ui-autocomplete-loading{background:url('../images/load.gif') no-repeat right center}.ui-autocomplete{height:auto!important;border-radius:1px!important}.dropdown-menu.pull-right:after,.dropdown-menu.pull-right:before{right:3px;left:auto;top:-5px;border-bottom-width:6px}span.wrapper a{color:#08c!important;font-size:15px!important;font-weight:bold}a{color:#353c44}a:hover{color:#1e2327;text-decoration:none;cursor:pointer}a:active,a:focus{outline:0}.well{border-radius:2px;padding:15px}.verticalBottomSpacing{margin-bottom:10px}.mergeTables{margin-bottom:0}.font-x-x-large{font-size:18px;line-height:28px}form{margin:0}.fc-state-default .fc-button-effect span{background:0}.dateField{width:183px}.form-horizontal [class^="icon-"],.form-horizontal [class*=" icon-"]{vertical-align:baseline}.timePicker{width:8.5em!important;z-index:1000029!important}.datepicker{z-index:1000029!important}.colorpicker{z-index:1029!important}.colorpicker input{width:30px!important}.colorpicker input[type="text"],.colorpicker input{color:#898989!important}.colorpicker_hex input{width:45px!important}.modal-body.accordion{margin-bottom:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}//.modal-open{// overflow:hidden;//}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.removeNoFileChosen{color:transparent!important}.modelContainer .modal-header{border-radius:2px 2px 0 0}.modelContainer form{border-radius:0 0 2px 2px}.hide{display:none}i{cursor:pointer;text-decoration:none!important}.marginbottomZero{margin-bottom:0!important}.marginLeftZero{margin-left:0!important}.marginRightZero{margin-right:0!important}.clearfix{clear:both!important}textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%}.textOverflowEllipsis{overflow:hidden;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;//width:9em}.margin0px{margin:0!important}.padding10{padding:10px;padding-bottom:0}.padding20{padding:20px}.pushDown{margin-top:5px}.boxSizingBorderBox{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.boxSizingContentBox{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.cursorPointer{cursor:pointer;text-decoration:none!important}.zeroOpacity{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.dullOpacity{opacity:.8;-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80)}.fullOpacity{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.redColor{color:red}.highlightBackgroundColor{background:#eeeff2}.contentsBackground{background:#fff;border:1px solid #ddd}.textAlignCenter{text-align:center}.textAlignRight{text-align:right}.alignMiddle{vertical-align:middle}.alignTop{vertical-align:top}.padding1per{padding:1%}.paddingTop20{padding-top:20px}.padding20px{padding:20px}.padding-bottom1per{padding-bottom:1%}.marginBottom10px{margin-bottom:10px}.displayInlineBlock{display:inline-block}.backgroundImageNone{background-image:none}.liStyleNone{list-style:none outside none}.fontBold{font-weight:bold!important}.livesupport_tab,#userfeedback{display:none!important}#reportDetails table tr td.summary{border-bottom:0;border-top:0}#portalDetailViewHttpError{padding-bottom:7px;margin-top:50px;color:red;text-align:center}.slidesjs-pagination{list-style:none}.slidesjs-pagination li a{display:block;width:13px;height:0;padding-top:13px;background-image:url('../images/pagination.png');background-position:0 0;float:left;overflow:hidden}.slidesjs-pagination li a.active,.slidesjs-pagination li a:hover.active{background-position:0 -13px}.extensionStorebtn{background:#f08c39;background-image:-webkit-linear-gradient(top,#f08c39,#e68b3c);background-image:-moz-linear-gradient(top,#f08c39,#e68b3c);background-image:-ms-linear-gradient(top,#f08c39,#e68b3c);background-image:-o-linear-gradient(top,#f08c39,#e68b3c);background-image:linear-gradient(to bottom,#f08c39,#e68b3c);-webkit-border-radius:2;-moz-border-radius:2;border-radius:2px;text-shadow:0 0 1px #595959;color:#fff;font-size:14px;font-weight:bold;padding:8px 20px 8px 20px;text-decoration:none;border:0}.extensionStorebtn:hover{background:#fc9f3c;background-image:-webkit-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-moz-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-ms-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-o-linear-gradient(top,#fc9f3c,#f08a3c);background-image:linear-gradient(to bottom,#fc9f3c,#f08a3c);text-decoration:none}.extensionSearch{padding:8px 12px 8px 30px!important;margin:6px 0 14px 0;box-shadow:inset 2px 2px 10px #ddd;border-radius:2px!important;background:url('../images/search.png') no-repeat;background-position:5px 6px}.banner-container{border-bottom:1px solid #fff;box-sizing:border-box}.banner{margin:0 90px}.bx-wrapper{margin:0 auto 35px!important;padding-top:17px!important}.bx-wrapper li a{display:block}.bx-wrapper a img{height:100px;width:auto;margin:0 auto}.wide,.table td.wide,.listViewEntries td.wide,td.listViewEntryValue.wide{padding:8px!important}.medium,.table td.medium,.listViewEntries td.medium,td.listViewEntryValue.medium{padding:5px 6px!important}.narrow,.table td.narrow,.listViewEntries td.narrow,td.listViewEntryValue.narrow{padding:2px 4px!important}.table thead th.narrow{vertical-align:middle}td.listViewEntryValue .row input{padding:0;margin-bottom:0}.listViewContentDiv{position:relative}.fieldLabel .pull-right{text-align:right}#tagRecordText{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;width:80%!important}#tagRecord{margin-left:5px!important}.tag{float:right!important}.cut-string{text-overflow:ellipsis;-o-text-overflow:ellipsis;-webkit-text-overflow:ellipsis;width:200px;white-space:nowrap;overflow:hidden}.paddingLRZero{padding-left:0;padding-right:0}.paddingRightZero{padding-right:0}.detailViewToolbar{margin-top:5px}.input-group.input-group-sm>.input-group-addon img{width:15px}table tr td .input-sm{min-width:50px}.modal-footer.backgroundColor{background-color:#f5f5f5}.panel-title{font-size:14px}.quickWidgetContainer .panel-body{padding-bottom:0;padding-top:0}tr.summaryViewEntries,#detailView table{font-size:13px}table.listViewEntriesTable{font-size:13px;margin-top:5px}.no-margin{margin:0}.companyLogo img{max-height:200px;max-width:250px}.navbar-inverse .navbar-nav>li>a{color:#fff;padding:15px 12px}.navbar-inverse .navbar-nav .dropdown-menu>li>a{padding:3px 15px;font-size:12px}.headerCalendar .month h3{font-size:18px;font-weight:bold;margin:5px 0 0 0}.columnsSelect{width:100%!important}.marginBottom5{margin-bottom:5px}.editViewContainer .recordEditView table.blockContainer tr td.fieldValue{width:30%}.recordEditView[name=QuickCreate] .quickCreateContent table tr td.fieldValue,#massEditContainer .massEditContent table tr td.fieldValue,#tab_accounts td.functionList{width:30%}.btn{white-space:normal}.valuesAssignedToRole{border:1px solid #adadad;overflow:hidden;text-overflow:ellipsis;padding:6px}table.dataTable .form-control{width:100%!important}#breadcrumb .stepNum{margin-top:0}#breadcrumb .stepText{position:relative;top:-4px}.fc button{height:auto!important}.fc-toolbar{margin-bottom:0!important}.fc-center,.fc-left,.fc-right{margin-bottom:1em}.calendarRightPanel{padding-left:5px;padding-right:5px}.calendarRightPanel ul li{margin-bottom:2px;margin-left:5px}.calendarRightPanel ul li:hover{background-color:#eee!important;border-radius:5px}.square9{width:12px;height:12px;margin:4px}.panel-dark{border-color:#737373}.panel-dark>.panel-heading{color:#fff;background-color:#737373;border-color:#737373}.panel-dark>.panel-heading+.panel-collapse>.panel-body{border-top-color:#737373}.panel-dark>.panel-heading .badge{color:#737373;background-color:#fff}.panel-dark>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#737373}.calendarRightPanel .widgetContainer ul{margin-top:5px;margin-bottom:5px}.paddingLeft5px{padding-left:5px}.marginBottom5px{margin-bottom:5px}.detailview-table .fieldValue .summaryViewEdit{display:none}.detailview-table .fieldValue:hover .summaryViewEdit{display:inherit}.icon-in-history-widget{font-size:17px;padding:4px}#prefPageHeader .logo img{height:70px;width:70px}#myPrefHeading h3{margin-top:12px}.list-user-img{width:50px;height:40px}span[name=existingImages] img{height:200px;width:300px}.narrow.fieldValue .chosen-container-single .chosen-single{height:26px;line-height:26px}.narrow.fieldValue input{height:26px}.narrow.fieldValue .input-group-addon{padding:4px 10px}.narrow.fieldValue .chosen-container-single .chosen-single div b{background-position-y:4px}.image-in-button{width:18px}.fc-time-grid .fc-time-grid-event.fc-event{min-height:27px;min-width:100px}.fc-time-grid-event.fc-short .fc-title{font-size:1em}.paddingTBZero{padding-top:0;padding-bottom:0}.dashboardWidgetContent a .glyphicon{top:-3px}.detailViewTitle .popover{min-width:130px;text-align:center}.cursorDefault{cursor:default!important}.remindersNoticeContainer{position:fixed;right:0;top:109px;z-index:1029;width:0;height:100%;bottom:30px;overflow-y:auto;background:rgba(0,0,0,0.4);border-left:1px solid #797979;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;overflow-y:auto}.remindersNoticeContainer.toggled{width:380px}.remindersContent{margin:5px 8px 0 8px}.activityTypeIcon{height:20px}.remindersNoticeContainer .panel{margin-bottom:10px}.remindersNoticeContainer .panel-body{padding:10px}.remindersNoticeContainer .actionRow a.btn{margin-right:3%}.remindersNotice{color:#fff;padding:15px 12px}.remindersNotice .glyphicon{font-size:20px}.cancelLink.btn[type='reset'],.cancel.btn[type='reset']{float:right;margin-left:5px;margin-bottom:0}.activityWidgetContainer .popover{min-width:240px}.filterActionImage{margin-left:8px}#tagRecord{line-height:25px}#tagsList .btn-info{margin-left:5px}#tagRecordInput{padding-left:15px;padding-right:15px}.clearReferenceSelection,.createReferenceRecord{padding:0 6px}.relatedPopup{padding:0 4px}.popupContainer .popupModuleName{margin-top:0}.mailRows hr{margin:0}.paddingLeftMd{padding-left:15px}.widget_header div:nth-child(2).btn-toolbar,.editViewContainer .contentHeader.row div:nth-child(2){margin-top:20px}.fieldLabel .referenceMandatory{margin-right:-12px}.ui-widget-content{padding:.8em}.ui-autocomplete .ui-autocomplete-category{font-weight:bold;line-height:1.5}.ui-autocomplete .ui-autocomplete-category:first-child{margin:.8em 0 .2em}.ui-autocomplete .ui-menu-item{padding:.2em .8em}.ui-autocomplete .ui-state-focus{border:0;background:#ebebeb}.widgetHr{margin-top:0}.headerLinksMails .btn-group{margin-top:11px}.finalDiscountUI,.finalTaxUI{bottom:5px}.sideBarTitle{font-size:20px}.globalSearchInput{width:300px}#groupsDetailContainer strong{line-height:21px}#addTaskContainer #taskStatus{margin-left:10px}.scanerMailActionsButtons{min-width:96px}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#404040}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active,.ui-menu .ui-menu-item a.ui-widget-content{font-weight:bold;margin:0;background-color:#428bca;border-color:#357ebd;color:#fff;display:block}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style:none}#layoutEditorButtons{margin-bottom:10px;margin-top:-10px}.individualTaxContainer{text-align:left!important}.suppliesItemsTable .input-group{max-width:200px}.suppliesItemsTable .rowName .input-group{max-width:400px}.suppliesItemsTable td,.suppliesItemsTable th{border:1px solid #ddd}.suppliesItemsTable tfoot td.hideTd{border:0;background:#fafafb}.suppliesSummaryContainer .panel-body,.suppliesSummaryContainer .panel-footer{padding:0}.suppliesSummaryContainer .panel-body .form-group,.suppliesSummaryContainer .panel-footer .form-group{margin:0}.suppliesSummaryContainer .input-group .form-control{background-color:#f5f5f5}.suppliesSummaryContainer .panel-body .percent{min-width:55px}.suppliesItemsTable tfoot{font-weight:800}.suppliesSummaryContainer img{max-width:15px} \ No newline at end of file +@media print{.noprint{display:none}}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}.hide-text{overflow:hidden;text-indent:100%;white-space:nowrap}.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot');src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.woff') format('woff'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.ttf') format('truetype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg')}body{width:100%;font-family:'Open Sans','Lucida Grande',Verdana,Tahoma,Arial,sans-serif!important;font-size:12px!important;background:#fff;color:#2b2b2b}hr{margin:8px 0;border-bottom:1px solid #ddd}.navbar.navbar-fixed-top .navbar-collapse{padding-right:15px!important}.navbar-nav.navbar-left .open ul{display:none}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background:0}.navbar-default .navbar-nav>li:hover{background:#e7e7e7}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background:0}.navbar-inverse .navbar-nav>li:hover{background:#080808}.navbar-nav .hovernav:hover>.dropdown-menu{display:block}#collapsedMenu{display:block;position:relative}#collapsedMenu a{color:#fff}#collapsedMenu .dropdown-menu .shortDropdown{max-height:300px;overflow-y:scroll;padding:10px;position:relative;z-index:10000;-webkit-overflow-scrolling:touch;-webkit-transform:translateZ(0)}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames{margin-bottom:2px}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a{font-size:.9em;padding:3%!important;color:#2b2b2b!important}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a:hover{text-decoration:none;background:#404952;color:#fff!important}.moreMenus{width:52em;padding:24%;left:0;border-radius:2px}.moreMenus.leftAligned:after,.moreMenus.leftAligned:before{left:21px!important}.moreMenus strong{font-size:1.1em;color:#2b2b2b}.moreMenus:after,.moreMenus:before{left:292px!important}.announcement{// display:none;background:#fafad2;// padding:2px 0;// border-bottom:1px solid #ccc;// max-height:24px;// width:100%}.announcement .marStyle{// width:100%}#headerLinks{padding:10px 0 7px;min-width:240px;float:right!important}#headerLinks .headerLinksContainer{margin-right:10px}#headerLinks .headerLinksContainer>[class*="span"]{float:left;margin-left:15px}#headerLinks .headerLinksContainer .dropdown.open .dropdown-toggle{background:transparent}#headerLinks .headerLinksContainer ul.dropdown-menu{top:30px}#headerLinks .headerLinksContainer ul.dropdown-menu:after,#headerLinks .headerLinksContainer ul.dropdown-menu:before{right:15px;left:auto}#headerLinks .headerLinksContainer>span a img,#headerLinks .headerLinksContainer>span a.userName{color:#fff;cursor:pointer;text-decoration:none!important}#headerLinks .headerLinksContainer>span a img .caret,#headerLinks .headerLinksContainer>span a.userName .caret{border-top:4px solid #fff}.dropdown-menu.pull-right{right:0;left:auto;cursor:pointer}.themeMenuContainer{min-width:110px;width:110px;left:-84px!important;padding:10px 0}.themeMenuContainer .themeMenu{padding:0 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement{cursor:pointer;margin:5px;height:20px;width:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement:hover{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}.themeMenuContainer .themeMenu .themeSelected{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}@media screen and (min-width:1161px){#mediumNav,#shortNav,#headerLinksCompact{display:none}#largeNav{margin-left:10px;margin-right:0}}@media screen and (max-width:1160px) and (min-width:960px){.companyLogo{width:100%}.customFilterMainSpan .select2-container{width:300px!important}*{zoom:1!important}}@media screen and (max-width:960px){.bodyContents{margin:0!important}#centerPanel{width:100%!important}.col-md-3#headerLinks{padding:5px 5px 0}.menuBar .col-md-9,.col-md-3#headerLinks{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-width:80px}.menuBar .col-md-9 .qCreate,.col-md-3#headerLinks .qCreate{display:inline-block;margin:0}.menuBar .col-md-9 .qCreate img,.col-md-3#headerLinks .qCreate img{margin-bottom:3px;margin-right:5px}.menuBar .col-md-9 .qCreate ul li.title,.col-md-3#headerLinks .qCreate ul li.title{padding:5px 0 0 15px}.menuBar .col-md-9 li.tabs:first-child>a,.col-md-3#headerLinks li.tabs:first-child>a{padding:10px 12px 9px}.customFilterMainSpan .select2-container{width:300px!important}#quickCreateModules{width:100%!important;padding:0!important}.CompactQC{max-height:300px;overflow-y:scroll;overflow-x:hidden}.CompactQC a:hover{text-decoration:none}}.commonActionsContainer .quickActions{height:3em}.commonActionsContainer .quickActions img{height:60%;margin:40% auto}.commonActionsContainer .quickActions #companyLogo-container img{height:98%;margin:0 auto}.commonActionsContainer .actionsContainer{background:#f3f3f3}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown{min-width:715px;top:28px;margin:0;padding-top:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a{padding:2px;border:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mainContainer{min-height:500px;margin-top:103px;background:#eeeff2;min-width:1200px}.mainContainer>.col-md-2{// padding:0 1.06383%;height:auto!important;// min-width:174px}.mainContainer .contentsDiv{min-height:500px;background:#fafafb;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;border-left:1px solid #e6e6e6;position:relative}.mainContainer #leftPanel{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.toggleButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;left:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-left:0;display:inline-block}.toggleButton .glyphicon-chevron-left{background-position:-434px -72px!important}.toggleButton .glyphicon-chevron-right{background-position:-460px -72px!important}.toggleRightPanelButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;right:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-right:0;display:inline-block}.quickLinksDiv{margin:10px 0}.quickLinksDiv p{font-size:1.2em;padding:3% 0 0 6%;height:40px;cursor:pointer;box-shadow:0 0 0 1px #ddd;border-top:1px solid #fff!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);position:relative;border-radius:2px}.quickLinksDiv p a{color:#2b2b2b}.quickLinksDiv p a:hover{text-decoration:none}.quickLinksDiv p.selectedQuickLink{background-color:#2a2f35;background-image:-moz-linear-gradient(top,#2a2f35,#2a2f35);background-image:-ms-linear-gradient(top,#2a2f35,#2a2f35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#2a2f35),to(#2a2f35));background-image:-webkit-linear-gradient(top,#2a2f35,#2a2f35);background-image:-o-linear-gradient(top,#2a2f35,#2a2f35);background-image:linear-gradient(top,#2a2f35,#2a2f35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2a2f35',endColorstr='#2a2f35',GradientType=0);border-color:#2a2f35 #2a2f35 #08090a;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);background-image:none;position:relative;border:1px solid #fff;box-shadow:4px 0 3px -4px #000 inset}.quickLinksDiv p.selectedQuickLink a{color:#fff}.quickLinksDiv p.selectedQuickLink a:after{border-bottom:19px solid rgba(0,0,0,0);border-left:10px solid #2a2f35;border-top:19px solid rgba(0,0,0,0);content:" ";display:inline-block;position:absolute;left:100%;top:0}.quickWidgetContainer li a{overflow:hidden;white-space:normal;padding:5px;margin:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.quickWidgetContainer .quickWidget{margin-bottom:10px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.sidebarTitleBlock{padding:12px 0}.sidebarTitleBlock a{color:#373737!important}.sidebarTitleBlock a:hover{text-decoration:none}#selectAllMsgDiv,#deSelectAllMsgDiv{display:none;background-color:#fafad2;padding:.01%;text-align:center}.blockUI form,#globalmodal form{margin:0}.dashboardHeading h2{padding-bottom:8px}.dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardHeading .dropdown-menu{left:-70px;right:0}.dashboardContainer{padding:0}.dashboardContainer .dashboardHeading{padding:10px 0 0;background:#f5f5f5}.dashboardContainer .dashboardHeading h2{padding:0 0 8px 20px}.dashboardContainer .dashboardHeading .btn-toolbar{padding:3px 20px 0 0}.dashboardContainer .dashboardHeading hr{border-bottom:1px solid #ddd}.dashboardContainer .dashboardHeading .dropdown-menu{left:-82px}.widgetsList{max-height:400px;overflow-y:auto;overflow-x:hidden}.widgetsList li{display:block}.widgetsList li a{white-space:normal;word-wrap:break-word}.dashboard_notebookWidget_view .row{margin-bottom:5px}.gridster{margin-left:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.gridster ul{width:auto;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:460px}.gridster ul{list-style:none}.gridster ul li.dashboardWidget{background:#fff;border-radius:1px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.gridster ul li.dashboardWidget .dashboardWidgetHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd;color:#444;cursor:move;padding:5px}.gridster ul li.dashboardWidget .dashboardWidgetHeader table{height:28px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .dashboardTitle{text-align:left;padding-left:10px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .widgeticons{opacity:.5;padding-right:6px}.gridster ul li.dashboardWidget .filterContainer{position:absolute;border:1px solid #ddd;background:#fff;margin-left:-7px;margin-right:3px;margin-top:4px;padding:8px 0;border-radius:0 0 5px 5px;box-shadow:0 5px 8px -5px #888}.gridster ul li.dashboardWidget .filterContainer div span{margin-top:6px}.gridster ul li.dashboardWidget .filterContainer .col-md-5{margin-top:3px}.gridster ul li.dashboardWidget .dashboardWidgetContent{padding:10px 0;line-height:20px}.gridster ul li.dashboardWidget .dashboardWidgetContent .dashboard_notebookWidget_viewarea{height:200px}.gridster ul li.dashboardWidget .widgeticons{min-width:50px;height:30px;margin-right:30px}.gridster ul li.dashboardWidget .widgeticons a{cursor:pointer;text-decoration:none}.gridster ul .widgetChartContainer{margin-left:10px}.listViewPageDiv{margin:11px 0}.customFilterMainSpan{width:100%}.customFilterMainSpan .select2-container{width:95%!important}.select2-container .select2-choice{border-radius:2px;background:#fff;border-color:#ddd;font-size:14px;letter-spacing:.01em;color:#2b2b2b}.select2-container .select2-choice div{border-radius:0;border-left:0;background:#fff}.select2-drop{border-color:#ddd}.select2-dropdown ul.filterActions{list-style:none!important;padding-left:15px}.select2-dropdown ul.filterActions li{cursor:pointer}.ui-autocomplete .ui-menu-item #ui-active-menuitem{background:#404952;border-radius:0}li.ui-timepicker-selected,.ui-timepicker-list li:hover,.ui-timepicker-list:hover .ui-timepicker-selected:hover{background:#404952}#relatedTabOrder .select2-input{min-width:200px}.alphabetSorting .alphabetSearch a{vertical-align:middle;display:inline-block;margin-bottom:2px}.alphabetSorting .alphabetSearch:hover{background:#eeeff2}.listViewActions .settingsIcon{display:inline-block;margin-left:5px}.listViewActions>.btn-group{min-width:105px}#listViewPageJumpDropDown,#relatedListPageJumpDropDown{left:-60px}.pageNumbers{display:inline-block;margin-right:5px;margin-top:6px;vertical-align:top}.pageNumbers .totalNumberOfRecords{margin:0 5px}.contents-topscroll,#reportDetails{overflow-x:auto!important;overflow-y:visible}.contents-bottomscroll{overflow-x:auto!important}.bottomscroll-div,.topscroll-div{display:table;min-width:100%}.listViewLoadingImageBlock{background:0;border-radius:0;box-shadow:none;text-align:center}.detailViewContainer{padding:0 20px}.userPreferences .contents{padding-left:0!important}.userPreferences .details{border-right:0!important}.detailViewTitle{padding:1% 0 0 1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .recordLabel{font-size:16px;font-weight:bold}.detailViewTitle .detailViewButtoncontainer{margin-top:8px}.detailViewTitle .detailViewPagingButton{margin-top:8px;padding-right:10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .btn-toolbar{margin:0}.detailview-table th,.detailview-table td{vertical-align:middle}.detailview-table th label,.detailview-table td label{margin-bottom:3px}.detailViewInfo{box-shadow:0 -4px 4px -4px #959595;margin-top:5px}.detailViewInfo .details{// min-height:600px;padding-right:1.5%;border-right:4px solid #404952;padding-bottom:10px;padding-top:10px}.detailViewInfo .related .nav-pills .active>a,.detailViewInfo .related .nav-pills .active>a:hover{background:#404952;border-radius:1px;margin-top:0;margin-bottom:2px}.fieldLabel{width:20%;background:#f7f7f9}.fieldLabel label.marginRight10px{text-align:right}.summaryView{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.summaryView .summary-table tr.summaryViewEntries:last-child .fieldValue,.summaryView .summary-table tr.summaryViewEntries:last-child .fieldLabel{border-bottom:1px solid #ddd}.summaryView .summaryViewEntries .fieldLabel{vertical-align:top;padding:5px 0 5px 5%;border-top:1px solid #ddd;border-right:1px solid #ddd}.summaryView .summaryViewEntries .fieldValue{vertical-align:top;padding:5px 0 5px 5px;border-top:1px solid #ddd}.summaryView .summaryViewEntries:hover .summaryViewEdit{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryView .summaryViewEntries .summaryViewEdit{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryView .toggleViewByMode{margin:8px 0;padding-right:0}.summaryView .toggleViewByMode .changeDetailViewMode{white-space:normal!important}.summaryWidgetContainer{border-radius:2px;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border:1px solid #eaeaea;background:#fff;margin-bottom:10px;padding:15px}.commentContainer .commentTitle{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;margin-bottom:10px}.commentContainer .commentTitle textarea{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordDetails .squeezedWell{padding:3% 0;min-height:105px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordEditView .contentHeader{padding:.5% 0 1% 0}.recordEditView .table .fieldLabel,.recordEditView .table .fieldValue{vertical-align:middle}.recordEditView .table tbody tr:hover td,.recordEditView .table tbody tr:hover th{background:#f7f7f9}.commentContainer{border-radius:2px}.commentContainer hr{margin:0!important}.commentContainer .addCommentBlock .commentsControls{display:inline-block}.commentContainer .commentsList>.liStyleNone>.commentDetails .commentDiv{width:100%}.commentContainer .commentDetails{background:#fff;border:1px solid #ddd;margin-bottom:5px;border-radius:2px;padding:10px 10px 5px;display:inline-block;min-width:354px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentContainer .commentorInfo p{margin-bottom:0}.commentContainer .addCommentBlock{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border:1px solid #ddd;padding:12px 12px 5px;min-height:115px;margin-top:15px;display:block}.commentContainer .addCommentBlock .commentcontent{padding:8px!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;resize:none}.commentContainer .commentInfoContent{padding:1px 0;word-wrap:break-word}.commentTitle .col-md-1{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentTitle .col-md-1 img{width:32px;height:32px}.commentsList>ul{margin-left:0}.singleComment .editedStatus{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:5px 0 5px 32px}.singleComment .editedStatus p{margin-bottom:0}.singleComment .commentActionsDiv{display:none}.singleComment .commentActionsDiv p{margin-bottom:0}.singleComment:hover .commentActionsDiv{display:block;margin-bottom:3px}.recentComments{margin:0;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recentComments .commentDiv{min-width:100%}.recentComments .addCommentBlock{border:0;margin-top:0;display:block}.recentComments .commentDetails{display:block}.singleComment:hover .commentActions .replyComment{display:inline-block}.commentActionsContainer a:hover{text-decoration:none}.commentActionsContainer .editStatus{padding:5px 2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentActionsContainer .editStatus p{margin-bottom:0}.table{background:#fff}.table-bordered{border-radius:1px;margin-bottom:0}.table-bordered th{border-top:1px solid #fff!important}.table th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;color:#444}.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td,.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td{border-left:0;border-right:0}.listViewEntriesTable tbody tr td:first-child{border-left:0 none}.equalSplit td:nth-child(odd){width:20%}.equalSplit td:nth-child(even){width:30%}td.fieldValue input,td.fieldValue .input-group{margin-bottom:0}.actionImage,.actionImages{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.listViewHeaders a{color:#444}.listViewEntriesDiv .listViewHeaders th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd}.listViewEntriesDiv,.listViewEntriesDiv td{overflow:visible}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues{color:#444}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues:hover{text-decoration:none}.listViewEntriesTable td.listViewEntryValue,.listViewEntries td{vertical-align:middle;cursor:pointer;overflow:visible;padding:5px}.listViewEntriesTable td.listViewEntryValue:hover .actionImages,.listViewEntries td:hover .actionImages,.listViewEntriesTable td.listViewEntryValue:hover .actions,.listViewEntries td:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryViewEntries .summaryViewEdit,.activityStatus .editStatus,.activityDescription .editDescription,.addedCalendars .actionImage{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryViewEntries:hover .fieldValue .summaryViewEdit,.activityStatus:hover .editStatus,.activityDescription:hover .editDescription,.addedCalendars:hover .actionImage{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewEntriesTable tr:hover td .actions .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewBasicAction.dropdown-menu{width:100%}.listViewBasicAction.dropdown-menu input{border-radius:2px;height:24px;margin-bottom:0;margin-top:-2px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.emptyRecordsDiv{width:100%;border:1px solid #ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.emptyRecordsDiv td{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.CustomFilterViewTitle{padding-top:1%}#CustomView .filterActions{padding-bottom:20px;overflow:hidden}.filterConditionsDiv{padding-bottom:0}.conditionGroup .header{margin-bottom:20px;font-size:1.2em}.conditionGroup .contents .conditionRow{margin-bottom:10px}.conditionGroup .contents .conditionRow select,.conditionGroup .contents .conditionRow input{width:90%}.conditionGroup .contents .conditionRow .chzn-results li{line-height:20px}.conditionGroup .deleteCondition{vertical-align:bottom}.searchUIBasic{border-collapse:separate!important;border-spacing:10px!important;margin:0 10%}.searchUIBasic .importContents{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.searchUIBasic .listRow .listViewHeaders>td{color:#404952}.searchUIBasic .listRow .defaultInputTextContainer{max-width:87%!important;margin-bottom:0!important}#lineItemTab.table tr:first-child:hover th ~ td{background-color:#f3f3f4;background-image:-moz-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-ms-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f3f3f4),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-o-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:linear-gradient(top,#f3f3f4,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f4',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}#lineItemTab.table tr:nth-child(2):hover td{background:0}.lineItemTable tr td{width:0}.lineItemTable tr td div.finalDiscountUI,.lineItemTable tr td div.discountUI,.lineItemTable tr td div#shipping_handling_div,.lineItemTable tr td div.taxUI,.lineItemTable tr td div.finalTaxUI{border:2px solid #c4c4c4;border-radius:2px}.lineItemTable tr td div.finalDiscountUI table tr td,.lineItemTable tr td div.discountUI table tr td,.lineItemTable tr td div#shipping_handling_div table tr td,.lineItemTable tr td div.taxUI table tr td,.lineItemTable tr td div.finalTaxUI table tr td,.lineItemTable tr td div.finalDiscountUI table tr th,.lineItemTable tr td div.discountUI table tr th,.lineItemTable tr td div#shipping_handling_div table tr th,.lineItemTable tr td div.taxUI table tr th,.lineItemTable tr td div.finalTaxUI table tr th{border-left:0}.lineItemTable tr:hover td{width:0}.lineItemTable tr:hover td div.finalDiscountUI table tr td{background:none!important}.lineItemTable tr:hover td div.discountUI table tr td{background:none!important}.lineItemTable tr:hover td div#shipping_handling_div table tr td{background:none!important}.lineItemTable tr:hover td span.taxDivContainer div table tr td{background:none!important}.lineItemTable tr:hover td div.finalTaxUI table tr td{background:none!important}.lineItemResult{width:70.5%!important}.lineItemResult a:hover{color:#404952}.lineItemInputBox{width:45%;float:right;text-align:right}.discountUI,.taxUI,.finalDiscountUI,.finalTaxUI,#shipping_handling_div{position:absolute;left:46%;width:30%;z-index:500;box-shadow:1px 0 7px #ddd;border-radius:6px}.discountUI table.table,.taxUI table.table,.finalDiscountUI table.table,.finalTaxUI table.table,#shipping_handling_div table.table{margin-bottom:0}.discountUI .table tbody tr:first-child th:first-child,.taxUI .table tbody tr:first-child th:first-child,.finalDiscountUI .table tbody tr:first-child th:first-child,.finalTaxUI .table tbody tr:first-child th:first-child,#shipping_handling_div .table tbody tr:first-child th:first-child{border-radius:4px 0 0 0!important}.discountUI .table tbody tr:first-child th:last-child,.taxUI .table tbody tr:first-child th:last-child,.finalDiscountUI .table tbody tr:first-child th:last-child,.finalTaxUI .table tbody tr:first-child th:last-child,#shipping_handling_div .table tbody tr:first-child th:last-child{border-radius:0 4px 0 0!important}.LineItemDirectPriceReduction{width:65%!important}th.htColHeader,.handsontable thead th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd;padding:6px 2px}.contentHeader{padding:15px;padding-left:5px;line-height:20px}.contentsDiv>div{padding:0 20px}#settingsQuickWidgetContainer .widgetContainer.accordion-body{border-bottom:none!important;border-bottom:3px solid #ddd}#settingsQuickWidgetContainer .widgetContainer.accordion-body>div:hover{background:#eeeff2}#settingsShortCutsContainer{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:1% 3%}#settingsShortCutsContainer .moduleBlock{min-height:60px}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin{display:inline-block;opacity:.4}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin:hover{opacity:.8}.settingsIndexPage .settingsSummary{text-align:center;margin-top:10px}.settingsIndexPage .settingsSummary a{display:inline-block;background:#f3f3f4;color:#444;border-radius:2px;min-width:200px;padding:20px 0 10px;border:1px solid #ddd}.settingsIndexPage .settingsSummary a .summaryText{display:inline-block;margin-top:20px;font-size:15px}.settingsIndexPage .settingsSummary a:hover .summaryText,.settingsIndexPage .settingsSummary a:hover .summaryCount{color:#404952}.settingsIndexPage .moduleBlock h5{font-size:1.2em;margin-bottom:5px}.settingsIndexPage .moduleBlock:hover{background:#f3f3f4}#userPageHeader{padding:8px 0 0}#userPageHeader #userHeading h3{margin-top:10px}.treeView li{border-left:4px solid #ddd;list-style:none;padding-top:15px}.treeView li .toolbar-handle{margin-left:10px;position:relative}.treeView li .toolbar-handle .btn{margin:0}.treeView li .toolbar-handle a:before{background:none repeat scroll 0 0 #ddd;content:" ";display:inline-block;height:4px;left:-10px;position:absolute;top:12px;width:10px}.treeView .btn{margin-bottom:10px}.profilesEditView tr.blockHeader th{text-align:center}.profilesEditView tr.blockHeader th:first-child{text-align:left}.profilesEditView input{margin-right:5px}.profilesEditView tr td.row table.table{border-left:none;margin-bottom:20px}.profilesEditView tr:hover td.row{background:0}.profilesEditView tr:hover td.row table.table tr td{background:0}.profilesEditView tr:hover td.row table.table tr:hover td{background:0}.profilesEditView tr:hover td.row table.table td{background:#f3f3f4}#s2id_memberList li>div,.groupMembersColors li>div{margin-left:10px}#s2id_memberList .Users,.groupMembersColors .Users{background-color:#f99984!important;padding:5px;margin-bottom:2px;background-image:none}#s2id_memberList .Groups,.groupMembersColors .Groups{background-color:#acd5ff!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .Roles,.groupMembersColors .Roles{background-color:#ffec98!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .RoleAndSubordinates,.groupMembersColors .RoleAndSubordinates{background-color:#c4dea2!important;background-image:none;padding:5px;margin-bottom:2px}.collectiveGroupMembers{border:1px solid #ddd;border-top:0}.collectiveGroupMembers ul{padding:0;margin:0}.collectiveGroupMembers ul li{padding:4px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.collectiveGroupMembers ul li a{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;margin:0}.collectiveGroupMembers ul li.groupLabel{background-color:#f3f3f4;border-bottom:1px solid #ddd;border-top:1px solid #ddd;padding:10px 5px;margin:0;color:#444}.mini-slider-control{width:50px}.mini-slider-control+div{margin-left:15px}.mini-slider-control .ui-slider-handle{border:0;border-radius:50%;height:16px;top:-2px;width:16px;cursor:pointer}.mini-slider-control .ui-slider-handle:focus{outline:0}.ui-widget-content{border-radius:6px;border-color:#fff;box-shadow:0 0 3px -1px inset;margin-top:2px;margin-left:5px;height:12px}.ui-slider-disabled{opacity:.5;border-color:#ddd;box-shadow:none;cursor:not-allowed}.ui-slider-disabled .ui-slider-handle{cursor:not-allowed}.ui-slider-disabled+div{opacity:.5;cursor:not-allowed}.mini-slider-control[data-value="0"] .ui-slider-handle{background:#7d7e7d;background:-moz-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#7d7e7d),color-stop(100%,#0e0e0e));background:-webkit-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-o-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-ms-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:linear-gradient(to bottom,#7d7e7d 0,#0e0e0e 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7d7e7d',endColorstr='#0e0e0e',GradientType=0)}.mini-slider-control[data-value="1"] .ui-slider-handle{background:#ffb76b;background:-moz-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ffb76b),color-stop(0%,#ffa73d),color-stop(49%,#ff7c00),color-stop(100%,#ff7f04));background:-webkit-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-o-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-ms-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:linear-gradient(to bottom,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffb76b',endColorstr='#ff7f04',GradientType=0)}.mini-slider-control[data-value="2"] .ui-slider-handle{background:#bfd255;background:-moz-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#bfd255),color-stop(79%,#8eb92a),color-stop(100%,#72aa00),color-stop(100%,#9ecb2d));background:-webkit-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-o-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-ms-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:linear-gradient(to bottom,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bfd255',endColorstr='#9ecb2d',GradientType=0)}#moduleManagerContents{padding-bottom:10px}#moduleManagerContents .moduleManagerBlock .btn-group.open .dropdown-menu{left:-144%}#moduleManagerContents .modulesTable td{width:50%}#importModules .contents .row{margin-bottom:2.2%}.extensionWidgetContainer{background-color:#fff;border:1px solid #ddd;min-height:200px;padding:2%;background:#fafafa;box-shadow:0 0 10px -4px #777}.extensionWidgetContainer .extension_contents{margin-top:2%;background:#fff;padding:10px;box-sizing:border-box;max-height:160px}.extension_contents:hover{border-radius:4px}.thumbnailImage{height:130px;width:130px;float:right}.extensionWidgetContainer .extension_contents .slimScrollDiv{padding-right:10px}.extensionWidgetContainer .extension_header .font-x-x-large{font-size:1.5em;padding-left:3px;font-weight:bold;color:#404952}.extensionWidgetContainer .extensionDescription{line-height:20px}.extensionWidgetContainer .extensionInfo{padding-top:5px}.extensionWidgetContainer .extensionInfo .rating,.extensionDetails .rating{vertical-align:middle;margin-top:2px;display:inline-block}.extensionDetails .authorInfo{margin:3px 0}.extensionDetails .extensionDetailActions{padding:15px 0}.extensionWidgetContainer .tab-pane .bx-wrapper .imageSlider{margin:0}.sliderImage{width:90%;height:360px}.opacity .actions{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.opacity:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.sharingAccessDetails{margin-bottom:30px}.sharingAccessDetails td,.sharingAccessDetails th{text-align:center;vertical-align:middle!important}.sharingAccessDetails tr td:first-child,.sharingAccessDetails tr th:first-child{text-align:left}.sharingAccessDetails td.row>div{display:block}.sharingAccessDetails .customRuleContainer:hover{background:0}.sharingAccessDetails hr{border-bottom:1px solid #bcbcbc}.sharingAccessDetails .title{padding:1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.sharingAccessDetails .title .rulehead{padding-top:5px}.sharingAccessDetails .customRuleEntries:hover .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.layoutContent{border-top:4px solid #404952}.layoutContent #moduleBlocks .editFieldsTable{margin-bottom:20px}.layoutContent #moduleBlocks .editFieldsTable .fieldLabel{background:0}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockLabel{padding-top:13px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group{margin-top:5px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group .dropdown-menu{left:-100%}.layoutContent .relatedTabModulesList{padding:2% 1%}.fieldDetailsForm .search-choice-close{padding:0}.border1px{border:1px solid #ddd}.blockFieldsList .opacity{margin-left:.5%!important}.blockFieldsList .opacity .dropdown-menu a{padding:0!important}.blockFieldsList .opacity a.dropdown-toggle.editFieldDetails{box-shadow:none}.blockFieldsList .editFields .dropdown-menu{z-index:1000003;padding:0;left:-215px;position:absolute}.blockFieldsList .editFieldsWidget .dropdown-menu{z-index:1000003;padding:0;left:-315px;position:absolute}.blockFieldsList .editFields .dropdown-menu .modal-header{border-width:0;border-bottom-width:1px}.blockFieldsList .editFields .dropdown-menu .modal-header .cancel{padding-right:0;font-weight:bold}.blockFieldsList .editFields:hover{background:#f3f3f4!important}#modulePickListValuesContainer .layoutContent{padding-left:2%}#modulePickListValuesContainer .layoutContent .selectedCell,#modulePickListValuesContainer .layoutContent .selectedListItem{background:#a5afb9;white-space:nowrap}#modulePickListValuesContainer .layoutContent .pickListValue{cursor:pointer}.nonEditableValuesDiv .nonEditablePicklistValues{margin-left:0}.nonEditableValuesDiv .nonEditablePicklistValues li{padding:3px 15px;margin-bottom:2px;background:#e0f2ff}.popover{z-index:1000023!important}.popover-content .fieldLabel{width:35%;white-space:normal}#dependencyGraph .tableHeading{text-align:center;padding-top:30px;font-size:1.2em;font-weight:bold}#dependencyGraph .depandencyTable{border:1px solid #ddd;background:#f3f3f4}#dependencyGraph .depandencyTable .blockHeader{border-bottom:1px solid #ddd}#dependencyGraph .depandencyTable .picklistValueMapping{border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping{text-align:center;border-left:1px solid #ddd;border-right:1px solid #ddd;background:#fff}#dependencyGraph .dependencyMapping .mCSB_container{margin-bottom:16px!important}#dependencyGraph .dependencyMapping .pickListDependencyTable{border:0}#dependencyGraph .dependencyMapping .pickListDependencyTable .blockHeader th{background:#f3f3f4;border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping .pickListDependencyTable .selectedCell{background:#a5afb9}.webformFieldInfo{margin-bottom:250px}.targetFieldsTableContainer input[type="text"]{min-width:100px}#customRecordNumbering.table thead th{vertical-align:middle}.addMailBoxBlock{margin-left:83px;padding:0!important;font-size:12px}.addMailBoxStep{background:#fff;padding:30px 0;border:1px solid #ddd;border-radius:1px;min-height:170px}.mailConveterDesc{height:350px;width:96%;border:1.5px solid;border-radius:2px;border-color:#ddd;font-size:11pt;margin-top:55px;margin-left:20px;background:#fff}#mailBoxLabel{margin-top:15px;margin-left:-18px;font-size:12pt;width:75px}.mailBoxDropdownWrapper{height:49px;width:70%;background:url('../images/mailbox-icon.png') no-repeat 5px 5px;overflow:hidden;border:1px solid #ddd}.mailBoxDropdown{background:transparent url('../images/downArrowBlue.png') no-repeat 236px 13px;width:110%;height:50px;font-size:14pt;color:#0065a6;padding:10px 55px;padding-right:0}#mailConverterDragIcon{margin-top:12px}#mailConverterBody{padding-top:20px;margin-left:0}.ruleHead{padding:6px 0;background:#d8d8dc}.mailConverterRuleBlock{font-size:14px;line-height:30px;border:1.5px solid;border-color:#ddd}.mailConverterRuleLegend{font-size:14px;color:#0065a6;margin-bottom:10px;background:#f3f3f4}#mailConverterStats{font-size:10pt;margin-top:5px;margin-left:-10px}.addMailBoxBlock{border-color:#ddd;margin-left:83px;margin-top:20px;padding-top:30px;padding-left:200px;padding-bottom:20px;padding-right:30px;font-size:11pt}.taskTypeUi>.row{margin:10px 0}#taskListContainer .listViewEntriesTable tr td:last-child{border-left:1px solid #ddd}#workflow_step2>.row{padding:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:400px}#open_email_con .detailViewTitle{padding:0}#open_email_con .detailViewTitle .detailViewPagingButton{margin-top:0;padding-right:0}#foldersList .list-group{padding-right:0}.massEditTable th+th,.massEditTable td+td,.massEditTable th+td,.massEditTable td+th{border-left:0}.nav.massEditTabs{margin-bottom:0;border-bottom:0}.nav.massEditTabs li.active a{background:#404952;color:#fff;margin-left:10px}.nav.massEditTabs li a:hover{border-bottom:1px solid #404952}.massEditContent{border-top:3px solid #404952}.calendarSettingsContainer{width:700px}.calendarSettingsContainer .control-label{width:26%}#calendarSettings{margin:1px 0 3px}.calendarMassEdit{min-width:400px}.fc-state-default .fc-button-effect{top:100%!important}.fc-event-style1,.fc-event-style1 .fc-event-skin{background:#17309a;border-color:#17309a;font-weight:normal;text-shadow:none}.fc-event-style2,.fc-event-style2 .fc-event-skin{background:#3a87ad;border-color:#3a87ad;font-weight:normal;text-shadow:none}.fc-event-style3,.fc-event-style3 .fc-event-skin{background:#aa6705;border-color:#aa6705;font-weight:normal;text-shadow:none}.fc-event-style4,.fc-event-style4 .fc-event-skin{background:#953b39;border-color:#953b39;font-weight:normal;text-shadow:none}.fc-event-style5,.fc-event-style5 .fc-event-skin{background:#545252;border-color:#545252;font-weight:normal;text-shadow:none}.fc-event-style6,.fc-event-style6 .fc-event-skin{background:#87865d;border-color:#87865d;font-weight:normal;text-shadow:none}.fc-event-style7,.fc-event-style7 .fc-event-calendarMassEditskin{background:#c71585;border-color:#c71585;font-weight:normal;text-shadow:none}.fc-event-style8,.fc-event-style8 .fc-event-skin{background:#006400;border-color:#006400;font-weight:normal;text-shadow:none}#calendarview th{color:#000}.fc-agenda-divider+div{overflow-y:visible!important}.fc-button{display:inline-block;padding:6px .4em!important;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.fc-button:active .fc-button-inner{background:transparent}.fc-button:active .fc-button-inner .fc-button-content{color:#fff}.fc-button.fc-state-active .fc-button-inner .fc-button-content,.fc-button:active .fc-button-inner .fc-button-content{color:#000!important;background:transparent;background-image:none}.fc-header-title h2{font-size:15px;line-height:20px}.fc-widget-header th{padding:4px 0!important}.fc-widget-header{color:#666;background:#eee;border-color:#ccc}.fc-content{background:#fff;margin-top:15px}.fc-content td:hover{background:#f3f3f3}.btn:focus{outline:0}.reminderPostpone.btn-primary{background:#404952}.reminderPostpone.btn-primary:hover{background:#1e2327}.saveButton{margin-right:5px}.addCustomRule{float:right}.importMore{background:#fff}.lastImport{background:#fff}.undoImport{background:#da4f49}.close{border:0;background:none repeat scroll 0 0 transparent;border:0 none;cursor:pointer}.resetButton{margin-top:0!important}.vtGlyph{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("../images/vtGlyph.png");background-position:0 0;background-repeat:no-repeat;*margin-right:.3em}.vticon-pageJump{background-position:0 0}.vticon-call-inbound{background-position:-14px 0}.vticon-call-outbound{background-position:-28px 0}#massEdit .cancelLinkContainer{padding:5px 0;margin-left:.5em}.ui-pnotify{z-index:1000023}.feedback{z-index:10002}.feedback .handle{z-index:10003;display:block;position:fixed;bottom:50px;left:-30px;left:0\9;bottom:100px\9;background:#2c2c2c;color:white;padding:7px 15px;border:1px solid gray;text-decoration:none;outline:0;-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-o-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg);-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.00000000, M12=1.00000000, M21=-1.00000000, M22=0.00000000,sizingMethod='auto expand')";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0,M12=1,M21=-1,M22=0,sizingMethod='auto expand')}.feedback .handle:hover{text-decoration:none}.vtFooter{text-align:center}.vtFooter p{background:#404952;color:#fff;border-top:1px solid #ddd;padding:1px 0;font-size:.9em;margin-bottom:0}.vtFooter p a{color:#fff}.imageHolder{background:url('../images/loadback.png') repeat-y;background-position:center;padding:10px 0}.breadcrumbContainer{padding:2% 2% 0 2%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;height:auto}.breadcrumb{display:inline-block;height:auto;height:40px}.crumbs{height:40px;margin:0;padding:0 20px 0 0;display:inline-block;font-family:sans-serif}.crumbs li:after{content:'\0000a0';width:0;height:0;border-left:18px solid #ececec;border-top:20px solid transparent;border-bottom:20px solid transparent;display:inline-block;position:relative;top:-20px;left:18px;zoom:1}.crumbs li{height:0;border-top:20px solid #ececec;border-bottom:20px solid #ececec;border-left:20px solid transparent;display:inline-block;box-shadow:0 1px #ddd;margin-right:5px}.crumbs li a{display:inline-block;float:left;margin-top:-13px;font-size:14px;font-weight:bold;color:#666;text-decoration:none}.crumbs li.active{height:0;border-top:20px solid #404952;border-bottom:20px solid #404952;box-shadow:0 1px #404952}.crumbs li.active:after{border-left:18px solid #404952!important}.stepText{display:inline-block;white-space:nowrap;overflow:hidden;font-size:13px;vertical-align:bottom}.active .stepText,.active .stepNum{color:#fff}.stepNum{display:inline-block;padding:0 5px;overflow:hidden;font-size:20px;vertical-align:top;margin-top:5px}.greyStar{background-image:url("../images/stars.png");background-position:20px 20px;height:20px;width:20px;display:inline-block}.yellowStar{background-image:url('../images/stars.png');background-position:0 20px;width:20px;height:20px;display:inline-block}.blockUI{border-radius:2px!important;border:0!important}textarea.col-md-11{width:100%!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.popover .popover-inner{border-radius:2px;font-size:.8em;box-shadow:0}.popover .popover-inner .popover-title{color:#444;font-size:15px}.popover .popover-inner .close{color:#000!important;margin-top:3px;opacity:.5!important}.popover .popover-inner .close:hover{opacity:1!important}.popover .popover-inner td{padding:3px 5px;overflow-wrap:break-word}.popover .popover-inner .detailViewInfo{margin-top:0;box-shadow:0}.popover .popover-inner .detailViewInfo .fieldLabel label{font-size:1em}#findDuplicate>.control-group{margin-bottom:0;width:400px}#moveReports .modal-body{padding:20px 40px}#composeEmailContainer{padding:0 20px}#composeEmailContainer .MultiFile-wrap{display:inline-block}#composeEmailContainer .MultiFile-intercepted .ui-wrapper{min-height:400px}#transferOwnershipContainer .select2-container.select2-container-multi{max-width:220px}.fieldInfo.in{overflow:visible!important;height:auto!important}.moduleSelection{border-radius:2px 2px 0 0!important;border:1px solid #ddd!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);color:#444}.convertLeadModules{margin-bottom:2%;border:1px none}.moduleBlock{border-radius:0!important}.overflowVisible{overflow:visible!important}.convertLeadError{border:3px solid #999;background-color:#fff;width:55%;position:relative;z-index:10000000}.convertLeadError table td{border-bottom:1px solid #ccc;nowrap:nowrap;width:70%}.bootbox,.alert{z-index:1000023}.chzn-container{vertical-align:middle}.chzn-container .chzn-results li{margin-right:7px}.chzn-container .chzn-results .highlighted{background:#404952}.select2-results .select2-highlighted{background:#404952}.select2-result-label i{background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.ui-autocomplete-loading{background:url('../images/load.gif') no-repeat right center}.ui-autocomplete{height:auto!important;border-radius:1px!important}.dropdown-menu.pull-right:after,.dropdown-menu.pull-right:before{right:3px;left:auto;top:-5px;border-bottom-width:6px}span.wrapper a{color:#08c!important;font-size:15px!important;font-weight:bold}a{color:#353c44}a:hover{color:#1e2327;text-decoration:none;cursor:pointer}a:active,a:focus{outline:0}.well{border-radius:2px;padding:15px}.verticalBottomSpacing{margin-bottom:10px}.mergeTables{margin-bottom:0}.font-x-x-large{font-size:18px;line-height:28px}form{margin:0}.fc-state-default .fc-button-effect span{background:0}.dateField{width:183px}.form-horizontal [class^="icon-"],.form-horizontal [class*=" icon-"]{vertical-align:baseline}.timePicker{width:8.5em!important;z-index:1000029!important}.datepicker{z-index:1000029!important}.colorpicker{z-index:1029!important}.colorpicker input{width:30px!important}.colorpicker input[type="text"],.colorpicker input{color:#898989!important}.colorpicker_hex input{width:45px!important}.modal-body.accordion{margin-bottom:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}//.modal-open{// overflow:hidden;//}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.removeNoFileChosen{color:transparent!important}.modelContainer .modal-header{border-radius:2px 2px 0 0}.modelContainer form{border-radius:0 0 2px 2px}.hide{display:none}i{cursor:pointer;text-decoration:none!important}.marginbottomZero{margin-bottom:0!important}.marginLeftZero{margin-left:0!important}.marginRightZero{margin-right:0!important}.clearfix{clear:both!important}textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%}.textOverflowEllipsis{overflow:hidden;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;//width:9em}.margin0px{margin:0!important}.padding10{padding:10px;padding-bottom:0}.padding20{padding:20px}.pushDown{margin-top:5px}.boxSizingBorderBox{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.boxSizingContentBox{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.cursorPointer{cursor:pointer;text-decoration:none!important}.zeroOpacity{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.dullOpacity{opacity:.8;-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80)}.fullOpacity{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.redColor{color:red}.highlightBackgroundColor{background:#eeeff2}.contentsBackground{background:#fff;border:1px solid #ddd}.textAlignCenter{text-align:center}.textAlignRight{text-align:right}.alignMiddle{vertical-align:middle}.alignTop{vertical-align:top}.padding1per{padding:1%}.paddingTop20{padding-top:20px}.padding20px{padding:20px}.padding-bottom1per{padding-bottom:1%}.marginBottom10px{margin-bottom:10px}.displayInlineBlock{display:inline-block}.backgroundImageNone{background-image:none}.liStyleNone{list-style:none outside none}.fontBold{font-weight:bold!important}.livesupport_tab,#userfeedback{display:none!important}#reportDetails table tr td.summary{border-bottom:0;border-top:0}#portalDetailViewHttpError{padding-bottom:7px;margin-top:50px;color:red;text-align:center}.slidesjs-pagination{list-style:none}.slidesjs-pagination li a{display:block;width:13px;height:0;padding-top:13px;background-image:url('../images/pagination.png');background-position:0 0;float:left;overflow:hidden}.slidesjs-pagination li a.active,.slidesjs-pagination li a:hover.active{background-position:0 -13px}.extensionStorebtn{background:#f08c39;background-image:-webkit-linear-gradient(top,#f08c39,#e68b3c);background-image:-moz-linear-gradient(top,#f08c39,#e68b3c);background-image:-ms-linear-gradient(top,#f08c39,#e68b3c);background-image:-o-linear-gradient(top,#f08c39,#e68b3c);background-image:linear-gradient(to bottom,#f08c39,#e68b3c);-webkit-border-radius:2;-moz-border-radius:2;border-radius:2px;text-shadow:0 0 1px #595959;color:#fff;font-size:14px;font-weight:bold;padding:8px 20px 8px 20px;text-decoration:none;border:0}.extensionStorebtn:hover{background:#fc9f3c;background-image:-webkit-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-moz-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-ms-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-o-linear-gradient(top,#fc9f3c,#f08a3c);background-image:linear-gradient(to bottom,#fc9f3c,#f08a3c);text-decoration:none}.extensionSearch{padding:8px 12px 8px 30px!important;margin:6px 0 14px 0;box-shadow:inset 2px 2px 10px #ddd;border-radius:2px!important;background:url('../images/search.png') no-repeat;background-position:5px 6px}.banner-container{border-bottom:1px solid #fff;box-sizing:border-box}.banner{margin:0 90px}.bx-wrapper{margin:0 auto 35px!important;padding-top:17px!important}.bx-wrapper li a{display:block}.bx-wrapper a img{height:100px;width:auto;margin:0 auto}.wide,.table td.wide,.listViewEntries td.wide,td.listViewEntryValue.wide{padding:8px!important}.medium,.table td.medium,.listViewEntries td.medium,td.listViewEntryValue.medium{padding:5px 6px!important}.narrow,.table td.narrow,.listViewEntries td.narrow,td.listViewEntryValue.narrow{padding:2px 4px!important}.table thead th.narrow{vertical-align:middle}td.listViewEntryValue .row input{padding:0;margin-bottom:0}.listViewContentDiv{position:relative}.fieldLabel .pull-right{text-align:right}#tagRecordText{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;width:80%!important}#tagRecord{margin-left:5px!important}.tag{float:right!important}.cut-string{text-overflow:ellipsis;-o-text-overflow:ellipsis;-webkit-text-overflow:ellipsis;width:200px;white-space:nowrap;overflow:hidden}.paddingLRZero{padding-left:0;padding-right:0}.paddingRightZero{padding-right:0}.detailViewToolbar{margin-top:5px}.input-group.input-group-sm>.input-group-addon img{width:15px}table tr td .input-sm{min-width:50px}.modal-footer.backgroundColor{background-color:#f5f5f5}.panel-title{font-size:14px}.quickWidgetContainer .panel-body{padding-bottom:0;padding-top:0}tr.summaryViewEntries,#detailView table{font-size:13px}table.listViewEntriesTable{font-size:13px;margin-top:5px}.no-margin{margin:0}.companyLogo img{max-height:200px;max-width:250px}.navbar-inverse .navbar-nav>li>a{color:#fff;padding:15px 12px}.navbar-inverse .navbar-nav .dropdown-menu>li>a{padding:3px 15px;font-size:12px}.headerCalendar .month h3{font-size:18px;font-weight:bold;margin:5px 0 0 0}.columnsSelect{width:100%!important}.marginBottom5{margin-bottom:5px}.editViewContainer .recordEditView table.blockContainer tr td.fieldValue{width:30%}.recordEditView[name=QuickCreate] .quickCreateContent table tr td.fieldValue,#massEditContainer .massEditContent table tr td.fieldValue,#tab_accounts td.functionList{width:30%}.btn{white-space:normal}.valuesAssignedToRole{border:1px solid #adadad;overflow:hidden;text-overflow:ellipsis;padding:6px}table.dataTable .form-control{width:100%!important}#breadcrumb .stepNum{margin-top:0}#breadcrumb .stepText{position:relative;top:-4px}.fc button{height:auto!important}.fc-toolbar{margin-bottom:0!important}.fc-center,.fc-left,.fc-right{margin-bottom:1em}.calendarRightPanel{padding-left:5px;padding-right:5px}.calendarRightPanel ul li{margin-bottom:2px;margin-left:5px}.calendarRightPanel ul li:hover{background-color:#eee!important;border-radius:5px}.square9{width:12px;height:12px;margin:4px}.panel-dark{border-color:#737373}.panel-dark>.panel-heading{color:#fff;background-color:#737373;border-color:#737373}.panel-dark>.panel-heading+.panel-collapse>.panel-body{border-top-color:#737373}.panel-dark>.panel-heading .badge{color:#737373;background-color:#fff}.panel-dark>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#737373}.calendarRightPanel .widgetContainer ul{margin-top:5px;margin-bottom:5px}.paddingLeft5px{padding-left:5px}.marginBottom5px{margin-bottom:5px}.detailview-table .fieldValue .summaryViewEdit{display:none}.detailview-table .fieldValue:hover .summaryViewEdit{display:inherit}.icon-in-history-widget{font-size:17px;padding:4px}#prefPageHeader .logo img{height:70px;width:70px}#myPrefHeading h3{margin-top:12px}.list-user-img{width:50px;height:40px}span[name=existingImages] img{height:200px;width:300px}.narrow.fieldValue .chosen-container-single .chosen-single{height:26px;line-height:26px}.narrow.fieldValue input{height:26px}.narrow.fieldValue .input-group-addon{padding:4px 10px}.narrow.fieldValue .chosen-container-single .chosen-single div b{background-position-y:4px}.image-in-button{width:18px}.fc-time-grid .fc-time-grid-event.fc-event{min-height:27px;min-width:100px}.fc-time-grid-event.fc-short .fc-title{font-size:1em}.paddingTBZero{padding-top:0;padding-bottom:0}.dashboardWidgetContent a .glyphicon{top:-3px}.detailViewTitle .popover{min-width:130px;text-align:center}.cursorDefault{cursor:default!important}.remindersNoticeContainer{position:fixed;right:0;top:109px;z-index:1029;width:0;height:100%;bottom:30px;overflow-y:auto;background:rgba(0,0,0,0.4);border-left:1px solid #797979;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;overflow-y:auto}.remindersNoticeContainer.toggled{width:380px}.remindersContent{margin:5px 8px 0 8px}.activityTypeIcon{height:20px}.remindersNoticeContainer .panel{margin-bottom:10px}.remindersNoticeContainer .panel-body{padding:10px}.remindersNoticeContainer .actionRow a.btn{margin-right:3%}.remindersNotice{color:#fff;padding:15px 12px}.remindersNotice .glyphicon{font-size:20px}.cancelLink.btn[type='reset'],.cancel.btn[type='reset']{float:right;margin-left:5px;margin-bottom:0}.activityWidgetContainer .popover{min-width:240px}.filterActionImage{margin-left:8px}#tagRecord{line-height:25px}#tagsList .btn-info{margin-left:5px}#tagRecordInput{padding-left:15px;padding-right:15px}.clearReferenceSelection,.createReferenceRecord{padding:0 6px}.relatedPopup{padding:0 4px}.popupContainer .popupModuleName{margin-top:0}.mailRows hr{margin:0}.paddingLeftMd{padding-left:15px}.widget_header div:nth-child(2).btn-toolbar,.editViewContainer .contentHeader.row div:nth-child(2){margin-top:20px}.fieldLabel .referenceMandatory{margin-right:-12px}.ui-widget-content{padding:.8em}.ui-autocomplete .ui-autocomplete-category{font-weight:bold;line-height:1.5}.ui-autocomplete .ui-autocomplete-category:first-child{margin:.8em 0 .2em}.ui-autocomplete .ui-menu-item{padding:.2em .8em}.ui-autocomplete .ui-state-focus{border:0;background:#ebebeb}.widgetHr{margin-top:0}.headerLinksMails .btn-group{margin-top:11px}.finalDiscountUI,.finalTaxUI{bottom:5px}.sideBarTitle{font-size:20px}.globalSearchInput{width:300px}#groupsDetailContainer strong{line-height:21px}#addTaskContainer #taskStatus{margin-left:10px}.scanerMailActionsButtons{min-width:96px}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#404040}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active,.ui-menu .ui-menu-item a.ui-widget-content{font-weight:bold;margin:0;background-color:#428bca;border-color:#357ebd;color:#fff;display:block}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style:none}#layoutEditorButtons{margin-bottom:10px;margin-top:-10px}.individualTaxContainer{text-align:left!important}.inventoryItems .input-group{max-width:200px}.inventoryItems .rowName .input-group{max-width:400px}.inventoryItems td,.inventoryItems th{border:1px solid #ddd}.inventoryItems tfoot td.hideTd{border:0;background:#fafafb}.inventorySummaryContainer .panel-body,.inventorySummaryContainer .panel-footer{padding:0}.inventorySummaryContainer .panel-body .form-group,.inventorySummaryContainer .panel-footer .form-group{margin:0}.inventorySummaryContainer .input-group .form-control{background-color:#f5f5f5}.inventorySummaryContainer .panel-body .percent{min-width:55px}.inventoryItems tfoot{font-weight:800}.inventorySummaryContainer img{max-width:15px} \ No newline at end of file diff --git a/modules/Vtiger/innventoryFields/Basic.php b/modules/Vtiger/innventoryFields/Basic.php new file mode 100644 index 000000000000..abf1a587a570 --- /dev/null +++ b/modules/Vtiger/innventoryFields/Basic.php @@ -0,0 +1,139 @@ + + */ +class Vtiger_Basic_InnventoryField extends Vtiger_Base_Model +{ + + protected $name = ''; + protected $defaultLabel = 'LBL_CURRENCY'; + protected $defaultValue = ''; + protected $columnName = ''; + protected $dbType = 'varchar(100)'; + protected $customColumn = []; + protected $summationValue = false; + + /** + * Geting database-type of field + * @return string dbType + */ + public function getDBType() + { + return $this->dbType; + } + + /** + * Geting template name + * @return string templateName + */ + public function getTemplateName($view, $moduleName) + { + $tpl = $view . $this->name . '.tpl'; + $filename = 'layouts' . DIRECTORY_SEPARATOR . 'vlayout' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . $moduleName . DIRECTORY_SEPARATOR . 'innventoryFields' . DIRECTORY_SEPARATOR . $tpl; + if (is_file($filename)) { + return $tpl; + } + $filename = 'layouts' . DIRECTORY_SEPARATOR . 'vlayout' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'Vtiger' . DIRECTORY_SEPARATOR . 'innventoryFields' . DIRECTORY_SEPARATOR . $tpl; + if (is_file($filename)) { + return $tpl; + } + return $view . 'Base' . '.tpl'; + } + + /** + * Geting default label + * @return string defaultLabel + */ + public function getDefaultLabel() + { + return $this->defaultLabel; + } + + /** + * Geting field name + * @return string name + */ + public function getName() + { + return $this->name; + } + + /** + * Geting column name + * @return string columnName + */ + public function getColumnName() + { + return $this->columnName; + } + + /** + * Geting column name + * @return string customColumn + */ + public function getCustomColumn() + { + return $this->customColumn; + } + + public function isSummary() + { + return $this->summationValue; + } + + /** + * Data field instance initialization + * @param array $valueArray Array for initialization + */ + public function initialize($valueArray) + { + $this->setData($valueArray); + } + + /** + * Geting value to display + * @param type $value + * @return string + */ + public function getDisplayValue($value) + { + return $value; + } + + /** + * Geting value to display + * @param type $value + * @return string + */ + public function getEditValue($value) + { + return $this->getDisplayValue($value); + } + + /** + * Geting value + * @param type $value + * @return string + */ + public function getValue($value) + { + if ($value == '') { + return $this->get('defaultvalue'); + } + return $value; + } + + public function isMandatory() + { + return true; + } + + public function isVisible($data) + { + return true; + } +} diff --git a/modules/Vtiger/innventoryFields/Comment.php b/modules/Vtiger/innventoryFields/Comment.php new file mode 100644 index 000000000000..465c7151f7d9 --- /dev/null +++ b/modules/Vtiger/innventoryFields/Comment.php @@ -0,0 +1,17 @@ + + */ +class Vtiger_Comment_InnventoryField extends Vtiger_Basic_InnventoryField +{ + + protected $name = 'Comment'; + protected $defaultLabel = 'LBL_COMMENT'; + protected $columnName = 'comment'; + protected $dbType = 'varchar(500)'; + +} diff --git a/modules/Vtiger/innventoryFields/Currency.php b/modules/Vtiger/innventoryFields/Currency.php new file mode 100644 index 000000000000..e56731d4a3d5 --- /dev/null +++ b/modules/Vtiger/innventoryFields/Currency.php @@ -0,0 +1,26 @@ + + */ +class Vtiger_Currency_InnventoryField extends Vtiger_Basic_InnventoryField +{ + + protected $name = 'Currency'; + protected $defaultLabel = 'LBL_CURRENCY'; + protected $columnName = 'currency'; + protected $dbType = 'int(10)'; + + /** + * Geting value to display + * @param int $value + * @return string + */ + public function getDisplayValue($value) + { + return Vtiger_Functions::getCurrencyName($value,false); + } +} diff --git a/modules/Vtiger/innventoryFields/Discount.php b/modules/Vtiger/innventoryFields/Discount.php new file mode 100644 index 000000000000..2eaf09d93947 --- /dev/null +++ b/modules/Vtiger/innventoryFields/Discount.php @@ -0,0 +1,30 @@ + + */ +class Vtiger_Discount_InnventoryField extends Vtiger_Basic_InnventoryField +{ + + protected $name = 'Discount'; + protected $defaultLabel = 'LBL_DISCOUNT'; + protected $columnName = 'discount'; + protected $dbType = 'decimal(27,8) DEFAULT \'0\''; + protected $customColumn = [ + 'discountparam' => 'varchar(255) NOT NULL' + ]; + protected $summationValue = true; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return CurrencyField::convertToUserFormat($value, null, true); + } +} diff --git a/modules/Vtiger/innventoryFields/DiscountMode.php b/modules/Vtiger/innventoryFields/DiscountMode.php new file mode 100644 index 000000000000..57900e28a113 --- /dev/null +++ b/modules/Vtiger/innventoryFields/DiscountMode.php @@ -0,0 +1,28 @@ + + */ +class Vtiger_DiscountMode_InnventoryField extends Vtiger_Basic_InnventoryField +{ + + protected $name = 'DiscountMode'; + protected $defaultLabel = 'LBL_DISCOUNT_MODE'; + protected $defaultValue = '0'; + protected $columnName = 'discountmode'; + protected $dbType = "tinyint(1) NOT NULL DEFAULT '0'"; + protected $values = [0 => 'group', 1 => 'individual']; + + /** + * Geting value to display + * @param int $value + * @return string + */ + public function getDisplayValue($value) + { + return 'LBL_' . strtoupper($this->values[$value]); + } +} diff --git a/modules/Vtiger/innventoryFields/GrossPrice.php b/modules/Vtiger/innventoryFields/GrossPrice.php new file mode 100644 index 000000000000..f7078733faa1 --- /dev/null +++ b/modules/Vtiger/innventoryFields/GrossPrice.php @@ -0,0 +1,27 @@ + + */ +class Vtiger_GrossPrice_InnventoryField extends Vtiger_Basic_InnventoryField +{ + + protected $name = 'GrossPrice'; + protected $defaultLabel = 'LBL_GROSS_PRICE'; + protected $columnName = 'gross'; + protected $dbType = 'decimal(27,8) DEFAULT \'0\''; + protected $summationValue = true; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return CurrencyField::convertToUserFormat($value, null, true); + } +} diff --git a/modules/Vtiger/innventoryFields/Margin.php b/modules/Vtiger/innventoryFields/Margin.php new file mode 100644 index 000000000000..546686f048c0 --- /dev/null +++ b/modules/Vtiger/innventoryFields/Margin.php @@ -0,0 +1,26 @@ + + */ +class Vtiger_Margin_InnventoryField extends Vtiger_Basic_InnventoryField +{ + + protected $name = 'Margin'; + protected $defaultLabel = 'LBL_MARGIN'; + protected $columnName = 'margin'; + protected $dbType = 'decimal(27,8) DEFAULT \'0\''; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return CurrencyField::convertToUserFormat($value, null, true); + } +} diff --git a/modules/Vtiger/innventoryFields/MarginP.php b/modules/Vtiger/innventoryFields/MarginP.php new file mode 100644 index 000000000000..34c1f22fd066 --- /dev/null +++ b/modules/Vtiger/innventoryFields/MarginP.php @@ -0,0 +1,26 @@ + + */ +class Vtiger_MarginP_InnventoryField extends Vtiger_Basic_InnventoryField +{ + + protected $name = 'MarginP'; + protected $defaultLabel = 'LBL_MARGIN_PRECENT'; + protected $columnName = 'marginp'; + protected $dbType = 'decimal(27,8) DEFAULT \'0\''; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return CurrencyField::convertToUserFormat($value, null, true); + } +} diff --git a/modules/Vtiger/innventoryFields/Name.php b/modules/Vtiger/innventoryFields/Name.php new file mode 100644 index 000000000000..11466edfaaba --- /dev/null +++ b/modules/Vtiger/innventoryFields/Name.php @@ -0,0 +1,28 @@ + + */ +class Vtiger_Name_InnventoryField extends Vtiger_Basic_InnventoryField +{ + + protected $name = 'Name'; + protected $defaultLabel = 'LBL_ITEM_NAME'; + protected $columnName = 'name'; + protected $dbType = 'int(19) DEFAULT \'0\''; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + if($value != 0) + return Vtiger_Functions::getCRMRecordLabel($value); + return ''; + } +} diff --git a/modules/Vtiger/innventoryFields/NetPrice.php b/modules/Vtiger/innventoryFields/NetPrice.php new file mode 100644 index 000000000000..fccf408a7646 --- /dev/null +++ b/modules/Vtiger/innventoryFields/NetPrice.php @@ -0,0 +1,27 @@ + + */ +class Vtiger_NetPrice_InnventoryField extends Vtiger_Basic_InnventoryField +{ + + protected $name = 'NetPrice'; + protected $defaultLabel = 'LBL_DISCOUNT_PRICE'; + protected $columnName = 'net'; + protected $dbType = 'decimal(27,8) DEFAULT \'0\''; + protected $summationValue = true; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return CurrencyField::convertToUserFormat($value, null, true); + } +} diff --git a/modules/Vtiger/innventoryFields/Purchase.php b/modules/Vtiger/innventoryFields/Purchase.php new file mode 100644 index 000000000000..9cb0c8717258 --- /dev/null +++ b/modules/Vtiger/innventoryFields/Purchase.php @@ -0,0 +1,26 @@ + + */ +class Vtiger_Purchase_InnventoryField extends Vtiger_Basic_InnventoryField +{ + + protected $name = 'Purchase'; + protected $defaultLabel = 'LBL_PURCHASE'; + protected $columnName = 'purchase'; + protected $dbType = 'decimal(27,8) DEFAULT \'0\''; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return CurrencyField::convertToUserFormat($value, null, true); + } +} diff --git a/modules/Vtiger/innventoryFields/Quantity.php b/modules/Vtiger/innventoryFields/Quantity.php new file mode 100644 index 000000000000..cf456aec4f19 --- /dev/null +++ b/modules/Vtiger/innventoryFields/Quantity.php @@ -0,0 +1,27 @@ + + */ +class Vtiger_Quantity_InnventoryField extends Vtiger_Basic_InnventoryField +{ + + protected $name = 'Quantity'; + protected $defaultLabel = 'LBL_QUANTITY'; + protected $defaultValue = '1'; + protected $columnName = 'qty'; + protected $dbType = 'decimal(25,3)'; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return Vtiger_Functions::formatDecimal($value); + } +} diff --git a/modules/Vtiger/innventoryFields/Reference.php b/modules/Vtiger/innventoryFields/Reference.php new file mode 100644 index 000000000000..8ac1a756ffdf --- /dev/null +++ b/modules/Vtiger/innventoryFields/Reference.php @@ -0,0 +1,28 @@ + + */ +class Vtiger_Reference_InnventoryField extends Vtiger_Basic_InnventoryField +{ + + protected $name = 'Reference'; + protected $defaultLabel = 'LBL_REFERENCE'; + protected $columnName = 'ref'; + protected $dbType = 'int(19)'; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + if($value != 0) + return Vtiger_Functions::getCRMRecordLabel($value); + return ''; + } +} diff --git a/modules/Vtiger/innventoryFields/Tax.php b/modules/Vtiger/innventoryFields/Tax.php new file mode 100644 index 000000000000..dc9f6813bd79 --- /dev/null +++ b/modules/Vtiger/innventoryFields/Tax.php @@ -0,0 +1,38 @@ + + */ +class Vtiger_Tax_InnventoryField extends Vtiger_Basic_InnventoryField +{ + + protected $name = 'Tax'; + protected $defaultLabel = 'LBL_TAX'; + protected $columnName = 'tax'; + protected $dbType = 'decimal(27,8) DEFAULT \'0\''; + protected $customColumn = [ + 'taxparam' => 'varchar(255) NOT NULL' + ]; + protected $summationValue = true; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return CurrencyField::convertToUserFormat($value, null, true); + } + + public function getClassName($data) + { + if(count($data) > 0 && $data[0]['taxmode'] == 0){ + return 'hide'; + } + return ''; + } +} diff --git a/modules/Vtiger/innventoryFields/TaxMode.php b/modules/Vtiger/innventoryFields/TaxMode.php new file mode 100644 index 000000000000..cfb8a40a03ca --- /dev/null +++ b/modules/Vtiger/innventoryFields/TaxMode.php @@ -0,0 +1,28 @@ + + */ +class Vtiger_TaxMode_InnventoryField extends Vtiger_Basic_InnventoryField +{ + + protected $name = 'TaxMode'; + protected $defaultLabel = 'LBL_TAX_MODE'; + protected $defaultValue = '0'; + protected $columnName = 'taxmode'; + protected $dbType = "tinyint(1) NOT NULL DEFAULT '0'"; + protected $values = [0 => 'group', 1 => 'individual']; + + /** + * Geting value to display + * @param int $value + * @return string + */ + public function getDisplayValue($value) + { + return 'LBL_' . strtoupper($this->values[$value]); + } +} diff --git a/modules/Vtiger/innventoryFields/TotalPrice.php b/modules/Vtiger/innventoryFields/TotalPrice.php new file mode 100644 index 000000000000..e70d6cdbebbf --- /dev/null +++ b/modules/Vtiger/innventoryFields/TotalPrice.php @@ -0,0 +1,27 @@ + + */ +class Vtiger_TotalPrice_InnventoryField extends Vtiger_Basic_InnventoryField +{ + + protected $name = 'TotalPrice'; + protected $defaultLabel = 'LBL_TOTAL_PRICE'; + protected $columnName = 'total'; + protected $dbType = 'decimal(27,8) DEFAULT \'0\''; + protected $summationValue = true; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return CurrencyField::convertToUserFormat($value, null, true); + } +} diff --git a/modules/Vtiger/innventoryFields/UnitPrice.php b/modules/Vtiger/innventoryFields/UnitPrice.php new file mode 100644 index 000000000000..e05b2e9f62f1 --- /dev/null +++ b/modules/Vtiger/innventoryFields/UnitPrice.php @@ -0,0 +1,27 @@ + + */ +class Vtiger_UnitPrice_InnventoryField extends Vtiger_Basic_InnventoryField +{ + + protected $name = 'UnitPrice'; + protected $defaultLabel = 'LBL_UNIT_PRICE'; + protected $columnName = 'price'; + protected $dbType = 'decimal(27,8)'; + protected $summationValue = true; + + /** + * Geting value to display + * @param type $value + * @return type + */ + public function getDisplayValue($value) + { + return CurrencyField::convertToUserFormat($value, null, true); + } +} diff --git a/modules/Vtiger/innventoryFields/Value.php b/modules/Vtiger/innventoryFields/Value.php new file mode 100644 index 000000000000..b2cfc6a65f4a --- /dev/null +++ b/modules/Vtiger/innventoryFields/Value.php @@ -0,0 +1,16 @@ + + */ +class Vtiger_Value_InnventoryField extends Vtiger_Basic_InnventoryField +{ + + protected $name = 'Value'; + protected $defaultLabel = 'LBL_VALUE'; + protected $columnName = 'value'; + protected $dbType = 'varchar(255)'; +} diff --git a/modules/Vtiger/models/InventoryField.php b/modules/Vtiger/models/InventoryField.php new file mode 100644 index 000000000000..ea43dde2eadb --- /dev/null +++ b/modules/Vtiger/models/InventoryField.php @@ -0,0 +1,239 @@ + + */ +class Vtiger_InventoryField_Model extends Vtiger_Base_Model +{ + + const DATA_PREFIX = '_sups'; + const FIELDS_PREFIX = '_supfield'; + const AUTOFIELD_PREFIX = '_supmap'; + + protected static $fields = false; + protected static $columns = false; + + /** + * Create the name of the Supplies data table + * @param string $module Module name + * @param string $prefix Prefix table + * @return string Table name + */ + public function getTableName($type = 'data') + { + switch ($type) { + case 'data': + $prefix = self::DATA_PREFIX; + break; + case 'fields': + $prefix = self::FIELDS_PREFIX; + break; + case 'autofield': + $prefix = self::AUTOFIELD_PREFIX; + break; + } + $moduleName = strtolower($this->get('module')); + $basetable = 'vtiger_' . $moduleName; + $supfield = $basetable . $prefix; + return $supfield; + } + + /** + * Loading the Supplies data + * @param string $module Module name + * @param boolean $returnInBlock Should the result be divided into blocks + * @return array Supplies data + */ + public function getFields($returnInBlock = false) + { + $log = vglobal('log'); + $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . '| '); + + if (!$this->fields) { + $db = PearDatabase::getInstance(); + $table = $this->getTableName('fields'); + $result = $db->query("SHOW TABLES LIKE '$table'"); + if ($result->rowCount() == 0) { + return false; + } + $result = $db->pquery('SELECT * FROM ' . $table . ' WHERE presence = ? ORDER BY sequence', [0]); + $fields = []; + while ($row = $db->fetch_array($result)) { + if (!$this->isActiveField($row)) { + continue; + } + $fields[$row['columnname']] = $this->getInventoryFieldInstance($row); + } + $this->fields = $fields; + }else{ + $fields = $this->fields; + } + if ($returnInBlock) { + $block = []; + foreach ($fields as $field) { + $block[$field->get('block')][$field->get('columnname')] = $field; + } + $fields = $block; + } + $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); + return $fields; + } + + public function isActiveField($row) + { + if (in_array($row['suptype'], ['Discount', 'DiscountMode'])) { + $discountsConfig = Products_Record_Model::getDiscountsConfig(); + if ($discountsConfig['active'] == '0') { + return false; + } + } + + return true; + } + + /** + * Loading the Supplies data + * @param string $module Module name + * @param boolean $returnInBlock Should the result be divided into blocks + * @return array Supplies data + */ + public function getColumns() + { + $log = vglobal('log'); + $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . '| '); + if ($this->columns) { + return $this->columns; + } + + $columns = []; + foreach ($this->getFields() as $field) { + $column = $field->getColumnName(); + if ($column != '') + $columns[] = $column; + foreach ($field->getCustomColumn() as $name => $field) { + $columns[] = $name; + } + } + $this->columns = $columns; + $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); + return $columns; + } + + /** + * Creating installation of the field from the table + * @param string $valueArray Array of data + * @return \modelClassName Instance Supplies_Basic_Field + */ + public function getInventoryFieldInstance($valueArray) + { + $log = vglobal('log'); + $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . '| '); + + $className = Vtiger_Loader::getComponentClassName('InnventoryField', $valueArray['suptype'], $this->get('module')); + $instance = new $className(); + $instance->initialize($valueArray); + + $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); + return $instance; + } + + /** + * Retrieve list of all fields + * @param string $module Module name + * @return array Fields instance Supplies_Basic_Field + */ + public static function getAllFields($module = false) + { + $log = vglobal('log'); + $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . '| ' . $module); + $fieldPaths = ['modules/Supplies/fields/']; + if ($module) { + $fieldPaths[] = "modules/$module/fields/"; + } + $fields = []; + foreach ($fieldPaths as $fieldPath) { + if (!is_dir($fieldPath)) + continue; + foreach (new DirectoryIterator($fieldPath) as $fileinfo) { + if ($fileinfo->isFile() && $fileinfo->getFilename() != 'Basic.php') { + $fieldName = str_replace('.php', '', $fileinfo->getFilename()); + $className = Vtiger_Loader::getComponentClassName('Field', $fieldName, 'Supplies'); + $fields[$fieldName] = new $className(); + } + } + } + $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); + return $fields; + } + + /** + * Retrieve list of parameters + * @param array $fields Array of instances fields (Supplies_Basic_Field) + * @return array Array of parameters + */ + public static function getMainParams($fields) + { + $log = vglobal('log'); + $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__); + + $params = false; + foreach ($fields as $field) { + if ($field->getName() == 'Name') { + $params = Zend_Json::decode($field->get('params')); + } + } + + $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); + return $params; + } + + public static function getInstance($moduleName) + { + $instance = Vtiger_Cache::get('inventoryField', $moduleName); + if (!$instance) { + $modelClassName = Vtiger_Loader::getComponentClassName('Model', 'InventoryField', $moduleName); + $instance = new $modelClassName(); + $instance->set('module', $moduleName); + Vtiger_Cache::set('inventoryField', $moduleName, $instance); + } + return $instance; + } + + public static function getAutoCompleteField($recordModuleName, $moduleName) + { + $db = PearDatabase::getInstance(); + $table = self::getTableName($moduleName, 'autofield'); + $result = $db->query("SHOW TABLES LIKE '$table'"); + if ($result->rowCount() == 0) { + return false; + } + $result = $db->pquery('SELECT * FROM ' . $table . ' WHERE module = ?', [$recordModuleName]); + $fields = []; + while ($row = $db->fetch_array($result)) { + $fields[] = $row; + } + return $fields; + } + + public static function getTaxParam($taxParam, $net, $return = false) + { + $taxParam = json_decode($taxParam, true); + if (count($taxParam) == 0) { + return []; + } + if (is_string($taxParam['aggregationType'])) { + $taxParam['aggregationType'] = [$taxParam['aggregationType']]; + } + if (!$return) { + $return = []; + } + foreach ($taxParam['aggregationType'] as $aggregationType) { + $precent = $taxParam[$aggregationType . 'Tax']; + $return[$precent] += $net * ($precent / 100); + } + return $return; + } +} diff --git a/modules/Vtiger/models/Record.php b/modules/Vtiger/models/Record.php index c0bc7383798a..35ea68e0f21a 100644 --- a/modules/Vtiger/models/Record.php +++ b/modules/Vtiger/models/Record.php @@ -537,4 +537,32 @@ function getListFieldsToGenerate($parentModuleName, $moduleName) $module = CRMEntity::getInstance($parentModuleName); return $module->fieldsToGenerate[$moduleName] ? $module->fieldsToGenerate[$moduleName] : array(); } + + /** + * Loading the inventory data + * @return array Supplies data + */ + public function getInventoryData() + { + $log = vglobal('log'); + $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__); + + $module = $this->getModuleName(); + $record = $this->getId(); + if (empty($record)) { + return []; + } + + $db = PearDatabase::getInstance(); + $inventoryField = Vtiger_InventoryField_Model::getInstance($module); + $table = $inventoryField->getTableName('data'); + $result = $db->pquery('SELECT * FROM ' . $table . ' WHERE id = ? ORDER BY seq', [$record]); + $fields = []; + while ($row = $db->fetch_array($result)) { + $fields[] = $row; + } + + $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); + return $fields; + } } diff --git a/modules/Vtiger/views/Detail.php b/modules/Vtiger/views/Detail.php index adb4df831456..742d73469788 100644 --- a/modules/Vtiger/views/Detail.php +++ b/modules/Vtiger/views/Detail.php @@ -256,7 +256,7 @@ function showModuleDetailView(Vtiger_Request $request) $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel()); $viewer->assign('MODULE_NAME', $moduleName); $viewer->assign('IS_AJAX_ENABLED', $this->isAjaxEnabled($recordModel)); - + $viewer->assign('MODULE_TYPE', $moduleModel->getModuleType()); return $viewer->view('DetailViewFullContents.tpl', $moduleName, true); } From dd6afa6b421cbcd1875b6dd8fa4feeddf039fa80 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Mon, 31 Aug 2015 14:34:22 +0200 Subject: [PATCH 036/489] Added new module inventory to the engine (edit view) --- languages/pl_pl/Supplies.php | 63 --- languages/pl_pl/Vtiger.php | 51 +++ .../modules/Supplies/DetailViewSupplies.tpl | 81 ---- .../Supplies/DetailViewSuppliesSummary.tpl | 96 ----- .../modules/Supplies/EditViewSupplies.tpl | 93 ---- .../Supplies/fields/DetailViewBase.tpl | 4 - .../fields/DetailViewDiscountMode.tpl | 4 - .../Supplies/fields/DetailViewTaxMode.tpl | 4 - .../Supplies/fields/EditViewComment.tpl | 8 - .../Supplies/fields/EditViewCurrency.tpl | 38 -- .../Supplies/fields/EditViewDiscount.tpl | 15 - .../Supplies/fields/EditViewDiscountMode.tpl | 7 - .../Supplies/fields/EditViewGrossPrice.tpl | 6 - .../Supplies/fields/EditViewMargin.tpl | 5 - .../Supplies/fields/EditViewMarginP.tpl | 8 - .../modules/Supplies/fields/EditViewName.tpl | 41 -- .../Supplies/fields/EditViewNetPrice.tpl | 6 - .../Supplies/fields/EditViewPurchase.tpl | 7 - .../Supplies/fields/EditViewQuantity.tpl | 5 - .../Supplies/fields/EditViewReference.tpl | 33 -- .../modules/Supplies/fields/EditViewTax.tpl | 13 - .../Supplies/fields/EditViewTaxMode.tpl | 7 - .../Supplies/fields/EditViewTotalPrice.tpl | 6 - .../Supplies/fields/EditViewUnitPrice.tpl | 16 - .../modules/Supplies/fields/EditViewValue.tpl | 10 - .../modules/Supplies/resources/Edit.min.js | 2 - .../Vtiger/DetailViewInventoryView.tpl | 4 +- layouts/vlayout/modules/Vtiger/EditView.tpl | 21 +- .../modules/Vtiger/EditViewInventory.tpl | 99 +++++ .../EditViewInventoryItem.tpl} | 24 +- .../EditViewInventorySummary.tpl} | 28 +- .../InventoryDiscounts.tpl} | 4 +- .../InventoryDiscountsType0.tpl} | 0 .../InventoryDiscountsType1.tpl} | 0 .../InventoryDiscountsType2.tpl} | 0 .../InventoryLimitAlert.tpl} | 0 .../Taxs.tpl => Vtiger/InventoryTaxes.tpl} | 4 +- .../InventoryTaxesType0.tpl} | 0 .../InventoryTaxesType1.tpl} | 0 .../InventoryTaxesType2.tpl} | 0 .../InventoryTaxesType3.tpl} | 0 .../innventoryFields/DetailViewBase.tpl | 2 +- .../DetailViewDiscountMode.tpl | 2 +- .../innventoryFields/DetailViewTaxMode.tpl | 2 +- .../innventoryFields/EditViewComment.tpl | 4 +- .../innventoryFields/EditViewCurrency.tpl | 2 +- .../innventoryFields/EditViewDiscount.tpl | 4 +- .../innventoryFields/EditViewDiscountMode.tpl | 4 +- .../innventoryFields/EditViewGrossPrice.tpl | 2 +- .../innventoryFields/EditViewMargin.tpl | 2 +- .../innventoryFields/EditViewMarginP.tpl | 2 +- .../Vtiger/innventoryFields/EditViewName.tpl | 8 +- .../innventoryFields/EditViewNetPrice.tpl | 2 +- .../innventoryFields/EditViewPurchase.tpl | 2 +- .../innventoryFields/EditViewQuantity.tpl | 2 +- .../innventoryFields/EditViewReference.tpl | 8 +- .../Vtiger/innventoryFields/EditViewTax.tpl | 4 +- .../innventoryFields/EditViewTaxMode.tpl | 4 +- .../innventoryFields/EditViewTotalPrice.tpl | 2 +- .../innventoryFields/EditViewUnitPrice.tpl | 2 +- .../Vtiger/innventoryFields/EditViewValue.tpl | 4 +- .../Edit.js => Vtiger/resources/Inventory.js} | 400 +++++++++--------- .../modules/Vtiger/resources/Inventory.min.js | 2 + .../{SuppliesLimit.tpl => InventoryLimit.tpl} | 0 ...hView.tpl => InventoryLimitSearchView.tpl} | 0 modules/Products/models/Record.php | 66 --- modules/Products/views/Discounts.php | 52 --- modules/Products/views/Taxs.php | 56 --- modules/Supplies/actions/CheckLimits.php | 73 ---- modules/Supplies/actions/GetDetails.php | 84 ---- modules/Supplies/actions/Inventory.php | 46 -- modules/Supplies/actions/MassSave.php | 11 - modules/Supplies/actions/Save.php | 23 - modules/Supplies/fields/Basic.php | 139 ------ modules/Supplies/fields/Comment.php | 17 - modules/Supplies/fields/Currency.php | 26 -- modules/Supplies/fields/Discount.php | 30 -- modules/Supplies/fields/DiscountMode.php | 28 -- modules/Supplies/fields/GrossPrice.php | 27 -- modules/Supplies/fields/Margin.php | 26 -- modules/Supplies/fields/MarginP.php | 26 -- modules/Supplies/fields/Name.php | 28 -- modules/Supplies/fields/NetPrice.php | 27 -- modules/Supplies/fields/Purchase.php | 26 -- modules/Supplies/fields/Quantity.php | 27 -- modules/Supplies/fields/Reference.php | 28 -- modules/Supplies/fields/Tax.php | 38 -- modules/Supplies/fields/TaxMode.php | 28 -- modules/Supplies/fields/TotalPrice.php | 27 -- modules/Supplies/fields/UnitPrice.php | 27 -- modules/Supplies/fields/Value.php | 16 - modules/Supplies/models/DetailView.php | 11 - modules/Supplies/models/EditView.php | 52 --- modules/Supplies/models/Module.php | 33 -- modules/Supplies/models/Record.php | 87 ---- modules/Supplies/models/SupField.php | 224 ---------- modules/Supplies/views/Detail.php | 31 -- modules/Supplies/views/Edit.php | 142 ------- modules/Vtiger/actions/Inventory.php | 165 ++++++++ modules/Vtiger/models/Field.php | 4 +- modules/Vtiger/models/Inventory.php | 128 ++++++ modules/Vtiger/models/InventoryField.php | 99 ++++- modules/Vtiger/models/Record.php | 34 ++ .../{SuppliesLimit.php => InventoryLimit.php} | 0 modules/Vtiger/views/Edit.php | 127 +++--- modules/Vtiger/views/Inventory.php | 77 ++++ 106 files changed, 996 insertions(+), 2499 deletions(-) delete mode 100644 languages/pl_pl/Supplies.php delete mode 100644 layouts/vlayout/modules/Supplies/DetailViewSupplies.tpl delete mode 100644 layouts/vlayout/modules/Supplies/DetailViewSuppliesSummary.tpl delete mode 100644 layouts/vlayout/modules/Supplies/EditViewSupplies.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/DetailViewBase.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/DetailViewDiscountMode.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/DetailViewTaxMode.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewComment.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewCurrency.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewDiscount.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewDiscountMode.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewGrossPrice.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewMargin.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewMarginP.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewName.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewNetPrice.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewPurchase.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewQuantity.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewReference.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewTax.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewTaxMode.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewTotalPrice.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewUnitPrice.tpl delete mode 100644 layouts/vlayout/modules/Supplies/fields/EditViewValue.tpl delete mode 100644 layouts/vlayout/modules/Supplies/resources/Edit.min.js create mode 100644 layouts/vlayout/modules/Vtiger/EditViewInventory.tpl rename layouts/vlayout/modules/{Supplies/EditViewSuppliesRow.tpl => Vtiger/EditViewInventoryItem.tpl} (50%) rename layouts/vlayout/modules/{Supplies/EditViewSuppliesSummary.tpl => Vtiger/EditViewInventorySummary.tpl} (75%) rename layouts/vlayout/modules/{Products/Discounts.tpl => Vtiger/InventoryDiscounts.tpl} (89%) rename layouts/vlayout/modules/{Products/DiscountsType0.tpl => Vtiger/InventoryDiscountsType0.tpl} (100%) rename layouts/vlayout/modules/{Products/DiscountsType1.tpl => Vtiger/InventoryDiscountsType1.tpl} (100%) rename layouts/vlayout/modules/{Products/DiscountsType2.tpl => Vtiger/InventoryDiscountsType2.tpl} (100%) rename layouts/vlayout/modules/{Supplies/LimitAlert.tpl => Vtiger/InventoryLimitAlert.tpl} (100%) rename layouts/vlayout/modules/{Products/Taxs.tpl => Vtiger/InventoryTaxes.tpl} (90%) rename layouts/vlayout/modules/{Products/TaxsType0.tpl => Vtiger/InventoryTaxesType0.tpl} (100%) rename layouts/vlayout/modules/{Products/TaxsType1.tpl => Vtiger/InventoryTaxesType1.tpl} (100%) rename layouts/vlayout/modules/{Products/TaxsType2.tpl => Vtiger/InventoryTaxesType2.tpl} (100%) rename layouts/vlayout/modules/{Products/TaxsType3.tpl => Vtiger/InventoryTaxesType3.tpl} (100%) rename layouts/vlayout/modules/{Supplies/resources/Edit.js => Vtiger/resources/Inventory.js} (73%) create mode 100644 layouts/vlayout/modules/Vtiger/resources/Inventory.min.js rename layouts/vlayout/modules/Vtiger/uitypes/{SuppliesLimit.tpl => InventoryLimit.tpl} (100%) rename layouts/vlayout/modules/Vtiger/uitypes/{SuppliesLimitSearchView.tpl => InventoryLimitSearchView.tpl} (100%) delete mode 100644 modules/Products/views/Discounts.php delete mode 100644 modules/Products/views/Taxs.php delete mode 100644 modules/Supplies/actions/CheckLimits.php delete mode 100644 modules/Supplies/actions/GetDetails.php delete mode 100644 modules/Supplies/actions/Inventory.php delete mode 100644 modules/Supplies/actions/MassSave.php delete mode 100644 modules/Supplies/actions/Save.php delete mode 100644 modules/Supplies/fields/Basic.php delete mode 100644 modules/Supplies/fields/Comment.php delete mode 100644 modules/Supplies/fields/Currency.php delete mode 100644 modules/Supplies/fields/Discount.php delete mode 100644 modules/Supplies/fields/DiscountMode.php delete mode 100644 modules/Supplies/fields/GrossPrice.php delete mode 100644 modules/Supplies/fields/Margin.php delete mode 100644 modules/Supplies/fields/MarginP.php delete mode 100644 modules/Supplies/fields/Name.php delete mode 100644 modules/Supplies/fields/NetPrice.php delete mode 100644 modules/Supplies/fields/Purchase.php delete mode 100644 modules/Supplies/fields/Quantity.php delete mode 100644 modules/Supplies/fields/Reference.php delete mode 100644 modules/Supplies/fields/Tax.php delete mode 100644 modules/Supplies/fields/TaxMode.php delete mode 100644 modules/Supplies/fields/TotalPrice.php delete mode 100644 modules/Supplies/fields/UnitPrice.php delete mode 100644 modules/Supplies/fields/Value.php delete mode 100644 modules/Supplies/models/DetailView.php delete mode 100644 modules/Supplies/models/EditView.php delete mode 100644 modules/Supplies/models/Module.php delete mode 100644 modules/Supplies/models/Record.php delete mode 100644 modules/Supplies/models/SupField.php delete mode 100644 modules/Supplies/views/Detail.php delete mode 100644 modules/Supplies/views/Edit.php create mode 100644 modules/Vtiger/actions/Inventory.php create mode 100644 modules/Vtiger/models/Inventory.php rename modules/Vtiger/uitypes/{SuppliesLimit.php => InventoryLimit.php} (100%) create mode 100644 modules/Vtiger/views/Inventory.php diff --git a/languages/pl_pl/Supplies.php b/languages/pl_pl/Supplies.php deleted file mode 100644 index 16930481c330..000000000000 --- a/languages/pl_pl/Supplies.php +++ /dev/null @@ -1,63 +0,0 @@ - 'Rabat', - 'LBL_TAX' => 'Podatek', - 'LBL_TOTAL_PRICE' => 'Netto', - 'LBL_ROW_COMMENT' => 'Opis', - 'LBL_SELECT_DISCOUNT' => 'Wybierz rabat', - 'LBL_GLOBAL_DISCOUNTS' => 'Globalny', - 'LBL_GROUP_DISCOUNTS' => 'Grupowy', - 'LBL_INDIVIDUAL_DISCOUNTS' => 'Indywidualny', - 'LBL_PERCENTAGE_DISCOUNTS' => 'Procentowy', - 'LBL_AMOUNT_DISCOUNTS' => 'Wartościowy', - 'LBL_DISCOUNT_FOR_ACCOUNT' => 'Rabat ustawiony na kontrahencie', - 'LBL_PRICE_BEFORE_DISCOUNT' => 'Cena przed rabatem', - 'LBL_DISCOUNT_IN_TOTAL' => 'Łączna wartość rabatu', - 'LBL_PRICE_AFTER_DISCOUNT' => 'Cena po rabacie', - 'LBL_DISCOUNT_MODE' => 'Typ rabatu', - 'LBL_VALUE' => 'Wartość', - 'LBL_QUANTITY' => 'Ilość', - 'LBL_REFERENCE' => 'Powiązanie', - 'LBL_UNIT_PRICE' => 'Cena jednostkowa', - 'LBL_MARGIN_PRECENT' => 'Marża (%)', - 'LBL_GROSS_PRICE' => 'Brutto', - 'LBL_DISCOUNT_PRICE' => 'Cena po rabacie', - 'LBL_SELECT_TAX' => 'Wybierz podatek', - 'LBL_PRICE_BEFORE_TAX' => 'Cena bez podatku', - 'LBL_TAX_IN_TOTAL' => 'Łączna wartość podatku', - 'LBL_PRICE_AFTER_TAX' => 'Cena z podatkiem', - 'LBL_GLOBAL_TAXS' => 'Globalny', - 'LBL_INDIVIDUAL_TAX' => 'Indywidualny', - 'LBL_GROUP_TAXS' => 'Grupowy', - 'LBL_TAX_FOR_MODULE' => 'Podatego ustawiony w module', - 'LBL_REGIONAL_TAX' => 'Podatek regionalny', - 'LBL_TAX_FOR_ACCOUNT' => 'Podatek ustawiony na kontrahencie', - 'LBL_LIMIT_TITLE' => 'Limit kredytowy został przekroczony', - 'LBL_CREDIT_LIMIT' => 'Limit kredytowy', - 'LBL_BALANCE_LIMIT' => 'Saldo kontrahenta', - 'LBL_CURRENT_VALUE' => 'Wartość dokumentu', - 'LBL_TOTALS_LIMIT' => 'Wartość całkowita', - 'LBL_LIMIT_ALERT' => 'Nie można zapisać rekordu', - 'LBL_IMAGE' => 'Zdjęcie', - - 'LBL_TAX_RATE' => 'Stawka VAT', - 'LBL_TAX_VALUE' => 'Podatek', - 'LBL_DISCOUNTS_SUMMARY' => 'Podsumowanie rabatu', - 'LBL_TAX_SUMMARY' => 'Podsumowanie podatu', - 'LBL_CURRENCIES_SUMMARY' => 'Podsumowanie walut', - 'LBL_CHANGE_CURRENCY' => 'Zmiana waluty', - 'LBL_CHANGE_CURRENCY_INFO' => 'Zmiana waluty spowoduje przeliczenie wszystkich wartości.
    Czy jesteś pewien czy chcesz to zroić?', - 'LBL_SUMMARY' => 'Podsumowanie', - 'LBL_AMOUNT' => 'Suma', - 'LBL_SET_GLOBAL_TAX' => 'Ustaw', - 'LBL_SET_GLOBAL_DISCOUNT' => 'Ustaw', -]; diff --git a/languages/pl_pl/Vtiger.php b/languages/pl_pl/Vtiger.php index 4b9705efb858..742907539c56 100644 --- a/languages/pl_pl/Vtiger.php +++ b/languages/pl_pl/Vtiger.php @@ -971,6 +971,57 @@ 'Mails List' => 'Najnowsze maile', 'Support Group' => 'Grupa wsparcia', 'Marketing Group' => 'Grupa marketingowa', + + //Inventory + 'LBL_DISCOUNT' => 'Rabat', + 'LBL_TAX' => 'Podatek', + 'LBL_TOTAL_PRICE' => 'Netto', + 'LBL_ROW_COMMENT' => 'Opis', + 'LBL_SELECT_DISCOUNT' => 'Wybierz rabat', + 'LBL_GLOBAL_DISCOUNTS' => 'Globalny', + 'LBL_GROUP_DISCOUNTS' => 'Grupowy', + 'LBL_INDIVIDUAL_DISCOUNTS' => 'Indywidualny', + 'LBL_PERCENTAGE_DISCOUNTS' => 'Procentowy', + 'LBL_AMOUNT_DISCOUNTS' => 'Wartościowy', + 'LBL_DISCOUNT_FOR_ACCOUNT' => 'Rabat ustawiony na kontrahencie', + 'LBL_PRICE_BEFORE_DISCOUNT' => 'Cena przed rabatem', + 'LBL_DISCOUNT_IN_TOTAL' => 'Łączna wartość rabatu', + 'LBL_PRICE_AFTER_DISCOUNT' => 'Cena po rabacie', + 'LBL_DISCOUNT_MODE' => 'Typ rabatu', + 'LBL_VALUE' => 'Wartość', + 'LBL_QUANTITY' => 'Ilość', + 'LBL_REFERENCE' => 'Powiązanie', + 'LBL_UNIT_PRICE' => 'Cena jednostkowa', + 'LBL_MARGIN_PRECENT' => 'Marża (%)', + 'LBL_GROSS_PRICE' => 'Brutto', + 'LBL_DISCOUNT_PRICE' => 'Cena po rabacie', + 'LBL_SELECT_TAX' => 'Wybierz podatek', + 'LBL_PRICE_BEFORE_TAX' => 'Cena bez podatku', + 'LBL_TAX_IN_TOTAL' => 'Łączna wartość podatku', + 'LBL_PRICE_AFTER_TAX' => 'Cena z podatkiem', + 'LBL_GLOBAL_TAXS' => 'Globalny', + 'LBL_INDIVIDUAL_TAX' => 'Indywidualny', + 'LBL_GROUP_TAXS' => 'Grupowy', + 'LBL_TAX_FOR_MODULE' => 'Podatego ustawiony w module', + 'LBL_REGIONAL_TAX' => 'Podatek regionalny', + 'LBL_TAX_FOR_ACCOUNT' => 'Podatek ustawiony na kontrahencie', + 'LBL_LIMIT_TITLE' => 'Limit kredytowy został przekroczony', + 'LBL_CREDIT_LIMIT' => 'Limit kredytowy', + 'LBL_BALANCE_LIMIT' => 'Saldo kontrahenta', + 'LBL_CURRENT_VALUE' => 'Wartość dokumentu', + 'LBL_TOTALS_LIMIT' => 'Wartość całkowita', + 'LBL_LIMIT_ALERT' => 'Nie można zapisać rekordu', + 'LBL_TAX_RATE' => 'Stawka VAT', + 'LBL_TAX_VALUE' => 'Podatek', + 'LBL_DISCOUNTS_SUMMARY' => 'Podsumowanie rabatu', + 'LBL_TAX_SUMMARY' => 'Podsumowanie podatu', + 'LBL_CURRENCIES_SUMMARY' => 'Podsumowanie walut', + 'LBL_CHANGE_CURRENCY' => 'Zmiana waluty', + 'LBL_CHANGE_CURRENCY_INFO' => 'Zmiana waluty spowoduje przeliczenie wszystkich wartości.
    Czy jesteś pewien czy chcesz to zroić?', + 'LBL_SUMMARY' => 'Podsumowanie', + 'LBL_AMOUNT' => 'Suma', + 'LBL_SET_GLOBAL_TAX' => 'Ustaw', + 'LBL_SET_GLOBAL_DISCOUNT' => 'Ustaw', ]; $jsLanguageStrings = [ 'JS_DATE_SHOULD_BE_GREATER_THAN' => 'Data zakończenia nie może być mniejsza od daty początkowej', diff --git a/layouts/vlayout/modules/Supplies/DetailViewSupplies.tpl b/layouts/vlayout/modules/Supplies/DetailViewSupplies.tpl deleted file mode 100644 index d92ce954d7c0..000000000000 --- a/layouts/vlayout/modules/Supplies/DetailViewSupplies.tpl +++ /dev/null @@ -1,81 +0,0 @@ -{**} -{strip} - {assign var="FIELDS" value=Supplies_SupField_Model::getFields($MODULE, true)} - {if count($FIELDS) neq 0} - {assign var="SUPMODULE" value='Supplies'} - {assign var="COLUMNS" value=Supplies_SupField_Model::getColumns($MODULE)} - {assign var="SUP_RECORD_DATA" value=$RECORD->getSupplieData()} - {assign var="MAIN_PARAMS" value=Supplies_SupField_Model::getMainParams($FIELDS[1])} - {assign var="COUNT_FIELDS0" value=count($FIELDS[0])} - {assign var="COUNT_FIELDS1" value=count($FIELDS[1])} - {assign var="COUNT_FIELDS2" value=count($FIELDS[2])} - {assign var="BASE_CURRENCY" value=Vtiger_Util_Helper::getBaseCurrency()} - {if in_array("currency",$COLUMNS)} - {if count($SUP_RECORD_DATA) > 0} - {assign var="CURRENCY" value=$SUP_RECORD_DATA[0]['currency']} - {else} - {assign var="CURRENCY" value=$BASE_CURRENCY['id']} - {/if} - {assign var="CURRENCY_SYMBOLAND" value=Vtiger_Functions::getCurrencySymbolandRate($CURRENCY)} - {/if} - - - - - {foreach item=FIELD from=$FIELDS[0]} - - {/foreach} - - -
    - {vtranslate($FIELD->get('label'), $SUPMODULE)}:  - {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('DetailView',$MODULE)} - {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$MODULE) SUP_VALUE=$SUP_RECORD_DATA[0][$FIELD->get('columnname')]} -
    - {assign var="FIELDS_TEXT_ALIGN_RIGHT" value=['TotalPrice','Tax','MarginP','Margin','Purchase','Discount','NetPrice','GrossPrice','UnitPrice','Quantity']} - - - - {foreach item=FIELD from=$FIELDS[1]} - {if $FIELD->isVisible($SUP_RECORD_DATA)} - - {/if} - {/foreach} - - - - {foreach key=KEY item=SUP_DATA from=$SUP_RECORD_DATA} - {assign var="ROW_NO" value=$KEY+1} - - {foreach item=FIELD from=$FIELDS[1]} - {if $FIELD->isVisible($SUP_RECORD_DATA)} - - {/if} - {/foreach} - - {/foreach} - - - - {foreach item=FIELD from=$FIELDS[1]} - {if $FIELD->isVisible($SUP_RECORD_DATA)} - - {/if} - {/foreach} - - -
    {vtranslate($FIELD->get('label'), $SUPMODULE)}
    getName(), $FIELDS_TEXT_ALIGN_RIGHT)}class="textAlignRight"{/if}> - {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('DetailView',$MODULE)} - {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$MODULE) SUP_VALUE=$SUP_DATA[$FIELD->get('columnname')]} -
    - {if $FIELD->isSummary()} - {assign var="SUM" value=0} - {foreach key=KEY item=SUP_DATA from=$SUP_RECORD_DATA} - {assign var="SUM" value=($SUM + $SUP_DATA[$FIELD->get('columnname')])} - {/foreach} - {CurrencyField::convertToUserFormat($SUM, null, true)} - {/if} -
    - {include file='DetailViewSuppliesSummary.tpl'|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl('DetailViewSuppliesSummary.tpl',$MODULE)} - {/if} -{/strip} diff --git a/layouts/vlayout/modules/Supplies/DetailViewSuppliesSummary.tpl b/layouts/vlayout/modules/Supplies/DetailViewSuppliesSummary.tpl deleted file mode 100644 index 14c9081c7a0a..000000000000 --- a/layouts/vlayout/modules/Supplies/DetailViewSuppliesSummary.tpl +++ /dev/null @@ -1,96 +0,0 @@ -{**} -{strip} - {foreach key=KEY item=SUP_DATA from=$SUP_RECORD_DATA} - {assign var="DISCOUNT" value=$DISCOUNT + $SUP_DATA['discount']} - {assign var="TAXS" value=Supplies_SupField_Model::getTaxParam($SUP_DATA['taxparam'],$SUP_DATA['net'], $TAXS)} - {/foreach} -
    -
    - - - - - - - - - - - -
    - {vtranslate('LBL_DISCOUNT', $SUPMODULE)}   - {vtranslate('LBL_DISCOUNTS_SUMMARY',$SUPMODULE)} -
    - {CurrencyField::convertToUserFormat($DISCOUNT, null, true)} {$CURRENCY_SYMBOLAND['symbol']} -
    -
    -
    - - - - - - - - {foreach item=TAX key=KEY from=$TAXS} - {assign var="TAX_AMOUNT" value=$TAX_AMOUNT + $TAX} - - - - - {/foreach} - - - - - -
    - {vtranslate('LBL_TAX', $SUPMODULE)}   - {vtranslate('LBL_TAX_SUMMARY',$SUPMODULE)} -
    - {$KEY}% - - {CurrencyField::convertToUserFormat($TAX, null, true)} {$CURRENCY_SYMBOLAND['symbol']} -
    - {vtranslate('LBL_AMOUNT',$SUPMODULE)} - - {CurrencyField::convertToUserFormat($TAX_AMOUNT, null, true)} {$CURRENCY_SYMBOLAND['symbol']} -
    -
    - {if $BASE_CURRENCY['id'] != $CURRENCY} - {assign var="RATE" value=$BASE_CURRENCY['conversion_rate']/$CURRENCY_SYMBOLAND['rate']} -
    - - - - - - - - {foreach item=TAX key=KEY from=$TAXS} - {assign var="CURRENY_AMOUNT" value=$CURRENY_AMOUNT + $TAX} - - - - - {/foreach} - - - - - -
    - {vtranslate('LBL_CURRENCIES_SUMMARY',$SUPMODULE)} -
    - {$KEY}% - - {CurrencyField::convertToUserFormat($TAX * $RATE, null, true)} {$BASE_CURRENCY['currency_symbol']} -
    - {vtranslate('LBL_AMOUNT',$SUPMODULE)} - - {CurrencyField::convertToUserFormat($CURRENY_AMOUNT * $RATE, null, true)} {$BASE_CURRENCY['currency_symbol']} -
    -
    - {/if} -
    -{/strip} diff --git a/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl b/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl deleted file mode 100644 index 9f5116ee0051..000000000000 --- a/layouts/vlayout/modules/Supplies/EditViewSupplies.tpl +++ /dev/null @@ -1,93 +0,0 @@ -{**} -{strip} - {assign var="SUPMODULE" value='Supplies'} - {assign var="FIELDS" value=$SUPFIELD_MODEL->getFields($MODULE, true)} - {if count($FIELDS) neq 0} - {assign var="COLUMNS" value=$SUPFIELD_MODEL->getColumns($MODULE)} - {assign var="SUP_RECORD_DATA" value=$RECORD->getSupplieData()} - {assign var="MAIN_PARAMS" value=$SUPFIELD_MODEL->getMainParams($FIELDS[1])} - {assign var="COUNT_FIELDS0" value=count($FIELDS[0])} - {assign var="COUNT_FIELDS1" value=count($FIELDS[1])} - {assign var="COUNT_FIELDS2" value=count($FIELDS[2])} - {if in_array("currency",$COLUMNS)} - {if count($SUP_RECORD_DATA) > 0} - {assign var="CURRENCY" value=$SUP_RECORD_DATA[0]['currency']} - {else} - {assign var="BASE_CURRENCY" value=Vtiger_Util_Helper::getBaseCurrency()} - {assign var="CURRENCY" value=$BASE_CURRENCY['id']} - {/if} - {assign var="CURRENCY_SYMBOLAND" value=Vtiger_Functions::getCurrencySymbolandRate($CURRENCY)} - {/if} - - - - - - - - {foreach item=FIELD from=$FIELDS[0]} - - {/foreach} - - -
    - {foreach item=MAIN_MODULE from=$MAIN_PARAMS['modules']} - {assign var="CRMEntity" value=CRMEntity::getInstance($MAIN_MODULE)} - - - - {/foreach} - - {vtranslate($FIELD->get('label'), $SUPMODULE)}   - {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('EditView',$MODULE)} - {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$MODULE) SUP_VALUE=$SUP_RECORD_DATA[0][$FIELD->get('columnname')]} -
    - - - - - {foreach item=FIELD from=$FIELDS[1]} - - {/foreach} - - - - {foreach key=KEY item=SUP_DATA from=$SUP_RECORD_DATA} - {assign var="ROW_NO" value=$KEY+1} - {include file='EditViewSuppliesRow.tpl'|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl('EditViewSuppliesRow.tpl',$MODULE)} - {/foreach} - - - - - {foreach item=FIELD from=$FIELDS[1]} - - {/foreach} - - -
      {vtranslate($FIELD->get('label'), $SUPMODULE)}
       - {if $FIELD->isSummary()} - {assign var="SUM" value=0} - {foreach key=KEY item=SUP_DATA from=$SUP_RECORD_DATA} - {assign var="SUM" value=($SUM + $SUP_DATA[$FIELD->get('columnname')])} - {/foreach} - {CurrencyField::convertToUserFormat($SUM, null, true)} - {/if} - {if $FIELD->getName() == 'Name'} - {vtranslate('LBL_SUMMARY', $SUPMODULE)} - {/if} -
    - {include file='EditViewSuppliesSummary.tpl'|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl('EditViewSuppliesRow.tpl',$MODULE)} - {assign var="SUP_DATA" value=[]} - - - {assign var="ROW_NO" value='_NUM_'} - {include file='EditViewSuppliesRow.tpl'|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl('EditViewSuppliesRow.tpl',$MODULE)} - - -
    - {/if} -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewBase.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewBase.tpl deleted file mode 100644 index 46bc023508e4..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/DetailViewBase.tpl +++ /dev/null @@ -1,4 +0,0 @@ -{**} -{strip} - {$FIELD->getDisplayValue($SUP_VALUE)} -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewDiscountMode.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewDiscountMode.tpl deleted file mode 100644 index 7009f01922e4..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/DetailViewDiscountMode.tpl +++ /dev/null @@ -1,4 +0,0 @@ -{**} -{strip} - {vtranslate($FIELD->getDisplayValue($SUP_VALUE), $SUPMODULE)} -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/DetailViewTaxMode.tpl b/layouts/vlayout/modules/Supplies/fields/DetailViewTaxMode.tpl deleted file mode 100644 index 7009f01922e4..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/DetailViewTaxMode.tpl +++ /dev/null @@ -1,4 +0,0 @@ -{**} -{strip} - {vtranslate($FIELD->getDisplayValue($SUP_VALUE), $SUPMODULE)} -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewComment.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewComment.tpl deleted file mode 100644 index 7ab2ce6ad4e5..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/EditViewComment.tpl +++ /dev/null @@ -1,8 +0,0 @@ -{**} -{strip} - {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} - -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewCurrency.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewCurrency.tpl deleted file mode 100644 index 6606f438a42e..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/EditViewCurrency.tpl +++ /dev/null @@ -1,38 +0,0 @@ -{**} -{strip} - {assign var=CURRENCIES value=Vtiger_Functions::getAllCurrency(true)} - {assign var=SELECTED_CURRENCY value=$SUP_VALUE} - {if $SELECTED_CURRENCY eq ''} - {assign var=USER_CURRENCY_ID value=$USER_MODEL->get('currency_id')} - {foreach item=CURRENCY from=$CURRENCIES} - {if $CURRENCY.id eq $USER_CURRENCY_ID} - {assign var=SELECTED_CURRENCY value=$CURRENCY.id} - {/if} - {/foreach} - {/if} - - -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewDiscount.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewDiscount.tpl deleted file mode 100644 index d327a3294d74..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/EditViewDiscount.tpl +++ /dev/null @@ -1,15 +0,0 @@ -{**} -{strip} - {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} -
    -
    - - {if $DISCOUNTS_CONFIG['discounts'][0] != ''} - - - {vtranslate('LBL_DISCOUNT', $SUPMODULE)} - - {/if} -
    -
    -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewDiscountMode.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewDiscountMode.tpl deleted file mode 100644 index 2a7380456234..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/EditViewDiscountMode.tpl +++ /dev/null @@ -1,7 +0,0 @@ -{**} -{strip} - -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewGrossPrice.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewGrossPrice.tpl deleted file mode 100644 index bcf08b2f32a3..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/EditViewGrossPrice.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{**} -{strip} - {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} - - {$FIELD->getEditValue($VALUE)} -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewMargin.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewMargin.tpl deleted file mode 100644 index bf74711ee292..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/EditViewMargin.tpl +++ /dev/null @@ -1,5 +0,0 @@ -{**} -{strip} - {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} - -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewMarginP.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewMarginP.tpl deleted file mode 100644 index 2b03eedc619a..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/EditViewMarginP.tpl +++ /dev/null @@ -1,8 +0,0 @@ -{**} -{strip} - {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} -
    - - % -
    -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewName.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewName.tpl deleted file mode 100644 index 97b1a332843c..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/EditViewName.tpl +++ /dev/null @@ -1,41 +0,0 @@ -{**} -{strip} -
    - {assign var="FIELD_NAME" value={$FIELD->getColumnName()}|cat:$ROW_NO} - {assign var="FIELD_INFO" value=Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode(['mandatory'=>true]))} - {assign var="CRMEntity" value=CRMEntity::getInstance($REFERENCE_MODULE)} -
    - - get('displaytype') == 10}readonly="readonly"{/if} /> - - {assign var="displayId" value=$SUP_VALUE} - {if $FIELD->get('displaytype') != 10} - - - - {/if} - - get('displaytype') != 10}placeholder="{vtranslate('LBL_TYPE_SEARCH',$SUPMODULE)}"{/if} - {if $FIELD->get('displaytype') == 10}readonly="readonly"{/if}/> - - {if $FIELD->get('displaytype') != 10} - - - - {/if} - - {assign var=REFERENCE_MODULE_MODEL value=Vtiger_Module_Model::getInstance($REFERENCE_MODULE)} - {if $REFERENCE_MODULE_MODEL->isQuickCreateSupported() && $FIELD->get('displaytype') != 10} - - - - {/if} -
    -
    -
      -
    -
    -
    -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewNetPrice.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewNetPrice.tpl deleted file mode 100644 index 7fa910152a90..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/EditViewNetPrice.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{**} -{strip} - {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} - - {$FIELD->getEditValue($VALUE)} -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewPurchase.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewPurchase.tpl deleted file mode 100644 index a060bfe0583a..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/EditViewPurchase.tpl +++ /dev/null @@ -1,7 +0,0 @@ -{**} -{strip} - {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} - -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewQuantity.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewQuantity.tpl deleted file mode 100644 index 06dd7bdfe097..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/EditViewQuantity.tpl +++ /dev/null @@ -1,5 +0,0 @@ -{**} -{strip} - {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} - get('displaytype') == 10}readonly="readonly"{/if}/> -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewReference.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewReference.tpl deleted file mode 100644 index ea4fce9ff0b5..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/EditViewReference.tpl +++ /dev/null @@ -1,33 +0,0 @@ -{**} -{strip} - {assign var="REFERENCE_MODULE" value=$FIELD->get('params')} - {assign var="FIELD_NAME" value={$FIELD->getColumnName()}|cat:$ROW_NO} - {assign var="FIELD_INFO" value=Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode(['mandatory'=>true]))} - -
    - - get('displaytype') == 10}readonly="readonly"{/if} /> - {assign var="displayId" value=$SUP_VALUE} - {if $FIELD->get('displaytype') != 10} - - - - {/if} - get('displaytype') != 10}placeholder="{vtranslate('LBL_TYPE_SEARCH',$SUPMODULE)}"{/if} - {if $FIELD->get('displaytype') == 10}readonly="readonly"{/if}/> - {if $FIELD->get('displaytype') != 10} - - - - {/if} - {assign var=REFERENCE_MODULE_MODEL value=Vtiger_Module_Model::getInstance($REFERENCE_MODULE)} - - {if $smarty.request.view eq 'Edit' && $REFERENCE_MODULE_MODEL->isQuickCreateSupported() && $FIELD->get('displaytype') != 10} - - - - {/if} -
    -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewTax.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewTax.tpl deleted file mode 100644 index d5453dbccdaf..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/EditViewTax.tpl +++ /dev/null @@ -1,13 +0,0 @@ -{**} -{strip} - {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} -
    - - {if $TAXS_CONFIG['taxs'][0] != ''} - - - {vtranslate('LBL_TAX', $SUPMODULE)} - - {/if} -
    -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewTaxMode.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewTaxMode.tpl deleted file mode 100644 index 7bd99c8fa44a..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/EditViewTaxMode.tpl +++ /dev/null @@ -1,7 +0,0 @@ -{**} -{strip} - -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewTotalPrice.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewTotalPrice.tpl deleted file mode 100644 index 37c50e4c0320..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/EditViewTotalPrice.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{**} -{strip} - {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} - - {$FIELD->getEditValue($VALUE)} -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewUnitPrice.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewUnitPrice.tpl deleted file mode 100644 index eae8cc666a1d..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/EditViewUnitPrice.tpl +++ /dev/null @@ -1,16 +0,0 @@ -{**} -{strip} - {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} -
    - - - {assign var=PRICEBOOK_MODULE_MODEL value=Vtiger_Module_Model::getInstance('PriceBooks')} - {if in_array('3',$DISCOUNTS_CONFIG['discounts']) && $PRICEBOOK_MODULE_MODEL->isPermitted('DetailView')} - - {vtranslate('PriceBooks',$SUPMODULE)} - - {/if} -
    -{/strip} diff --git a/layouts/vlayout/modules/Supplies/fields/EditViewValue.tpl b/layouts/vlayout/modules/Supplies/fields/EditViewValue.tpl deleted file mode 100644 index ffb123e36404..000000000000 --- a/layouts/vlayout/modules/Supplies/fields/EditViewValue.tpl +++ /dev/null @@ -1,10 +0,0 @@ -{**} -{strip} - {assign var=VALUE value=$FIELD->getValue($SUP_VALUE)} - {assign var="INPUT_TYPE" value='text'} - {if $FIELD->get('displaytype') == 10} - {assign var="INPUT_TYPE" value='hidden'} - {$SUP_VALUE} - {/if} - -{/strip} diff --git a/layouts/vlayout/modules/Supplies/resources/Edit.min.js b/layouts/vlayout/modules/Supplies/resources/Edit.min.js deleted file mode 100644 index 9f0e181e5560..000000000000 --- a/layouts/vlayout/modules/Supplies/resources/Edit.min.js +++ /dev/null @@ -1,2 +0,0 @@ - -Vtiger_Edit_Js("Supplies_Edit_Js",{},{supTableContainer:false,supTableHeadContainer:false,summaryTaxesContainer:false,summaryDiscountContainer:false,summaryCurrenciesContainer:false,rowClass:"tr.rowSup",discountMondalFields:["aggregationType","globalDiscount","groupCheckbox","groupDiscount","individualDiscount","individualDiscountType"],taxMondalFields:["aggregationType","globalTax","groupCheckbox","groupTax","individualTax"],getSupTableContainer:function(){if(this.supTableContainer===false){this.supTableContainer=$(".suppliesItemsTable")}return this.supTableContainer},getSupTableHeadContainer:function(){if(this.supTableHeadContainer===false){this.supTableHeadContainer=$(".suppliesHeaderTable")}return this.supTableHeadContainer},getSupSummaryDiscountContainer:function(){if(this.summaryDiscountContainer===false){this.summaryDiscountContainer=$(".suppliesSummaryDiscounts")}return this.summaryDiscountContainer},getSupSummaryTaxesContainer:function(){if(this.summaryTaxesContainer===false){this.summaryTaxesContainer=$(".suppliesSummaryTaxes")}return this.summaryTaxesContainer},getSupSummaryCurrenciesContainer:function(){if(this.summaryCurrenciesContainer===false){this.summaryCurrenciesContainer=$(".suppliesSummaryCurrencies")}return this.summaryCurrenciesContainer},getNextLineItemRowNumber:function(){var a=$(this.rowClass,this.getSupTableContainer()).length;$("#suppliesRowNo").val(a+1);return ++a},getAccountId:function(){var a=$("#accountReferenceField").val();if(a!=""){return $('[name="'+a+'"]').val()}return""},checkDeleteIcon:function(){var a=this.getSupTableContainer();if(a.find(this.rowClass).length>1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getSupTableContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackSuppliesTable tbody").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},getTaxModeSelectElement:function(b){var a=this.getSupTableHeadContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(d){var c=this;var a=c.getSupSummaryTaxesContainer().find(".groupTax");var b=c.getSupTableContainer();if(c.isIndividualTaxMode()){a.addClass("hide");b.find(".changeTax").removeClass("hide")}else{a.removeClass("hide");b.find(".changeTax").addClass("hide")}c.setTax(b,0);c.setTaxParam(b,[]);c.rowsCalculations()},getDiscountModeSelectElement:function(b){var a=this.getSupTableHeadContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(d){var c=this;var a=c.getSupSummaryDiscountContainer().find(".groupDiscount");var b=c.getSupTableContainer();if(c.isIndividualDiscountMode()){a.addClass("hide");b.find(".changeDiscount").removeClass("hide")}else{a.removeClass("hide");b.find(".changeDiscount").addClass("hide")}c.setDiscount(b,0);c.setDiscountParam(b,[]);c.rowsCalculations()},getCurrency:function(){var a=$('[name="currency"]',this.getSupTableHeadContainer());return a.find("option:selected").val()},getTax:function(a){return app.parseNumberToFloat($(".tax",a).val())},getQuantityValue:function(a){return app.parseNumberToFloat($(".qty",a).val())},getUnitPriceValue:function(a){return app.parseNumberToFloat($(".unitPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return app.parseNumberToFloat(b)},getNetPrice:function(a){return app.parseNumberToFloat($(".netPrice",a).val())},getTotalPrice:function(a){return app.parseNumberToFloat($(".totalPrice",a).val())},getGrossPrice:function(a){return app.parseNumberToFloat($(".grossPrice",a).val())},getPurchase:function(a){var b=this.getQuantityValue(a);return app.parseNumberToFloat($(".purchase",a).val())*b},getSummaryGrossPrice:function(){var b=this;var a=0;this.getSupTableContainer().find(this.rowClass).each(function(c){a+=b.getGrossPrice($(this))});return app.parseNumberToFloat(a)},setUnitPrice:function(b,a){a=app.parseNumberToShow(a);b.find(".unitPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=app.parseNumberToShow(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=app.parseNumberToShow(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=app.parseNumberToShow(a);$(".totalPriceText",b).text(a);$(".totalPrice",b).val(a)},setMargin:function(b,a){a=app.parseNumberToShow(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=app.parseNumberToShow(a);$(".marginp",b).val(a)},setDiscount:function(b,a){a=app.parseNumberToShow(a);$(".discount",b).val(a)},setDiscountParam:function(b,a){$(".discountParam",b).val(JSON.stringify(a))},setTax:function(b,a){a=app.parseNumberToShow(a);$(".tax",b).val(a)},setTaxParam:function(b,a){$(".taxParam",b).val(JSON.stringify(a))},quantityChangeActions:function(a){this.rowCalculations(a);this.summaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getSupTableContainer().find(a.rowClass).each(function(b){a.quantityChangeActions($(this))})},summaryCalculations:function(){var a=this;a.getSupTableContainer().find("tfoot .wisableTd").each(function(b){a.calculatSummary($(this),$(this).data("sumfield"))});a.calculatDiscountSummary();a.calculatTaxSummary();a.calculatCurrenciesSummary()},calculatSummary:function(a,d){var c=this;var b=0;this.getSupTableContainer().find(c.rowClass).each(function(e){b+=app.parseNumberToFloat($(this).find("."+d).val())});a.text(app.parseNumberToShow(b))},calculatDiscountSummary:function(){var b=this;var c=b.getAllDiscount();var a=b.getSupSummaryDiscountContainer();a.find("input").val(app.parseNumberToShow(c))},getAllDiscount:function(){var a=this;var b=0;this.getSupTableContainer().find(a.rowClass).each(function(d){var e=$(this);var c=a.getDiscount(e);b+=c});return b},calculatCurrenciesSummary:function(){var g=this;var a=g.getSupSummaryCurrenciesContainer();var f=$('[name="currency"] option:selected',g.getSupTableHeadContainer());var h=$('[name="currency"] option[data-base-currency="1"]',g.getSupTableHeadContainer());var b=f.data("conversionRate");var e=h.data("conversionRate");if(b==e){a.addClass("hide");return}b=parseFloat(e)/parseFloat(b);a.removeClass("hide");var c=g.getAllTaxs();var d=0;a.find(".panel-body").html("");$.each(c,function(i,j){if(j!=undefined){j=j*b;var k=a.find(".hide .form-group").clone();k.find(".percent").text(i+"%");k.find("input").val(app.parseNumberToShow(j));k.appendTo(a.find(".panel-body"));d+=j}});a.find(".panel-footer input").val(app.parseNumberToShow(d))},calculatTaxSummary:function(){var d=this;var b=d.getAllTaxs();var a=d.getSupSummaryTaxesContainer();a.find(".panel-body").html("");var c=0;$.each(b,function(e,f){if(f!=undefined){var g=a.find(".hide .form-group").clone();g.find(".percent").text(e+"%");g.find("input").val(app.parseNumberToShow(f));g.appendTo(a.find(".panel-body"));c+=f}});a.find(".panel-footer input").val(app.parseNumberToShow(c))},getAllTaxs:function(){var b=this;var a=[];this.getSupTableContainer().find(b.rowClass).each(function(c){var f=$(this);var g=b.getNetPrice(f);var e=f.find(".taxParam").val();if(e!=""&&e!="[]"){var d=$.parseJSON(e);if(typeof d.aggregationType=="string"){d.aggregationType=[d.aggregationType]}$.each(d.aggregationType,function(k,j){var j=j+"Tax";var i=d[j];var h=0;if(a[i]!=undefined){h=parseFloat(a[i])}a[i]=h+g*(i/100)})}});return a},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getUnitPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,c){var e=app.parseNumberToFloat(c.find(".valueTotalPrice").text()),b=e,k=0,f=0,g=0,a=0;var i=c.find(".discountsType").val();if(i=="0"||i=="1"){if(c.find(".activepanel .globalDiscount").length>0){var k=app.parseNumberToFloat(c.find(".activepanel .globalDiscount").val())}if(c.find(".activepanel .individualDiscountType").length>0){var d=c.find(".activepanel .individualDiscountType:checked").val();var h=c.find(".activepanel .individualDiscountValue").val();if(d=="percentage"){g=e*(h/100)}else{g=h}}if(c.find(".activepanel .groupCheckbox").length>0&&c.find(".activepanel .groupCheckbox").prop("checked")==true){var f=app.parseNumberToFloat(c.find(".groupValue").val());f=e*(f/100)}b=b*((100-k)/100);b=b-app.parseNumberToFloat(g);b=b-f}else{if(i=="2"){c.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=app.parseNumberToFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=app.parseNumberToFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=app.parseNumberToFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}c.find(".valuePrices").text(app.parseNumberToShow(b));c.find(".valueDiscount").text(app.parseNumberToShow(e-b))},calculateTax:function(k,g){var h=app.parseNumberToFloat(g.find(".valueNetPrice").text()),b=h,c=0,f=0,a=0,i=0,e=0;var d=g.find(".taxsType").val();if(d=="0"||d=="1"){if(g.find(".activepanel .globalTax").length>0){var c=g.find(".activepanel .globalTax").val()}if(g.find(".activepanel .individualTaxValue").length>0){var j=app.parseNumberToFloat(g.find(".activepanel .individualTaxValue").val());i=(j/100)*b}if(g.find(".activepanel .groupTax").length>0){var f=app.parseNumberToFloat(g.find(".groupTax").val());f=h*(app.parseNumberToFloat(f)/100)}if(g.find(".activepanel .regionalTax").length>0){var a=app.parseNumberToFloat(g.find(".regionalTax").val());a=h*(app.parseNumberToFloat(a)/100)}b=b*((100+app.parseNumberToFloat(c))/100);b=b+app.parseNumberToFloat(i);b=b+app.parseNumberToFloat(f);b=b+app.parseNumberToFloat(a)}else{if(d=="2"){g.find(".activepanel").each(function(p){var l=$(this);if(l.find(".globalTax").length>0){var o=app.parseNumberToFloat(l.find(".globalTax").val());b=b*((100+o)/100)}else{if(l.find(".groupTax").length>0){var n=app.parseNumberToFloat(l.find(".groupTax").val());b=b*((100+n)/100)}else{if(l.find(".regionalTax").length>0){var m=app.parseNumberToFloat(l.find(".regionalTax").val());b=b*((100+m)/100)}else{if(l.find(".individualTaxValue").length>0){var q=app.parseNumberToFloat(l.find(".individualTaxValue").val());b=((q+100)/100)*b}}}}})}}g.find(".valuePrices").text(app.parseNumberToShow(b));g.find(".valueTax").text(app.parseNumberToShow(b-h))},updateRowSequence:function(){var a=this.getSupTableContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerSuppliesSaveData:function(a){var b=this;a.on(Vtiger_Edit_Js.recordPreSave,function(f,d){if(!b.checkLimits(a)){return false}var c=a.find("#blackSuppliesTable");c.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductUnitPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setUnitPrice(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(g,a){var d=this;var c=jQuery("input.sourceField",g).val();var e=g.find('.rowName input[name="popupReferenceModule"]').val();d.removeSubProducts(g);if(c=="0"||$.inArray(e,["Products","Services"])<0){return false}if(d.subProductsCashe[c]){d.addSubProducts(g,d.subProductsCashe[c]);return false}var f={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(f).then(function(i){var h=i.result;d.subProductsCashe[c]=h;d.addSubProducts(g,h);if(b){b.hide()}},function(h,i){if(b){b.hide()}console.error(h,i)})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,c){var i=this;for(var b in c){var a=c[b];var j=a.description;var e=a.unitPriceValues;var d=JSON.stringify(e);for(var g in a.autoFields){k.find("input."+g).val(a.autoFields[g])}var h=i.getCurrency();if(typeof e[h]!=="undefined"){i.setUnitPrice(k,e[h])}$("input.unitPrice",k).attr("list-info",d);$("textarea.commentTextarea",k).val(j);i.showIndividualTax(k)}if(f==="Products"){i.loadSubProducts(k,true)}i.quantityChangeActions(k)},saveDiscountsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(b.discountMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});b.setDiscountParam(d,c)},saveTaxsParameters:function(d,a){var b=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(b.taxMondalFields,function(f,g){if($.inArray(g,e)>=0){if(a.find('[name="'+g+'"]:checked').length>1){c[g]=[];a.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=a.find('[name="'+g+'"]:checked').val()}}else{c[g]=a.find('[name="'+g+'"]').val()}});b.setTaxParam(d,c)},showExpandedRow:function(e){var d=this;var c=d.getSupTableContainer();var b=c.find('[numrowex="'+e.attr("numrow")+'"]');var a=e.find(".toggleVisibility");a.data("status","1");a.find(".glyphicon").removeClass("glyphicon-menu-down");a.find(".glyphicon").addClass("glyphicon-menu-up");b.removeClass("hide");d.loadCkEditorElement(b.find(".ckEditorSource"))},hideExpandedRow:function(f){var e=this;var d=e.getSupTableContainer();var c=d.find('[numrowex="'+f.attr("numrow")+'"]');var b=f.find(".toggleVisibility");b.data("status","0");b.find(".glyphicon").removeClass("glyphicon-menu-up");b.find(".glyphicon").addClass("glyphicon-menu-down");c.addClass("hide");var a=CKEDITOR.instances[c.find(".ckEditorSource").attr("id")];if(a){a.destroy()}},initDiscountsParameters:function(d,a){var c=this;var b=d.find(".discountParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.discountMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateDiscount(d,a)},initTaxParameters:function(d,a){var c=this;var b=d.find(".taxParam").val();if(b==""){return}var b=JSON.parse(b);$.each(c.taxMondalFields,function(e,g){var i=b[g];var f=a.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{a.find('[name="'+g+'"]').val(i)}}});c.calculateTax(d,a)},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#suppliesLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"CheckLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#suppliesLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide();console.error(f,g)});return a},currencyChangeActions:function(a,b){var c=this;if(b.data("baseCurrency")==0){c.showCurrencyChangeMondal(a)}else{c.currencyConvertValues(a);a.data("oldValue",a.val())}},showCurrencyChangeMondal:function(a){var c=this;if(c.lockCurrencyChange==true){return}c.lockCurrencyChange=true;var b=a.closest("th").find(".modelContainer").clone();app.showModalWindow(b,function(e){var d=$(e);d.on("click",'button[type="submit"]',function(f){c.currencyConvertValues(a);a.data("oldValue",a.val());app.hideModalWindow();c.lockCurrencyChange=false});d.on("click",'button[type="reset"]',function(f){a.val(a.data("oldValue")).change();c.lockCurrencyChange=false})})},currencyConvertValues:function(a){var f=this;var d=a.find("option:selected");var e=a.find('option[value="'+a.data("oldValue")+'"]');var b=d.data("conversionRate");var c=e.data("conversionRate");b=parseFloat(b)/parseFloat(c);this.getSupTableContainer().find(f.rowClass).each(function(g){var h=$(this);f.setUnitPrice(h,app.parseNumberToFloat(f.getUnitPriceValue(h)*b));f.setDiscount(h,app.parseNumberToFloat(f.getDiscount(h)*b));f.setTax(h,app.parseNumberToFloat(f.getTax(h)*b));f.quantityChangeActions(h)})},registerAddRow:function(a){var c=this;var b=this.getSupTableContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackSuppliesTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.find("tr").appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.registerAutoCompleteFields(m);c.initRow(m)})},registerSortableRow:function(){var b=this;var a=b.getSupTableContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(c,d){a.find(b.rowClass).each(function(e,f){var g=$(f);b.hideExpandedRow(g)});d.item.startPos=d.item.index()},stop:function(d,e){var c=$(e.item.context).attr("numrow");var f=a.find(".numRow"+c).remove().clone();a.find('[numrow="'+c+'"]').after(f);if(e.item.startPos {vtranslate($FIELD->get('label'), $MODULE_NAME)}:  {assign var="FIELD_TPL_NAME" value="innventoryFields/"|cat:$FIELD->getTemplateName('DetailView',$MODULE_NAME)} - {include file=$FIELD_TPL_NAME|@vtemplate_path:$MODULE_NAME SUP_VALUE=$INVENTORY_ROWS[0][$FIELD->get('columnname')]} + {include file=$FIELD_TPL_NAME|@vtemplate_path:$MODULE_NAME ITEM_VALUE=$INVENTORY_ROWS[0][$FIELD->get('columnname')]} {/foreach} @@ -54,7 +54,7 @@ {if $FIELD->isVisible($INVENTORY_ROWS)} getName(), $FIELDS_TEXT_ALIGN_RIGHT)}class="textAlignRight"{/if}> {assign var="FIELD_TPL_NAME" value="innventoryFields/"|cat:$FIELD->getTemplateName('DetailView',$MODULE_NAME)} - {include file=$FIELD_TPL_NAME|@vtemplate_path:$MODULE_NAME SUP_VALUE=$INVENTORY_ROW[$FIELD->get('columnname')]} + {include file=$FIELD_TPL_NAME|@vtemplate_path:$MODULE_NAME ITEM_VALUE=$INVENTORY_ROW[$FIELD->get('columnname')]} {/if} {/foreach} diff --git a/layouts/vlayout/modules/Vtiger/EditView.tpl b/layouts/vlayout/modules/Vtiger/EditView.tpl index 5873f349d169..ee42d678f4b4 100644 --- a/layouts/vlayout/modules/Vtiger/EditView.tpl +++ b/layouts/vlayout/modules/Vtiger/EditView.tpl @@ -1,13 +1,16 @@ {**} {include file="EditViewBlocks.tpl"|@vtemplate_path:$MODULE} -{include file="EditViewActions.tpl"|@vtemplate_path:$MODULE} \ No newline at end of file +{if $MODULE_TYPE == 'Inventory'} + {include file='EditViewInventory.tpl'|@vtemplate_path:$MODULE} +{/if} +{include file="EditViewActions.tpl"|@vtemplate_path:$MODULE} diff --git a/layouts/vlayout/modules/Vtiger/EditViewInventory.tpl b/layouts/vlayout/modules/Vtiger/EditViewInventory.tpl new file mode 100644 index 000000000000..0f7704eb5934 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/EditViewInventory.tpl @@ -0,0 +1,99 @@ +{**} +{strip} + {assign var="INVENTORY_FIELD" value=Vtiger_InventoryField_Model::getInstance($MODULE)} + {assign var="FIELDS" value=$INVENTORY_FIELD->getFields(true)} + {if count($FIELDS) neq 0} + {assign var="DISCOUNTS_CONFIG" value=Vtiger_Inventory_Model::getDiscountsConfig()} + {assign var="TAXS_CONFIG" value=Vtiger_Inventory_Model::getTaxsConfig()} + {assign var="BASE_CURRENCY" value=Vtiger_Util_Helper::getBaseCurrency()} + + {assign var="COLUMNS" value=$INVENTORY_FIELD->getColumns()} + {assign var="INVENTORY_ROWS" value=$RECORD->getInventoryData()} + {assign var="MAIN_PARAMS" value=$INVENTORY_FIELD->getMainParams($FIELDS[1])} + {assign var="COUNT_FIELDS0" value=count($FIELDS[0])} + {assign var="COUNT_FIELDS1" value=count($FIELDS[1])} + {assign var="COUNT_FIELDS2" value=count($FIELDS[2])} + + {if in_array("currency",$COLUMNS)} + {if count($INVENTORY_ROWS) > 0} + {assign var="CURRENCY" value=$INVENTORY_ROWS[0]['currency']} + {else} + {assign var="CURRENCY" value=$BASE_CURRENCY['id']} + {/if} + {assign var="CURRENCY_SYMBOLAND" value=Vtiger_Functions::getCurrencySymbolandRate($CURRENCY)} + {/if} + + + + + + + + {foreach item=FIELD from=$FIELDS[0]} + + {/foreach} + + +
    + {foreach item=MAIN_MODULE from=$MAIN_PARAMS['modules']} + {assign var="CRMENTITY" value=CRMEntity::getInstance($MAIN_MODULE)} + + + + {/foreach} + + {vtranslate($FIELD->get('label'), $MODULE)}   + {assign var="FIELD_TPL_NAME" value="innventoryFields/"|cat:$FIELD->getTemplateName('EditView',$MODULE)} + {include file=$FIELD_TPL_NAME|@vtemplate_path:$MODULE ITEM_VALUE=$INVENTORY_ROWS[0][$FIELD->get('columnname')]} +
    + + + + + {foreach item=FIELD from=$FIELDS[1]} + + {/foreach} + + + + {foreach key=KEY item=ITEM_DATA from=$INVENTORY_ROWS} + {assign var="ROW_NO" value=$KEY+1} + {include file='EditViewInventoryItem.tpl'|@vtemplate_path:$MODULE} + {/foreach} + + + + + {foreach item=FIELD from=$FIELDS[1]} + + {/foreach} + + +
      {vtranslate($FIELD->get('label'), $MODULE)}
       + {if $FIELD->isSummary()} + {assign var="SUM" value=0} + {foreach key=KEY item=ITEM_VALUE from=$INVENTORY_ROWS} + {assign var="SUM" value=($SUM + $ITEM_VALUE[$FIELD->get('columnname')])} + {/foreach} + {CurrencyField::convertToUserFormat($SUM, null, true)} + {/if} + {if $FIELD->getName() == 'Name'} + {vtranslate('LBL_SUMMARY', $MODULE)} + {/if} +
    + {include file='EditViewInventorySummary.tpl'|@vtemplate_path:$MODULE} + {assign var="ITEM_DATA" value=[]} + + + {assign var="ROW_NO" value='_NUM_'} + {include file='EditViewInventoryItem.tpl'|@vtemplate_path:$MODULE} + +
    +
    + {/if} +{/strip} diff --git a/layouts/vlayout/modules/Supplies/EditViewSuppliesRow.tpl b/layouts/vlayout/modules/Vtiger/EditViewInventoryItem.tpl similarity index 50% rename from layouts/vlayout/modules/Supplies/EditViewSuppliesRow.tpl rename to layouts/vlayout/modules/Vtiger/EditViewInventoryItem.tpl index 89f77abe5381..fcd16aa8ae49 100644 --- a/layouts/vlayout/modules/Supplies/EditViewSuppliesRow.tpl +++ b/layouts/vlayout/modules/Vtiger/EditViewInventoryItem.tpl @@ -1,14 +1,14 @@ {**} {strip} - {if isset($SUP_DATA['name'])} - {assign var="REFERENCE_MODULE" value=Vtiger_Functions::getCRMRecordType($SUP_DATA['name'])} + {if isset($ITEM_DATA['name'])} + {assign var="REFERENCE_MODULE" value=Vtiger_Functions::getCRMRecordType($ITEM_DATA['name'])} {elseif $MAIN_PARAMS} {assign var="REFERENCE_MODULE" value=reset($MAIN_PARAMS['modules'])} {/if} - + - -   {vtranslate('LBL_DRAG',$SUPMODULE)} + +   {vtranslate('LBL_DRAG',$MODULE)} {if $COUNT_FIELDS2 > 0}

    @@ -18,23 +18,23 @@ {/if} {foreach item=FIELD from=$FIELDS[1]} - - {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('EditView',$MODULE)} - {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$MODULE) SUP_VALUE=$SUP_DATA[$FIELD->get('columnname')]} + + {assign var="FIELD_TPL_NAME" value="innventoryFields/"|cat:$FIELD->getTemplateName('EditView',$MODULE)} + {include file=$FIELD_TPL_NAME|@vtemplate_path:$MODULE ITEM_VALUE=$ITEM_DATA[$FIELD->get('columnname')]} {/foreach} {if $FIELDS[2] neq 0} - + {foreach item=FIELD from=$FIELDS[2]} {if $FIELD->get('colspan') eq 0} {assign var="COLSPAN" value=$COUNT_FIELDS1+1} {else} {assign var="COLSPAN" value=$FIELD->get('colspan')} {/if} - - {assign var="FIELD_TPL_NAME" value="fields/"|cat:$FIELD->getTemplateName('EditView',$MODULE)} - {include file=$FIELD_TPL_NAME|@vtemplate_path:Supplies_Module_Model::getModuleNameForTpl($FIELD_TPL_NAME,$MODULE) SUP_VALUE=$SUP_DATA[$FIELD->get('columnname')]} + + {assign var="FIELD_TPL_NAME" value="innventoryFields/"|cat:$FIELD->getTemplateName('EditView',$MODULE)} + {include file=$FIELD_TPL_NAME|@vtemplate_path:$MODULE ITEM_VALUE=$ITEM_DATA[$FIELD->get('columnname')]} {/foreach} diff --git a/layouts/vlayout/modules/Supplies/EditViewSuppliesSummary.tpl b/layouts/vlayout/modules/Vtiger/EditViewInventorySummary.tpl similarity index 75% rename from layouts/vlayout/modules/Supplies/EditViewSuppliesSummary.tpl rename to layouts/vlayout/modules/Vtiger/EditViewInventorySummary.tpl index 0585b34daf9c..3fa5b407fa76 100644 --- a/layouts/vlayout/modules/Supplies/EditViewSuppliesSummary.tpl +++ b/layouts/vlayout/modules/Vtiger/EditViewInventorySummary.tpl @@ -2,12 +2,12 @@ {strip}
    -
    +
    - {vtranslate('LBL_DISCOUNT', $SUPMODULE)}   - {vtranslate('LBL_DISCOUNTS_SUMMARY',$SUPMODULE)} - - + {vtranslate('LBL_DISCOUNT', $MODULE)}   + {vtranslate('LBL_DISCOUNTS_SUMMARY',$MODULE)} + +
    @@ -23,19 +23,19 @@
    -
    +
    - {vtranslate('LBL_TAX', $SUPMODULE)}   - {vtranslate('LBL_TAX_SUMMARY',$SUPMODULE)} - - + {vtranslate('LBL_TAX', $MODULE)}   + {vtranslate('LBL_TAX_SUMMARY',$MODULE)} + +
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,c){var i=this;for(var b in c){var a=c[b];var j=a.description;var e=a.unitPriceValues;var d=JSON.stringify(e);for(var g in a.autoFields){k.find("input."+g).val(a.autoFields[g])}var h=i.getCurrency();if(typeof e[h]!=="undefined"){i.setUnitPrice(k,e[h])}$("input.unitPrice",k).attr("list-info",d);$("textarea.commentTextarea",k).val(j)}if(f==="Products"){i.loadSubProducts(k,true)}i.quantityChangeActions(k)},saveDiscountsParameters:function(d,b){var a=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(a.discountModalFields,function(f,g){if($.inArray(g,e)>=0){if(b.find('[name="'+g+'"]:checked').length>1){c[g]=[];b.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=b.find('[name="'+g+'"]:checked').val()}}else{c[g]=b.find('[name="'+g+'"]').val()}});a.setDiscountParam(d,c)},saveTaxsParameters:function(d,b){var a=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(a.taxModalFields,function(f,g){if($.inArray(g,e)>=0){if(b.find('[name="'+g+'"]:checked').length>1){c[g]=[];b.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=b.find('[name="'+g+'"]:checked').val()}}else{c[g]=b.find('[name="'+g+'"]').val()}});a.setTaxParam(d,c)},showExpandedRow:function(e){var d=this;var a=d.getInventoryItemsContainer();var b=a.find('[numrowex="'+e.attr("numrow")+'"]');var c=e.find(".toggleVisibility");c.data("status","1");c.find(".glyphicon").removeClass("glyphicon-menu-down");c.find(".glyphicon").addClass("glyphicon-menu-up");b.removeClass("hide");d.loadCkEditorElement(b.find(".ckEditorSource"))},hideExpandedRow:function(f){var e=this;var a=e.getInventoryItemsContainer();var b=a.find('[numrowex="'+f.attr("numrow")+'"]');var d=f.find(".toggleVisibility");d.data("status","0");d.find(".glyphicon").removeClass("glyphicon-menu-up");d.find(".glyphicon").addClass("glyphicon-menu-down");b.addClass("hide");var c=CKEDITOR.instances[b.find(".ckEditorSource").attr("id")];if(c){c.destroy()}},initDiscountsParameters:function(d,c){var b=this;var a=d.find(".discountParam").val();if(a==""){return}var a=JSON.parse(a);$.each(b.discountModalFields,function(e,g){var i=a[g];var f=c.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{c.find('[name="'+g+'"]').val(i)}}});b.calculateDiscount(d,c)},initTaxParameters:function(d,c){var b=this;var a=d.find(".taxParam").val();if(a==""){return}var a=JSON.parse(a);$.each(b.taxModalFields,function(e,g){var i=a[g];var f=c.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{c.find('[name="'+g+'"]').val(i)}}});b.calculateTax(d,c)},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#inventoryLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"Inventory",mode:"checkLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#inventoryLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide();console.error(f,g)});return a},currencyChangeActions:function(a,b){var c=this;if(b.data("baseCurrency")==0){c.showCurrencyChangeModal(a)}else{c.currencyConvertValues(a);a.data("oldValue",a.val())}},showCurrencyChangeModal:function(a){var c=this;if(c.lockCurrencyChange==true){return}c.lockCurrencyChange=true;var b=a.closest("th").find(".modelContainer").clone();app.showModalWindow(b,function(e){var d=$(e);d.on("click",'button[type="submit"]',function(f){c.currencyConvertValues(a);a.data("oldValue",a.val());app.hideModalWindow();c.lockCurrencyChange=false});d.on("click",'button[type="reset"]',function(f){a.val(a.data("oldValue")).change();c.lockCurrencyChange=false})})},currencyConvertValues:function(a){var f=this;var d=a.find("option:selected");var e=a.find('option[value="'+a.data("oldValue")+'"]');var b=d.data("conversionRate");var c=e.data("conversionRate");b=parseFloat(b)/parseFloat(c);this.getInventoryItemsContainer().find(f.rowClass).each(function(g){var h=$(this);f.setUnitPrice(h,app.parseNumberToFloat(f.getUnitPriceValue(h)*b));f.setDiscount(h,app.parseNumberToFloat(f.getDiscount(h)*b));f.setTax(h,app.parseNumberToFloat(f.getTax(h)*b));f.quantityChangeActions(h)})},registerAddItem:function(a){var c=this;var b=this.getInventoryItemsContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackIthemTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.find("tr").appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.initItem(m)})},registerSortableItems:function(){var b=this;var a=b.getInventoryItemsContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(c,d){a.find(b.rowClass).each(function(e,f){var g=$(f);b.hideExpandedRow(g)});d.item.startPos=d.item.index()},stop:function(d,e){var c=$(e.item.context).attr("numrow");var f=a.find(".numRow"+c).remove().clone();a.find('[numrow="'+c+'"]').after(f);if(e.item.startPosfetch_array($result)) { - $value = $row['value']; - if (in_array($row['param'], ['discounts'])) { - $value = explode(',', $value); - } - $config[$row['param']] = $value; - } - self::$discountsConfig = $config; - return $config; - } - - public function getGlobalDiscounts() - { - $db = PearDatabase::getInstance(); - $config = []; - $result = $db->pquery('SELECT * FROM a_yf_discounts_global WHERE status = ?', [1]); - while ($row = $db->fetch_array($result)) { - $config[$row['name']] = $row['value']; - } - return $config; - } - - protected static $taxsConfig = false; - - public static function getTaxsConfig() - { - if (self::$taxsConfig != false) { - return self::$taxsConfig; - } - - $db = PearDatabase::getInstance(); - $config = []; - $result = $db->query('SELECT * FROM a_yf_taxs_config'); - while ($row = $db->fetch_array($result)) { - $value = $row['value']; - if (in_array($row['param'], ['taxs'])) { - $value = explode(',', $value); - } - $config[$row['param']] = $value; - } - self::$taxsConfig = $config; - return $config; - } - - public function getGlobalTaxs() - { - $db = PearDatabase::getInstance(); - $config = []; - $result = $db->pquery('SELECT * FROM a_yf_taxs_global WHERE status = ?', [1]); - while ($row = $db->fetch_array($result)) { - $config[$row['name']] = $row['value']; - } - return $config; - } } diff --git a/modules/Products/views/Discounts.php b/modules/Products/views/Discounts.php deleted file mode 100644 index af2e3177560c..000000000000 --- a/modules/Products/views/Discounts.php +++ /dev/null @@ -1,52 +0,0 @@ -getModule(); - $discountType = $request->get('discountType'); - $currency = $request->get('currency'); - $sourceModule = $request->get('sourceModule'); - $sourceRecord = $request->get('sourceRecord'); - $isIndividual = $request->get('isIndividual'); - $totalPrice = $request->get('totalPrice'); - $accountField = $request->get('accountField'); - - $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName); - $config = $recordModel->getDiscountsConfig(); - $groupDiscount = $this->getAccountDiscount($sourceModule, $sourceRecord, $accountField); - - $viewer = $this->getViewer($request); - $viewer->assign('MODULE', $moduleName); - $viewer->assign('GLOBAL_DISCOUNTS', $recordModel->getGlobalDiscounts()); - $viewer->assign('CURRENCY_SYMBOL', Vtiger_Functions::getCurrencySymbolandRate($currency)['symbol']); - $viewer->assign('TOTAL_PRICE', $totalPrice); - $viewer->assign('CONFIG', $config); - $viewer->assign('DISCOUNT_TYPE', $discountType); - $viewer->assign('AGGREGATION_TYPE', $config['aggregation']); - $viewer->assign('AGGREGATION_INPUT_TYPE', $config['aggregation'] == 0 ? 'radio' : 'checkbox'); - $viewer->assign('GROUP_DISCOUNT', $groupDiscount['discount']); - $viewer->assign('ACCOUNT_NAME', $groupDiscount['name']); - $viewer->view('Discounts.tpl', $moduleName); - } - - public function getAccountDiscount($moduleName, $record, $accountField) - { - $discount = 0; - $discountField = 'discount'; - $name = ''; - if ($accountField != '') { - $recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName); - $relationFieldValue = $recordModel->get($accountField); - if ($relationFieldValue != 0) { - $accountRecordModel = Vtiger_Record_Model::getInstanceById($relationFieldValue); - $discount = $accountRecordModel->get($discountField); - $name = $accountRecordModel->getName(); - } - } - - return ['discount' => $discount, 'name' => $name]; - } -} diff --git a/modules/Products/views/Taxs.php b/modules/Products/views/Taxs.php deleted file mode 100644 index ab4dbb6e15d6..000000000000 --- a/modules/Products/views/Taxs.php +++ /dev/null @@ -1,56 +0,0 @@ -getModule(); - $record = $request->get('record'); - $recordModule = $request->get('recordModule'); - $currency = $request->get('currency'); - $sourceModule = $request->get('sourceModule'); - $sourceRecord = $request->get('sourceRecord'); - $taxType = $request->get('taxType'); - $totalPrice = $request->get('totalPrice'); - $accountField = $request->get('accountField'); - - $accountTaxs = $this->getAccountTax($sourceModule, $sourceRecord, $accountField); - - $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName); - $config = $recordModel->getTaxsConfig(); - $viewer = $this->getViewer($request); - $viewer->assign('MODULE', $moduleName); - $viewer->assign('RECORD', $record); - $viewer->assign('RECORD_MODULE', $recordModule); - $viewer->assign('GLOBAL_TAXS', $recordModel->getGlobalTaxs()); - $viewer->assign('CURRENCY_SYMBOL', Vtiger_Functions::getCurrencySymbolandRate($currency)['symbol']); - $viewer->assign('TOTAL_PRICE', $totalPrice); - $viewer->assign('CONFIG', $config); - $viewer->assign('TAX_TYPE', $taxType); - $viewer->assign('TAX_FIELD', Supplies_EditView_Model::getTaxField($recordModule)); - $viewer->assign('AGGREGATION_TYPE', $config['aggregation']); - $viewer->assign('AGGREGATION_INPUT_TYPE', $config['aggregation'] == 0 ? 'radio' : 'checkbox'); - $viewer->assign('GROUP_TAXS', $accountTaxs['taxs']); - $viewer->assign('ACCOUNT_NAME', $accountTaxs['name']); - $viewer->view('Taxs.tpl', $moduleName); - } - - public function getAccountTax($moduleName, $record, $accountField) - { - $accountTaxs = []; - $name = ''; - $taxField = Supplies_EditView_Model::getTaxField('Accounts'); - if ($accountField != '' && $taxField != false) { - $recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName); - $relationFieldValue = $recordModel->get($accountField); - if ($relationFieldValue != 0) { - $accountRecordModel = Vtiger_Record_Model::getInstanceById($relationFieldValue, 'Accounts'); - $accountTaxs = Vtiger_Taxs_UIType::getValues($accountRecordModel->get($taxField)); - $name = $accountRecordModel->getName(); - } - } - - return ['taxs' => $accountTaxs, 'name' => $name]; - } -} diff --git a/modules/Supplies/actions/CheckLimits.php b/modules/Supplies/actions/CheckLimits.php deleted file mode 100644 index 73b7b3b18562..000000000000 --- a/modules/Supplies/actions/CheckLimits.php +++ /dev/null @@ -1,73 +0,0 @@ - - */ -class Supplies_CheckLimits_Action extends Vtiger_Action_Controller -{ - - function checkPermission(Vtiger_Request $request) - { - $moduleName = $request->getModule(); - $moduleModel = Vtiger_Module_Model::getInstance($moduleName); - $currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); - - if (!$currentUserPriviligesModel->hasModulePermission($moduleModel->getId())) { - throw new AppException(vtranslate($moduleName) . ' ' . vtranslate('LBL_NOT_ACCESSIBLE')); - } - } - - function process(Vtiger_Request $request) - { - $record = $request->get('record'); - $currency = $request->get('currency'); - $price = $request->get('price'); - $limitConfig = $request->get('limitConfig'); - - $response = new Vtiger_Response(); - $response->setResult($this->checkLimits($record, $currency, $price, $limitConfig)); - $response->emit(); - } - - function checkLimits($record, $currency, $price, $limitConfig) - { - $limitFieldName = 'xxx'; - $balanceFieldName = 'limit'; - $moduleInstance = Vtiger_Module_Model::getInstance('Accounts'); - $limitField = Vtiger_Field_Model::getInstance($limitFieldName, $moduleInstance); - $balanceField = Vtiger_Field_Model::getInstance($limitFieldName, $moduleInstance); - if (!$limitField->isActiveField() || !$balanceField->isActiveField()) { - return ['status' => true]; - } - $recordModel = Vtiger_Record_Model::getInstanceById($record, 'Accounts'); - $limitID = $recordModel->get($limitFieldName); - $balance = $recordModel->get($balanceFieldName); - $limit = reset(Vtiger_SuppliesLimit_UIType::getValues($limitID))['value']; - - $baseCurrency = Vtiger_Util_Helper::getBaseCurrency(); - $symbol = $baseCurrency['currency_symbol']; - if ($baseCurrency['id'] != $currency) { - $selectedCurrency = Vtiger_Functions::getCurrencySymbolandRate($currency); - $price = floatval($price) * $selectedCurrency['rate']; - $symbol = $selectedCurrency['symbol']; - } - $totalPrice = $price + $balance; - - $status = $totalPrice > $limit ? false : true; - if (!$status) { - $viewer = new Vtiger_Viewer(); - $viewer->assign('PRICE', $price); - $viewer->assign('BALANCE', $balance); - $viewer->assign('SYMBOL', $symbol); - $viewer->assign('LIMIT', $limit); - $viewer->assign('TOTALS', $totalPrice); - $viewer->assign('LIMIT_CONFIG', $limitConfig); - $html = $viewer->view('LimitAlert.tpl', 'Supplies', true); - } - return ['status' => $status, 'html' => $html]; - } - -} diff --git a/modules/Supplies/actions/GetDetails.php b/modules/Supplies/actions/GetDetails.php deleted file mode 100644 index 0bf347c309f0..000000000000 --- a/modules/Supplies/actions/GetDetails.php +++ /dev/null @@ -1,84 +0,0 @@ - - */ -class Supplies_GetDetails_Action extends Vtiger_Action_Controller -{ - - function checkPermission(Vtiger_Request $request) - { - $moduleName = $request->getModule(); - $moduleModel = Vtiger_Module_Model::getInstance($moduleName); - $currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); - - if (!$currentUserPriviligesModel->hasModulePermission($moduleModel->getId())) { - throw new AppException(vtranslate($moduleName) . ' ' . vtranslate('LBL_NOT_ACCESSIBLE')); - } - } - - function process(Vtiger_Request $request) - { - $recordId = $request->get('record'); - $idList = $request->get('idlist'); - $currencyId = $request->get('currency_id'); - $moduleName = $request->getModule(); - - $conversionRate = 1; - $response = new Vtiger_Response(); - $unitPriceValues = $taxes = []; - $unitPrice = false; - - if (empty($idList)) { - $info = $this->getRecordDetail($recordId, $currencyId, $moduleName); - } else { - foreach ($idList as $id) { - $info[] = $this->getRecordDetail($id, $currencyId, $moduleName); - } - } - $response->setResult($info); - $response->emit(); - } - - function getRecordDetail($recordId, $currencyId, $moduleName) - { - $conversionRate = 1; - $unitPriceValues = $taxes = []; - $unitPrice = false; - - $recordModel = Vtiger_Record_Model::getInstanceById($recordId); - $recordModuleName = $recordModel->getModuleName(); - if (in_array($recordModuleName, ['Products', 'Services'])) { - $unitPriceValues = $recordModel->getListPriceValues($recordModel->getId()); - $priceDetails = $recordModel->getPriceDetails(); - foreach ($priceDetails as $currencyDetails) { - if ($currencyId == $currencyDetails['curid']) { - $conversionRate = $currencyDetails['conversionrate']; - } - } - $unitPrice = (float) $recordModel->get('unit_price') * (float) $conversionRate; - } - $autoCompleteField = Supplies_SupField_Model::getAutoCompleteField($recordModuleName, $moduleName); - $autoFields = []; - if ($autoCompleteField) { - foreach ($autoCompleteField as $field) { - if ($recordModel->has($field['field']) && $recordModel->get($field['field']) != '') { - $autoFields[$field['tofield']] = $recordModel->get($field['field']); - } - } - } - $info = [ - $recordId => [ - 'id' => $recordId, - 'name' => decode_html($recordModel->getName()), - 'price' => CurrencyField::convertToUserFormat($unitPrice, null, true), - 'unitPriceValues' => $unitPriceValues, - 'description' => decode_html($recordModel->get('description')), - 'autoFields' => $autoFields, - ]]; - return $info; - } -} diff --git a/modules/Supplies/actions/Inventory.php b/modules/Supplies/actions/Inventory.php deleted file mode 100644 index a5c781cf74a6..000000000000 --- a/modules/Supplies/actions/Inventory.php +++ /dev/null @@ -1,46 +0,0 @@ - - */ -class Supplies_Inventory_Action extends Vtiger_Action_Controller -{ - - function __construct() - { - $this->exposeMethod('getUnitPrice'); - } - - function checkPermission(Vtiger_Request $request) - { - return true; - } - - function process(Vtiger_Request $request) - { - $mode = $request->getMode(); - - if ($mode) { - $this->invokeExposedMethod($mode, $request); - } - } - - function getUnitPrice(Vtiger_Request $request) - { - $record = $request->get('record'); - $recordModule = $request->get('recordModule'); - $moduleName = $request->getModule(); - $unitPriceValues = false; - - if (in_array($recordModule, ['Products', 'Services'])) { - $recordModel = Vtiger_Record_Model::getInstanceById($record, $recordModule); - $unitPriceValues = $recordModel->getListPriceValues($record); - } - $response = new Vtiger_Response(); - $response->setResult($unitPriceValues); - $response->emit(); - } -} diff --git a/modules/Supplies/actions/MassSave.php b/modules/Supplies/actions/MassSave.php deleted file mode 100644 index 587a3d75a8d4..000000000000 --- a/modules/Supplies/actions/MassSave.php +++ /dev/null @@ -1,11 +0,0 @@ - - */ -class Supplies_MassSave_Action extends Vtiger_MassSave_Action -{ - -} diff --git a/modules/Supplies/actions/Save.php b/modules/Supplies/actions/Save.php deleted file mode 100644 index c3ce4d0d8632..000000000000 --- a/modules/Supplies/actions/Save.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ -class Supplies_Save_Action extends Vtiger_Save_Action -{ - - /** - * Function to save record - * @param $request - values of the record - * @return - record Model of saved record - */ - public function saveRecord($request) - { - $recordModel = parent::saveRecord($request); - $recordModel->saveSupplieData($request); - return $recordModel; - } -} diff --git a/modules/Supplies/fields/Basic.php b/modules/Supplies/fields/Basic.php deleted file mode 100644 index 7144cbbdb7f0..000000000000 --- a/modules/Supplies/fields/Basic.php +++ /dev/null @@ -1,139 +0,0 @@ - - */ -class Supplies_Basic_Field extends Vtiger_Base_Model -{ - - protected $name = ''; - protected $defaultLabel = 'LBL_CURRENCY'; - protected $defaultValue = ''; - protected $columnName = ''; - protected $dbType = 'varchar(100)'; - protected $customColumn = []; - protected $summationValue = false; - - /** - * Geting database-type of field - * @return string dbType - */ - public function getDBType() - { - return $this->dbType; - } - - /** - * Geting template name - * @return string templateName - */ - public function getTemplateName($view, $moduleName) - { - $tpl = $view . $this->name . '.tpl'; - $filename = 'layouts' . DIRECTORY_SEPARATOR . 'vlayout' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . $moduleName . DIRECTORY_SEPARATOR . 'fields' . DIRECTORY_SEPARATOR . $tpl; - if (is_file($filename)) { - return $tpl; - } - $filename = 'layouts' . DIRECTORY_SEPARATOR . 'vlayout' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'Supplies' . DIRECTORY_SEPARATOR . 'fields' . DIRECTORY_SEPARATOR . $tpl; - if (is_file($filename)) { - return $tpl; - } - return $view . 'Base' . '.tpl'; - } - - /** - * Geting default label - * @return string defaultLabel - */ - public function getDefaultLabel() - { - return $this->defaultLabel; - } - - /** - * Geting field name - * @return string name - */ - public function getName() - { - return $this->name; - } - - /** - * Geting column name - * @return string columnName - */ - public function getColumnName() - { - return $this->columnName; - } - - /** - * Geting column name - * @return string customColumn - */ - public function getCustomColumn() - { - return $this->customColumn; - } - - public function isSummary() - { - return $this->summationValue; - } - - /** - * Data field instance initialization - * @param array $valueArray Array for initialization - */ - public function initialize($valueArray) - { - $this->setData($valueArray); - } - - /** - * Geting value to display - * @param type $value - * @return string - */ - public function getDisplayValue($value) - { - return $value; - } - - /** - * Geting value to display - * @param type $value - * @return string - */ - public function getEditValue($value) - { - return $this->getDisplayValue($value); - } - - /** - * Geting value - * @param type $value - * @return string - */ - public function getValue($value) - { - if ($value == '') { - return $this->get('defaultvalue'); - } - return $value; - } - - public function isMandatory() - { - return true; - } - - public function isVisible($data) - { - return true; - } -} diff --git a/modules/Supplies/fields/Comment.php b/modules/Supplies/fields/Comment.php deleted file mode 100644 index d5b909163822..000000000000 --- a/modules/Supplies/fields/Comment.php +++ /dev/null @@ -1,17 +0,0 @@ - - */ -class Supplies_Comment_Field extends Supplies_Basic_Field -{ - - protected $name = 'Comment'; - protected $defaultLabel = 'LBL_COMMENT'; - protected $columnName = 'comment'; - protected $dbType = 'varchar(500)'; - -} diff --git a/modules/Supplies/fields/Currency.php b/modules/Supplies/fields/Currency.php deleted file mode 100644 index a461adde880e..000000000000 --- a/modules/Supplies/fields/Currency.php +++ /dev/null @@ -1,26 +0,0 @@ - - */ -class Supplies_Currency_Field extends Supplies_Basic_Field -{ - - protected $name = 'Currency'; - protected $defaultLabel = 'LBL_CURRENCY'; - protected $columnName = 'currency'; - protected $dbType = 'int(10)'; - - /** - * Geting value to display - * @param int $value - * @return string - */ - public function getDisplayValue($value) - { - return Vtiger_Functions::getCurrencyName($value,false); - } -} diff --git a/modules/Supplies/fields/Discount.php b/modules/Supplies/fields/Discount.php deleted file mode 100644 index d5afe2d9def7..000000000000 --- a/modules/Supplies/fields/Discount.php +++ /dev/null @@ -1,30 +0,0 @@ - - */ -class Supplies_Discount_Field extends Supplies_Basic_Field -{ - - protected $name = 'Discount'; - protected $defaultLabel = 'LBL_DISCOUNT'; - protected $columnName = 'discount'; - protected $dbType = 'decimal(27,8) DEFAULT \'0\''; - protected $customColumn = [ - 'discountparam' => 'varchar(255) NOT NULL' - ]; - protected $summationValue = true; - - /** - * Geting value to display - * @param type $value - * @return type - */ - public function getDisplayValue($value) - { - return CurrencyField::convertToUserFormat($value, null, true); - } -} diff --git a/modules/Supplies/fields/DiscountMode.php b/modules/Supplies/fields/DiscountMode.php deleted file mode 100644 index 7126e20f333f..000000000000 --- a/modules/Supplies/fields/DiscountMode.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ -class Supplies_DiscountMode_Field extends Supplies_Basic_Field -{ - - protected $name = 'DiscountMode'; - protected $defaultLabel = 'LBL_DISCOUNT_MODE'; - protected $defaultValue = '0'; - protected $columnName = 'discountmode'; - protected $dbType = "tinyint(1) NOT NULL DEFAULT '0'"; - protected $values = [0 => 'group', 1 => 'individual']; - - /** - * Geting value to display - * @param int $value - * @return string - */ - public function getDisplayValue($value) - { - return 'LBL_' . strtoupper($this->values[$value]); - } -} diff --git a/modules/Supplies/fields/GrossPrice.php b/modules/Supplies/fields/GrossPrice.php deleted file mode 100644 index 88bc30280028..000000000000 --- a/modules/Supplies/fields/GrossPrice.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ -class Supplies_GrossPrice_Field extends Supplies_Basic_Field -{ - - protected $name = 'GrossPrice'; - protected $defaultLabel = 'LBL_GROSS_PRICE'; - protected $columnName = 'gross'; - protected $dbType = 'decimal(27,8) DEFAULT \'0\''; - protected $summationValue = true; - - /** - * Geting value to display - * @param type $value - * @return type - */ - public function getDisplayValue($value) - { - return CurrencyField::convertToUserFormat($value, null, true); - } -} diff --git a/modules/Supplies/fields/Margin.php b/modules/Supplies/fields/Margin.php deleted file mode 100644 index c06819309d2b..000000000000 --- a/modules/Supplies/fields/Margin.php +++ /dev/null @@ -1,26 +0,0 @@ - - */ -class Supplies_Margin_Field extends Supplies_Basic_Field -{ - - protected $name = 'Margin'; - protected $defaultLabel = 'LBL_MARGIN'; - protected $columnName = 'margin'; - protected $dbType = 'decimal(27,8) DEFAULT \'0\''; - - /** - * Geting value to display - * @param type $value - * @return type - */ - public function getDisplayValue($value) - { - return CurrencyField::convertToUserFormat($value, null, true); - } -} diff --git a/modules/Supplies/fields/MarginP.php b/modules/Supplies/fields/MarginP.php deleted file mode 100644 index 63cd22182a15..000000000000 --- a/modules/Supplies/fields/MarginP.php +++ /dev/null @@ -1,26 +0,0 @@ - - */ -class Supplies_MarginP_Field extends Supplies_Basic_Field -{ - - protected $name = 'MarginP'; - protected $defaultLabel = 'LBL_MARGIN_PRECENT'; - protected $columnName = 'marginp'; - protected $dbType = 'decimal(27,8) DEFAULT \'0\''; - - /** - * Geting value to display - * @param type $value - * @return type - */ - public function getDisplayValue($value) - { - return CurrencyField::convertToUserFormat($value, null, true); - } -} diff --git a/modules/Supplies/fields/Name.php b/modules/Supplies/fields/Name.php deleted file mode 100644 index 4ec9a7296268..000000000000 --- a/modules/Supplies/fields/Name.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ -class Supplies_Name_Field extends Supplies_Basic_Field -{ - - protected $name = 'Name'; - protected $defaultLabel = 'LBL_ITEM_NAME'; - protected $columnName = 'name'; - protected $dbType = 'int(19) DEFAULT \'0\''; - - /** - * Geting value to display - * @param type $value - * @return type - */ - public function getDisplayValue($value) - { - if($value != 0) - return Vtiger_Functions::getCRMRecordLabel($value); - return ''; - } -} diff --git a/modules/Supplies/fields/NetPrice.php b/modules/Supplies/fields/NetPrice.php deleted file mode 100644 index 204970e07986..000000000000 --- a/modules/Supplies/fields/NetPrice.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ -class Supplies_NetPrice_Field extends Supplies_Basic_Field -{ - - protected $name = 'NetPrice'; - protected $defaultLabel = 'LBL_DISCOUNT_PRICE'; - protected $columnName = 'net'; - protected $dbType = 'decimal(27,8) DEFAULT \'0\''; - protected $summationValue = true; - - /** - * Geting value to display - * @param type $value - * @return type - */ - public function getDisplayValue($value) - { - return CurrencyField::convertToUserFormat($value, null, true); - } -} diff --git a/modules/Supplies/fields/Purchase.php b/modules/Supplies/fields/Purchase.php deleted file mode 100644 index 8bec2052773b..000000000000 --- a/modules/Supplies/fields/Purchase.php +++ /dev/null @@ -1,26 +0,0 @@ - - */ -class Supplies_Purchase_Field extends Supplies_Basic_Field -{ - - protected $name = 'Purchase'; - protected $defaultLabel = 'LBL_PURCHASE'; - protected $columnName = 'purchase'; - protected $dbType = 'decimal(27,8) DEFAULT \'0\''; - - /** - * Geting value to display - * @param type $value - * @return type - */ - public function getDisplayValue($value) - { - return CurrencyField::convertToUserFormat($value, null, true); - } -} diff --git a/modules/Supplies/fields/Quantity.php b/modules/Supplies/fields/Quantity.php deleted file mode 100644 index 5c4fa7fc5ecb..000000000000 --- a/modules/Supplies/fields/Quantity.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ -class Supplies_Quantity_Field extends Supplies_Basic_Field -{ - - protected $name = 'Quantity'; - protected $defaultLabel = 'LBL_QUANTITY'; - protected $defaultValue = '1'; - protected $columnName = 'qty'; - protected $dbType = 'decimal(25,3)'; - - /** - * Geting value to display - * @param type $value - * @return type - */ - public function getDisplayValue($value) - { - return Vtiger_Functions::formatDecimal($value); - } -} diff --git a/modules/Supplies/fields/Reference.php b/modules/Supplies/fields/Reference.php deleted file mode 100644 index fa737238982d..000000000000 --- a/modules/Supplies/fields/Reference.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ -class Supplies_Reference_Field extends Supplies_Basic_Field -{ - - protected $name = 'Reference'; - protected $defaultLabel = 'LBL_REFERENCE'; - protected $columnName = 'ref'; - protected $dbType = 'int(19)'; - - /** - * Geting value to display - * @param type $value - * @return type - */ - public function getDisplayValue($value) - { - if($value != 0) - return Vtiger_Functions::getCRMRecordLabel($value); - return ''; - } -} diff --git a/modules/Supplies/fields/Tax.php b/modules/Supplies/fields/Tax.php deleted file mode 100644 index d3f8192dd86f..000000000000 --- a/modules/Supplies/fields/Tax.php +++ /dev/null @@ -1,38 +0,0 @@ - - */ -class Supplies_Tax_Field extends Supplies_Basic_Field -{ - - protected $name = 'Tax'; - protected $defaultLabel = 'LBL_TAX'; - protected $columnName = 'tax'; - protected $dbType = 'decimal(27,8) DEFAULT \'0\''; - protected $customColumn = [ - 'taxparam' => 'varchar(255) NOT NULL' - ]; - protected $summationValue = true; - - /** - * Geting value to display - * @param type $value - * @return type - */ - public function getDisplayValue($value) - { - return CurrencyField::convertToUserFormat($value, null, true); - } - - public function getClassName($data) - { - if(count($data) > 0 && $data[0]['taxmode'] == 0){ - return 'hide'; - } - return ''; - } -} diff --git a/modules/Supplies/fields/TaxMode.php b/modules/Supplies/fields/TaxMode.php deleted file mode 100644 index 665bbabba6d8..000000000000 --- a/modules/Supplies/fields/TaxMode.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ -class Supplies_TaxMode_Field extends Supplies_Basic_Field -{ - - protected $name = 'TaxMode'; - protected $defaultLabel = 'LBL_TAX_MODE'; - protected $defaultValue = '0'; - protected $columnName = 'taxmode'; - protected $dbType = "tinyint(1) NOT NULL DEFAULT '0'"; - protected $values = [0 => 'group', 1 => 'individual']; - - /** - * Geting value to display - * @param int $value - * @return string - */ - public function getDisplayValue($value) - { - return 'LBL_' . strtoupper($this->values[$value]); - } -} diff --git a/modules/Supplies/fields/TotalPrice.php b/modules/Supplies/fields/TotalPrice.php deleted file mode 100644 index f34fc51523e3..000000000000 --- a/modules/Supplies/fields/TotalPrice.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ -class Supplies_TotalPrice_Field extends Supplies_Basic_Field -{ - - protected $name = 'TotalPrice'; - protected $defaultLabel = 'LBL_TOTAL_PRICE'; - protected $columnName = 'total'; - protected $dbType = 'decimal(27,8) DEFAULT \'0\''; - protected $summationValue = true; - - /** - * Geting value to display - * @param type $value - * @return type - */ - public function getDisplayValue($value) - { - return CurrencyField::convertToUserFormat($value, null, true); - } -} diff --git a/modules/Supplies/fields/UnitPrice.php b/modules/Supplies/fields/UnitPrice.php deleted file mode 100644 index 017966c4b24b..000000000000 --- a/modules/Supplies/fields/UnitPrice.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ -class Supplies_UnitPrice_Field extends Supplies_Basic_Field -{ - - protected $name = 'UnitPrice'; - protected $defaultLabel = 'LBL_UNIT_PRICE'; - protected $columnName = 'price'; - protected $dbType = 'decimal(27,8)'; - protected $summationValue = true; - - /** - * Geting value to display - * @param type $value - * @return type - */ - public function getDisplayValue($value) - { - return CurrencyField::convertToUserFormat($value, null, true); - } -} diff --git a/modules/Supplies/fields/Value.php b/modules/Supplies/fields/Value.php deleted file mode 100644 index a161c1ca909d..000000000000 --- a/modules/Supplies/fields/Value.php +++ /dev/null @@ -1,16 +0,0 @@ - - */ -class Supplies_Value_Field extends Supplies_Basic_Field -{ - - protected $name = 'Value'; - protected $defaultLabel = 'LBL_VALUE'; - protected $columnName = 'value'; - protected $dbType = 'varchar(255)'; -} diff --git a/modules/Supplies/models/DetailView.php b/modules/Supplies/models/DetailView.php deleted file mode 100644 index fce876056035..000000000000 --- a/modules/Supplies/models/DetailView.php +++ /dev/null @@ -1,11 +0,0 @@ - - */ -class Supplies_DetailView_Model extends Vtiger_DetailView_Model -{ - -} diff --git a/modules/Supplies/models/EditView.php b/modules/Supplies/models/EditView.php deleted file mode 100644 index 2a56f92adfe0..000000000000 --- a/modules/Supplies/models/EditView.php +++ /dev/null @@ -1,52 +0,0 @@ - - */ -class Supplies_EditView_Model extends Vtiger_EditView_Model -{ - - public function isWysiwygType($moduleName) - { - if (!$moduleName) { - return false; - } - $cache = Vtiger_Cache::get('SuppliesisWysiwygType', $moduleName); - if ($cache) { - return $cache; - } - $return = 0; - $moduleModel = Vtiger_Module_Model::getInstance($moduleName); - $fieldModel = Vtiger_Field_Model::getInstance('description', $moduleModel); - if ($fieldModel && $fieldModel->get('uitype') == '300') { - $return = 1; - } - Vtiger_Cache::set('SuppliesisWysiwygType', $moduleName, $return); - return $return; - } - - public function getTaxField($moduleName) - { - $cache = Vtiger_Cache::get('SuppliesisGetTaxField', $moduleName); - if ($cache) { - return $cache; - } - $return = false; - if($moduleName == ''){ - return $return; - } - $moduleModel = Vtiger_Module_Model::getInstance($moduleName); - foreach ($moduleModel->getFields() as $fieldName => $fieldModel) { - if ($fieldModel->get('uitype') == 303) { - $return = $fieldName; - continue; - } - } - - Vtiger_Cache::set('SuppliesisGetTaxField', $moduleName, $return); - return $return; - } -} diff --git a/modules/Supplies/models/Module.php b/modules/Supplies/models/Module.php deleted file mode 100644 index 3bbf57fa67ac..000000000000 --- a/modules/Supplies/models/Module.php +++ /dev/null @@ -1,33 +0,0 @@ - - */ -class Supplies_Module_Model extends Vtiger_Module_Model -{ - - protected static $modulesNameForTpl = []; - protected $moduleType = 'Supplies'; - - public static function getModuleNameForTpl($tpl, $moduleName) - { - if (isset(self::$modulesNameForTpl[$moduleName . '_' . $tpl])) { - return self::$modulesNameForTpl[$moduleName . '_' . $tpl]; - } - $filename = 'layouts' . DIRECTORY_SEPARATOR . 'vlayout' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . $moduleName . DIRECTORY_SEPARATOR . $tpl; - if (is_file($filename)){ - self::$modulesNameForTpl[$moduleName . '_' . $tpl] = $moduleName; - return $moduleName; - } - - $basicModuleName = 'Supplies'; - $filename = 'layouts' . DIRECTORY_SEPARATOR . 'vlayout' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . $basicModuleName . DIRECTORY_SEPARATOR . $tpl; - if (is_file($filename)){ - self::$modulesNameForTpl[$moduleName . '_' . $tpl] = $basicModuleName; - return $basicModuleName; - } - } -} diff --git a/modules/Supplies/models/Record.php b/modules/Supplies/models/Record.php deleted file mode 100644 index 941f8cd638bc..000000000000 --- a/modules/Supplies/models/Record.php +++ /dev/null @@ -1,87 +0,0 @@ - - */ -class Supplies_Record_Model extends Vtiger_Record_Model -{ - - protected $jsonFields = ['discountparam', 'taxparam']; - - /** - * Save supplie data - * @param Vtiger_Request $request - */ - public function saveSupplieData(Vtiger_Request $request) - { - $db = PearDatabase::getInstance(); - $log = vglobal('log'); - $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__); - - $moduleName = $request->getModule(); - $SupFieldModel = Supplies_SupField_Model::getCleanInstance(); - $fields = $SupFieldModel->getColumns($moduleName); - $table = $SupFieldModel->getTableName($moduleName, 'data'); - $numRow = $request->get('suppliesRowNo'); - - $db->pquery("delete from $table where id = ? ", [$this->getId()]); - - for ($i = 1; $i <= $numRow; $i++) { - if (!$request->has(reset($fields) . $i)) { - continue; - } - $insertData = ['id' => $this->getId(), 'seq' => $request->get('seq' . $i)]; - foreach ($fields as $field) { - $insertData[$field] = $this->getValueForSave($request, $field, $i); - } - $db->insert($table, $insertData); - } - $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); - } - - public function getValueForSave(Vtiger_Request $request, $field, $i) - { - $value = ''; - if (in_array($field, $this->jsonFields) && $request->get($field . $i) != '') { - $value = json_encode($request->get($field . $i)); - } else if ($request->has($field . $i)) { - $value = $request->get($field . $i); - } else if ($request->has($field)) { - $value = $request->get($field); - } - if (in_array($field, ['price','gross','net','discount','purchase','margin','marginp','tax','total'])) { - $value = CurrencyField::convertToDBFormat($value, null, true); - } - return $value; - } - - /** - * Loading the Supplies data for a record - * @return array Supplies data - */ - public function getSupplieData() - { - $log = vglobal('log'); - $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . '| module:' . $module . ' record:' . $record); - - $module = $this->getModuleName(); - $record = $this->getId(); - if (empty($record)) { - return []; - } - - $db = PearDatabase::getInstance(); - $sups = Supplies_SupField_Model::getTableName($module, 'data'); - $result = $db->pquery('SELECT * FROM ' . $sups . ' WHERE id = ? ORDER BY seq', [$record]); - $fields = []; - while ($row = $db->fetch_array($result)) { - $fields[] = $row; - } - - $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); - return $fields; - } -} diff --git a/modules/Supplies/models/SupField.php b/modules/Supplies/models/SupField.php deleted file mode 100644 index 008064b6746e..000000000000 --- a/modules/Supplies/models/SupField.php +++ /dev/null @@ -1,224 +0,0 @@ - - */ -class Supplies_SupField_Model -{ - - const DATA_PREFIX = '_sups'; - const FIELDS_PREFIX = '_supfield'; - const AUTOFIELD_PREFIX = '_supmap'; - - protected static $columns = false; - - /** - * Create the name of the Supplies data table - * @param string $module Module name - * @param string $prefix Prefix table - * @return string Table name - */ - public function getTableName($module, $type = 'data') - { - switch ($type) { - case 'data': - $prefix = self::DATA_PREFIX; - break; - case 'fields': - $prefix = self::FIELDS_PREFIX; - break; - case 'autofield': - $prefix = self::AUTOFIELD_PREFIX; - break; - } - $moduleName = strtolower($module); - $basetable = 'vtiger_' . $moduleName; - $supfield = $basetable . $prefix; - return $supfield; - } - - /** - * Loading the Supplies data - * @param string $module Module name - * @param boolean $returnInBlock Should the result be divided into blocks - * @return array Supplies data - */ - public static function getFields($module, $returnInBlock = false) - { - $log = vglobal('log'); - $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . '| ' . $module); - - $db = PearDatabase::getInstance(); - $supfield = self::getTableName($module, 'fields'); - $result = $db->query("SHOW TABLES LIKE '$supfield'"); - if ($result->rowCount() == 0) { - return false; - } - $result = $db->pquery('SELECT * FROM ' . $supfield . ' WHERE presence = ? ORDER BY sequence', [0]); - $fields = []; - while ($row = $db->fetch_array($result)) { - if (!self::isActiveField($row)) { - continue; - } - if ($returnInBlock) { - $fields[$row['block']][$row['columnname']] = self::getInstanceFromArray($row); - } else { - $fields[$row['columnname']] = self::getInstanceFromArray($row); - } - } - - $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); - return $fields; - } - - public static function isActiveField($row) - { - if (in_array($row['suptype'], ['Discount', 'DiscountMode'])) { - $discountsConfig = Products_Record_Model::getDiscountsConfig(); - if ($discountsConfig['active'] == '0') { - return false; - } - } - - return true; - } - - /** - * Loading the Supplies data - * @param string $module Module name - * @param boolean $returnInBlock Should the result be divided into blocks - * @return array Supplies data - */ - public static function getColumns($module) - { - $log = vglobal('log'); - $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . '| ' . $module); - if (self::$columns) { - return self::$columns; - } - - $columns = []; - foreach (self::getFields($module) as $field) { - $column = $field->getColumnName(); - if ($column != '') - $columns[] = $column; - foreach ($field->getCustomColumn() as $name => $field) { - $columns[] = $name; - } - } - self::$columns = $columns; - $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); - return $columns; - } - - /** - * Creating installation of the field from the table - * @param string $valueArray Array of data - * @return \modelClassName Instance Supplies_Basic_Field - */ - public static function getInstanceFromArray($valueArray) - { - $log = vglobal('log'); - $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . '| '); - - $className = Vtiger_Loader::getComponentClassName('Field', $valueArray['suptype'], 'Supplies'); - $instance = new $className(); - $instance->initialize($valueArray); - - $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); - return $instance; - } - - /** - * Retrieve list of all fields - * @param string $module Module name - * @return array Fields instance Supplies_Basic_Field - */ - public static function getAllFields($module = false) - { - $log = vglobal('log'); - $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__ . '| ' . $module); - $fieldPaths = ['modules/Supplies/fields/']; - if ($module) { - $fieldPaths[] = "modules/$module/fields/"; - } - $fields = []; - foreach ($fieldPaths as $fieldPath) { - if (!is_dir($fieldPath)) - continue; - foreach (new DirectoryIterator($fieldPath) as $fileinfo) { - if ($fileinfo->isFile() && $fileinfo->getFilename() != 'Basic.php') { - $fieldName = str_replace('.php', '', $fileinfo->getFilename()); - $className = Vtiger_Loader::getComponentClassName('Field', $fieldName, 'Supplies'); - $fields[$fieldName] = new $className(); - } - } - } - $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); - return $fields; - } - - /** - * Retrieve list of parameters - * @param array $fields Array of instances fields (Supplies_Basic_Field) - * @return array Array of parameters - */ - public static function getMainParams($fields) - { - $log = vglobal('log'); - $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__); - - $params = false; - foreach ($fields as $field) { - if ($field->getName() == 'Name') { - $params = Zend_Json::decode($field->get('params')); - } - } - - $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); - return $params; - } - - public static function getCleanInstance() - { - $instance = new self(); - return $instance; - } - - public static function getAutoCompleteField($recordModuleName, $moduleName) - { - $db = PearDatabase::getInstance(); - $table = self::getTableName($moduleName, 'autofield'); - $result = $db->query("SHOW TABLES LIKE '$table'"); - if ($result->rowCount() == 0) { - return false; - } - $result = $db->pquery('SELECT * FROM ' . $table . ' WHERE module = ?', [$recordModuleName]); - $fields = []; - while ($row = $db->fetch_array($result)) { - $fields[] = $row; - } - return $fields; - } - public static function getTaxParam($taxParam, $net, $return = false) - { - $taxParam = json_decode($taxParam,true); - if(count($taxParam) == 0){ - return []; - } - if(is_string($taxParam['aggregationType'])){ - $taxParam['aggregationType'] = [$taxParam['aggregationType']]; - } - if(!$return){ - $return = []; - } - foreach ($taxParam['aggregationType'] as $aggregationType) { - $precent = $taxParam[$aggregationType.'Tax']; - $return[$precent] += $net * ($precent/100); - } - return $return; - } -} diff --git a/modules/Supplies/views/Detail.php b/modules/Supplies/views/Detail.php deleted file mode 100644 index 4af7501b72d9..000000000000 --- a/modules/Supplies/views/Detail.php +++ /dev/null @@ -1,31 +0,0 @@ - - */ -class Supplies_Detail_View extends Vtiger_Detail_View -{ - - /** - * Function returns Inventory details - * @param Vtiger_Request $request - */ - function showModuleDetailView(Vtiger_Request $request) - { - echo parent::showModuleDetailView($request); - $this->showLineItemDetails($request); - } - - function showLineItemDetails(Vtiger_Request $request) - { - $record = $request->get('record'); - $moduleName = $request->getModule(); - - $viewer = $this->getViewer($request); - $viewer->assign('SUP_RECORD', $record); - echo $viewer->view('DetailViewSupplies.tpl', Supplies_Module_Model::getModuleNameForTpl('DetailViewSupplies.tpl', $moduleName), true); - } -} diff --git a/modules/Supplies/views/Edit.php b/modules/Supplies/views/Edit.php deleted file mode 100644 index c96be77fb8c8..000000000000 --- a/modules/Supplies/views/Edit.php +++ /dev/null @@ -1,142 +0,0 @@ - - */ -class Supplies_Edit_View extends Vtiger_Edit_View -{ - public function preProcess (Vtiger_Request $request, $display=true) { - parent::preProcess($request, $display); - - $moduleName = $request->getModule(); - $viewer = $this->getViewer($request); - $viewer->view('TopEditView.tpl', Supplies_Module_Model::getModuleNameForTpl('TopEditView.tpl', $moduleName)); - } - - public function process(Vtiger_Request $request) - { - $viewer = $this->getViewer($request); - $moduleName = $request->getModule(); - $record = $request->get('record'); - if (!empty($record) && $request->get('isDuplicate') == true) { - $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName); - $viewer->assign('MODE', ''); - $recordModel->set('id', ''); - //While Duplicating record, If the related record is deleted then we are removing related record info in record model - $mandatoryFieldModels = $recordModel->getModule()->getMandatoryFieldModels(); - foreach ($mandatoryFieldModels as $fieldModel) { - if ($fieldModel->isReferenceField()) { - $fieldName = $fieldModel->get('name'); - if (Vtiger_Util_Helper::checkRecordExistance($recordModel->get($fieldName))) { - $recordModel->set($fieldName, ''); - } - } - } - } else if (!empty($record)) { - $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName); - $viewer->assign('RECORD_ID', $record); - $viewer->assign('MODE', 'edit'); - } else { - $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName); - $referenceId = $request->get('reference_id'); - if ($referenceId) { - $parentRecordModel = Vtiger_Record_Model::getInstanceById($referenceId); - $recordModel->setRecordFieldValues($parentRecordModel); - } - $viewer->assign('MODE', ''); - } - if (!$this->record) { - $this->record = $recordModel; - } - - $moduleModel = $recordModel->getModule(); - $fieldList = $moduleModel->getFields(); - $requestFieldList = array_intersect_key($request->getAll(), $fieldList); - - foreach ($requestFieldList as $fieldName => $fieldValue) { - $fieldModel = $fieldList[$fieldName]; - $specialField = false; - if ($fieldModel->isEditable() || $specialField) { - $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue)); - } - } - $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT); - $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName); - - $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource)); - $mappingRelatedField = $moduleModel->getMappingRelatedField($moduleName); - $viewer->assign('MAPPING_RELATED_FIELD', Zend_Json::encode($mappingRelatedField)); - $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance); - $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure()); - $viewer->assign('MODULE', $moduleName); - $viewer->assign('RECORD', $recordModel); - $viewer->assign('BLOCK_LIST', $moduleModel->getBlocks()); - $viewer->assign('CURRENTDATE', date('Y-n-j')); - $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel()); - $viewer->assign('APIADDRESS', Settings_ApiAddress_Module_Model::getInstance('Settings:ApiAddress')->getConfig()); - - $isRelationOperation = $request->get('relationOperation'); - - //if it is relation edit - $viewer->assign('IS_RELATION_OPERATION', $isRelationOperation); - if ($isRelationOperation) { - $viewer->assign('SOURCE_MODULE', $request->get('sourceModule')); - $viewer->assign('SOURCE_RECORD', $request->get('sourceRecord')); - } - - $viewer->assign('MAX_UPLOAD_LIMIT_MB', Vtiger_Util_Helper::getMaxUploadSize()); - $viewer->assign('MAX_UPLOAD_LIMIT', vglobal('upload_maxsize')); - - // Supplies block - $viewer->assign('SUPFIELD_MODEL', Supplies_SupField_Model::getCleanInstance()); - $viewer->assign('ACCOUNT_REFERENCE_FIELD', $this->getReferenceField($moduleName)); - $viewer->assign('DISCOUNTS_CONFIG', Products_Record_Model::getDiscountsConfig()); - $viewer->assign('TAXS_CONFIG', Products_Record_Model::getTaxsConfig()); - $viewer->view('EditView.tpl', $moduleModel->getModuleNameForTpl('EditView.tpl', $moduleName)); - } - - /** - * Function to get the list of Script models to be included - * @param Vtiger_Request $request - * @return - List of Vtiger_JsScript_Model instances - */ - function getFooterScripts(Vtiger_Request $request) - { - $headerScriptInstances = parent::getFooterScripts($request); - - $moduleName = $request->getModule(); - $moduleEditFile = 'modules.' . $moduleName . '.resources.Edit'; - unset($headerScriptInstances[$moduleEditFile]); - - $jsFileNames = array( - 'modules.Supplies.resources.Edit', - ); - $jsFileNames[] = $moduleEditFile; - $jsScriptInstances = $this->checkAndConvertJsScripts($jsFileNames); - $headerScriptInstances = array_merge($headerScriptInstances, $jsScriptInstances); - return $headerScriptInstances; - } - - public function getReferenceField($moduleName) - { - $mainModule = 'Accounts'; - - $moduleModel = Vtiger_Module_Model::getInstance($moduleName); - $modelFields = $moduleModel->getFields(); - $referenceField = ''; - foreach ($modelFields as $fieldName => $fieldModel) { - if ($fieldModel->getFieldDataType() == Vtiger_Field_Model::REFERENCE_TYPE) { - $referenceList = $fieldModel->getReferenceList(); - if (in_array($mainModule, $referenceList)) { - $referenceField = $fieldName; - break; - } - } - } - - return $referenceField; - } -} diff --git a/modules/Vtiger/actions/Inventory.php b/modules/Vtiger/actions/Inventory.php new file mode 100644 index 000000000000..597e25410115 --- /dev/null +++ b/modules/Vtiger/actions/Inventory.php @@ -0,0 +1,165 @@ + + */ +class Vtiger_Inventory_Action extends Vtiger_Action_Controller +{ + + function __construct() + { + $this->exposeMethod('checkLimits'); + $this->exposeMethod('getUnitPrice'); + $this->exposeMethod('getDetails'); + } + + function checkPermission(Vtiger_Request $request) + { + $moduleName = $request->getModule(); + $moduleModel = Vtiger_Module_Model::getInstance($moduleName); + $currentUserPriviligesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); + + if (!$currentUserPriviligesModel->hasModulePermission($moduleModel->getId())) { + throw new AppException(vtranslate($moduleName) . ' ' . vtranslate('LBL_NOT_ACCESSIBLE')); + } + } + + function process(Vtiger_Request $request) + { + $mode = $request->getMode(); + + if ($mode) { + $this->invokeExposedMethod($mode, $request); + } + } + + public function checkLimits(Vtiger_Request $request) + { + $moduleName = $request->getModule(); + $record = $request->get('record'); + $currency = $request->get('currency'); + $price = $request->get('price'); + $limitConfig = $request->get('limitConfig'); + $limitFieldName = 'xxx'; + $balanceFieldName = 'limit'; + + $moduleInstance = Vtiger_Module_Model::getInstance('Accounts'); + $limitField = Vtiger_Field_Model::getInstance($limitFieldName, $moduleInstance); + $balanceField = Vtiger_Field_Model::getInstance($limitFieldName, $moduleInstance); + if (!$limitField->isActiveField() || !$balanceField->isActiveField()) { + $response = new Vtiger_Response(); + $response->setResult(['status' => true]); + $response->emit(); + return; + } + $recordModel = Vtiger_Record_Model::getInstanceById($record, 'Accounts'); + $limitID = $recordModel->get($limitFieldName); + $balance = $recordModel->get($balanceFieldName); + $limit = reset(Vtiger_SuppliesLimit_UIType::getValues($limitID))['value']; + + $baseCurrency = Vtiger_Util_Helper::getBaseCurrency(); + $symbol = $baseCurrency['currency_symbol']; + if ($baseCurrency['id'] != $currency) { + $selectedCurrency = Vtiger_Functions::getCurrencySymbolandRate($currency); + $price = floatval($price) * $selectedCurrency['rate']; + $symbol = $selectedCurrency['symbol']; + } + $totalPrice = $price + $balance; + + $status = $totalPrice > $limit ? false : true; + if (!$status) { + $viewer = new Vtiger_Viewer(); + $viewer->assign('PRICE', $price); + $viewer->assign('BALANCE', $balance); + $viewer->assign('SYMBOL', $symbol); + $viewer->assign('LIMIT', $limit); + $viewer->assign('TOTALS', $totalPrice); + $viewer->assign('LIMIT_CONFIG', $limitConfig); + $html = $viewer->view('InventoryLimitAlert.tpl', $moduleName, true); + } + $response = new Vtiger_Response(); + $response->setResult([ + 'status' => $status, + 'html' => $html + ]); + $response->emit(); + } + + public function getUnitPrice(Vtiger_Request $request) + { + $record = $request->get('record'); + $recordModule = $request->get('recordModule'); + $moduleName = $request->getModule(); + $unitPriceValues = false; + + if (in_array($recordModule, ['Products', 'Services'])) { + $recordModel = Vtiger_Record_Model::getInstanceById($record, $recordModule); + $unitPriceValues = $recordModel->getListPriceValues($record); + } + $response = new Vtiger_Response(); + $response->setResult($unitPriceValues); + $response->emit(); + } + + public function getDetails(Vtiger_Request $request) + { + $recordId = $request->get('record'); + $idList = $request->get('idlist'); + $currencyId = $request->get('currency_id'); + $moduleName = $request->getModule(); + + if (empty($idList)) { + $info = $this->getRecordDetail($recordId, $currencyId, $moduleName); + } else { + foreach ($idList as $id) { + $info[] = $this->getRecordDetail($id, $currencyId, $moduleName); + } + } + $response = new Vtiger_Response(); + $response->setResult($info); + $response->emit(); + } + + public function getRecordDetail($recordId, $currencyId, $moduleName) + { + $conversionRate = 1; + $unitPriceValues = $taxes = []; + $unitPrice = false; + + $recordModel = Vtiger_Record_Model::getInstanceById($recordId); + $recordModuleName = $recordModel->getModuleName(); + if (in_array($recordModuleName, ['Products', 'Services'])) { + $unitPriceValues = $recordModel->getListPriceValues($recordModel->getId()); + $priceDetails = $recordModel->getPriceDetails(); + foreach ($priceDetails as $currencyDetails) { + if ($currencyId == $currencyDetails['curid']) { + $conversionRate = $currencyDetails['conversionrate']; + } + } + $unitPrice = (float) $recordModel->get('unit_price') * (float) $conversionRate; + } + $inventoryField = Vtiger_InventoryField_Model::getInstance($moduleName); + $autoCompleteField = $inventoryField->getAutoCompleteField($recordModuleName); + $autoFields = []; + if ($autoCompleteField) { + foreach ($autoCompleteField as $field) { + if ($recordModel->has($field['field']) && $recordModel->get($field['field']) != '') { + $autoFields[$field['tofield']] = $recordModel->get($field['field']); + } + } + } + $info = [ + $recordId => [ + 'id' => $recordId, + 'name' => decode_html($recordModel->getName()), + 'price' => CurrencyField::convertToUserFormat($unitPrice, null, true), + 'unitPriceValues' => $unitPriceValues, + 'description' => decode_html($recordModel->get('description')), + 'autoFields' => $autoFields, + ]]; + return $info; + } +} diff --git a/modules/Vtiger/models/Field.php b/modules/Vtiger/models/Field.php index 9fc333c2a123..2157f8f88c05 100644 --- a/modules/Vtiger/models/Field.php +++ b/modules/Vtiger/models/Field.php @@ -190,7 +190,7 @@ public function getFieldDataType() } else if ($uiType == '303') { $fieldDataType = 'taxs'; } else if ($uiType == '304') { - $fieldDataType = 'suppliesLimit'; + $fieldDataType = 'inventoryLimit'; } else { $webserviceField = $this->getWebserviceFieldObject(); $fieldDataType = $webserviceField->getFieldDataType(); @@ -603,7 +603,7 @@ public function getFieldInfo() } } - if ($fieldDataType == 'suppliesLimit') { + if ($fieldDataType == 'inventoryLimit') { $limits = $this->getUITypeModel()->getLimits(); if (!empty($limits)) { $this->fieldInfo['picklistvalues'] = $limits; diff --git a/modules/Vtiger/models/Inventory.php b/modules/Vtiger/models/Inventory.php new file mode 100644 index 000000000000..d092237e42d9 --- /dev/null +++ b/modules/Vtiger/models/Inventory.php @@ -0,0 +1,128 @@ + + */ +class Vtiger_Inventory_Model +{ + + public static function getInstance($moduleName) + { + $instance = Vtiger_Cache::get('Inventory', $moduleName); + if (!$instance) { + $modelClassName = Vtiger_Loader::getComponentClassName('Model', 'Inventory', $moduleName); + $instance = new $modelClassName(); + Vtiger_Cache::set('Inventory', $moduleName, $instance); + } + return $instance; + } + + protected static $discountsConfig = false; + + public static function getDiscountsConfig() + { + if (self::$discountsConfig != false) { + return self::$discountsConfig; + } + + $db = PearDatabase::getInstance(); + $config = []; + $result = $db->query('SELECT * FROM a_yf_discounts_config'); + while ($row = $db->fetch_array($result)) { + $value = $row['value']; + if (in_array($row['param'], ['discounts'])) { + $value = explode(',', $value); + } + $config[$row['param']] = $value; + } + self::$discountsConfig = $config; + return $config; + } + + public function getGlobalDiscounts() + { + $db = PearDatabase::getInstance(); + $config = []; + $result = $db->pquery('SELECT * FROM a_yf_discounts_global WHERE status = ?', [1]); + while ($row = $db->fetch_array($result)) { + $config[$row['name']] = $row['value']; + } + return $config; + } + + protected static $taxsConfig = false; + + public static function getTaxsConfig() + { + if (self::$taxsConfig != false) { + return self::$taxsConfig; + } + + $db = PearDatabase::getInstance(); + $config = []; + $result = $db->query('SELECT * FROM a_yf_taxs_config'); + while ($row = $db->fetch_array($result)) { + $value = $row['value']; + if (in_array($row['param'], ['taxs'])) { + $value = explode(',', $value); + } + $config[$row['param']] = $value; + } + self::$taxsConfig = $config; + return $config; + } + + public function getGlobalTaxs() + { + $db = PearDatabase::getInstance(); + $config = []; + $result = $db->pquery('SELECT * FROM a_yf_taxs_global WHERE status = ?', [1]); + while ($row = $db->fetch_array($result)) { + $config[$row['name']] = $row['value']; + } + return $config; + } + + public function getAccountDiscount($moduleName, $record) + { + $inventoryField = Vtiger_InventoryField_Model::getInstance($moduleName); + $accountField = $inventoryField->getReferenceField(); + $discount = 0; + $discountField = 'discount'; + $name = ''; + if ($accountField) { + $recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName); + $relationFieldValue = $recordModel->get($accountField); + if ($relationFieldValue != 0) { + $accountRecordModel = Vtiger_Record_Model::getInstanceById($relationFieldValue); + $discount = $accountRecordModel->get($discountField); + $name = $accountRecordModel->getName(); + } + } + + return ['discount' => $discount, 'name' => $name]; + } + + public function getAccountTax($moduleName, $record) + { + $inventoryField = Vtiger_InventoryField_Model::getInstance($moduleName); + $accountField = $inventoryField->getReferenceField(); + $accountTaxs = []; + $name = ''; + $taxField = Vtiger_InventoryField_Model::getTaxField('Accounts'); + if ($accountField != '' && $taxField != false) { + $recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName); + $relationFieldValue = $recordModel->get($accountField); + if ($relationFieldValue != 0) { + $accountRecordModel = Vtiger_Record_Model::getInstanceById($relationFieldValue, 'Accounts'); + $accountTaxs = Vtiger_Taxs_UIType::getValues($accountRecordModel->get($taxField)); + $name = $accountRecordModel->getName(); + } + } + + return ['taxs' => $accountTaxs, 'name' => $name]; + } +} diff --git a/modules/Vtiger/models/InventoryField.php b/modules/Vtiger/models/InventoryField.php index ea43dde2eadb..cdb710690bbe 100644 --- a/modules/Vtiger/models/InventoryField.php +++ b/modules/Vtiger/models/InventoryField.php @@ -9,13 +9,9 @@ class Vtiger_InventoryField_Model extends Vtiger_Base_Model { - const DATA_PREFIX = '_sups'; - const FIELDS_PREFIX = '_supfield'; - const AUTOFIELD_PREFIX = '_supmap'; - protected static $fields = false; protected static $columns = false; - + protected $jsonFields = ['discountparam', 'taxparam']; /** * Create the name of the Supplies data table * @param string $module Module name @@ -26,13 +22,13 @@ public function getTableName($type = 'data') { switch ($type) { case 'data': - $prefix = self::DATA_PREFIX; + $prefix = '_sups'; break; case 'fields': - $prefix = self::FIELDS_PREFIX; + $prefix = '_supfield'; break; case 'autofield': - $prefix = self::AUTOFIELD_PREFIX; + $prefix = '_supmap'; break; } $moduleName = strtolower($this->get('module')); @@ -68,7 +64,7 @@ public function getFields($returnInBlock = false) $fields[$row['columnname']] = $this->getInventoryFieldInstance($row); } $this->fields = $fields; - }else{ + } else { $fields = $this->fields; } if ($returnInBlock) { @@ -85,7 +81,7 @@ public function getFields($returnInBlock = false) public function isActiveField($row) { if (in_array($row['suptype'], ['Discount', 'DiscountMode'])) { - $discountsConfig = Products_Record_Model::getDiscountsConfig(); + $discountsConfig = Vtiger_Inventory_Model::getDiscountsConfig(); if ($discountsConfig['active'] == '0') { return false; } @@ -202,15 +198,15 @@ public static function getInstance($moduleName) return $instance; } - public static function getAutoCompleteField($recordModuleName, $moduleName) + public function getAutoCompleteField($moduleName) { $db = PearDatabase::getInstance(); - $table = self::getTableName($moduleName, 'autofield'); + $table = $this->getTableName('autofield'); $result = $db->query("SHOW TABLES LIKE '$table'"); if ($result->rowCount() == 0) { return false; } - $result = $db->pquery('SELECT * FROM ' . $table . ' WHERE module = ?', [$recordModuleName]); + $result = $db->pquery('SELECT * FROM ' . $table . ' WHERE module = ?', [$moduleName]); $fields = []; while ($row = $db->fetch_array($result)) { $fields[] = $row; @@ -236,4 +232,81 @@ public static function getTaxParam($taxParam, $net, $return = false) } return $return; } + + public function getReferenceField($mainModule = 'Accounts') + { + $relationField = $this->get('relationField' . $mainModule); + if (!$relationField) { + $moduleModel = Vtiger_Module_Model::getInstance($this->get('module')); + $modelFields = $moduleModel->getFields(); + $relationField = false; + foreach ($modelFields as $fieldName => $fieldModel) { + if ($fieldModel->getFieldDataType() == Vtiger_Field_Model::REFERENCE_TYPE) { + $referenceList = $fieldModel->getReferenceList(); + if (in_array($mainModule, $referenceList)) { + $relationField = $fieldName; + break; + } + } + } + } + return $relationField; + } + + public function isWysiwygType($moduleName) + { + if (!$moduleName) { + return false; + } + $cache = Vtiger_Cache::get('InventoryIsWysiwygType', $moduleName); + if ($cache) { + return $cache; + } + $return = 0; + $moduleModel = Vtiger_Module_Model::getInstance($moduleName); + $fieldModel = Vtiger_Field_Model::getInstance('description', $moduleModel); + if ($fieldModel && $fieldModel->get('uitype') == '300') { + $return = 1; + } + Vtiger_Cache::set('InventoryIsWysiwygType', $moduleName, $return); + return $return; + } + + public function getTaxField($moduleName) + { + $cache = Vtiger_Cache::get('InventoryIsGetTaxField', $moduleName); + if ($cache) { + return $cache; + } + $return = false; + if ($moduleName == '') { + return $return; + } + $moduleModel = Vtiger_Module_Model::getInstance($moduleName); + foreach ($moduleModel->getFields() as $fieldName => $fieldModel) { + if ($fieldModel->get('uitype') == 303) { + $return = $fieldName; + continue; + } + } + + Vtiger_Cache::set('InventoryIsGetTaxField', $moduleName, $return); + return $return; + } + + public function getValueForSave(Vtiger_Request $request, $field, $i) + { + $value = ''; + if (in_array($field, $this->jsonFields) && $request->get($field . $i) != '') { + $value = json_encode($request->get($field . $i)); + } else if ($request->has($field . $i)) { + $value = $request->get($field . $i); + } else if ($request->has($field)) { + $value = $request->get($field); + } + if (in_array($field, ['price','gross','net','discount','purchase','margin','marginp','tax','total'])) { + $value = CurrencyField::convertToDBFormat($value, null, true); + } + return $value; + } } diff --git a/modules/Vtiger/models/Record.php b/modules/Vtiger/models/Record.php index 35ea68e0f21a..9c8cc3efeb00 100644 --- a/modules/Vtiger/models/Record.php +++ b/modules/Vtiger/models/Record.php @@ -258,6 +258,9 @@ public function getDisplayableValues() public function save() { $this->getModule()->saveRecord($this); + if($this->getModule()->getModuleType() == 'Inventory'){ + $this->saveInventoryData(); + } } /** @@ -565,4 +568,35 @@ public function getInventoryData() $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); return $fields; } + + /** + * Save the inventory data + * @param Vtiger_Request $request + */ + public function saveInventoryData() + { + $db = PearDatabase::getInstance(); + $log = vglobal('log'); + $log->debug('Entering ' . __CLASS__ . '::' . __METHOD__); + + $moduleName = $this->getModuleName(); + $inventory = Vtiger_InventoryField_Model::getInstance($moduleName); + $fields = $inventory->getColumns(); + $table = $inventory->getTableName('data'); + $request = new Vtiger_Request($_REQUEST, $_REQUEST); + $numRow = $request->get('inventoryItemsNo'); + + $db->pquery("delete from $table where id = ?", [$this->getId()]); + for ($i = 1; $i <= $numRow; $i++) { + if (!$request->has(reset($fields) . $i)) { + continue; + } + $insertData = ['id' => $this->getId(), 'seq' => $request->get('seq' . $i)]; + foreach ($fields as $field) { + $insertData[$field] = $inventory->getValueForSave($request, $field, $i); + } + $db->insert($table, $insertData); + } + $log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__); + } } diff --git a/modules/Vtiger/uitypes/SuppliesLimit.php b/modules/Vtiger/uitypes/InventoryLimit.php similarity index 100% rename from modules/Vtiger/uitypes/SuppliesLimit.php rename to modules/Vtiger/uitypes/InventoryLimit.php diff --git a/modules/Vtiger/views/Edit.php b/modules/Vtiger/views/Edit.php index bebcbe6be135..5252f2006c88 100644 --- a/modules/Vtiger/views/Edit.php +++ b/modules/Vtiger/views/Edit.php @@ -1,5 +1,5 @@ getModule(); $record = $request->get('record'); $recordPermission = Users_Privileges_Model::isPermitted($moduleName, 'EditView', $record); $recordPermissionToEditView = Users_Privileges_Model::CheckPermissionsToEditView($moduleName, $record); - if(!$recordPermission || (!$recordPermissionToEditView && $request->get('isDuplicate') != 'true')) { + if (!$recordPermission || (!$recordPermissionToEditView && $request->get('isDuplicate') != 'true')) { throw new AppException(vtranslate('LBL_PERMISSION_DENIED')); } } - public function process(Vtiger_Request $request) { - $viewer = $this->getViewer ($request); + public function process(Vtiger_Request $request) + { + $viewer = $this->getViewer($request); $moduleName = $request->getModule(); $record = $request->get('record'); - if(!empty($record) && $request->get('isDuplicate') == true) { - $recordModel = $this->record?$this->record:Vtiger_Record_Model::getInstanceById($record, $moduleName); + if (!empty($record) && $request->get('isDuplicate') == true) { + $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName); $viewer->assign('MODE', ''); - $recordModel->set('id',''); + $recordModel->set('id', ''); //While Duplicating record, If the related record is deleted then we are removing related record info in record model $mandatoryFieldModels = $recordModel->getModule()->getMandatoryFieldModels(); foreach ($mandatoryFieldModels as $fieldModel) { @@ -43,60 +49,60 @@ public function process(Vtiger_Request $request) { $recordModel->set($fieldName, ''); } } - } - }else if(!empty($record)) { - $recordModel = $this->record?$this->record:Vtiger_Record_Model::getInstanceById($record, $moduleName); - $viewer->assign('RECORD_ID', $record); - $viewer->assign('MODE', 'edit'); - } else { - $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName); - $referenceId = $request->get('reference_id'); - if ($referenceId){ - $parentRecordModel = Vtiger_Record_Model::getInstanceById($referenceId); - $recordModel->setRecordFieldValues($parentRecordModel); - } - $viewer->assign('MODE', ''); - } - if(!$this->record){ - $this->record = $recordModel; - } - + } + } else if (!empty($record)) { + $recordModel = $this->record ? $this->record : Vtiger_Record_Model::getInstanceById($record, $moduleName); + $viewer->assign('RECORD_ID', $record); + $viewer->assign('MODE', 'edit'); + } else { + $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName); + $referenceId = $request->get('reference_id'); + if ($referenceId) { + $parentRecordModel = Vtiger_Record_Model::getInstanceById($referenceId); + $recordModel->setRecordFieldValues($parentRecordModel); + } + $viewer->assign('MODE', ''); + } + if (!$this->record) { + $this->record = $recordModel; + } + $moduleModel = $recordModel->getModule(); $fieldList = $moduleModel->getFields(); $requestFieldList = array_intersect_key($request->getAll(), $fieldList); - foreach($requestFieldList as $fieldName=>$fieldValue){ + foreach ($requestFieldList as $fieldName => $fieldValue) { $fieldModel = $fieldList[$fieldName]; $specialField = false; // We collate date and time part together in the EditView UI handling // so a bit of special treatment is required if we come from QuickCreate - if ($moduleName == 'Calendar' && empty($record) && $fieldName == 'time_start' && !empty($fieldValue)) { - $specialField = true; + if ($moduleName == 'Calendar' && empty($record) && $fieldName == 'time_start' && !empty($fieldValue)) { + $specialField = true; // Convert the incoming user-picked time to GMT time // which will get re-translated based on user-time zone on EditForm - $fieldValue = DateTimeField::convertToDBTimeZone($fieldValue)->format("H:i"); - + $fieldValue = DateTimeField::convertToDBTimeZone($fieldValue)->format("H:i"); } - - if ($moduleName == 'Calendar' && empty($record) && $fieldName == 'date_start' && !empty($fieldValue)) { - $startTime = Vtiger_Time_UIType::getTimeValueWithSeconds($requestFieldList['time_start']); - $startDateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($fieldValue." ".$startTime); - list($startDate, $startTime) = explode(' ', $startDateTime); - $fieldValue = Vtiger_Date_UIType::getDisplayDateValue($startDate); - } - if($fieldModel->isEditable() || $specialField) { + + if ($moduleName == 'Calendar' && empty($record) && $fieldName == 'date_start' && !empty($fieldValue)) { + $startTime = Vtiger_Time_UIType::getTimeValueWithSeconds($requestFieldList['time_start']); + $startDateTime = Vtiger_Datetime_UIType::getDBDateTimeValue($fieldValue . " " . $startTime); + list($startDate, $startTime) = explode(' ', $startDateTime); + $fieldValue = Vtiger_Date_UIType::getDisplayDateValue($startDate); + } + if ($fieldModel->isEditable() || $specialField) { $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue)); } } $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT); $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName); - - $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE',Zend_Json::encode($picklistDependencyDatasource)); + + $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource)); $mappingRelatedField = $moduleModel->getMappingRelatedField($moduleName); - $viewer->assign('MAPPING_RELATED_FIELD',Zend_Json::encode($mappingRelatedField)); + $viewer->assign('MAPPING_RELATED_FIELD', Zend_Json::encode($mappingRelatedField)); $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance); $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure()); $viewer->assign('MODULE', $moduleName); + $viewer->assign('MODULE_TYPE', $moduleModel->getModuleType()); $viewer->assign('RECORD', $recordModel); $viewer->assign('BLOCK_LIST', $moduleModel->getBlocks()); $viewer->assign('CURRENTDATE', date('Y-n-j')); @@ -107,13 +113,34 @@ public function process(Vtiger_Request $request) { //if it is relation edit $viewer->assign('IS_RELATION_OPERATION', $isRelationOperation); - if($isRelationOperation) { + if ($isRelationOperation) { $viewer->assign('SOURCE_MODULE', $request->get('sourceModule')); $viewer->assign('SOURCE_RECORD', $request->get('sourceRecord')); } - + $viewer->assign('MAX_UPLOAD_LIMIT_MB', Vtiger_Util_Helper::getMaxUploadSize()); $viewer->assign('MAX_UPLOAD_LIMIT', vglobal('upload_maxsize')); $viewer->view('EditView.tpl', $moduleName); } -} \ No newline at end of file + + /** + * Function to get the list of Script models to be included + * @param Vtiger_Request $request + * @return - List of Vtiger_JsScript_Model instances + */ + function getFooterScripts(Vtiger_Request $request) + { + $parentScript = parent::getFooterScripts($request); + + $moduleName = $request->getModule(); + if (Vtiger_Module_Model::getInstance($moduleName)->getModuleType() == 'Inventory') { + $fileNames = array( + 'modules.Vtiger.resources.Inventory', + 'modules.' . $moduleName . '.resources.Inventory', + ); + $scriptInstances = $this->checkAndConvertJsScripts($fileNames); + $parentScript = array_merge($parentScript, $scriptInstances); + } + return $parentScript; + } +} diff --git a/modules/Vtiger/views/Inventory.php b/modules/Vtiger/views/Inventory.php new file mode 100644 index 000000000000..fb56ed2b905a --- /dev/null +++ b/modules/Vtiger/views/Inventory.php @@ -0,0 +1,77 @@ + + */ +class Vtiger_Inventory_View extends Vtiger_IndexAjax_View +{ + + function __construct() + { + parent::__construct(); + $this->exposeMethod('showDiscounts'); + $this->exposeMethod('showTaxes'); + } + + function showDiscounts(Vtiger_Request $request) + { + $moduleName = $request->getModule(); + $discountType = $request->get('discountType'); + $currency = $request->get('currency'); + $sourceModule = $request->get('sourceModule'); + $sourceRecord = $request->get('sourceRecord'); + $isIndividual = $request->get('isIndividual'); + $totalPrice = $request->get('totalPrice'); + + $inventoryModel = Vtiger_Inventory_Model::getInstance($moduleName); + $config = $inventoryModel->getDiscountsConfig(); + $groupDiscount = $inventoryModel->getAccountDiscount($sourceModule, $sourceRecord); + + $viewer = $this->getViewer($request); + $viewer->assign('MODULE', $moduleName); + $viewer->assign('GLOBAL_DISCOUNTS', $inventoryModel->getGlobalDiscounts()); + $viewer->assign('CURRENCY_SYMBOL', Vtiger_Functions::getCurrencySymbolandRate($currency)['symbol']); + $viewer->assign('TOTAL_PRICE', $totalPrice); + $viewer->assign('CONFIG', $config); + $viewer->assign('DISCOUNT_TYPE', $discountType); + $viewer->assign('AGGREGATION_TYPE', $config['aggregation']); + $viewer->assign('AGGREGATION_INPUT_TYPE', $config['aggregation'] == 0 ? 'radio' : 'checkbox'); + $viewer->assign('GROUP_DISCOUNT', $groupDiscount['discount']); + $viewer->assign('ACCOUNT_NAME', $groupDiscount['name']); + echo $viewer->view('InventoryDiscounts.tpl', $moduleName, true); + } + + function showTaxes(Vtiger_Request $request) + { + $moduleName = $request->getModule(); + $record = $request->get('record'); + $recordModule = $request->get('recordModule'); + $currency = $request->get('currency'); + $sourceRecord = $request->get('sourceRecord'); + $taxType = $request->get('taxType'); + $totalPrice = $request->get('totalPrice'); + + $inventoryModel = Vtiger_Inventory_Model::getInstance($moduleName); + $accountTaxs = $inventoryModel->getAccountTax($moduleName, $sourceRecord); + + $config = $inventoryModel->getTaxsConfig(); + $viewer = $this->getViewer($request); + $viewer->assign('MODULE', $moduleName); + $viewer->assign('RECORD', $record); + $viewer->assign('RECORD_MODULE', $recordModule); + $viewer->assign('GLOBAL_TAXS', $inventoryModel->getGlobalTaxs()); + $viewer->assign('CURRENCY_SYMBOL', Vtiger_Functions::getCurrencySymbolandRate($currency)['symbol']); + $viewer->assign('TOTAL_PRICE', $totalPrice); + $viewer->assign('CONFIG', $config); + $viewer->assign('TAX_TYPE', $taxType); + $viewer->assign('TAX_FIELD', Vtiger_InventoryField_Model::getTaxField($recordModule)); + $viewer->assign('AGGREGATION_TYPE', $config['aggregation']); + $viewer->assign('AGGREGATION_INPUT_TYPE', $config['aggregation'] == 0 ? 'radio' : 'checkbox'); + $viewer->assign('GROUP_TAXS', $accountTaxs['taxs']); + $viewer->assign('ACCOUNT_NAME', $accountTaxs['name']); + echo $viewer->view('InventoryTaxes.tpl', $moduleName, true); + } +} From ce8a52eb7993dd76cbf2ab34addec46e63d3cb88 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Mon, 31 Aug 2015 14:57:04 +0200 Subject: [PATCH 037/489] Added types of modules --- install/install_schema/scheme.sql | 2 +- layouts/vlayout/modules/Vtiger/DetailViewFullContents.tpl | 2 +- layouts/vlayout/modules/Vtiger/EditView.tpl | 2 +- modules/Vtiger/models/Module.php | 7 ++++++- modules/Vtiger/models/Record.php | 2 +- modules/Vtiger/views/Edit.php | 2 +- vtlib/Vtiger/ModuleBasic.php | 5 ++--- 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/install/install_schema/scheme.sql b/install/install_schema/scheme.sql index e17bfaefc1c3..a8247e1b21c6 100644 --- a/install/install_schema/scheme.sql +++ b/install/install_schema/scheme.sql @@ -6814,9 +6814,9 @@ CREATE TABLE `vtiger_tab` ( `isentitytype` int(11) NOT NULL DEFAULT '1', `version` varchar(10) DEFAULT NULL, `parent` varchar(30) DEFAULT NULL, - `trial` int(1) DEFAULT '0', `color` varchar(30) DEFAULT NULL, `coloractive` tinyint(1) DEFAULT '0', + `type` tinyint(1) DEFAULT '0', PRIMARY KEY (`tabid`), UNIQUE KEY `tab_name_idx` (`name`), KEY `tab_modifiedby_idx` (`modifiedby`), diff --git a/layouts/vlayout/modules/Vtiger/DetailViewFullContents.tpl b/layouts/vlayout/modules/Vtiger/DetailViewFullContents.tpl index 6b2a47ac1d00..57cd864eb536 100644 --- a/layouts/vlayout/modules/Vtiger/DetailViewFullContents.tpl +++ b/layouts/vlayout/modules/Vtiger/DetailViewFullContents.tpl @@ -11,7 +11,7 @@ -->*} {strip} {include file='DetailViewBlockView.tpl'|@vtemplate_path:$MODULE_NAME RECORD_STRUCTURE=$RECORD_STRUCTURE MODULE_NAME=$MODULE_NAME} - {if $MODULE_TYPE == 'Inventory'} + {if $MODULE_TYPE == '1'} {include file='DetailViewInventoryView.tpl'|@vtemplate_path:$MODULE_NAME MODULE_NAME=$MODULE_NAME} {/if} {/strip} diff --git a/layouts/vlayout/modules/Vtiger/EditView.tpl b/layouts/vlayout/modules/Vtiger/EditView.tpl index ee42d678f4b4..33d9d19e3a9b 100644 --- a/layouts/vlayout/modules/Vtiger/EditView.tpl +++ b/layouts/vlayout/modules/Vtiger/EditView.tpl @@ -10,7 +10,7 @@ ********************************************************************************/ -->*} {include file="EditViewBlocks.tpl"|@vtemplate_path:$MODULE} -{if $MODULE_TYPE == 'Inventory'} +{if $MODULE_TYPE == '1'} {include file='EditViewInventory.tpl'|@vtemplate_path:$MODULE} {/if} {include file="EditViewActions.tpl"|@vtemplate_path:$MODULE} diff --git a/modules/Vtiger/models/Module.php b/modules/Vtiger/models/Module.php index d576c059999d..feea7f627aae 100644 --- a/modules/Vtiger/models/Module.php +++ b/modules/Vtiger/models/Module.php @@ -66,7 +66,12 @@ public function isSummaryViewSupported() public function getModuleType() { - return $this->moduleType; + return $this->get('type'); + } + + public function isInventory() + { + return $this->getModuleType() == 1; } /** diff --git a/modules/Vtiger/models/Record.php b/modules/Vtiger/models/Record.php index 9c8cc3efeb00..e6a4690bd0ce 100644 --- a/modules/Vtiger/models/Record.php +++ b/modules/Vtiger/models/Record.php @@ -258,7 +258,7 @@ public function getDisplayableValues() public function save() { $this->getModule()->saveRecord($this); - if($this->getModule()->getModuleType() == 'Inventory'){ + if($this->getModule()->isInventory()){ $this->saveInventoryData(); } } diff --git a/modules/Vtiger/views/Edit.php b/modules/Vtiger/views/Edit.php index 5252f2006c88..c214034f629a 100644 --- a/modules/Vtiger/views/Edit.php +++ b/modules/Vtiger/views/Edit.php @@ -133,7 +133,7 @@ function getFooterScripts(Vtiger_Request $request) $parentScript = parent::getFooterScripts($request); $moduleName = $request->getModule(); - if (Vtiger_Module_Model::getInstance($moduleName)->getModuleType() == 'Inventory') { + if (Vtiger_Module_Model::getInstance($moduleName)->isInventory()) { $fileNames = array( 'modules.Vtiger.resources.Inventory', 'modules.' . $moduleName . '.resources.Inventory', diff --git a/vtlib/Vtiger/ModuleBasic.php b/vtlib/Vtiger/ModuleBasic.php index df611a0d453c..cdc5a7982be8 100644 --- a/vtlib/Vtiger/ModuleBasic.php +++ b/vtlib/Vtiger/ModuleBasic.php @@ -39,7 +39,6 @@ class Vtiger_ModuleBasic var $tabsequence = false; var $parent = false; var $customized = 0; - var $trial = 0; var $isentitytype = true; // Real module or an extension? var $entityidcolumn = false; var $entityidfield = false; @@ -47,7 +46,7 @@ class Vtiger_ModuleBasic var $basetableid = false; var $customtable = false; var $grouptable = false; - var $type = 'BaseModule'; + var $type = 0; const EVENT_MODULE_ENABLED = 'module.enabled'; const EVENT_MODULE_DISABLED = 'module.disabled'; @@ -80,7 +79,7 @@ function initialize($valuemap) $this->tabsequence = $valuemap['tabsequence']; $this->parent = $valuemap['parent']; $this->customized = $valuemap['customized']; - $this->trial = $valuemap['trial']; + $this->type = $valuemap['type']; $this->isentitytype = $valuemap['isentitytype']; From 4175b68fb8018bbf2ba1e358c8ff4f9f0c3e823b Mon Sep 17 00:00:00 2001 From: Paula W Date: Mon, 31 Aug 2015 15:20:28 +0200 Subject: [PATCH 038/489] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 06ea54bd9762..e5e4d3b647b7 100644 --- a/README.md +++ b/README.md @@ -15,4 +15,4 @@ Follow us on [Twitter](https://twitter.com/YetiForceEN) to get real-time info ab YetiForce CRM was orginally forked from Vtiger CRM and has mechanisms that allow to easily migrate from Vtiger to YetiForce. -The lists of changes for previous versions of YetiForce CRM are available at [our website] (https://yetiforce.com/pl/dokumentacja-programisty/zmiany.html). +The lists of changes for previous versions of YetiForce CRM are available at [our website] (https://yetiforce.com/en/developer-documentation/changes.html). From 719fb992fdaa6f3012636336626b26e8dc4d0c9d Mon Sep 17 00:00:00 2001 From: MaciejStencel Date: Mon, 31 Aug 2015 20:12:14 +0200 Subject: [PATCH 039/489] Optimisation of Currency Update code. --- install/install_schema/scheme.sql | 4 +- languages/de_de/Settings/CurrencyUpdate.php | 2 +- languages/en_us/Settings/CurrencyUpdate.php | 2 +- languages/nl_nl/Settings/CurrencyUpdate.php | 2 +- languages/pt_br/Settings/CurrencyUpdate.php | 2 +- languages/ru_ru/Settings/CurrencyUpdate.php | 2 +- .../modules/Settings/CurrencyUpdate/Index.tpl | 5 +- .../CurrencyUpdate/resources/Index.js | 56 ++++--- .../CurrencyUpdate/resources/Index.min.js | 2 +- .../actions/GetBankCurrencies.php | 16 +- .../cron/CurrencyUpdateCron.php | 4 +- .../CurrencyUpdate/models/AbstractBank.php | 2 +- .../Settings/CurrencyUpdate/models/Module.php | 144 +++++------------- .../models/{BankModels => bankmodels}/ECB.php | 13 +- .../models/{BankModels => bankmodels}/NBP.php | 17 ++- .../Settings/CurrencyUpdate/views/Index.php | 17 ++- vtlib/Vtiger/Functions.php | 29 ++++ 17 files changed, 140 insertions(+), 179 deletions(-) rename modules/Settings/CurrencyUpdate/models/{BankModels => bankmodels}/ECB.php (91%) rename modules/Settings/CurrencyUpdate/models/{BankModels => bankmodels}/NBP.php (93%) diff --git a/install/install_schema/scheme.sql b/install/install_schema/scheme.sql index 8c276da1f4a8..779ede99eafb 100644 --- a/install/install_schema/scheme.sql +++ b/install/install_schema/scheme.sql @@ -7734,6 +7734,7 @@ CREATE TABLE `yetiforce_currencyupdate` ( `exchange` decimal(10,4) NOT NULL, `bank_id` int(19) NOT NULL, PRIMARY KEY (`id`), + UNIQUE KEY `fetchdate_currencyid_unique` (`currency_id`,`fetch_date`,`bank_id`), KEY `fk_1_vtiger_osscurrencies` (`currency_id`), CONSTRAINT `fk_1_vtiger_osscurrencies` FOREIGN KEY (`currency_id`) REFERENCES `vtiger_currency_info` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -7744,7 +7745,8 @@ CREATE TABLE `yetiforce_currencyupdate_banks` ( `id` int(19) NOT NULL AUTO_INCREMENT, `bank_name` varchar(255) NOT NULL, `active` int(1) NOT NULL, - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + UNIQUE KEY `unique_bankname` (`bank_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Table structure for table `yetiforce_mail_config` */ diff --git a/languages/de_de/Settings/CurrencyUpdate.php b/languages/de_de/Settings/CurrencyUpdate.php index c2e954730f13..f09e30258602 100644 --- a/languages/de_de/Settings/CurrencyUpdate.php +++ b/languages/de_de/Settings/CurrencyUpdate.php @@ -19,7 +19,7 @@ 'LBL_ACTUAL_DATE_OF_COURSE' => 'Date of course', 'LBL_SHOW' => 'Show', 'LBL_CURRENCIES_SUPPORTED' => 'List of supported currencies by this bank', - 'LBL_CURRENCIES_UNSUPPORTED' => 'List of unsupported currencies by this bank.', + 'LBL_CURRENCIES_UNSUPPORTED' => 'List of unsupported currencies by this bank', 'LBL_SET_BANK_OK' => 'Successfully saved active bank.', 'LBL_SET_BANK_ERROR' => 'Failed to set active bank.', 'LBL_INFORMATIONS' => 'Informations', diff --git a/languages/en_us/Settings/CurrencyUpdate.php b/languages/en_us/Settings/CurrencyUpdate.php index c2e954730f13..f09e30258602 100644 --- a/languages/en_us/Settings/CurrencyUpdate.php +++ b/languages/en_us/Settings/CurrencyUpdate.php @@ -19,7 +19,7 @@ 'LBL_ACTUAL_DATE_OF_COURSE' => 'Date of course', 'LBL_SHOW' => 'Show', 'LBL_CURRENCIES_SUPPORTED' => 'List of supported currencies by this bank', - 'LBL_CURRENCIES_UNSUPPORTED' => 'List of unsupported currencies by this bank.', + 'LBL_CURRENCIES_UNSUPPORTED' => 'List of unsupported currencies by this bank', 'LBL_SET_BANK_OK' => 'Successfully saved active bank.', 'LBL_SET_BANK_ERROR' => 'Failed to set active bank.', 'LBL_INFORMATIONS' => 'Informations', diff --git a/languages/nl_nl/Settings/CurrencyUpdate.php b/languages/nl_nl/Settings/CurrencyUpdate.php index c2e954730f13..f09e30258602 100644 --- a/languages/nl_nl/Settings/CurrencyUpdate.php +++ b/languages/nl_nl/Settings/CurrencyUpdate.php @@ -19,7 +19,7 @@ 'LBL_ACTUAL_DATE_OF_COURSE' => 'Date of course', 'LBL_SHOW' => 'Show', 'LBL_CURRENCIES_SUPPORTED' => 'List of supported currencies by this bank', - 'LBL_CURRENCIES_UNSUPPORTED' => 'List of unsupported currencies by this bank.', + 'LBL_CURRENCIES_UNSUPPORTED' => 'List of unsupported currencies by this bank', 'LBL_SET_BANK_OK' => 'Successfully saved active bank.', 'LBL_SET_BANK_ERROR' => 'Failed to set active bank.', 'LBL_INFORMATIONS' => 'Informations', diff --git a/languages/pt_br/Settings/CurrencyUpdate.php b/languages/pt_br/Settings/CurrencyUpdate.php index c2e954730f13..f09e30258602 100644 --- a/languages/pt_br/Settings/CurrencyUpdate.php +++ b/languages/pt_br/Settings/CurrencyUpdate.php @@ -19,7 +19,7 @@ 'LBL_ACTUAL_DATE_OF_COURSE' => 'Date of course', 'LBL_SHOW' => 'Show', 'LBL_CURRENCIES_SUPPORTED' => 'List of supported currencies by this bank', - 'LBL_CURRENCIES_UNSUPPORTED' => 'List of unsupported currencies by this bank.', + 'LBL_CURRENCIES_UNSUPPORTED' => 'List of unsupported currencies by this bank', 'LBL_SET_BANK_OK' => 'Successfully saved active bank.', 'LBL_SET_BANK_ERROR' => 'Failed to set active bank.', 'LBL_INFORMATIONS' => 'Informations', diff --git a/languages/ru_ru/Settings/CurrencyUpdate.php b/languages/ru_ru/Settings/CurrencyUpdate.php index c2e954730f13..f09e30258602 100644 --- a/languages/ru_ru/Settings/CurrencyUpdate.php +++ b/languages/ru_ru/Settings/CurrencyUpdate.php @@ -19,7 +19,7 @@ 'LBL_ACTUAL_DATE_OF_COURSE' => 'Date of course', 'LBL_SHOW' => 'Show', 'LBL_CURRENCIES_SUPPORTED' => 'List of supported currencies by this bank', - 'LBL_CURRENCIES_UNSUPPORTED' => 'List of unsupported currencies by this bank.', + 'LBL_CURRENCIES_UNSUPPORTED' => 'List of unsupported currencies by this bank', 'LBL_SET_BANK_OK' => 'Successfully saved active bank.', 'LBL_SET_BANK_ERROR' => 'Failed to set active bank.', 'LBL_INFORMATIONS' => 'Informations', diff --git a/layouts/vlayout/modules/Settings/CurrencyUpdate/Index.tpl b/layouts/vlayout/modules/Settings/CurrencyUpdate/Index.tpl index 8009b36f637d..a8d3b0a1a130 100644 --- a/layouts/vlayout/modules/Settings/CurrencyUpdate/Index.tpl +++ b/layouts/vlayout/modules/Settings/CurrencyUpdate/Index.tpl @@ -1,5 +1,5 @@ {**} - +{strip}

    {vtranslate('LBL_CURRENCY_UPDATE', $QUALIFIED_MODULE)}

    {vtranslate('LBL_CURRENCY_UPDATE_DESCRIPTION', $QUALIFIED_MODULE)}
    @@ -108,7 +108,7 @@ {if $USER_MODEL->get('currency_symbol_placement') eq '$1.0'} {$MAINCURR['currency_symbol']} {/if} - {number_format($key.exchange, 4, $USER_MODEL->get('currency_decimal_separator'), $USER_MODEL->get('currency_grouping_separator'))} + {number_format($key.exchange, 4, $USER_MODEL->get('currency_decimal_separator'), $USER_MODEL->get('currency_grouping_separator'))} {if $USER_MODEL->get('currency_symbol_placement') eq '1.0$'} {$MAINCURR['currency_symbol']} {/if} @@ -120,3 +120,4 @@
    +{/strip} diff --git a/layouts/vlayout/modules/Settings/CurrencyUpdate/resources/Index.js b/layouts/vlayout/modules/Settings/CurrencyUpdate/resources/Index.js index d3b2b3b99e0b..a41a4d324ed1 100644 --- a/layouts/vlayout/modules/Settings/CurrencyUpdate/resources/Index.js +++ b/layouts/vlayout/modules/Settings/CurrencyUpdate/resources/Index.js @@ -4,17 +4,17 @@ jQuery.Class("Settings_CurrencyUpdate_Index_Js", {}, { /* * Shows or hides block informing about supported currencies by presently chosen bank */ - registerInfoButton: function () { - jQuery('#supportedCurrencies').on('click', function () { + registerInfoButton: function (container) { + container.find('#supportedCurrencies').on('click', function () { jQuery('#infoBlock').toggleClass('hide'); }); }, /* * Shows or hides block informing about unsupported currencies by presently chosen bank */ - registerAlertButton: function () { - jQuery('#unsupportedCurrencies').on('click', function () { - jQuery('#alertBlock').toggleClass('hide'); + registerAlertButton: function (container) { + container.find('#unsupportedCurrencies').on('click', function () { + container.find('#alertBlock').toggleClass('hide'); }); }, /* @@ -22,11 +22,11 @@ jQuery.Class("Settings_CurrencyUpdate_Index_Js", {}, { * Daves the chosen bank as active in database. * Updates information about supported and unsupported currencies for currently chosen bank, */ - registerBankChange: function () { - jQuery('#bank').on('change', function () { - bankName = jQuery('#bank option:selected').data('name'); - jQuery('#alertSpan').html(''); - jQuery('#infoSpan').html(''); + registerBankChange: function (container) { + container.find('#bank').on('change', function () { + bankName = container.find('#bank option:selected').data('name'); + container.find('#alertSpan').html(''); + container.find('#infoSpan').html(''); var infoProgress = jQuery.progressIndicator({ position: 'html', blockInfo: { @@ -45,7 +45,11 @@ jQuery.Class("Settings_CurrencyUpdate_Index_Js", {}, { AppConnector.request(params).then( function (data) { var response = data['result']; - jQuery('#infoSpan').html(response); + var html = ''; + for (var name in response) { + html += '

    '+name+' - '+response[name]+'

    '; + } + container.find('#infoSpan').html(html); }, function (data, err) { @@ -63,20 +67,21 @@ jQuery.Class("Settings_CurrencyUpdate_Index_Js", {}, { AppConnector.request(params).then( function (data) { var response = data['result']; - console.log(response); - if (response === '') { - console.log('puste'); - if (!jQuery('#unsupportedCurrencies').hasClass('hide')) { - jQuery('#unsupportedCurrencies').addClass('hide'); + if (jQuery.isEmptyObject(response)) { + if (!container.find('#unsupportedCurrencies').hasClass('hide')) { + container.find('#unsupportedCurrencies').addClass('hide'); } - if (!jQuery('#alertBlock').hasClass('hide')) { - jQuery('#alertBlock').addClass('hide') + if (!container.find('#alertBlock').hasClass('hide')) { + container.find('#alertBlock').addClass('hide') } } else { - console.log(' nie puste'); - jQuery('#unsupportedCurrencies').removeClass('hide'); + container.find('#unsupportedCurrencies').removeClass('hide'); + } + var html = ''; + for (var name in response) { + html += '

    '+name+' - '+response[name]+'

    '; } - jQuery('#alertSpan').html(response); + container.find('#alertSpan').html(html); }, function (data, err) { @@ -117,15 +122,16 @@ jQuery.Class("Settings_CurrencyUpdate_Index_Js", {}, { } ); - }) + }); }, /** * Register events */ registerEvents: function () { + var container = jQuery('#currencyUpdateContainer'); app.registerEventForDatePickerFields('#datepicker', false, {}); - this.registerInfoButton(); - this.registerAlertButton(); - this.registerBankChange(); + this.registerInfoButton(container); + this.registerAlertButton(container); + this.registerBankChange(container); } }); diff --git a/layouts/vlayout/modules/Settings/CurrencyUpdate/resources/Index.min.js b/layouts/vlayout/modules/Settings/CurrencyUpdate/resources/Index.min.js index 7095df10b77f..cb657da570fe 100644 --- a/layouts/vlayout/modules/Settings/CurrencyUpdate/resources/Index.min.js +++ b/layouts/vlayout/modules/Settings/CurrencyUpdate/resources/Index.min.js @@ -1,2 +1,2 @@ -jQuery.Class("Settings_CurrencyUpdate_Index_Js",{},{registerInfoButton:function(){jQuery("#supportedCurrencies").on("click",function(){jQuery("#infoBlock").toggleClass("hide")})},registerAlertButton:function(){jQuery("#unsupportedCurrencies").on("click",function(){jQuery("#alertBlock").toggleClass("hide")})},registerBankChange:function(){jQuery("#bank").on("change",function(){bankName=jQuery("#bank option:selected").data("name");jQuery("#alertSpan").html("");jQuery("#infoSpan").html("");var b=jQuery.progressIndicator({position:"html",blockInfo:{enabled:true}});var c={};c.data={parent:app.getParentModuleName(),module:app.getModuleName(),action:"GetBankCurrencies",mode:"supported",name:bankName};c.dataType="json";AppConnector.request(c).then(function(e){var d=e.result;jQuery("#infoSpan").html(d)},function(e,d){});c.data={parent:app.getParentModuleName(),module:app.getModuleName(),action:"GetBankCurrencies",mode:"unsupported",name:bankName};c.dataType="json";AppConnector.request(c).then(function(e){var d=e.result;console.log(d);if(d===""){console.log("puste");if(!jQuery("#unsupportedCurrencies").hasClass("hide")){jQuery("#unsupportedCurrencies").addClass("hide")}if(!jQuery("#alertBlock").hasClass("hide")){jQuery("#alertBlock").addClass("hide")}}else{console.log(" nie puste");jQuery("#unsupportedCurrencies").removeClass("hide")}jQuery("#alertSpan").html(d)},function(e,d){});var a=jQuery("#bank option:selected").val();c.data={parent:app.getParentModuleName(),module:app.getModuleName(),action:"SaveActiveBank",id:a};c.dataType="json";AppConnector.request(c).then(function(e){var d=e.result;if(d.success){var f={text:d.message,animation:"show",type:"success"};Vtiger_Helper_Js.showPnotify(f)}else{var f={text:d.message,animation:"show",hide:false,type:"error"};Vtiger_Helper_Js.showPnotify(f)}b.progressIndicator({mode:"hide"})},function(e,d){})})},registerEvents:function(){app.registerEventForDatePickerFields("#datepicker",false,{});this.registerInfoButton();this.registerAlertButton();this.registerBankChange()}}); \ No newline at end of file +jQuery.Class("Settings_CurrencyUpdate_Index_Js",{},{registerInfoButton:function(a){a.find("#supportedCurrencies").on("click",function(){jQuery("#infoBlock").toggleClass("hide")})},registerAlertButton:function(a){a.find("#unsupportedCurrencies").on("click",function(){a.find("#alertBlock").toggleClass("hide")})},registerBankChange:function(a){a.find("#bank").on("change",function(){bankName=a.find("#bank option:selected").data("name");a.find("#alertSpan").html("");a.find("#infoSpan").html("");var c=jQuery.progressIndicator({position:"html",blockInfo:{enabled:true}});var d={};d.data={parent:app.getParentModuleName(),module:app.getModuleName(),action:"GetBankCurrencies",mode:"supported",name:bankName};d.dataType="json";AppConnector.request(d).then(function(h){var e=h.result;var g="";for(var f in e){g+="

    "+f+" - "+e[f]+"

    "}a.find("#infoSpan").html(g)},function(f,e){});d.data={parent:app.getParentModuleName(),module:app.getModuleName(),action:"GetBankCurrencies",mode:"unsupported",name:bankName};d.dataType="json";AppConnector.request(d).then(function(h){var e=h.result;if(jQuery.isEmptyObject(e)){if(!a.find("#unsupportedCurrencies").hasClass("hide")){a.find("#unsupportedCurrencies").addClass("hide")}if(!a.find("#alertBlock").hasClass("hide")){a.find("#alertBlock").addClass("hide")}}else{a.find("#unsupportedCurrencies").removeClass("hide")}var g="";for(var f in e){g+="

    "+f+" - "+e[f]+"

    "}a.find("#alertSpan").html(g)},function(f,e){});var b=jQuery("#bank option:selected").val();d.data={parent:app.getParentModuleName(),module:app.getModuleName(),action:"SaveActiveBank",id:b};d.dataType="json";AppConnector.request(d).then(function(f){var e=f.result;if(e.success){var g={text:e.message,animation:"show",type:"success"};Vtiger_Helper_Js.showPnotify(g)}else{var g={text:e.message,animation:"show",hide:false,type:"error"};Vtiger_Helper_Js.showPnotify(g)}c.progressIndicator({mode:"hide"})},function(f,e){})})},registerEvents:function(){var a=jQuery("#currencyUpdateContainer");app.registerEventForDatePickerFields("#datepicker",false,{});this.registerInfoButton(a);this.registerAlertButton(a);this.registerBankChange(a)}}); \ No newline at end of file diff --git a/modules/Settings/CurrencyUpdate/actions/GetBankCurrencies.php b/modules/Settings/CurrencyUpdate/actions/GetBankCurrencies.php index 63fe8ef755bc..948104110bd7 100644 --- a/modules/Settings/CurrencyUpdate/actions/GetBankCurrencies.php +++ b/modules/Settings/CurrencyUpdate/actions/GetBankCurrencies.php @@ -12,23 +12,19 @@ public function checkPermission(Vtiger_Request $request) public function process(Vtiger_Request $request) { $mode = $request->get('mode'); - $name = $request->get('name'); + $name = 'Settings_CurrencyUpdate_models_'.$request->get('name').'_BankModel'; $moduleModel = Settings_CurrencyUpdate_Module_Model::getCleanInstance(); $response = new Vtiger_Response(); - $html = ''; if ($mode == 'supported') { $supported = $moduleModel->getSupportedCurrencies($name); - foreach ($supported as $name => $code) { - $html .= '

    ' . vtranslate($name, 'Settings:Currency') . ' - ' . $code . '

    '; - } - } else { + $response->setResult($supported); + } + else { $unsupported = $moduleModel->getUnSupportedCurrencies($name); - foreach ($unsupported as $name => $code) { - $html .= '

    ' . vtranslate($name, 'Settings:Currency') . ' - ' . $code . '

    '; - } + $response->setResult($unsupported); } - $response->setResult($html); + $response->emit(); } } diff --git a/modules/Settings/CurrencyUpdate/cron/CurrencyUpdateCron.php b/modules/Settings/CurrencyUpdate/cron/CurrencyUpdateCron.php index c0c16ba87289..67201e2214ea 100644 --- a/modules/Settings/CurrencyUpdate/cron/CurrencyUpdateCron.php +++ b/modules/Settings/CurrencyUpdate/cron/CurrencyUpdateCron.php @@ -2,12 +2,12 @@ /* {[The file is published on the basis of YetiForce Public License that can be found in the following directory: licenses/License.html]} */ require_once('include/main/WebUI.php'); -$log = vglobal('log'); +$log = &LoggerManager::getLogger('CurrencyUpdate'); $log->debug('Start CRON:' . __FILE__); $moduleModel = Settings_CurrencyUpdate_Module_Model::getCleanInstance(); $yesterday = date('Y-m-d', strtotime('-1 day')); -$lastWorkingDay = $moduleModel->getLastWorkingDay($yesterday); +$lastWorkingDay = Vtiger_Functions::getLastWorkingDay($yesterday); $status = $moduleModel->fetchCurrencyRates($lastWorkingDay, true); diff --git a/modules/Settings/CurrencyUpdate/models/AbstractBank.php b/modules/Settings/CurrencyUpdate/models/AbstractBank.php index 665ca6c4fd05..348b7bd0d8d4 100644 --- a/modules/Settings/CurrencyUpdate/models/AbstractBank.php +++ b/modules/Settings/CurrencyUpdate/models/AbstractBank.php @@ -4,7 +4,7 @@ /** * Abstract class for connection to bank currency exchange rates */ -abstract class AbstractBank +abstract class Settings_CurrencyUpdate_AbstractBank_Model { /* * Returns bank name diff --git a/modules/Settings/CurrencyUpdate/models/Module.php b/modules/Settings/CurrencyUpdate/models/Module.php index f30f33c131c8..23efd1c49b4c 100644 --- a/modules/Settings/CurrencyUpdate/models/Module.php +++ b/modules/Settings/CurrencyUpdate/models/Module.php @@ -32,58 +32,7 @@ public static function getCRMCurrencyName($code) */ public function getCurrencyNum() { - $db = PearDatabase::getInstance(); - - $query = 'SELECT COUNT(*) as num FROM `vtiger_currency_info` WHERE `currency_status` = ? LIMIT 1;'; - $result = $db->pquery($query, ['Active']); - - $num = $db->query_result($result, 0, 'num'); - return $num; - } - - /* - * Returns informations about systems main currency - * @return - array containing currency info - */ - public function getMainCurrencyInfo() - { - $db = PearDatabase::getInstance(); - - $query = 'SELECT `id`, `currency_name`, `currency_code`, `currency_symbol`, `conversion_rate` FROM `vtiger_currency_info` WHERE `defaultid` = ? LIMIT 1;'; - $result = $db->pquery($query, ['-11']); - - $curr = $db->fetch_array($result); - return $curr; - } - - /* - * Returns systems main currency code - * @return - currency code - */ - public function getMainCurrencyCode() - { - $db = PearDatabase::getInstance(); - - $query = 'SELECT `currency_code` FROM `vtiger_currency_info` WHERE `defaultid` = ? LIMIT 1;'; - $result = $db->pquery($query, ['-11']); - - $curr_code = $db->query_result($result, 0, 'currency_code'); - return $curr_code; - } - - /* - * Returns systems main currency id - * @return - currency id - */ - public function getMainCurrencyId() - { - $db = PearDatabase::getInstance(); - - $query = 'SELECT `id` FROM `vtiger_currency_info` WHERE `defaultid` = ? LIMIT 1;'; - $result = $db->pquery($query, ['-11']); - - $id = $db->query_result($result, 0, 'id'); - return $id; + return count(Vtiger_Functions::getAllCurrency(true)); } /* @@ -103,12 +52,12 @@ function fetchCurrencyRates($dateCur, $cron = false) if ($numToConvert >= 1) { $selectBankId = $this->getActiveBankId(); - $activeBankName = $this->getActiveBankName(); + $activeBankName = 'Settings_CurrencyUpdate_models_'.$this->getActiveBankName().'_BankModel'; $currIds = []; $otherCurrencyCode = []; - for ($i = 0; $i < $numToConvert; $i++) { - $id = $db->query_result($vtigerCurrencyResult, $i, 'id'); - $code = $db->query_result($vtigerCurrencyResult, $i, 'currency_code'); + while($row = $db->fetchByAssoc($vtigerCurrencyResult)){ + $id = $row['id']; + $code = $row['currency_code']; $currIds[] = $id; $otherCurrencyCode[$code] = $id; } @@ -119,10 +68,9 @@ function fetchCurrencyRates($dateCur, $cron = false) $params[] = $selectBankId; $existResult = $db->pquery($existSql, $params); - $currNum = $db->query_result($existResult, 0, 'num'); + $currNum = $db->getSingleValue($existResult); // download only if its not in archives if ($currNum != $numToConvert) { - vimport('~modules/Settings/CurrencyUpdate/models/BankModels/' . $activeBankName . '.php'); $bank = new $activeBankName(); $bank->getRates($otherCurrencyCode, $dateCur, false); $notifyNewRates = true; @@ -141,18 +89,15 @@ public function refreshBanks() $query = 'SELECT `id`, `bank_name` FROM `yetiforce_currencyupdate_banks`;'; $result = $db->query($query); - $num = $db->num_rows($result); - if ($num > 0) { - for ($i = 0; $i < $num; $i++) { - $id = $db->query_result($result, $i, 'id'); - $bankName = $db->query_result($result, $i, 'bank_name'); + while($row = $db->fetchByAssoc($result)) { + $id = $row['id']; + $bankName = $row['bank_name']; - $bankPath = __DIR__ . '/BankModels/' . $bankName . '.php'; - if (!file_exists($bankPath)) { // delete bank from database - $query = 'DELETE FROM `yetiforce_currencyupdate_banks` WHERE `id` = ? LIMIT 1;'; - $db->pquery($query, [$id]); - } + $bankPath = __DIR__ . '/BankModels/' . $bankName . '.php'; + if (!file_exists($bankPath)) { // delete bank from database + $query = 'DELETE FROM `yetiforce_currencyupdate_banks` WHERE `id` = ? LIMIT 1;'; + $db->pquery($query, [$id]); } } @@ -166,7 +111,7 @@ public function refreshBanks() $query = 'SELECT COUNT(*) as num FROM `yetiforce_currencyupdate_banks` WHERE `bank_name` = ?;'; $result = $db->pquery($query, [$bankClassName]); - $bankExists = intval($db->query_result($result, 0, 'num')); + $bankExists = intval($db->getSingleValue($result)); if (!$bankExists) { $query = 'INSERT INTO `yetiforce_currencyupdate_banks` (`bank_name`, `active`) VALUES (?,?);'; @@ -182,25 +127,6 @@ public function refreshBanks() } } - /* - * Checks if given date is working day, if not returns last working day - * @param $date - * @return - last working y - */ - public function getLastWorkingDay($date) - { - $date = strtotime($date); - if (date('D', $date) == 'Sat') { // switch to friday the day before - $lastWorkingDay = date('Y-m-d', strtotime("-1 day", $date)); - } else if (date('D', $date) == 'Sun') { // switch to friday two days before - $lastWorkingDay = date('Y-m-d', strtotime("-2 day", $date)); - } else { - $lastWorkingDay = date('Y-m-d', $date); - } - - return $lastWorkingDay; - } - /* * Update currency rate in archives * @param $id - exchange rate id @@ -221,7 +147,7 @@ public function updateCurrencyRate($id, $exchange) * @param $exchange - exchange rate * @param $bankId - bank id */ - public function addcurrencyRate($currId, $exchangeDate, $exchange, $bankId) + public function addCurrencyRate($currId, $exchangeDate, $exchange, $bankId) { $db = PearDatabase::getInstance(); @@ -245,7 +171,7 @@ public function getCurrencyRateId($currencyId, $exchangeDate, $bankId) $params = [$exchangeDate, $currencyId, $bankId]; $result = $db->pquery($query, $params); - return intval($db->query_result($result, 0, 'id')); + return intval($db->getSingleValue($result)); } /* @@ -254,9 +180,8 @@ public function getCurrencyRateId($currencyId, $exchangeDate, $bankId) * @param $dateCur - date, if empty show this months history * @return - array containing currency rates */ - public function getRatesHistory($bankId, $dateCur) + public function getRatesHistory($bankId, $dateCur, $request) { - $request = new Vtiger_Request($_REQUEST); $db = PearDatabase::getInstance(); $query = 'SELECT `exchange`, @@ -294,13 +219,15 @@ public function getRatesHistory($bankId, $dateCur) $history = array(); - for ($i = 0; $i < $db->num_rows($result); $i++) { - $history[$i]['exchange'] = $db->query_result($result, $i, 'exchange'); - $history[$i]['currency_name'] = $db->query_result($result, $i, 'currency_name'); - $history[$i]['code'] = $db->query_result($result, $i, 'currency_code'); - $history[$i]['symbol'] = $db->query_result($result, $i, 'currency_symbol'); - $history[$i]['fetch_date'] = $db->query_result($result, $i, 'fetch_date'); - $history[$i]['exchange_date'] = $db->query_result($result, $i, 'exchange_date'); + $i = 0; + while($row = $db->fetchByAssoc($result)) { + $history[$i]['exchange'] = $row['exchange']; + $history[$i]['currency_name'] = $row['currency_name']; + $history[$i]['code'] = $row['currency_code']; + $history[$i]['symbol'] = $row['currency_symbol']; + $history[$i]['fetch_date'] = $row['fetch_date']; + $history[$i]['exchange_date'] = $row['exchange_date']; + $i++; } return $history; @@ -314,9 +241,8 @@ public function getRatesHistory($bankId, $dateCur) public function getSupportedCurrencies($bankName = null) { if (!$bankName) { - $bankName = $this->getActiveBankName(); + $bankName = 'Settings_CurrencyUpdate_models_'.$this->getActiveBankName().'_BankModel'; } - vimport('~modules/Settings/CurrencyUpdate/models/BankModels/' . $bankName . '.php'); $bank = new $bankName(); return $bank->getSupportedCurrencies(); @@ -330,9 +256,8 @@ public function getSupportedCurrencies($bankName = null) public function getUnSupportedCurrencies($bankName = null) { if (!$bankName) { - $bankName = $this->getActiveBankName(); + $bankName = 'Settings_CurrencyUpdate_models_'.$this->getActiveBankName().'_BankModel'; } - vimport('~modules/Settings/CurrencyUpdate/models/BankModels/' . $bankName . '.php'); $bank = new $bankName(); $supported = $bank->getSupportedCurrencies($bankName); @@ -340,12 +265,11 @@ public function getUnSupportedCurrencies($bankName = null) $query = 'SELECT `currency_name`, `currency_code` FROM vtiger_currency_info WHERE `currency_status` = "Active" AND `deleted` = 0;'; $result = $db->query($query); - $num = $db->num_rows($result); $unsupported = []; - for ($i = 0; $i < $num; $i++) { - $name = $db->query_result($result, $i, 'currency_name'); - $code = $db->query_result($result, $i, 'currency_code'); + while($row = $db->fetchByAssoc($result)) { + $name = $row['currency_name']; + $code = $row['currency_code']; $unsupported[$name] = $code; } @@ -378,7 +302,7 @@ public function setCRMConversionRate($currency, $exchange) public function getCRMConversionRate($from, $to, $date = '') { $db = PearDatabase::getInstance(); - $mainCurrencyCode = $this->getMainCurrencyCode(); + $mainCurrencyCode = Vtiger_Functions::getDefaultCurrencyInfo()['currency_code']; $activeBankId = $this->getActiveBankId(); $exchange = false; // get present conversion rate from crm @@ -483,7 +407,7 @@ public function getActiveBankId() $queryBank = 'SELECT `id` FROM `yetiforce_currencyupdate_banks` WHERE `active` = 1 LIMIT 1;'; $resultBank = $db->query($queryBank); - $bankInfo = $db->query_result($resultBank, 0, 'id'); + $bankInfo = $db->getSingleValue($resultBank); return $bankInfo; } @@ -520,6 +444,6 @@ public function getActiveBankName() $query = 'SELECT `bank_name` FROM `yetiforce_currencyupdate_banks` WHERE `active` = 1 LIMIT 1;'; $result = $db->query($query); - return $db->query_result($result, 0, 'bank_name'); + return $db->getSingleValue($result); } } diff --git a/modules/Settings/CurrencyUpdate/models/BankModels/ECB.php b/modules/Settings/CurrencyUpdate/models/bankmodels/ECB.php similarity index 91% rename from modules/Settings/CurrencyUpdate/models/BankModels/ECB.php rename to modules/Settings/CurrencyUpdate/models/bankmodels/ECB.php index a1fd7423c327..3d1225b6165b 100644 --- a/modules/Settings/CurrencyUpdate/models/BankModels/ECB.php +++ b/modules/Settings/CurrencyUpdate/models/bankmodels/ECB.php @@ -1,11 +1,10 @@ getMainCurrencyCode(); + $supportedCurrencies[Settings_CurrencyUpdate_Module_Model::getCRMCurrencyName($this->getMainCurrencyCode())] = $this->getMainCurrencyCode(); $source = $this->getSource(); $XML = simplexml_load_file($source[0]); @@ -64,10 +63,10 @@ public function getRates($otherCurrencyCode, $dateParam, $cron = false) $yesterday = date('Y-m-d', strtotime('-1 day')); // check if data is correct, currency rates can be retrieved only for working days - $lastWorkingDay = $moduleModel->getLastWorkingDay($yesterday); + $lastWorkingDay = Vtiger_Functions::getLastWorkingDay($yesterday); $today = date('Y-m-d'); - $mainCurrency = $moduleModel->getMainCurrencyCode(); + $mainCurrency = Vtiger_Functions::getDefaultCurrencyInfo()['currency_code']; // source, ECB has 2 sources for older rates // 0 - last 90 days @@ -134,7 +133,7 @@ public function getRates($otherCurrencyCode, $dateParam, $cron = false) if ($existingId > 0) { $moduleModel->updateCurrencyRate($existingId, $exchange); } else { - $moduleModel->addcurrencyRate($currId, $datePublicationOfFile, $exchange, $selectedBank); + $moduleModel->addCurrencyRate($currId, $datePublicationOfFile, $exchange, $selectedBank); } } } @@ -167,7 +166,7 @@ public function getRates($otherCurrencyCode, $dateParam, $cron = false) if ($existingId > 0) { $moduleModel->updateCurrencyRate($existingId, $exchange); } else { - $moduleModel->addcurrencyRate($mainCurrencyId, $datePublicationOfFile, $exchange, $selectedBank); + $moduleModel->addCurrencyRate($mainCurrencyId, $datePublicationOfFile, $exchange, $selectedBank); } } } diff --git a/modules/Settings/CurrencyUpdate/models/BankModels/NBP.php b/modules/Settings/CurrencyUpdate/models/bankmodels/NBP.php similarity index 93% rename from modules/Settings/CurrencyUpdate/models/BankModels/NBP.php rename to modules/Settings/CurrencyUpdate/models/bankmodels/NBP.php index d91be721f641..41b6c10dd255 100644 --- a/modules/Settings/CurrencyUpdate/models/BankModels/NBP.php +++ b/modules/Settings/CurrencyUpdate/models/bankmodels/NBP.php @@ -1,11 +1,10 @@ pozycja[$i]->kod_waluty->__toString(); + + if ($currencyCode == 'XDR') { + continue; + } + $currencyName = Settings_CurrencyUpdate_Module_Model::getCRMCurrencyName($currencyCode); $supportedCurrencies[$currencyName] = $currencyCode; } @@ -102,11 +106,10 @@ public function getRates($otherCurrencyCode, $dateParam, $cron = false) $yesterday = date('Y-m-d', strtotime('-1 day')); // check if data is correct, currency rates can be retrieved only for working days - $lastWorkingDay = $moduleModel->getLastWorkingDay($yesterday); + $lastWorkingDay = Vtiger_Functions::getLastWorkingDay($yesterday); $today = date('Y-m-d'); - $mainCurrency = $moduleModel->getMainCurrencyCode(); - $mainId = $moduleModel->getMainCurrencyId(); + $mainCurrency = Vtiger_Functions::getDefaultCurrencyInfo()['currency_code']; $dateCur = $dateParam; $chosenYear = date('Y', strtotime($dateCur)); @@ -183,7 +186,7 @@ public function getRates($otherCurrencyCode, $dateParam, $cron = false) if ($existingId > 0) { $moduleModel->updateCurrencyRate($existingId, $exchange); } else { - $moduleModel->addcurrencyRate($currId, $datePublicationOfFile, $exchange, $selectedBank); + $moduleModel->addCurrencyRate($currId, $datePublicationOfFile, $exchange, $selectedBank); } } } @@ -209,7 +212,7 @@ public function getRates($otherCurrencyCode, $dateParam, $cron = false) if ($existingId > 0) { $moduleModel->updateCurrencyRate($existingId, $exchange); } else { - $moduleModel->addcurrencyRate($mainCurrencyId, $datePublicationOfFile, $exchange, $selectedBank); + $moduleModel->addCurrencyRate($mainCurrencyId, $datePublicationOfFile, $exchange, $selectedBank); } } } diff --git a/modules/Settings/CurrencyUpdate/views/Index.php b/modules/Settings/CurrencyUpdate/views/Index.php index 37c66e626acb..3dd10991271c 100644 --- a/modules/Settings/CurrencyUpdate/views/Index.php +++ b/modules/Settings/CurrencyUpdate/views/Index.php @@ -36,7 +36,7 @@ public function process(Vtiger_Request $request) $dateCur = date('Y-m-d', $dateCur); } - $dateCur = $moduleModel->getLastWorkingDay($dateCur); + $dateCur = Vtiger_Functions::getLastWorkingDay($dateCur); // get currency if not already archived if ($downloadBtn) { @@ -45,24 +45,25 @@ public function process(Vtiger_Request $request) $selectBankId = $moduleModel->getActiveBankId(); - $history = $moduleModel->getRatesHistory($selectBankId, $dateCur); + $history = $moduleModel->getRatesHistory($selectBankId, $dateCur, $request); $bankTab = array(); $bankSQL = "SELECT * FROM yetiforce_currencyupdate_banks"; $bankResult = $db->query($bankSQL, true); - - for ($i = 0; $i < $db->num_rows($bankResult); $i++) { - $bankTab[$i]['id'] = $db->query_result($bankResult, $i, 'id'); - $bankName = $db->query_result($bankResult, $i, 'bank_name'); + $i = 0; + while($row = $db->fetchByAssoc($bankResult)) { + $bankTab[$i]['id'] = $row['id']; + $bankName = $row['bank_name']; $bankTab[$i]['bank_name'] = $bankName; - $bankTab[$i]['active'] = $db->query_result($bankResult, $i, 'active'); + $bankTab[$i]['active'] = $row['active']; + $i++; } // number of currencies $curr_num = $moduleModel->getCurrencyNum(); // get info about main currency - $mainCurrencyInfo = $moduleModel->getMainCurrencyInfo(); + $mainCurrencyInfo = Vtiger_Functions::getDefaultCurrencyInfo(); $viewer = $this->getViewer($request); $viewer->assign('QUALIFIED_MODULE', $qualifiedModule); diff --git a/vtlib/Vtiger/Functions.php b/vtlib/Vtiger/Functions.php index 6d860339535f..8d32e7fb43c1 100644 --- a/vtlib/Vtiger/Functions.php +++ b/vtlib/Vtiger/Functions.php @@ -131,6 +131,16 @@ public static function getAllCurrency($onlyActive = false) return self::$currencyInfoCache; } } + + public static function getDefaultCurrencyInfo() { + $allCurrencies = self::getAllCurrency(true); + foreach($allCurrencies as $currency) { + if ($currency['defaultid'] === '-11') { + return $currency; + } + } + return false; + } static function getCurrencyName($currencyid, $show_symbol = true) { @@ -1333,4 +1343,23 @@ public function textLength($text, $length = false, $addDots = true) } return $newText; } + + /* + * Checks if given date is working day, if not returns last working day + * @param $date + * @return - last working y + */ + public static function getLastWorkingDay($date) + { + $date = strtotime($date); + if (date('D', $date) == 'Sat') { // switch to friday the day before + $lastWorkingDay = date('Y-m-d', strtotime("-1 day", $date)); + } else if (date('D', $date) == 'Sun') { // switch to friday two days before + $lastWorkingDay = date('Y-m-d', strtotime("-2 day", $date)); + } else { + $lastWorkingDay = date('Y-m-d', $date); + } + + return $lastWorkingDay; + } } From 558ef830118c7b9df6c5f57e4f86eb20d36ad6e4 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Mon, 31 Aug 2015 20:38:19 +0200 Subject: [PATCH 040/489] fix XSS vulnerability in error output --- config/version.php | 2 +- vtlib/Vtiger/Deprecated.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/version.php b/config/version.php index a13b31f59aa9..694d40b0abe1 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150831'; -$YetiForce_current_version = '2.2.0'; +$YetiForce_current_version = '2.2.1'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/vtlib/Vtiger/Deprecated.php b/vtlib/Vtiger/Deprecated.php index bf44a95bc941..ec192e90b353 100644 --- a/vtlib/Vtiger/Deprecated.php +++ b/vtlib/Vtiger/Deprecated.php @@ -373,7 +373,7 @@ static function checkFileAccess($filepath) if (!self::isFileAccessible($filepath)) { $log = vglobal('log'); $log->error(__CLASS__ . ':' . __FUNCTION__ . '(' . $filepath . ') - Sorry! Attempt to access restricted file. realfilepath: ' . print_r($realfilepath, true)); - die(Vtiger_Functions::throwNewException("Sorry! Attempt to access restricted file. '" . $realfilepath . "'")); + die(Vtiger_Functions::throwNewException("Sorry! Attempt to access restricted file. '" . htmlspecialchars($realfilepath, ENT_QUOTES, vglobal('default_charset')) . "'")); } } From f0c386f04e868eb0366512e23119b09117e0b812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Ko=C5=84?= Date: Mon, 31 Aug 2015 20:47:32 +0200 Subject: [PATCH 041/489] Fix #1881 Added margin to buttons --- config/version.php | 2 +- layouts/vlayout/modules/Settings/Dav/Keys.tpl | 2 +- layouts/vlayout/modules/Settings/MobileApps/MobileKeys.tpl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/version.php b/config/version.php index 694d40b0abe1..b3fbb23cbe6e 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150831'; -$YetiForce_current_version = '2.2.1'; +$YetiForce_current_version = '2.2.2'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/layouts/vlayout/modules/Settings/Dav/Keys.tpl b/layouts/vlayout/modules/Settings/Dav/Keys.tpl index 4138085cf029..da4d68d30380 100644 --- a/layouts/vlayout/modules/Settings/Dav/Keys.tpl +++ b/layouts/vlayout/modules/Settings/Dav/Keys.tpl @@ -13,7 +13,7 @@

    {vtranslate('LBL_DAV_KEYS', $QUALIFIED_MODULE)}

    {vtranslate('LBL_DAV_KEYS_DESCRIPTION', $QUALIFIED_MODULE)}
    -
    +

    diff --git a/layouts/vlayout/modules/Settings/MobileApps/MobileKeys.tpl b/layouts/vlayout/modules/Settings/MobileApps/MobileKeys.tpl index 09d7e3ef2e3f..419bccb0c1dc 100644 --- a/layouts/vlayout/modules/Settings/MobileApps/MobileKeys.tpl +++ b/layouts/vlayout/modules/Settings/MobileApps/MobileKeys.tpl @@ -13,7 +13,7 @@

    {vtranslate('LBL_MOBILE_KEYS', $QUALIFIED_MODULE)}

    {vtranslate('LBL_MOBILE_KEYS_DESCRIPTION', $QUALIFIED_MODULE)}
    -
    +

    From 420da255595e26e33aebddd8633fed7f5a56198a Mon Sep 17 00:00:00 2001 From: MaciejStencel Date: Mon, 31 Aug 2015 23:01:48 +0200 Subject: [PATCH 042/489] Fix #1887 - Fixed saving of currency fields when marking record as read. --- config/version.php | 2 +- modules/SalesOrder/actions/SaveAjax.php | 3 ++- modules/Vtiger/actions/SaveAjax.php | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config/version.php b/config/version.php index b3fbb23cbe6e..ced52c2d6f93 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150831'; -$YetiForce_current_version = '2.2.2'; +$YetiForce_current_version = '2.2.3'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/modules/SalesOrder/actions/SaveAjax.php b/modules/SalesOrder/actions/SaveAjax.php index db12ab6baec1..649dbbc7269b 100644 --- a/modules/SalesOrder/actions/SaveAjax.php +++ b/modules/SalesOrder/actions/SaveAjax.php @@ -36,11 +36,12 @@ public function getRecordModelFromRequest(Vtiger_Request $request) $uiType = $fieldModel->get('uitype'); if ($uiType == 70) { $fieldValue = $recordModel->get($fieldName); + } elseif (in_array($uiType, [71,72])) { // currency ui types + $fieldValue = $recordModel->get($fieldName); } else { $fieldValue = $fieldModel->getUITypeModel()->getUserRequestValue($recordModel->get($fieldName), $recordId); } - if ($fieldName === $request->get('field')) { $fieldValue = $request->get('value'); } diff --git a/modules/Vtiger/actions/SaveAjax.php b/modules/Vtiger/actions/SaveAjax.php index e2b9cfd75040..5c8e3fb0bbfc 100644 --- a/modules/Vtiger/actions/SaveAjax.php +++ b/modules/Vtiger/actions/SaveAjax.php @@ -76,6 +76,8 @@ public function getRecordModelFromRequest(Vtiger_Request $request) $uiType = $fieldModel->get('uitype'); if ($uiType == 70) { $fieldValue = $recordModel->get($fieldName); + } elseif (in_array($uiType, [71,72])) { // currency ui types + $fieldValue = $recordModel->get($fieldName); } else { $fieldValue = $fieldModel->getUITypeModel()->getUserRequestValue($recordModel->get($fieldName), $recordId); } From 4a22b657e3894c1f76feff0a1bb20f47d82cb633 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Mon, 31 Aug 2015 23:48:31 +0200 Subject: [PATCH 043/489] Add slug function --- config/version.php | 2 +- vtlib/Vtiger/Functions.php | 74 +++++++++++++++++++++++++++++++++++++- 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/config/version.php b/config/version.php index ced52c2d6f93..dd3d9f73b7b4 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150831'; -$YetiForce_current_version = '2.2.3'; +$YetiForce_current_version = '2.2.4'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/vtlib/Vtiger/Functions.php b/vtlib/Vtiger/Functions.php index 8d32e7fb43c1..badc48b27b05 100644 --- a/vtlib/Vtiger/Functions.php +++ b/vtlib/Vtiger/Functions.php @@ -1343,12 +1343,12 @@ public function textLength($text, $length = false, $addDots = true) } return $newText; } - /* * Checks if given date is working day, if not returns last working day * @param $date * @return - last working y */ + public static function getLastWorkingDay($date) { $date = strtotime($date); @@ -1362,4 +1362,76 @@ public static function getLastWorkingDay($date) return $lastWorkingDay; } + + function slug($str, $delimiter = '_') + { + // Make sure string is in UTF-8 and strip invalid UTF-8 characters + $str = mb_convert_encoding((string) $str, 'UTF-8', mb_list_encodings()); + $char_map = array( + // Latin + 'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A', 'Å' => 'A', 'Æ' => 'AE', 'Ç' => 'C', + 'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Ì' => 'I', 'Í' => 'I', 'Î' => 'I', 'Ï' => 'I', + 'Ð' => 'D', 'Ñ' => 'N', 'Ò' => 'O', 'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'Ö' => 'O', 'Ő' => 'O', + 'Ø' => 'O', 'Ù' => 'U', 'Ú' => 'U', 'Û' => 'U', 'Ü' => 'U', 'Ű' => 'U', 'Ý' => 'Y', 'Þ' => 'TH', + 'ß' => 'ss', + 'à' => 'a', 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ä' => 'a', 'å' => 'a', 'æ' => 'ae', 'ç' => 'c', + 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e', 'ệ' => 'e', 'ì' => 'i', 'í' => 'i', 'î' => 'i', + 'ï' => 'i', 'ĩ' => 'i', 'ð' => 'd', 'ñ' => 'n', 'ò' => 'o', 'ó' => 'o', 'ô' => 'o', 'ộ' => 'o', + 'õ' => 'o', 'ö' => 'o', 'ő' => 'o', 'ø' => 'o', 'ù' => 'u', 'ú' => 'u', 'û' => 'u', 'ü' => 'u', + 'ű' => 'u', 'ủ' => 'u', 'ý' => 'y', 'þ' => 'th', 'ÿ' => 'y', + // Latin symbols + '©' => '(c)', + // Greek + 'Α' => 'A', 'Β' => 'B', 'Γ' => 'G', 'Δ' => 'D', 'Ε' => 'E', 'Ζ' => 'Z', 'Η' => 'H', 'Θ' => '8', + 'Ι' => 'I', 'Κ' => 'K', 'Λ' => 'L', 'Μ' => 'M', 'Ν' => 'N', 'Ξ' => '3', 'Ο' => 'O', 'Π' => 'P', + 'Ρ' => 'R', 'Σ' => 'S', 'Τ' => 'T', 'Υ' => 'Y', 'Φ' => 'F', 'Χ' => 'X', 'Ψ' => 'PS', 'Ω' => 'W', + 'Ά' => 'A', 'Έ' => 'E', 'Ί' => 'I', 'Ό' => 'O', 'Ύ' => 'Y', 'Ή' => 'H', 'Ώ' => 'W', 'Ϊ' => 'I', + 'Ϋ' => 'Y', + 'α' => 'a', 'β' => 'b', 'γ' => 'g', 'δ' => 'd', 'ε' => 'e', 'ζ' => 'z', 'η' => 'h', 'θ' => '8', + 'ι' => 'i', 'κ' => 'k', 'λ' => 'l', 'μ' => 'm', 'ν' => 'n', 'ξ' => '3', 'ο' => 'o', 'π' => 'p', + 'ρ' => 'r', 'σ' => 's', 'τ' => 't', 'υ' => 'y', 'φ' => 'f', 'χ' => 'x', 'ψ' => 'ps', 'ω' => 'w', + 'ά' => 'a', 'έ' => 'e', 'ί' => 'i', 'ό' => 'o', 'ύ' => 'y', 'ή' => 'h', 'ώ' => 'w', 'ς' => 's', + 'ϊ' => 'i', 'ΰ' => 'y', 'ϋ' => 'y', 'ΐ' => 'i', + // Turkish + 'Ş' => 'S', 'İ' => 'I', 'Ç' => 'C', 'Ü' => 'U', 'Ö' => 'O', 'Ğ' => 'G', + 'ş' => 's', 'ı' => 'i', 'ç' => 'c', 'ü' => 'u', 'ö' => 'o', 'ğ' => 'g', + // Russian + 'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D', 'Е' => 'E', 'Ё' => 'Yo', 'Ж' => 'Zh', + 'З' => 'Z', 'И' => 'I', 'Й' => 'J', 'К' => 'K', 'Л' => 'L', 'М' => 'M', 'Н' => 'N', 'О' => 'O', + 'П' => 'P', 'Р' => 'R', 'С' => 'S', 'Т' => 'T', 'У' => 'U', 'Ф' => 'F', 'Х' => 'H', 'Ц' => 'C', + 'Ч' => 'Ch', 'Ш' => 'Sh', 'Щ' => 'Sh', 'Ъ' => '', 'Ы' => 'Y', 'Ь' => '', 'Э' => 'E', 'Ю' => 'Yu', + 'Я' => 'Ya', + 'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e', 'ё' => 'yo', 'ж' => 'zh', + 'з' => 'z', 'и' => 'i', 'й' => 'j', 'к' => 'k', 'л' => 'l', 'м' => 'm', 'н' => 'n', 'о' => 'o', + 'п' => 'p', 'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ц' => 'c', + 'ч' => 'ch', 'ш' => 'sh', 'щ' => 'sh', 'ъ' => '', 'ы' => 'y', 'ь' => '', 'э' => 'e', 'ю' => 'yu', + 'я' => 'ya', + // Ukrainian + 'Є' => 'Ye', 'І' => 'I', 'Ї' => 'Yi', 'Ґ' => 'G', + 'є' => 'ye', 'і' => 'i', 'ї' => 'yi', 'ґ' => 'g', + // Czech + 'Č' => 'C', 'Ď' => 'D', 'Ě' => 'E', 'Ň' => 'N', 'Ř' => 'R', 'Š' => 'S', 'Ť' => 'T', 'Ů' => 'U', + 'Ž' => 'Z', + 'č' => 'c', 'ď' => 'd', 'ě' => 'e', 'ň' => 'n', 'ř' => 'r', 'š' => 's', 'ť' => 't', 'ů' => 'u', + 'ž' => 'z', + // Polish + 'Ą' => 'A', 'Ć' => 'C', 'Ę' => 'e', 'Ł' => 'L', 'Ń' => 'N', 'Ó' => 'o', 'Ś' => 'S', 'Ź' => 'Z', + 'Ż' => 'Z', + 'ą' => 'a', 'ć' => 'c', 'ę' => 'e', 'ł' => 'l', 'ń' => 'n', 'ó' => 'o', 'ś' => 's', 'ź' => 'z', + 'ż' => 'z', + // Latvian + 'Ā' => 'A', 'Č' => 'C', 'Ē' => 'E', 'Ģ' => 'G', 'Ī' => 'i', 'Ķ' => 'k', 'Ļ' => 'L', 'Ņ' => 'N', + 'Š' => 'S', 'Ū' => 'u', 'Ž' => 'Z', + 'ā' => 'a', 'č' => 'c', 'ē' => 'e', 'ģ' => 'g', 'ī' => 'i', 'ķ' => 'k', 'ļ' => 'l', 'ņ' => 'n', + 'š' => 's', 'ū' => 'u', 'ž' => 'z' + ); + + // Transliterate characters to ASCII + $str = str_replace(array_keys($char_map), $char_map, $str); + // Replace non-alphanumeric characters with our delimiter + $str = preg_replace('/[^\p{L}\p{Nd}]+/u', $delimiter, $str); + // Remove delimiter from ends + $str = trim($str, $delimiter); + return $str; + } } From e4642ca7adaaa0a2a356ac5673180e5cd11443ea Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Mon, 31 Aug 2015 23:49:02 +0200 Subject: [PATCH 044/489] Fixed #1859 --- config/version.php | 2 +- include/utils/utils.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/config/version.php b/config/version.php index dd3d9f73b7b4..cee99b98e7ec 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150831'; -$YetiForce_current_version = '2.2.4'; +$YetiForce_current_version = '2.2.5'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/include/utils/utils.php b/include/utils/utils.php index 2835feed0b25..f06953307222 100644 --- a/include/utils/utils.php +++ b/include/utils/utils.php @@ -1806,8 +1806,7 @@ function getValidDBInsertDateTimeValue($value) */ function sanitizeUploadFileName($fileName, $badFileExtensions) { - $fileName = preg_replace('/[^a-zA-Z0-9_%\[().\]\\/-]/s', '_', $fileName); - $fileName = preg_replace('/\s+/', '_', $fileName); //replace space with _ in filename + $fileName = Vtiger_Functions::slug($fileName); $fileName = rtrim($fileName, '\\/<>?*:"<>|'); $fileNameParts = explode(".", $fileName); From 1aa37a9bf62b2ab14f5bdf472fdca172402f2d52 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Tue, 1 Sep 2015 00:13:06 +0200 Subject: [PATCH 045/489] Fix #1321 Fix #1859 --- config/version.php | 2 +- modules/Documents/Documents.php | 3 +-- modules/Documents/models/Record.php | 2 +- vtlib/Vtiger/Functions.php | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/config/version.php b/config/version.php index cee99b98e7ec..6b9f5ea9023f 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150831'; -$YetiForce_current_version = '2.2.5'; +$YetiForce_current_version = '2.2.6'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/modules/Documents/Documents.php b/modules/Documents/Documents.php index be6e719c1f07..eb3c348357cd 100644 --- a/modules/Documents/Documents.php +++ b/modules/Documents/Documents.php @@ -103,8 +103,7 @@ function save_module($module) $filetype = $_FILES[$filename_fieldname]['type']; $filesize = $_FILES[$filename_fieldname]['size']; $filelocationtype = 'I'; - $binFile = sanitizeUploadFileName($filename, $upload_badext); - $filename = ltrim(basename(" ".$binFile)); //allowed filename like UTF-8 characters + $filename = ltrim(basename(" ".$filename)); //allowed filename like UTF-8 characters } } diff --git a/modules/Documents/models/Record.php b/modules/Documents/models/Record.php index dfe2d4e109ad..2fd37966e0de 100644 --- a/modules/Documents/models/Record.php +++ b/modules/Documents/models/Record.php @@ -83,7 +83,7 @@ function downloadFile() { if (fopen($filePath.$savedFile, "r")) { $fileContent = fread(fopen($filePath.$savedFile, "r"), $fileSize); - + $fileName = $this->get('filename'); header("Content-type: ".$fileDetails['type']); header("Pragma: public"); header("Cache-Control: private"); diff --git a/vtlib/Vtiger/Functions.php b/vtlib/Vtiger/Functions.php index badc48b27b05..a030d1827f04 100644 --- a/vtlib/Vtiger/Functions.php +++ b/vtlib/Vtiger/Functions.php @@ -1429,7 +1429,7 @@ function slug($str, $delimiter = '_') // Transliterate characters to ASCII $str = str_replace(array_keys($char_map), $char_map, $str); // Replace non-alphanumeric characters with our delimiter - $str = preg_replace('/[^\p{L}\p{Nd}]+/u', $delimiter, $str); + $str = preg_replace('/[^\p{L}\p{Nd}\.]+/u', $delimiter, $str); // Remove delimiter from ends $str = trim($str, $delimiter); return $str; From b66da6d01cf2c067feab270ea66ba61b5c31e920 Mon Sep 17 00:00:00 2001 From: MaciejStencel Date: Tue, 1 Sep 2015 00:56:10 +0200 Subject: [PATCH 046/489] Fix #1889 - Fixed showing of "Add record" button in Sold Services for users w/o write permissions in Potentials. --- config/version.php | 4 ++-- modules/OSSSoldServices/models/ListView.php | 17 ++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/config/version.php b/config/version.php index 6b9f5ea9023f..b38ed202a4a4 100644 --- a/config/version.php +++ b/config/version.php @@ -8,6 +8,6 @@ * All Rights Reserved. * Contributor(s): YetiForce.com * ****************************************************************************** */ -$patch_version = '20150831'; -$YetiForce_current_version = '2.2.6'; +$patch_version = '20150901'; +$YetiForce_current_version = '2.2.7'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/modules/OSSSoldServices/models/ListView.php b/modules/OSSSoldServices/models/ListView.php index 9563f6847628..0d7658596656 100644 --- a/modules/OSSSoldServices/models/ListView.php +++ b/modules/OSSSoldServices/models/ListView.php @@ -1,5 +1,5 @@ 'LISTVIEWBASIC', 'linklabel' => 'LBL_GENERATE_EXTENSION', @@ -24,7 +27,7 @@ public function getBasicLinks() { 'linkicon' => 'icon-star-empty', 'linkclass' => 'btn-success', ); - return $basicLinks; } + return $basicLinks; } -} \ No newline at end of file +} From 26754de41f61d5c7aaee4621117b95dea29f312b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Skrzypczak?= Date: Tue, 1 Sep 2015 06:27:49 +0200 Subject: [PATCH 047/489] Improved login view. --- config/version.php | 2 +- languages/de_de/Vtiger.php | 1 + languages/en_us/Vtiger.php | 1 + languages/nl_nl/Vtiger.php | 1 + languages/pl_pl/Vtiger.php | 1 + languages/pt_br/Vtiger.php | 1 + languages/ru_ru/Vtiger.php | 1 + .../vlayout/modules/Users/Login.Default.tpl | 191 +++++++----------- layouts/vlayout/skins/login.css | 120 ++--------- layouts/vlayout/skins/login.min.css | 2 + 10 files changed, 100 insertions(+), 221 deletions(-) create mode 100644 layouts/vlayout/skins/login.min.css diff --git a/config/version.php b/config/version.php index b38ed202a4a4..3f181691aef1 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150901'; -$YetiForce_current_version = '2.2.7'; +$YetiForce_current_version = '2.2.8'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/languages/de_de/Vtiger.php b/languages/de_de/Vtiger.php index 779efa31eb80..d91b0efea437 100644 --- a/languages/de_de/Vtiger.php +++ b/languages/de_de/Vtiger.php @@ -1001,6 +1001,7 @@ 'LBL_ENTER_SEARCHED_ADDRESS' => 'Enter the address to search', 'equal to' => 'Equal to', 'None' => 'None', + 'LBL_SIGN_IN' => 'Sign in', ]; $jsLanguageStrings = [ 'JS_DATE_SHOULD_BE_GREATER_THAN' => ' Enddatum kann nicht gleich oder kleiner als Startdatum sein', diff --git a/languages/en_us/Vtiger.php b/languages/en_us/Vtiger.php index b0ce9409142d..4df4bce0310a 100644 --- a/languages/en_us/Vtiger.php +++ b/languages/en_us/Vtiger.php @@ -984,6 +984,7 @@ 'equal to' => 'Equal to', 'None' => 'None', 'Email Opt Out' => 'Email Opt Out', + 'LBL_SIGN_IN' => 'Sign in', ]; $jsLanguageStrings = [ 'JS_DATE_SHOULD_BE_GREATER_THAN' => 'End Date cannot be equal or less than Start Date', diff --git a/languages/nl_nl/Vtiger.php b/languages/nl_nl/Vtiger.php index d5270c203b09..5d8b1174a77a 100644 --- a/languages/nl_nl/Vtiger.php +++ b/languages/nl_nl/Vtiger.php @@ -978,6 +978,7 @@ 'equal to' => 'Equal to', 'None' => 'None', 'Email Opt Out' => 'Email Opt Out', + 'LBL_SIGN_IN' => 'Sign in', ]; $jsLanguageStrings = [ 'JS_DATE_SHOULD_BE_GREATER_THAN' => 'End Date cannot be equal or less than Start Date', diff --git a/languages/pl_pl/Vtiger.php b/languages/pl_pl/Vtiger.php index 2bc292f65224..9c14b80893fd 100644 --- a/languages/pl_pl/Vtiger.php +++ b/languages/pl_pl/Vtiger.php @@ -991,6 +991,7 @@ 'LBL_VIEW_ACTIONCONFIG' => 'Konfiguracja akcji', 'LBL_ENTER_SEARCHED_ADDRESS' => 'Wprowadź szukany adres', 'Email Opt Out' => 'Rezygnacja z otrzymywania emaili', + 'LBL_SIGN_IN' => 'Zaloguj', ]; $jsLanguageStrings = [ 'JS_DATE_SHOULD_BE_GREATER_THAN' => 'Data zakończenia nie może być mniejsza od daty początkowej', diff --git a/languages/pt_br/Vtiger.php b/languages/pt_br/Vtiger.php index a523dd362ed0..b46be72c460c 100644 --- a/languages/pt_br/Vtiger.php +++ b/languages/pt_br/Vtiger.php @@ -997,6 +997,7 @@ 'equal to' => 'Equal to', 'None' => 'None', 'Email Opt Out' => 'Email Opt Out', + 'LBL_SIGN_IN' => 'Sign in', ]; $jsLanguageStrings = [ 'JS_DATE_SHOULD_BE_GREATER_THAN' => 'A Data Final não pode ser igual ou menor que a Data Inicial', diff --git a/languages/ru_ru/Vtiger.php b/languages/ru_ru/Vtiger.php index fa64b2ab3235..6cd51bdc8093 100644 --- a/languages/ru_ru/Vtiger.php +++ b/languages/ru_ru/Vtiger.php @@ -1241,6 +1241,7 @@ 'LBL_ENTER_SEARCHED_ADDRESS' => 'Enter the address to search', 'equal to' => 'Equal to', 'None' => 'None', + 'LBL_SIGN_IN' => 'Sign in', ]; $jsLanguageStrings = [ 'SINGLE_SalesOrder' => 'Заказ', diff --git a/layouts/vlayout/modules/Users/Login.Default.tpl b/layouts/vlayout/modules/Users/Login.Default.tpl index 66b76b7a7793..5195175850b2 100644 --- a/layouts/vlayout/modules/Users/Login.Default.tpl +++ b/layouts/vlayout/modules/Users/Login.Default.tpl @@ -9,136 +9,97 @@ * Contributor(s): YetiForce.com ********************************************************************************/ -->*} - {strip} {assign var="CompanyDetails" value=getCompanyDetails()} {assign var="MODULE" value='Users'} -
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,c){var i=this;for(var b in c){var a=c[b];var j=a.description;var e=a.unitPriceValues;var d=JSON.stringify(e);for(var g in a.autoFields){k.find("input."+g).val(a.autoFields[g])}var h=i.getCurrency();if(typeof e[h]!=="undefined"){i.setUnitPrice(k,e[h])}$("input.unitPrice",k).attr("list-info",d);$("textarea.commentTextarea",k).val(j)}if(f==="Products"){i.loadSubProducts(k,true)}i.quantityChangeActions(k)},saveDiscountsParameters:function(d,b){var a=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(a.discountModalFields,function(f,g){if($.inArray(g,e)>=0){if(b.find('[name="'+g+'"]:checked').length>1){c[g]=[];b.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=b.find('[name="'+g+'"]:checked').val()}}else{c[g]=b.find('[name="'+g+'"]').val()}});a.setDiscountParam(d,c)},saveTaxsParameters:function(d,b){var a=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(a.taxModalFields,function(f,g){if($.inArray(g,e)>=0){if(b.find('[name="'+g+'"]:checked').length>1){c[g]=[];b.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=b.find('[name="'+g+'"]:checked').val()}}else{c[g]=b.find('[name="'+g+'"]').val()}});a.setTaxParam(d,c)},showExpandedRow:function(e){var d=this;var a=d.getInventoryItemsContainer();var b=a.find('[numrowex="'+e.attr("numrow")+'"]');var c=e.find(".toggleVisibility");c.data("status","1");c.find(".glyphicon").removeClass("glyphicon-menu-down");c.find(".glyphicon").addClass("glyphicon-menu-up");b.removeClass("hide");Vtiger_Edit_Js.getInstance().loadCkEditorElement(b.find(".ckEditorSource"))},hideExpandedRow:function(f){var e=this;var a=e.getInventoryItemsContainer();var b=a.find('[numrowex="'+f.attr("numrow")+'"]');var d=f.find(".toggleVisibility");d.data("status","0");d.find(".glyphicon").removeClass("glyphicon-menu-up");d.find(".glyphicon").addClass("glyphicon-menu-down");b.addClass("hide");var c=CKEDITOR.instances[b.find(".ckEditorSource").attr("id")];if(c){c.destroy()}},initDiscountsParameters:function(d,c){var b=this;var a=d.find(".discountParam").val();if(a==""){return}var a=JSON.parse(a);$.each(b.discountModalFields,function(e,g){var i=a[g];var f=c.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{c.find('[name="'+g+'"]').val(i)}}});b.calculateDiscount(d,c)},initTaxParameters:function(d,c){var b=this;var a=d.find(".taxParam").val();if(a==""){return}var a=JSON.parse(a);$.each(b.taxModalFields,function(e,g){var i=a[g];var f=c.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{c.find('[name="'+g+'"]').val(i)}}});b.calculateTax(d,c)},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#inventoryLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"Inventory",mode:"checkLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#inventoryLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide();console.error(f,g)});return a},currencyChangeActions:function(a,b){var c=this;if(b.data("baseCurrency")==0){c.showCurrencyChangeModal(a)}else{c.currencyConvertValues(a);a.data("oldValue",a.val())}},showCurrencyChangeModal:function(a){var c=this;if(c.lockCurrencyChange==true){return}c.lockCurrencyChange=true;var b=a.closest("th").find(".modelContainer").clone();app.showModalWindow(b,function(e){var d=$(e);d.on("click",'button[type="submit"]',function(f){c.currencyConvertValues(a);a.data("oldValue",a.val());app.hideModalWindow();c.lockCurrencyChange=false});d.on("click",'button[type="reset"]',function(f){a.val(a.data("oldValue")).change();c.lockCurrencyChange=false})})},currencyConvertValues:function(a){var f=this;var d=a.find("option:selected");var e=a.find('option[value="'+a.data("oldValue")+'"]');var b=d.data("conversionRate");var c=e.data("conversionRate");b=parseFloat(b)/parseFloat(c);this.getInventoryItemsContainer().find(f.rowClass).each(function(g){var h=$(this);f.setUnitPrice(h,app.parseNumberToFloat(f.getUnitPriceValue(h)*b));f.setDiscount(h,app.parseNumberToFloat(f.getDiscount(h)*b));f.setTax(h,app.parseNumberToFloat(f.getTax(h)*b));f.quantityChangeActions(h)})},registerAddItem:function(a){var c=this;var b=this.getInventoryItemsContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackIthemTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.find("tr").appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.initItem(m)})},registerSortableItems:function(){var b=this;var a=b.getInventoryItemsContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(c,d){a.find(b.rowClass).each(function(e,f){var g=$(f);b.hideExpandedRow(g)});d.item.startPos=d.item.index()},stop:function(d,e){var c=$(e.item.context).attr("numrow");var f=a.find(".numRow"+c).remove().clone();a.find('[numrow="'+c+'"]').after(f);if(e.item.startPos1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getInventoryItemsContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getInventoryItemsContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackIthemTable tbody").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},getTaxModeSelectElement:function(b){var a=this.getInventoryHeadContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(d){var c=this;var b=c.getInventorySummaryTaxesContainer().find(".groupTax");var a=c.getInventoryItemsContainer();if(c.isIndividualTaxMode()){b.addClass("hide");a.find(".changeTax").removeClass("hide")}else{b.removeClass("hide");a.find(".changeTax").addClass("hide")}c.setTax(a,0);c.setTaxParam(a,[]);c.rowsCalculations()},getDiscountModeSelectElement:function(b){var a=this.getInventoryHeadContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(d){var c=this;var a=c.getInventorySummaryDiscountContainer().find(".groupDiscount");var b=c.getInventoryItemsContainer();if(c.isIndividualDiscountMode()){a.addClass("hide");b.find(".changeDiscount").removeClass("hide")}else{a.removeClass("hide");b.find(".changeDiscount").addClass("hide")}c.setDiscount(b,0);c.setDiscountParam(b,[]);c.rowsCalculations()},getCurrency:function(){var a=$('[name="currency"]',this.getInventoryHeadContainer());return a.find("option:selected").val()},getTax:function(a){return app.parseNumberToFloat($(".tax",a).val())},getQuantityValue:function(a){return app.parseNumberToFloat($(".qty",a).val())},getUnitPriceValue:function(a){return app.parseNumberToFloat($(".unitPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return app.parseNumberToFloat(b)},getNetPrice:function(a){return app.parseNumberToFloat($(".netPrice",a).val())},getTotalPrice:function(a){return app.parseNumberToFloat($(".totalPrice",a).val())},getGrossPrice:function(a){return app.parseNumberToFloat($(".grossPrice",a).val())},getPurchase:function(a){var b=this.getQuantityValue(a);return app.parseNumberToFloat($(".purchase",a).val())*b},getSummaryGrossPrice:function(){var b=this;var a=0;this.getInventoryItemsContainer().find(b.rowClass).each(function(c){a+=b.getGrossPrice($(this))});return app.parseNumberToFloat(a)},setUnitPrice:function(b,a){a=app.parseNumberToShow(a);b.find(".unitPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=app.parseNumberToShow(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=app.parseNumberToShow(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=app.parseNumberToShow(a);$(".totalPriceText",b).text(a);$(".totalPrice",b).val(a)},setMargin:function(b,a){a=app.parseNumberToShow(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=app.parseNumberToShow(a);$(".marginp",b).val(a)},setDiscount:function(b,a){a=app.parseNumberToShow(a);$(".discount",b).val(a)},setDiscountParam:function(b,a){$(".discountParam",b).val(JSON.stringify(a))},setTax:function(b,a){a=app.parseNumberToShow(a);$(".tax",b).val(a)},setTaxParam:function(b,a){$(".taxParam",b).val(JSON.stringify(a))},quantityChangeActions:function(a){this.rowCalculations(a);this.summaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getInventoryItemsContainer().find(a.rowClass).each(function(b){a.quantityChangeActions($(this))})},summaryCalculations:function(){var a=this;a.getInventoryItemsContainer().find("tfoot .wisableTd").each(function(b){a.calculatSummary($(this),$(this).data("sumfield"))});a.calculatDiscountSummary();a.calculatTaxSummary();a.calculatCurrenciesSummary()},calculatSummary:function(a,d){var c=this;var b=0;this.getInventoryItemsContainer().find(c.rowClass).each(function(e){b+=app.parseNumberToFloat($(this).find("."+d).val())});a.text(app.parseNumberToShow(b))},calculatDiscountSummary:function(){var b=this;var c=b.getAllDiscount();var a=b.getInventorySummaryDiscountContainer();a.find("input").val(app.parseNumberToShow(c))},getAllDiscount:function(){var a=this;var b=0;this.getInventoryItemsContainer().find(a.rowClass).each(function(d){var e=$(this);var c=a.getDiscount(e);b+=c});return b},calculatCurrenciesSummary:function(){var g=this;var a=g.getInventorySummaryCurrenciesContainer();var f=$('[name="currency"] option:selected',g.getInventoryHeadContainer());var h=$('[name="currency"] option[data-base-currency="1"]',g.getInventoryHeadContainer());var b=f.data("conversionRate");var e=h.data("conversionRate");if(b==e){a.addClass("hide");return}b=parseFloat(e)/parseFloat(b);a.removeClass("hide");var c=g.getAllTaxs();var d=0;a.find(".panel-body").html("");$.each(c,function(i,j){if(j!=undefined){j=j*b;var k=a.find(".hide .form-group").clone();k.find(".percent").text(i+"%");k.find("input").val(app.parseNumberToShow(j));k.appendTo(a.find(".panel-body"));d+=j}});a.find(".panel-footer input").val(app.parseNumberToShow(d))},calculatTaxSummary:function(){var d=this;var b=d.getAllTaxs();var a=d.getInventorySummaryTaxesContainer();a.find(".panel-body").html("");var c=0;$.each(b,function(e,f){if(f!=undefined){var g=a.find(".hide .form-group").clone();g.find(".percent").text(e+"%");g.find("input").val(app.parseNumberToShow(f));g.appendTo(a.find(".panel-body"));c+=f}});a.find(".panel-footer input").val(app.parseNumberToShow(c))},getAllTaxs:function(){var b=this;var a=[];this.getInventoryItemsContainer().find(b.rowClass).each(function(c){var f=$(this);var g=b.getNetPrice(f);var e=f.find(".taxParam").val();if(e!=""&&e!="[]"){var d=$.parseJSON(e);if(typeof d.aggregationType=="string"){d.aggregationType=[d.aggregationType]}$.each(d.aggregationType,function(k,j){var j=j+"Tax";var i=d[j];var h=0;if(a[i]!=undefined){h=parseFloat(a[i])}a[i]=h+g*(i/100)})}});return a},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getUnitPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,h){var d=app.parseNumberToFloat(h.find(".valueTotalPrice").text()),b=d,k=0,e=0,f=0,a=0;var i=h.find(".discountsType").val();if(i=="0"||i=="1"){if(h.find(".activepanel .globalDiscount").length>0){var k=app.parseNumberToFloat(h.find(".activepanel .globalDiscount").val())}if(h.find(".activepanel .individualDiscountType").length>0){var c=h.find(".activepanel .individualDiscountType:checked").val();var g=h.find(".activepanel .individualDiscountValue").val();if(c=="percentage"){f=d*(g/100)}else{f=g}}if(h.find(".activepanel .groupCheckbox").length>0&&h.find(".activepanel .groupCheckbox").prop("checked")==true){var e=app.parseNumberToFloat(h.find(".groupValue").val());e=d*(e/100)}b=b*((100-k)/100);b=b-app.parseNumberToFloat(f);b=b-e}else{if(i=="2"){h.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=app.parseNumberToFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=app.parseNumberToFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=app.parseNumberToFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}h.find(".valuePrices").text(app.parseNumberToShow(b));h.find(".valueDiscount").text(app.parseNumberToShow(d-b))},calculateTax:function(k,j){var g=app.parseNumberToFloat(j.find(".valueNetPrice").text()),b=g,c=0,f=0,a=0,h=0,e=0;var d=j.find(".taxsType").val();if(d=="0"||d=="1"){if(j.find(".activepanel .globalTax").length>0){var c=j.find(".activepanel .globalTax").val()}if(j.find(".activepanel .individualTaxValue").length>0){var i=app.parseNumberToFloat(j.find(".activepanel .individualTaxValue").val());h=(i/100)*b}if(j.find(".activepanel .groupTax").length>0){var f=app.parseNumberToFloat(j.find(".groupTax").val());f=g*(app.parseNumberToFloat(f)/100)}if(j.find(".activepanel .regionalTax").length>0){var a=app.parseNumberToFloat(j.find(".regionalTax").val());a=g*(app.parseNumberToFloat(a)/100)}b=b*((100+app.parseNumberToFloat(c))/100);b=b+app.parseNumberToFloat(h);b=b+app.parseNumberToFloat(f);b=b+app.parseNumberToFloat(a)}else{if(d=="2"){j.find(".activepanel").each(function(p){var l=$(this);if(l.find(".globalTax").length>0){var o=app.parseNumberToFloat(l.find(".globalTax").val());b=b*((100+o)/100)}else{if(l.find(".groupTax").length>0){var n=app.parseNumberToFloat(l.find(".groupTax").val());b=b*((100+n)/100)}else{if(l.find(".regionalTax").length>0){var m=app.parseNumberToFloat(l.find(".regionalTax").val());b=b*((100+m)/100)}else{if(l.find(".individualTaxValue").length>0){var q=app.parseNumberToFloat(l.find(".individualTaxValue").val());b=((q+100)/100)*b}}}}})}}j.find(".valuePrices").text(app.parseNumberToShow(b));j.find(".valueTax").text(app.parseNumberToShow(b-g))},updateRowSequence:function(){var a=this.getInventoryItemsContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerInventorySaveData:function(a){var b=this;a.on(Vtiger_Edit_Js.recordPreSave,function(f,d){if(!b.checkLimits(a)){return false}var c=a.find("#blackIthemTable");c.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductUnitPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setUnitPrice(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(g,a){var d=this;var c=jQuery("input.sourceField",g).val();var e=g.find('.rowName input[name="popupReferenceModule"]').val();d.removeSubProducts(g);if(c=="0"||$.inArray(e,["Products","Services"])<0){return false}if(d.subProductsCashe[c]){d.addSubProducts(g,d.subProductsCashe[c]);return false}var f={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(f).then(function(i){var h=i.result;d.subProductsCashe[c]=h;d.addSubProducts(g,h);if(b){b.hide()}},function(h,i){if(b){b.hide()}console.error(h,i)})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,c){var i=this;for(var b in c){var a=c[b];var j=a.description;var e=a.unitPriceValues;var d=JSON.stringify(e);for(var g in a.autoFields){k.find("input."+g).val(a.autoFields[g])}var h=i.getCurrency();if(typeof e[h]!=="undefined"){i.setUnitPrice(k,e[h])}$("input.unitPrice",k).attr("list-info",d);$("textarea.commentTextarea",k).val(j)}if(f==="Products"){i.loadSubProducts(k,true)}i.quantityChangeActions(k)},saveDiscountsParameters:function(d,b){var a=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(a.discountModalFields,function(f,g){if($.inArray(g,e)>=0){if(b.find('[name="'+g+'"]:checked').length>1){c[g]=[];b.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=b.find('[name="'+g+'"]:checked').val()}}else{c[g]=b.find('[name="'+g+'"]').val()}});a.setDiscountParam(d,c)},saveTaxsParameters:function(d,b){var a=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(a.taxModalFields,function(f,g){if($.inArray(g,e)>=0){if(b.find('[name="'+g+'"]:checked').length>1){c[g]=[];b.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=b.find('[name="'+g+'"]:checked').val()}}else{c[g]=b.find('[name="'+g+'"]').val()}});a.setTaxParam(d,c)},showExpandedRow:function(e){var d=this;var a=d.getInventoryItemsContainer();var b=a.find('[numrowex="'+e.attr("numrow")+'"]');var c=e.find(".toggleVisibility");c.data("status","1");c.find(".glyphicon").removeClass("glyphicon-menu-down");c.find(".glyphicon").addClass("glyphicon-menu-up");b.removeClass("hide");Vtiger_Edit_Js.getInstance().loadCkEditorElement(b.find(".ckEditorSource"))},hideExpandedRow:function(f){var e=this;var a=e.getInventoryItemsContainer();var b=a.find('[numrowex="'+f.attr("numrow")+'"]');var d=f.find(".toggleVisibility");d.data("status","0");d.find(".glyphicon").removeClass("glyphicon-menu-up");d.find(".glyphicon").addClass("glyphicon-menu-down");b.addClass("hide");var c=CKEDITOR.instances[b.find(".ckEditorSource").attr("id")];if(c){c.destroy()}},initDiscountsParameters:function(d,c){var b=this;var a=d.find(".discountParam").val();if(a==""){return}var a=JSON.parse(a);$.each(b.discountModalFields,function(e,g){var i=a[g];var f=c.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{c.find('[name="'+g+'"]').val(i)}}});b.calculateDiscount(d,c)},initTaxParameters:function(d,c){var b=this;var a=d.find(".taxParam").val();if(a==""){return}var a=JSON.parse(a);$.each(b.taxModalFields,function(e,g){var i=a[g];var f=c.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{c.find('[name="'+g+'"]').val(i)}}});b.calculateTax(d,c)},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#inventoryLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"Inventory",mode:"checkLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#inventoryLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide();console.error(f,g)});return a},currencyChangeActions:function(a,b){var c=this;if(b.data("baseCurrency")==0){c.showCurrencyChangeModal(a,b)}else{c.currencyConvertValues(a,b);a.data("oldValue",a.val())}},showCurrencyChangeModal:function(a,b){var d=this;if(d.lockCurrencyChange==true){return}d.lockCurrencyChange=true;var e=a.closest("[colspan]");var c=e.find(".modelContainer").clone();app.showModalWindow(c,function(h){var g=$(h);var f=JSON.parse(e.find(".currencyparam").val());if(f!=false){g.find(".currencyName").text(b.text());g.find(".currencyRate").val(f[b.val()]["value"]);g.find(".currencyDate").text(f[b.val()]["date"])}g.on("click",'button[type="submit"]',function(l){var j=g.find(".currencyRate").val();var k=app.parseNumberToFloat(j);var i=1/app.parseNumberToFloat(j);b.data("conversionRate",i);f[b.val()]["value"]=k;f[b.val()]["conversion"]=i;e.find(".currencyparam").val(JSON.stringify(f));d.currencyConvertValues(a,b);a.data("oldValue",a.val());app.hideModalWindow();d.lockCurrencyChange=false});g.on("click",'button[type="reset"]',function(i){a.val(a.data("oldValue")).change();d.lockCurrencyChange=false})})},currencyConvertValues:function(a,d){var f=this;var e=a.find('option[value="'+a.data("oldValue")+'"]');var b=d.data("conversionRate");var c=e.data("conversionRate");b=parseFloat(b)/parseFloat(c);this.getInventoryItemsContainer().find(f.rowClass).each(function(g){var h=$(this);f.setUnitPrice(h,app.parseNumberToFloat(f.getUnitPriceValue(h)*b));f.setDiscount(h,app.parseNumberToFloat(f.getDiscount(h)*b));f.setTax(h,app.parseNumberToFloat(f.getTax(h)*b));f.quantityChangeActions(h)})},registerAddItem:function(a){var c=this;var b=this.getInventoryItemsContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackIthemTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.find("tr").appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.initItem(m)})},registerSortableItems:function(){var b=this;var a=b.getInventoryItemsContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(c,d){a.find(b.rowClass).each(function(e,f){var g=$(f);b.hideExpandedRow(g)});d.item.startPos=d.item.index()},stop:function(d,e){var c=$(e.item.context).attr("numrow");var f=a.find(".numRow"+c).remove().clone();a.find('[numrow="'+c+'"]').after(f);if(e.item.startPosjsonFields) && $request->get($field . $i) != '') { - $value = json_encode($request->get($field . $i)); - } else if ($request->has($field . $i)) { + if ($request->has($field . $i)) { $value = $request->get($field . $i); } else if ($request->has($field)) { $value = $request->get($field); } + + if (in_array($field, $this->jsonFields) && $value != '') { + $value = json_encode($value); + } if (in_array($field, ['price', 'gross', 'net', 'discount', 'purchase', 'margin', 'marginp', 'tax', 'total'])) { $value = CurrencyField::convertToDBFormat($value, null, true); } @@ -333,7 +335,7 @@ public function addField($type, $params) if (isset($params['colSpan'])) { $colSpan = $params['colSpan']; } - + Vtiger_Utils::AddColumn($table, $columnName, $instance->getDBType()); foreach ($instance->getCustomColumn() as $column => $criteria) { Vtiger_Utils::AddColumn($table, $column, $criteria); From bf7468a24f2333fc1549f98a9305a0efeba519aa Mon Sep 17 00:00:00 2001 From: Paula W Date: Wed, 2 Sep 2015 13:19:04 +0200 Subject: [PATCH 114/489] Added translations - Vtiger.php --- languages/de_de/Vtiger.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/languages/de_de/Vtiger.php b/languages/de_de/Vtiger.php index 07cf86254adb..bdabc367382b 100644 --- a/languages/de_de/Vtiger.php +++ b/languages/de_de/Vtiger.php @@ -1054,9 +1054,9 @@ 'LBL_AMOUNT' => 'Amount', 'LBL_SET_GLOBAL_TAX' => 'Set', 'LBL_SET_GLOBAL_DISCOUNT' => 'Set', - 'LBL_EXCHANGE_RATE' => '__UNTRANSLATED__', - 'LBL_EXCHANGE_DATE' => '__UNTRANSLATED__', - 'LBL_NO_EXCHANGE_RATES' => '__UNTRANSLATED__', + 'LBL_EXCHANGE_RATE' => 'Exchange rate', + 'LBL_EXCHANGE_DATE' => 'Exchange rate date', + 'LBL_NO_EXCHANGE_RATES' => 'No exchange rates found, check if downloading exchange rates works properly.', ]; $jsLanguageStrings = [ 'JS_DATE_SHOULD_BE_GREATER_THAN' => ' Enddatum kann nicht gleich oder kleiner als Startdatum sein', From c4d254334c9a47aa882113002197dba7e7df7b77 Mon Sep 17 00:00:00 2001 From: Paula W Date: Wed, 2 Sep 2015 13:22:28 +0200 Subject: [PATCH 115/489] Added translations - Vtiger.php --- languages/en_us/Vtiger.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/languages/en_us/Vtiger.php b/languages/en_us/Vtiger.php index 2efdedc56ce4..eb9f9772d0cd 100644 --- a/languages/en_us/Vtiger.php +++ b/languages/en_us/Vtiger.php @@ -1037,9 +1037,9 @@ 'LBL_AMOUNT' => 'Amount', 'LBL_SET_GLOBAL_TAX' => 'Set', 'LBL_SET_GLOBAL_DISCOUNT' => 'Set', - 'LBL_EXCHANGE_RATE' => '__UNTRANSLATED__', - 'LBL_EXCHANGE_DATE' => '__UNTRANSLATED__', - 'LBL_NO_EXCHANGE_RATES' => '__UNTRANSLATED__', + 'LBL_EXCHANGE_RATE' => 'Exchnage rate', + 'LBL_EXCHANGE_DATE' => 'Exchange rate date', + 'LBL_NO_EXCHANGE_RATES' => 'No exchange rates found, check if downloading exchange rates works properly.', ]; $jsLanguageStrings = [ 'JS_DATE_SHOULD_BE_GREATER_THAN' => 'End Date cannot be equal or less than Start Date', From e2d3754752ebc76c3900f4a1b4bad19a1779366c Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Wed, 2 Sep 2015 13:30:06 +0200 Subject: [PATCH 116/489] Improved download exchange rates --- config/version.php | 2 +- vtlib/Vtiger/Functions.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/config/version.php b/config/version.php index 9b77b11e7935..504a0bdecc54 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150902'; -$YetiForce_current_version = '2.2.45'; +$YetiForce_current_version = '2.2.46'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/vtlib/Vtiger/Functions.php b/vtlib/Vtiger/Functions.php index 6423d3c0ebb4..2a63cae33bc0 100644 --- a/vtlib/Vtiger/Functions.php +++ b/vtlib/Vtiger/Functions.php @@ -1478,7 +1478,7 @@ public static function slug($str, $delimiter = '_') */ public static function getConversionRateInfo($currencyId, $date='') { $currencyUpdateModel = Settings_CurrencyUpdate_Module_Model::getCleanInstance(); - $defaultCurrencyId = self::getDefaultCurrencyInfo()['id']; + $defaultCurrencyId = self::getDefaultCurrencyInfo()['id']; $info = []; if (empty($date)) { @@ -1491,8 +1491,9 @@ public static function getConversionRateInfo($currencyId, $date='') { $info['value'] = 1.0; $info['conversion'] = 1.0; } else { - $info['value'] = $currencyUpdateModel->convertFromTo(1, $defaultCurrencyId, $currencyId, $date); - $info['conversion'] = $currencyUpdateModel->getCRMConversionRate($currencyId, $defaultCurrencyId, $date); + $value = $currencyUpdateModel->getCRMConversionRate($currencyId, $defaultCurrencyId, $date); + $info['value'] = round($value, 5); + $info['conversion'] = round(1/$value, 5); } return $info; From 2747a184609c2674353aafe80d959b012aada542 Mon Sep 17 00:00:00 2001 From: Paula W Date: Wed, 2 Sep 2015 13:30:47 +0200 Subject: [PATCH 117/489] Added translations - Vtiger.php --- languages/nl_nl/Vtiger.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/languages/nl_nl/Vtiger.php b/languages/nl_nl/Vtiger.php index b3b27f893b80..b817b093d7e6 100644 --- a/languages/nl_nl/Vtiger.php +++ b/languages/nl_nl/Vtiger.php @@ -1030,9 +1030,9 @@ 'LBL_AMOUNT' => 'Amount', 'LBL_SET_GLOBAL_TAX' => 'Set', 'LBL_SET_GLOBAL_DISCOUNT' => 'Set', - 'LBL_EXCHANGE_RATE' => '__UNTRANSLATED__', - 'LBL_EXCHANGE_DATE' => '__UNTRANSLATED__', - 'LBL_NO_EXCHANGE_RATES' => '__UNTRANSLATED__', + 'LBL_EXCHANGE_RATE' => 'Exchange rate', + 'LBL_EXCHANGE_DATE' => 'Exchange rate date', + 'LBL_NO_EXCHANGE_RATES' => 'No exchange rates found, check if downloading exchange rates works properly.', ]; $jsLanguageStrings = [ 'JS_DATE_SHOULD_BE_GREATER_THAN' => 'End Date cannot be equal or less than Start Date', From bfef665b154fe22f08b03478520941ba84203a31 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Wed, 2 Sep 2015 13:31:06 +0200 Subject: [PATCH 118/489] Inventory module - Added download of exchange --- config/version.php | 2 +- modules/Vtiger/inventoryfields/Currency.php | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/config/version.php b/config/version.php index 504a0bdecc54..32728322cd98 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150902'; -$YetiForce_current_version = '2.2.46'; +$YetiForce_current_version = '2.2.47'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/modules/Vtiger/inventoryfields/Currency.php b/modules/Vtiger/inventoryfields/Currency.php index d851951a3b6b..7225a6737ca1 100644 --- a/modules/Vtiger/inventoryfields/Currency.php +++ b/modules/Vtiger/inventoryfields/Currency.php @@ -13,6 +13,9 @@ class Vtiger_Currency_InventoryField extends Vtiger_Basic_InventoryField protected $defaultLabel = 'LBL_CURRENCY'; protected $columnName = 'currency'; protected $dbType = 'int(10)'; + protected $customColumn = [ + 'currencyparam' => 'varchar(200)' + ]; /** * Geting value to display @@ -23,4 +26,16 @@ public function getDisplayValue($value) { return Vtiger_Functions::getCurrencyName($value, false); } + + public function getCurrencyParam($currencies, $param = false) + { + if ($param !== false) { + return Zend_Json::decode($param); + } else { + foreach ($currencies as $currency) { + $return[$currency['id']] = Vtiger_Functions::getConversionRateInfo($currency['id']); + } + } + return $return; + } } From 4d590bd19be35ab8cd6ada26e94ef640ba126969 Mon Sep 17 00:00:00 2001 From: Paula W Date: Wed, 2 Sep 2015 13:33:29 +0200 Subject: [PATCH 119/489] Added translations - Vtiger.php --- languages/pt_br/Vtiger.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/languages/pt_br/Vtiger.php b/languages/pt_br/Vtiger.php index 0a9df1dbb167..f14a5d292eff 100644 --- a/languages/pt_br/Vtiger.php +++ b/languages/pt_br/Vtiger.php @@ -1050,9 +1050,9 @@ 'LBL_AMOUNT' => 'Amount', 'LBL_SET_GLOBAL_TAX' => 'Set', 'LBL_SET_GLOBAL_DISCOUNT' => 'Set', - 'LBL_EXCHANGE_RATE' => '__UNTRANSLATED__', - 'LBL_EXCHANGE_DATE' => '__UNTRANSLATED__', - 'LBL_NO_EXCHANGE_RATES' => '__UNTRANSLATED__', + 'LBL_EXCHANGE_RATE' => 'Exchange rate', + 'LBL_EXCHANGE_DATE' => 'Exchange rate date', + 'LBL_NO_EXCHANGE_RATES' => 'No exchange rates found, check if downloading exchange rates works properly.', ]; $jsLanguageStrings = [ 'JS_DATE_SHOULD_BE_GREATER_THAN' => 'A Data Final não pode ser igual ou menor que a Data Inicial', From ed86f983a0b848376f5e5ddd0c273d011753a4fc Mon Sep 17 00:00:00 2001 From: Paula W Date: Wed, 2 Sep 2015 13:35:18 +0200 Subject: [PATCH 120/489] Added translations - Vtiger.php --- languages/ru_ru/Vtiger.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/languages/ru_ru/Vtiger.php b/languages/ru_ru/Vtiger.php index b12d882ca516..824588d1609c 100644 --- a/languages/ru_ru/Vtiger.php +++ b/languages/ru_ru/Vtiger.php @@ -1293,9 +1293,9 @@ 'LBL_AMOUNT' => 'Amount', 'LBL_SET_GLOBAL_TAX' => 'Set', 'LBL_SET_GLOBAL_DISCOUNT' => 'Set', - 'LBL_EXCHANGE_RATE' => '__UNTRANSLATED__', - 'LBL_EXCHANGE_DATE' => '__UNTRANSLATED__', - 'LBL_NO_EXCHANGE_RATES' => '__UNTRANSLATED__', + 'LBL_EXCHANGE_RATE' => 'Exchange rate', + 'LBL_EXCHANGE_DATE' => 'Exchange rate date', + 'LBL_NO_EXCHANGE_RATES' => 'No exchange rates found, check if downloading exchange rates works properly.', ]; $jsLanguageStrings = [ 'SINGLE_SalesOrder' => 'Заказ', From f4e60e0b72274c7d1c8432c5bbbaa8673a6a6c9c Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Wed, 2 Sep 2015 14:34:56 +0200 Subject: [PATCH 121/489] Inventory module - Added minor improvements --- config/version.php | 2 +- .../Vtiger/InventoryDiscountsType0.tpl | 32 ++++++++++--------- .../Vtiger/InventoryDiscountsType1.tpl | 2 +- .../modules/Vtiger/InventoryTaxesType0.tpl | 32 ++++++++++--------- .../inventoryfields/EditViewDiscount.tpl | 2 +- .../Vtiger/inventoryfields/EditViewTax.tpl | 2 +- modules/Vtiger/inventoryfields/Currency.php | 1 + modules/Vtiger/inventoryfields/Name.php | 1 + 8 files changed, 40 insertions(+), 34 deletions(-) diff --git a/config/version.php b/config/version.php index 32728322cd98..fbf8e7501bd8 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150902'; -$YetiForce_current_version = '2.2.47'; +$YetiForce_current_version = '2.2.48'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/layouts/vlayout/modules/Vtiger/InventoryDiscountsType0.tpl b/layouts/vlayout/modules/Vtiger/InventoryDiscountsType0.tpl index ccab87aced26..0cb1311c6412 100644 --- a/layouts/vlayout/modules/Vtiger/InventoryDiscountsType0.tpl +++ b/layouts/vlayout/modules/Vtiger/InventoryDiscountsType0.tpl @@ -1,20 +1,22 @@ {**} {strip} -
    -
    - {vtranslate('LBL_GLOBAL_DISCOUNTS', $MODULE)} -
    - + {if count($GLOBAL_DISCOUNTS) > 0} +
    +
    + {vtranslate('LBL_GLOBAL_DISCOUNTS', $MODULE)} +
    + +
    +
    +
    - -
    + {/if} {/strip} diff --git a/layouts/vlayout/modules/Vtiger/InventoryDiscountsType1.tpl b/layouts/vlayout/modules/Vtiger/InventoryDiscountsType1.tpl index 3c6062910919..0edf86402a3f 100644 --- a/layouts/vlayout/modules/Vtiger/InventoryDiscountsType1.tpl +++ b/layouts/vlayout/modules/Vtiger/InventoryDiscountsType1.tpl @@ -23,5 +23,5 @@
    - {/if} + {/if} {/strip} diff --git a/layouts/vlayout/modules/Vtiger/InventoryTaxesType0.tpl b/layouts/vlayout/modules/Vtiger/InventoryTaxesType0.tpl index b30450047533..89e0ce5e4927 100644 --- a/layouts/vlayout/modules/Vtiger/InventoryTaxesType0.tpl +++ b/layouts/vlayout/modules/Vtiger/InventoryTaxesType0.tpl @@ -1,20 +1,22 @@ {**} {strip} -
    -
    - {vtranslate('LBL_GLOBAL_TAXS', $MODULE)} -
    - + {if count($GLOBAL_TAXS) > 0} +
    +
    + {vtranslate('LBL_GLOBAL_TAXS', $MODULE)} +
    + +
    +
    +
    - -
    + {/if} {/strip} diff --git a/layouts/vlayout/modules/Vtiger/inventoryfields/EditViewDiscount.tpl b/layouts/vlayout/modules/Vtiger/inventoryfields/EditViewDiscount.tpl index 7178970e7668..89aeed63d9e1 100644 --- a/layouts/vlayout/modules/Vtiger/inventoryfields/EditViewDiscount.tpl +++ b/layouts/vlayout/modules/Vtiger/inventoryfields/EditViewDiscount.tpl @@ -6,7 +6,7 @@ {if $DISCOUNTS_CONFIG['discounts'][0] != ''} - + {vtranslate('LBL_DISCOUNT', $MODULE)} {/if} diff --git a/layouts/vlayout/modules/Vtiger/inventoryfields/EditViewTax.tpl b/layouts/vlayout/modules/Vtiger/inventoryfields/EditViewTax.tpl index 63fb8478404c..c2a64023c119 100644 --- a/layouts/vlayout/modules/Vtiger/inventoryfields/EditViewTax.tpl +++ b/layouts/vlayout/modules/Vtiger/inventoryfields/EditViewTax.tpl @@ -5,7 +5,7 @@ {if $TAXS_CONFIG['taxs'][0] != ''} - + {vtranslate('LBL_TAX', $MODULE)} {/if} diff --git a/modules/Vtiger/inventoryfields/Currency.php b/modules/Vtiger/inventoryfields/Currency.php index 7225a6737ca1..c063576cb4b8 100644 --- a/modules/Vtiger/inventoryfields/Currency.php +++ b/modules/Vtiger/inventoryfields/Currency.php @@ -16,6 +16,7 @@ class Vtiger_Currency_InventoryField extends Vtiger_Basic_InventoryField protected $customColumn = [ 'currencyparam' => 'varchar(200)' ]; + protected $params = ['type']; /** * Geting value to display diff --git a/modules/Vtiger/inventoryfields/Name.php b/modules/Vtiger/inventoryfields/Name.php index 3c7cc015162e..bb9fb7445c9e 100644 --- a/modules/Vtiger/inventoryfields/Name.php +++ b/modules/Vtiger/inventoryfields/Name.php @@ -13,6 +13,7 @@ class Vtiger_Name_InventoryField extends Vtiger_Basic_InventoryField protected $defaultLabel = 'LBL_ITEM_NAME'; protected $columnName = 'name'; protected $dbType = 'int(19) NOT NULL DEFAULT 0'; + protected $params = ['modules', 'limit']; /** * Geting value to display From 8c69f8680198059542ea22760533d2ceb980ede2 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Wed, 2 Sep 2015 15:04:43 +0200 Subject: [PATCH 122/489] Fixed configuration of the modules inventory --- config/version.php | 2 +- .../modules/Settings/Inventory/Modal.tpl | 93 ++++++++++--------- modules/Settings/Inventory/models/Record.php | 2 +- .../Settings/Inventory/views/ModalAjax.php | 2 +- modules/Vtiger/uitypes/InventoryLimit.php | 2 +- 5 files changed, 53 insertions(+), 48 deletions(-) diff --git a/config/version.php b/config/version.php index fbf8e7501bd8..1a2c56fe3eea 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150902'; -$YetiForce_current_version = '2.2.48'; +$YetiForce_current_version = '2.2.49'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/layouts/vlayout/modules/Settings/Inventory/Modal.tpl b/layouts/vlayout/modules/Settings/Inventory/Modal.tpl index a319fca05847..68cdec93d95c 100644 --- a/layouts/vlayout/modules/Settings/Inventory/Modal.tpl +++ b/layouts/vlayout/modules/Settings/Inventory/Modal.tpl @@ -5,52 +5,57 @@ {if empty($ID)} {assign var=EDIT_VIEW value=false} {/if} -
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,c){var i=this;for(var b in c){var a=c[b];var j=a.description;var e=a.unitPriceValues;var d=JSON.stringify(e);for(var g in a.autoFields){k.find("input."+g).val(a.autoFields[g])}var h=i.getCurrency();if(typeof e[h]!=="undefined"){i.setUnitPrice(k,e[h])}$("input.unitPrice",k).attr("list-info",d);$("textarea.commentTextarea",k).val(j)}if(f==="Products"){i.loadSubProducts(k,true)}i.quantityChangeActions(k)},saveDiscountsParameters:function(d,b){var a=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(a.discountModalFields,function(f,g){if($.inArray(g,e)>=0){if(b.find('[name="'+g+'"]:checked').length>1){c[g]=[];b.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=b.find('[name="'+g+'"]:checked').val()}}else{c[g]=b.find('[name="'+g+'"]').val()}});a.setDiscountParam(d,c)},saveTaxsParameters:function(d,b){var a=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(a.taxModalFields,function(f,g){if($.inArray(g,e)>=0){if(b.find('[name="'+g+'"]:checked').length>1){c[g]=[];b.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=b.find('[name="'+g+'"]:checked').val()}}else{c[g]=b.find('[name="'+g+'"]').val()}});a.setTaxParam(d,c)},showExpandedRow:function(e){var d=this;var a=d.getInventoryItemsContainer();var b=a.find('[numrowex="'+e.attr("numrow")+'"]');var c=e.find(".toggleVisibility");c.data("status","1");c.find(".glyphicon").removeClass("glyphicon-menu-down");c.find(".glyphicon").addClass("glyphicon-menu-up");b.removeClass("hide");Vtiger_Edit_Js.getInstance().loadCkEditorElement(b.find(".ckEditorSource"))},hideExpandedRow:function(f){var e=this;var a=e.getInventoryItemsContainer();var b=a.find('[numrowex="'+f.attr("numrow")+'"]');var d=f.find(".toggleVisibility");d.data("status","0");d.find(".glyphicon").removeClass("glyphicon-menu-up");d.find(".glyphicon").addClass("glyphicon-menu-down");b.addClass("hide");var c=CKEDITOR.instances[b.find(".ckEditorSource").attr("id")];if(c){c.destroy()}},initDiscountsParameters:function(d,c){var b=this;var a=d.find(".discountParam").val();if(a==""){return}var a=JSON.parse(a);$.each(b.discountModalFields,function(e,g){var i=a[g];var f=c.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{c.find('[name="'+g+'"]').val(i)}}});b.calculateDiscount(d,c)},initTaxParameters:function(d,c){var b=this;var a=d.find(".taxParam").val();if(a==""){return}var a=JSON.parse(a);$.each(b.taxModalFields,function(e,g){var i=a[g];var f=c.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{c.find('[name="'+g+'"]').val(i)}}});b.calculateTax(d,c)},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#inventoryLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"Inventory",mode:"checkLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#inventoryLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide();console.error(f,g)});return a},currencyChangeActions:function(a,b){var c=this;if(b.data("baseCurrency")==0){c.showCurrencyChangeModal(a,b)}else{c.currencyConvertValues(a,b);a.data("oldValue",a.val())}},showCurrencyChangeModal:function(a,b){var d=this;if(d.lockCurrencyChange==true){return}d.lockCurrencyChange=true;var e=a.closest("[colspan]");var c=e.find(".modelContainer").clone();app.showModalWindow(c,function(h){var g=$(h);var f=JSON.parse(e.find(".currencyparam").val());if(f!=false){g.find(".currencyName").text(b.text());g.find(".currencyRate").val(f[b.val()]["value"]);g.find(".currencyDate").text(f[b.val()]["date"])}g.on("click",'button[type="submit"]',function(l){var j=g.find(".currencyRate").val();var k=app.parseNumberToFloat(j);var i=1/app.parseNumberToFloat(j);b.data("conversionRate",i);f[b.val()]["value"]=k;f[b.val()]["conversion"]=i;e.find(".currencyparam").val(JSON.stringify(f));d.currencyConvertValues(a,b);a.data("oldValue",a.val());app.hideModalWindow();d.lockCurrencyChange=false});g.on("click",'button[type="reset"]',function(i){a.val(a.data("oldValue")).change();d.lockCurrencyChange=false})})},currencyConvertValues:function(a,d){var f=this;var e=a.find('option[value="'+a.data("oldValue")+'"]');var b=d.data("conversionRate");var c=e.data("conversionRate");b=parseFloat(b)/parseFloat(c);this.getInventoryItemsContainer().find(f.rowClass).each(function(g){var h=$(this);f.setUnitPrice(h,app.parseNumberToFloat(f.getUnitPriceValue(h)*b));f.setDiscount(h,app.parseNumberToFloat(f.getDiscount(h)*b));f.setTax(h,app.parseNumberToFloat(f.getTax(h)*b));f.quantityChangeActions(h)})},registerAddItem:function(a){var c=this;var b=this.getInventoryItemsContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackIthemTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.find("tr").appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.initItem(m)})},registerSortableItems:function(){var b=this;var a=b.getInventoryItemsContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(c,d){a.find(b.rowClass).each(function(e,f){var g=$(f);b.hideExpandedRow(g)});d.item.startPos=d.item.index()},stop:function(d,e){var c=$(e.item.context).attr("numrow");var f=a.find(".numRow"+c).remove().clone();a.find('[numrow="'+c+'"]').after(f);if(e.item.startPos1){this.showLineItemsDeleteIcon()}else{this.hideLineItemsDeleteIcon()}},showLineItemsDeleteIcon:function(){this.getInventoryItemsContainer().find(".deleteRow").removeClass("hide")},hideLineItemsDeleteIcon:function(){this.getInventoryItemsContainer().find(".deleteRow").addClass("hide")},getClosestRow:function(a){return a.closest(this.rowClass)},getBasicRow:function(){var a=$("#blackIthemTable tbody").clone(true,true);return a},isRecordSelected:function(b){var c=b.closest("tr");var d=c.find(".recordLabel");var a=d.validationEngine("validate");return a},getTaxModeSelectElement:function(b){var a=this.getInventoryHeadContainer();if(a.find("thead .taxMode").length>0){return $(".taxMode")}return b.find(".taxMode")},isIndividualTaxMode:function(c){var a=this.getTaxModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},isGroupTaxMode:function(){var a=this.getTaxModeSelectElement();var b=a.find("option:selected");if(b.val()=="0"){return true}return false},showIndividualTax:function(d){var c=this;var b=c.getInventorySummaryTaxesContainer().find(".groupTax");var a=c.getInventoryItemsContainer();if(c.isIndividualTaxMode()){b.addClass("hide");a.find(".changeTax").removeClass("hide")}else{b.removeClass("hide");a.find(".changeTax").addClass("hide")}c.setTax(a,0);c.setTaxParam(a,[]);c.rowsCalculations()},getDiscountModeSelectElement:function(b){var a=this.getInventoryHeadContainer();if(a.find("thead .discountMode").length>0){return $(".discountMode")}return b.find(".discountMode")},isIndividualDiscountMode:function(c){var a=this.getDiscountModeSelectElement(c);var b=a.find("option:selected");if(b.val()=="1"){return true}return false},showIndividualDiscount:function(d){var c=this;var a=c.getInventorySummaryDiscountContainer().find(".groupDiscount");var b=c.getInventoryItemsContainer();if(c.isIndividualDiscountMode()){a.addClass("hide");b.find(".changeDiscount").removeClass("hide")}else{a.removeClass("hide");b.find(".changeDiscount").addClass("hide")}c.setDiscount(b,0);c.setDiscountParam(b,[]);c.rowsCalculations()},getCurrency:function(){var a=$('[name="currency"]',this.getInventoryHeadContainer());return a.find("option:selected").val()},getTax:function(a){return app.parseNumberToFloat($(".tax",a).val())},getQuantityValue:function(a){return app.parseNumberToFloat($(".qty",a).val())},getUnitPriceValue:function(a){return app.parseNumberToFloat($(".unitPrice",a).val())},getDiscount:function(a){var b=$(".discount",a).val();if(b==undefined){b=0}return app.parseNumberToFloat(b)},getNetPrice:function(a){return app.parseNumberToFloat($(".netPrice",a).val())},getTotalPrice:function(a){return app.parseNumberToFloat($(".totalPrice",a).val())},getGrossPrice:function(a){return app.parseNumberToFloat($(".grossPrice",a).val())},getPurchase:function(a){var b=this.getQuantityValue(a);return app.parseNumberToFloat($(".purchase",a).val())*b},getSummaryGrossPrice:function(){var b=this;var a=0;this.getInventoryItemsContainer().find(b.rowClass).each(function(c){a+=b.getGrossPrice($(this))});return app.parseNumberToFloat(a)},setUnitPrice:function(b,a){a=app.parseNumberToShow(a);b.find(".unitPrice").val(a).attr("title",a);return this},setNetPrice:function(b,a){a=app.parseNumberToShow(a);$(".netPriceText",b).text(a);$(".netPrice",b).val(a)},setGrossPrice:function(b,a){a=app.parseNumberToShow(a);$(".grossPriceText",b).text(a);$(".grossPrice",b).val(a)},setTotalPrice:function(b,a){a=app.parseNumberToShow(a);$(".totalPriceText",b).text(a);$(".totalPrice",b).val(a)},setMargin:function(b,a){a=app.parseNumberToShow(a);$(".margin",b).val(a)},setMarginP:function(b,a){a=app.parseNumberToShow(a);$(".marginp",b).val(a)},setDiscount:function(b,a){a=app.parseNumberToShow(a);$(".discount",b).val(a)},setDiscountParam:function(b,a){$(".discountParam",b).val(JSON.stringify(a))},setTax:function(b,a){a=app.parseNumberToShow(a);$(".tax",b).val(a)},setTaxParam:function(b,a){$(".taxParam",b).val(JSON.stringify(a))},quantityChangeActions:function(a){this.rowCalculations(a);this.summaryCalculations()},rowCalculations:function(a){this.calculateTotalPrice(a);this.calculateNetPrice(a);this.calculateGrossPrice(a);this.calculateMargin(a)},rowsCalculations:function(){var a=this;this.getInventoryItemsContainer().find(a.rowClass).each(function(b){a.quantityChangeActions($(this))})},summaryCalculations:function(){var a=this;a.getInventoryItemsContainer().find("tfoot .wisableTd").each(function(b){a.calculatSummary($(this),$(this).data("sumfield"))});a.calculatDiscountSummary();a.calculatTaxSummary();a.calculatCurrenciesSummary()},calculatSummary:function(a,d){var c=this;var b=0;this.getInventoryItemsContainer().find(c.rowClass).each(function(e){b+=app.parseNumberToFloat($(this).find("."+d).val())});a.text(app.parseNumberToShow(b))},calculatDiscountSummary:function(){var b=this;var c=b.getAllDiscount();var a=b.getInventorySummaryDiscountContainer();a.find("input").val(app.parseNumberToShow(c))},getAllDiscount:function(){var a=this;var b=0;this.getInventoryItemsContainer().find(a.rowClass).each(function(d){var e=$(this);var c=a.getDiscount(e);b+=c});return b},calculatCurrenciesSummary:function(){var g=this;var a=g.getInventorySummaryCurrenciesContainer();var f=$('[name="currency"] option:selected',g.getInventoryHeadContainer());var h=$('[name="currency"] option[data-base-currency="1"]',g.getInventoryHeadContainer());var b=f.data("conversionRate");var e=h.data("conversionRate");if(b==e){a.addClass("hide");return}b=parseFloat(e)/parseFloat(b);a.removeClass("hide");var c=g.getAllTaxs();var d=0;a.find(".panel-body").html("");$.each(c,function(i,j){if(j!=undefined){j=j*b;var k=a.find(".hide .form-group").clone();k.find(".percent").text(i+"%");k.find("input").val(app.parseNumberToShow(j));k.appendTo(a.find(".panel-body"));d+=j}});a.find(".panel-footer input").val(app.parseNumberToShow(d))},calculatTaxSummary:function(){var d=this;var b=d.getAllTaxs();var a=d.getInventorySummaryTaxesContainer();a.find(".panel-body").html("");var c=0;$.each(b,function(e,f){if(f!=undefined){var g=a.find(".hide .form-group").clone();g.find(".percent").text(e+"%");g.find("input").val(app.parseNumberToShow(f));g.appendTo(a.find(".panel-body"));c+=f}});a.find(".panel-footer input").val(app.parseNumberToShow(c))},getAllTaxs:function(){var b=this;var a=[];this.getInventoryItemsContainer().find(b.rowClass).each(function(c){var f=$(this);var g=b.getNetPrice(f);var e=f.find(".taxParam").val();if(e!=""&&e!="[]"){var d=$.parseJSON(e);if(typeof d.aggregationType=="string"){d.aggregationType=[d.aggregationType]}$.each(d.aggregationType,function(k,j){var j=j+"Tax";var i=d[j];var h=0;if(a[i]!=undefined){h=parseFloat(a[i])}a[i]=h+g*(i/100)})}});return a},calculateNetPrice:function(a){var b=this.getTotalPrice(a)-this.getDiscount(a);this.setNetPrice(a,b)},calculateGrossPrice:function(b){var c=this.getNetPrice(b);if(this.isIndividualTaxMode(b)){var a=this.getTax(b);c+=a}this.setGrossPrice(b,c)},calculateTotalPrice:function(b){var a=this.getQuantityValue(b)*this.getUnitPriceValue(b);this.setTotalPrice(b,a)},calculateMargin:function(d){var e=this.getNetPrice(d);var b=this.getPurchase(d);var c=e-b;this.setMargin(d,c);var a="0";if(b!==0){a=(c/b)*100}this.setMarginP(d,a)},calculateDiscount:function(j,h){var d=app.parseNumberToFloat(h.find(".valueTotalPrice").text()),b=d,k=0,e=0,f=0,a=0;var i=h.find(".discountsType").val();if(i=="0"||i=="1"){if(h.find(".activepanel .globalDiscount").length>0){var k=app.parseNumberToFloat(h.find(".activepanel .globalDiscount").val())}if(h.find(".activepanel .individualDiscountType").length>0){var c=h.find(".activepanel .individualDiscountType:checked").val();var g=h.find(".activepanel .individualDiscountValue").val();if(c=="percentage"){f=d*(g/100)}else{f=g}}if(h.find(".activepanel .groupCheckbox").length>0&&h.find(".activepanel .groupCheckbox").prop("checked")==true){var e=app.parseNumberToFloat(h.find(".groupValue").val());e=d*(e/100)}b=b*((100-k)/100);b=b-app.parseNumberToFloat(f);b=b-e}else{if(i=="2"){h.find(".activepanel").each(function(n){var m=$(this);if(m.find(".globalDiscount").length>0){var o=app.parseNumberToFloat(m.find(".globalDiscount").val());b=b*((100-o)/100)}else{if(m.find(".groupCheckbox").length>0&&m.find(".groupCheckbox").prop("checked")==true){var l=app.parseNumberToFloat(m.find(".groupValue").val());b=b*((100-l)/100)}else{if(m.find(".individualDiscountType").length>0){var p=app.parseNumberToFloat(m.find(".individualDiscountValue").val());if(m.find('.individualDiscountType[name="individual"]:checked').val()=="percentage"){b=b*((100-p)/100)}else{b=b-p}}}}})}}h.find(".valuePrices").text(app.parseNumberToShow(b));h.find(".valueDiscount").text(app.parseNumberToShow(d-b))},calculateTax:function(k,j){var g=app.parseNumberToFloat(j.find(".valueNetPrice").text()),b=g,c=0,f=0,a=0,h=0,e=0;var d=j.find(".taxsType").val();if(d=="0"||d=="1"){if(j.find(".activepanel .globalTax").length>0){var c=j.find(".activepanel .globalTax").val()}if(j.find(".activepanel .individualTaxValue").length>0){var i=app.parseNumberToFloat(j.find(".activepanel .individualTaxValue").val());h=(i/100)*b}if(j.find(".activepanel .groupTax").length>0){var f=app.parseNumberToFloat(j.find(".groupTax").val());f=g*(app.parseNumberToFloat(f)/100)}if(j.find(".activepanel .regionalTax").length>0){var a=app.parseNumberToFloat(j.find(".regionalTax").val());a=g*(app.parseNumberToFloat(a)/100)}b=b*((100+app.parseNumberToFloat(c))/100);b=b+app.parseNumberToFloat(h);b=b+app.parseNumberToFloat(f);b=b+app.parseNumberToFloat(a)}else{if(d=="2"){j.find(".activepanel").each(function(p){var l=$(this);if(l.find(".globalTax").length>0){var o=app.parseNumberToFloat(l.find(".globalTax").val());b=b*((100+o)/100)}else{if(l.find(".groupTax").length>0){var n=app.parseNumberToFloat(l.find(".groupTax").val());b=b*((100+n)/100)}else{if(l.find(".regionalTax").length>0){var m=app.parseNumberToFloat(l.find(".regionalTax").val());b=b*((100+m)/100)}else{if(l.find(".individualTaxValue").length>0){var q=app.parseNumberToFloat(l.find(".individualTaxValue").val());b=((q+100)/100)*b}}}}})}}j.find(".valuePrices").text(app.parseNumberToShow(b));j.find(".valueTax").text(app.parseNumberToShow(b-g))},updateRowSequence:function(){var a=this.getInventoryItemsContainer();a.find(this.rowClass).each(function(b){$(this).find(".sequence").val(b+1)})},registerInventorySaveData:function(a){var b=this;a.on(Vtiger_Edit_Js.recordPreSave,function(f,d){if(!b.checkLimits(a)){return false}var c=a.find("#blackIthemTable");c.find("[name]").removeAttr("name")})},pricebooksPopupHandler:function(a){var d=this;var c=a.closest(this.rowClass);var b=c.find(".rowName");var e={};e.module="PriceBooks";e.src_module=$('[name="popupReferenceModule"]',b).val();e.src_record=$(".sourceField",b).val();e.src_field=$('[name="popupReferenceModule"]',b).data("field");e.get_url="getProductUnitPriceURL";e.currency_id=d.getCurrency();this.showPopup(e).then(function(g){var f=JSON.parse(g);for(var h in f){d.setUnitPrice(c,f[h])}d.quantityChangeActions(d.getClosestRow(b))})},showPopup:function(c){var a=$.Deferred();var b=Vtiger_Popup_Js.getInstance();b.show(c,function(d){a.resolve(d)});return a.promise()},subProductsCashe:[],loadSubProducts:function(g,a){var d=this;var c=jQuery("input.sourceField",g).val();var e=g.find('.rowName input[name="popupReferenceModule"]').val();d.removeSubProducts(g);if(c=="0"||$.inArray(e,["Products","Services"])<0){return false}if(d.subProductsCashe[c]){d.addSubProducts(g,d.subProductsCashe[c]);return false}var f={module:"Products",action:"SubProducts",record:c};if(a){var b=jQuery.progressIndicator()}AppConnector.request(f).then(function(i){var h=i.result;d.subProductsCashe[c]=h;d.addSubProducts(g,h);if(b){b.hide()}},function(h,i){if(b){b.hide()}console.error(h,i)})},removeSubProducts:function(a){var b=$(".subProductsContainer ul",a);b.find("li").remove()},addSubProducts:function(c,b){var e=$(".subProductsContainer ul",c);for(var d in b){var a=$("
  • ").text(b[d]);e.append(a)}},mapResultsToFields:function(f,k,c){var i=this;for(var b in c){var a=c[b];var j=a.description;var e=a.unitPriceValues;var d=JSON.stringify(e);for(var g in a.autoFields){k.find("input."+g).val(a.autoFields[g])}var h=i.getCurrency();if(typeof e[h]!=="undefined"){i.setUnitPrice(k,e[h])}else{i.setUnitPrice(k,a.price)}$("input.unitPrice",k).attr("list-info",d);$("textarea.commentTextarea",k).val(j)}if(f==="Products"){i.loadSubProducts(k,true)}i.quantityChangeActions(k)},saveDiscountsParameters:function(d,b){var a=this;var c={};var e=["aggregationType","groupCheckbox","individualDiscountType"];$.each(a.discountModalFields,function(f,g){if($.inArray(g,e)>=0){if(b.find('[name="'+g+'"]:checked').length>1){c[g]=[];b.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=b.find('[name="'+g+'"]:checked').val()}}else{c[g]=b.find('[name="'+g+'"]').val()}});a.setDiscountParam(d,c)},saveTaxsParameters:function(d,b){var a=this;var c={};var e=["aggregationType","groupCheckbox","individualTaxType"];$.each(a.taxModalFields,function(f,g){if($.inArray(g,e)>=0){if(b.find('[name="'+g+'"]:checked').length>1){c[g]=[];b.find('[name="'+g+'"]:checked').each(function(h){c[g].push($(this).val())})}else{c[g]=b.find('[name="'+g+'"]:checked').val()}}else{c[g]=b.find('[name="'+g+'"]').val()}});a.setTaxParam(d,c)},showExpandedRow:function(e){var d=this;var a=d.getInventoryItemsContainer();var b=a.find('[numrowex="'+e.attr("numrow")+'"]');var c=e.find(".toggleVisibility");c.data("status","1");c.find(".glyphicon").removeClass("glyphicon-menu-down");c.find(".glyphicon").addClass("glyphicon-menu-up");b.removeClass("hide");Vtiger_Edit_Js.getInstance().loadCkEditorElement(b.find(".ckEditorSource"))},hideExpandedRow:function(f){var e=this;var a=e.getInventoryItemsContainer();var b=a.find('[numrowex="'+f.attr("numrow")+'"]');var d=f.find(".toggleVisibility");d.data("status","0");d.find(".glyphicon").removeClass("glyphicon-menu-up");d.find(".glyphicon").addClass("glyphicon-menu-down");b.addClass("hide");var c=CKEDITOR.instances[b.find(".ckEditorSource").attr("id")];if(c){c.destroy()}},initDiscountsParameters:function(d,c){var b=this;var a=d.find(".discountParam").val();if(a==""){return}var a=JSON.parse(a);$.each(b.discountModalFields,function(e,g){var i=a[g];var f=c.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{c.find('[name="'+g+'"]').val(i)}}});b.calculateDiscount(d,c)},initTaxParameters:function(d,c){var b=this;var a=d.find(".taxParam").val();if(a==""){return}var a=JSON.parse(a);$.each(b.taxModalFields,function(e,g){var i=a[g];var f=c.find('[name="'+g+'"]');if(f.attr("type")=="checkbox"||f.attr("type")=="radio"){var h=i;if(!$.isArray(h)){h=[h]}$.each(h,function(j,k){var l=f.filter('[value="'+k+'"]').prop("checked",true);if(g=="aggregationType"){l.closest(".panel").find(".panel-body").show();l.closest(".panel").addClass("activepanel")}})}else{if(f.prop("tagName")=="SELECT"){f.find('option[value="'+i+'"]').prop("selected","selected").change()}else{c.find('[name="'+g+'"]').val(i)}}});b.calculateTax(d,c)},limitEnableSave:false,checkLimits:function(){var c=this;var d=c.getAccountId();var a=true;if(d==""||$("#inventoryLimit").val()=="0"||c.limitEnableSave){return true}var e={};e.data={module:app.getModuleName(),action:"Inventory",mode:"checkLimits",record:d,currency:c.getCurrency(),price:c.getSummaryGrossPrice(),limitConfig:$("#inventoryLimit").val(),};e.async=false;e.dataType="json";var b=jQuery.progressIndicator();AppConnector.request(e).then(function(f){b.hide();var g=c.getForm();if(f.result.status==false){app.showModalWindow(f.result.html,function(h){h.find(".enableSave").on("click",function(j,i){c.limitEnableSave=true;g.submit();app.hideModalWindow()})});a=false}},function(f,g){b.hide();console.error(f,g)});return a},currencyChangeActions:function(a,b){var c=this;if(b.data("baseCurrency")==0){c.showCurrencyChangeModal(a,b)}else{c.currencyConvertValues(a,b);a.data("oldValue",a.val())}},showCurrencyChangeModal:function(a,b){var d=this;if(d.lockCurrencyChange==true){return}d.lockCurrencyChange=true;var e=a.closest("[colspan]");var c=e.find(".modelContainer").clone();app.showModalWindow(c,function(h){var g=$(h);var f=JSON.parse(e.find(".currencyparam").val());if(f!=false){g.find(".currencyName").text(b.text());g.find(".currencyRate").val(f[b.val()]["value"]);g.find(".currencyDate").text(f[b.val()]["date"])}g.on("click",'button[type="submit"]',function(l){var j=g.find(".currencyRate").val();var k=app.parseNumberToFloat(j);var i=1/app.parseNumberToFloat(j);b.data("conversionRate",i);f[b.val()]["value"]=k;f[b.val()]["conversion"]=i;e.find(".currencyparam").val(JSON.stringify(f));d.currencyConvertValues(a,b);a.data("oldValue",a.val());app.hideModalWindow();d.lockCurrencyChange=false});g.on("click",'button[type="reset"]',function(i){a.val(a.data("oldValue")).change();d.lockCurrencyChange=false})})},currencyConvertValues:function(a,d){var f=this;var e=a.find('option[value="'+a.data("oldValue")+'"]');var b=d.data("conversionRate");var c=e.data("conversionRate");b=parseFloat(b)/parseFloat(c);this.getInventoryItemsContainer().find(f.rowClass).each(function(g){var h=$(this);f.setUnitPrice(h,app.parseNumberToFloat(f.getUnitPriceValue(h)*b));f.setDiscount(h,app.parseNumberToFloat(f.getDiscount(h)*b));f.setTax(h,app.parseNumberToFloat(f.getTax(h)*b));f.quantityChangeActions(h)})},registerAddItem:function(a){var c=this;var b=this.getInventoryItemsContainer();a.find(".btn-toolbar .addButton").on("click",function(h,f){var l=a.find("#blackIthemTable");var m=c.getBasicRow();var i=c.getNextLineItemRowNumber();var d=$(h.currentTarget).data("module");var j=$(h.currentTarget).data("field");var g=$(h.currentTarget).data("wysiwyg");var k=m.html().replace(/_NUM_/g,i);m.html(k);m=m.find("tr").appendTo(b.find("tbody"));m.find('.rowName input[name="popupReferenceModule"]').val(d).data("field",j);c.initItem(m)})},registerSortableItems:function(){var b=this;var a=b.getInventoryItemsContainer();a.sortable({handle:".dragHandle",items:b.rowClass,revert:true,tolerance:"pointer",placeholder:"ui-state-highlight",helper:function(d,c){c.children().each(function(e,f){f=$(f);f.width(f.width())});return c},start:function(c,d){a.find(b.rowClass).each(function(e,f){var g=$(f);b.hideExpandedRow(g)});d.item.startPos=d.item.index()},stop:function(d,e){var c=$(e.item.context).attr("numrow");var f=a.find(".numRow"+c).remove().clone();a.find('[numrow="'+c+'"]').after(f);if(e.item.startPos Date: Thu, 3 Sep 2015 09:28:47 +0200 Subject: [PATCH 133/489] Inventory module - Added comments --- modules/Vtiger/models/Inventory.php | 37 ++++++++++++++++- modules/Vtiger/models/InventoryField.php | 53 +++++++++++++++++++++++- modules/Vtiger/models/Record.php | 1 - 3 files changed, 86 insertions(+), 5 deletions(-) diff --git a/modules/Vtiger/models/Inventory.php b/modules/Vtiger/models/Inventory.php index 9ad845ec5ee1..4c20b495e3e6 100644 --- a/modules/Vtiger/models/Inventory.php +++ b/modules/Vtiger/models/Inventory.php @@ -9,6 +9,11 @@ class Vtiger_Inventory_Model { + /** + * Get invnetory instance + * @param string $moduleName Module name + * @return Vtiger_Inventory_Model instance + */ public static function getInstance($moduleName) { $instance = Vtiger_Cache::get('Inventory', $moduleName); @@ -22,6 +27,10 @@ public static function getInstance($moduleName) protected static $discountsConfig = false; + /** + * Get discounts configuration + * @return array config data + */ public static function getDiscountsConfig() { if (self::$discountsConfig != false) { @@ -42,6 +51,10 @@ public static function getDiscountsConfig() return $config; } + /** + * Get global giscounts list + * @return array giscounts list + */ public function getGlobalDiscounts() { $db = PearDatabase::getInstance(); @@ -55,6 +68,10 @@ public function getGlobalDiscounts() protected static $taxsConfig = false; + /** + * Get tax configuration + * @return array config data + */ public static function getTaxesConfig() { if (self::$taxsConfig != false) { @@ -75,6 +92,10 @@ public static function getTaxesConfig() return $config; } + /** + * Get global tax list + * @return array tax list + */ public function getGlobalTaxs() { $db = PearDatabase::getInstance(); @@ -85,7 +106,13 @@ public function getGlobalTaxs() } return $config; } - + + /** + * Get discount from the account + * @param string $moduleName Module name + * @param int $record Record ID + * @return array + */ public function getAccountDiscount($moduleName, $record) { $inventoryField = Vtiger_InventoryField_Model::getInstance($moduleName); @@ -105,7 +132,13 @@ public function getAccountDiscount($moduleName, $record) return ['discount' => $discount, 'name' => $name]; } - + + /** + * Get tax from the account + * @param string $moduleName Module name + * @param int $record Record ID + * @return array + */ public function getAccountTax($moduleName, $record) { $inventoryField = Vtiger_InventoryField_Model::getInstance($moduleName); diff --git a/modules/Vtiger/models/InventoryField.php b/modules/Vtiger/models/InventoryField.php index 8a22093ba9ab..461758643a20 100644 --- a/modules/Vtiger/models/InventoryField.php +++ b/modules/Vtiger/models/InventoryField.php @@ -79,6 +79,11 @@ public function getFields($returnInBlock = false) return $fields; } + /** + * Check whether this field is active + * @param array $row Field entry from the database + * @return boolean + */ public function isActiveField($row) { if (in_array($row['suptype'], ['Discount', 'DiscountMode'])) { @@ -92,10 +97,10 @@ public function isActiveField($row) } /** - * Loading the Inventory data + * Get inventory columns * @param string $module Module name * @param boolean $returnInBlock Should the result be divided into blocks - * @return array Inventory data + * @return array Inventory columns */ public function getColumns() { @@ -187,6 +192,11 @@ public static function getMainParams($fields) return $params; } + /** + * Get Vtiger_InventoryField_Model instance + * @param string $moduleName Module name + * @return \modelClassName Vtiger_InventoryField_Model Instance + */ public static function getInstance($moduleName) { $instance = Vtiger_Cache::get('inventoryField', $moduleName); @@ -199,6 +209,11 @@ public static function getInstance($moduleName) return $instance; } + /** + * Get fields to auto-completion + * @param string $moduleName + * @return array + */ public function getAutoCompleteField($moduleName) { $db = PearDatabase::getInstance(); @@ -215,6 +230,13 @@ public function getAutoCompleteField($moduleName) return $fields; } + /** + * Get configuration parameters for taxes + * @param string $taxParam String parameters json encode + * @param int $net net price + * @param array $return + * @return array + */ public static function getTaxParam($taxParam, $net, $return = false) { $taxParam = json_decode($taxParam, true); @@ -234,6 +256,11 @@ public static function getTaxParam($taxParam, $net, $return = false) return $return; } + /** + * Get related field name + * @param string $mainModule Module Name + * @return string + */ public function getReferenceField($mainModule = 'Accounts') { $relationField = $this->get('relationField' . $mainModule); @@ -254,6 +281,11 @@ public function getReferenceField($mainModule = 'Accounts') return $relationField; } + /** + * Whether the module should be turned on Wysiwyg + * @param string $moduleName Module Name + * @return boolean|int + */ public function isWysiwygType($moduleName) { if (!$moduleName) { @@ -273,6 +305,11 @@ public function isWysiwygType($moduleName) return $return; } + /** + * Get field name for the module taxes + * @param string $moduleName Module name + * @return string Tax field name + */ public function getTaxField($moduleName) { $cache = Vtiger_Cache::get('InventoryIsGetTaxField', $moduleName); @@ -295,6 +332,13 @@ public function getTaxField($moduleName) return $return; } + /** + * Get the value to save + * @param Vtiger_Request $request + * @param string $field Field name + * @param int $i Sequence number + * @return string + */ public function getValueForSave(Vtiger_Request $request, $field, $i) { $value = ''; @@ -313,6 +357,11 @@ public function getValueForSave(Vtiger_Request $request, $field, $i) return $value; } + /** + * Creating a new field + * @param string $type + * @param array $params + */ public function addField($type, $params) { $adb = PearDatabase::getInstance(); diff --git a/modules/Vtiger/models/Record.php b/modules/Vtiger/models/Record.php index 8454672f5ef5..b475c246a94c 100644 --- a/modules/Vtiger/models/Record.php +++ b/modules/Vtiger/models/Record.php @@ -571,7 +571,6 @@ public function getInventoryData() /** * Save the inventory data - * @param Vtiger_Request $request */ public function saveInventoryData() { From 113ac88af260ccf55b567f87d1c9dab443e3204c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Skrzypczak?= Date: Thu, 3 Sep 2015 09:30:17 +0200 Subject: [PATCH 134/489] Added a symbol to the value fields in panels in Extended Modules block in configuration. --- config/version.php | 2 +- languages/de_de/Settings/Inventory.php | 1 + languages/en_us/Settings/Inventory.php | 1 + languages/nl_nl/Settings/Inventory.php | 1 + languages/pl_pl/Settings/Inventory.php | 1 + languages/pt_br/Settings/Inventory.php | 1 + languages/ru_ru/Settings/Inventory.php | 1 + .../modules/Settings/Inventory/Index.tpl | 6 +++++- .../modules/Settings/Inventory/Modal.tpl | 13 +++++++++---- .../Settings/Inventory/resources/Index.js | 18 +++++++++++++++--- .../Settings/Inventory/resources/Index.min.js | 2 +- .../Settings/Inventory/views/CreditLimits.php | 1 + modules/Settings/Inventory/views/ModalAjax.php | 1 + 13 files changed, 39 insertions(+), 10 deletions(-) diff --git a/config/version.php b/config/version.php index e617e6c4f18d..aca91135c702 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150903'; -$YetiForce_current_version = '2.2.54'; +$YetiForce_current_version = '2.2.55'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/languages/de_de/Settings/Inventory.php b/languages/de_de/Settings/Inventory.php index 41b471ea143f..1d288f163ec4 100644 --- a/languages/de_de/Settings/Inventory.php +++ b/languages/de_de/Settings/Inventory.php @@ -17,6 +17,7 @@ 'LBL_DISCOUNTS_SINGLE' => 'Discount', 'LBL_DISCOUNTS' => 'Discounts', 'LBL_DISCOUNTS_DESCRIPTION' => ' ', + 'LBL_DELETE_OK' => 'Successfully removed the value', ]; $jsLanguageStrings = [ 'JS_SAVE_CHANGES' => 'Changes saved successfully.', diff --git a/languages/en_us/Settings/Inventory.php b/languages/en_us/Settings/Inventory.php index 41b471ea143f..1d288f163ec4 100644 --- a/languages/en_us/Settings/Inventory.php +++ b/languages/en_us/Settings/Inventory.php @@ -17,6 +17,7 @@ 'LBL_DISCOUNTS_SINGLE' => 'Discount', 'LBL_DISCOUNTS' => 'Discounts', 'LBL_DISCOUNTS_DESCRIPTION' => ' ', + 'LBL_DELETE_OK' => 'Successfully removed the value', ]; $jsLanguageStrings = [ 'JS_SAVE_CHANGES' => 'Changes saved successfully.', diff --git a/languages/nl_nl/Settings/Inventory.php b/languages/nl_nl/Settings/Inventory.php index 41b471ea143f..1d288f163ec4 100644 --- a/languages/nl_nl/Settings/Inventory.php +++ b/languages/nl_nl/Settings/Inventory.php @@ -17,6 +17,7 @@ 'LBL_DISCOUNTS_SINGLE' => 'Discount', 'LBL_DISCOUNTS' => 'Discounts', 'LBL_DISCOUNTS_DESCRIPTION' => ' ', + 'LBL_DELETE_OK' => 'Successfully removed the value', ]; $jsLanguageStrings = [ 'JS_SAVE_CHANGES' => 'Changes saved successfully.', diff --git a/languages/pl_pl/Settings/Inventory.php b/languages/pl_pl/Settings/Inventory.php index 1825a6a6df66..549790e02815 100644 --- a/languages/pl_pl/Settings/Inventory.php +++ b/languages/pl_pl/Settings/Inventory.php @@ -17,6 +17,7 @@ 'LBL_DISCOUNTS_SINGLE' => 'rabat', 'LBL_DISCOUNTS' => 'Rabaty', 'LBL_DISCOUNTS_DESCRIPTION' => ' ', + 'LBL_DELETE_OK' => 'Pomyślnie usunięto wartość', ]; $jsLanguageStrings = [ 'JS_SAVE_CHANGES' => 'Pomyślnie zapisano zmiany.', diff --git a/languages/pt_br/Settings/Inventory.php b/languages/pt_br/Settings/Inventory.php index 41b471ea143f..1d288f163ec4 100644 --- a/languages/pt_br/Settings/Inventory.php +++ b/languages/pt_br/Settings/Inventory.php @@ -17,6 +17,7 @@ 'LBL_DISCOUNTS_SINGLE' => 'Discount', 'LBL_DISCOUNTS' => 'Discounts', 'LBL_DISCOUNTS_DESCRIPTION' => ' ', + 'LBL_DELETE_OK' => 'Successfully removed the value', ]; $jsLanguageStrings = [ 'JS_SAVE_CHANGES' => 'Changes saved successfully.', diff --git a/languages/ru_ru/Settings/Inventory.php b/languages/ru_ru/Settings/Inventory.php index 41b471ea143f..1d288f163ec4 100644 --- a/languages/ru_ru/Settings/Inventory.php +++ b/languages/ru_ru/Settings/Inventory.php @@ -17,6 +17,7 @@ 'LBL_DISCOUNTS_SINGLE' => 'Discount', 'LBL_DISCOUNTS' => 'Discounts', 'LBL_DISCOUNTS_DESCRIPTION' => ' ', + 'LBL_DELETE_OK' => 'Successfully removed the value', ]; $jsLanguageStrings = [ 'JS_SAVE_CHANGES' => 'Changes saved successfully.', diff --git a/layouts/vlayout/modules/Settings/Inventory/Index.tpl b/layouts/vlayout/modules/Settings/Inventory/Index.tpl index 356040f147be..dcd8105ad6e1 100644 --- a/layouts/vlayout/modules/Settings/Inventory/Index.tpl +++ b/layouts/vlayout/modules/Settings/Inventory/Index.tpl @@ -1,5 +1,9 @@ {**} {strip} +{if $VIEW == 'CreditLimits'} + {assign var=CURRENCY_BOOL value=true} + +{/if}
    @@ -24,7 +28,7 @@ {foreach item=RECORD from=$INVENTORY_DATA} - {$RECORD->getValue()}{if $VIEW != 'CreditLimits'}%{/if} + {$RECORD->getValue()} {if !$CURRENCY_BOOL}%{else}{$CURRENCY.currency_symbol}{/if} getStatus()}checked{/if} />
      diff --git a/layouts/vlayout/modules/Settings/Inventory/Modal.tpl b/layouts/vlayout/modules/Settings/Inventory/Modal.tpl index 68cdec93d95c..3e82ac851f46 100644 --- a/layouts/vlayout/modules/Settings/Inventory/Modal.tpl +++ b/layouts/vlayout/modules/Settings/Inventory/Modal.tpl @@ -5,6 +5,9 @@ {if empty($ID)} {assign var=EDIT_VIEW value=false} {/if} + {if $TYPE != 'CreditLimits'} + {assign var=PERCENTAGE value=true} + {/if} {if $EDIT_VIEW}
    diff --git a/layouts/vlayout/modules/Settings/Inventory/resources/Index.js b/layouts/vlayout/modules/Settings/Inventory/resources/Index.js index 9bbe33a886e6..b763f48d2c7d 100644 --- a/layouts/vlayout/modules/Settings/Inventory/resources/Index.js +++ b/layouts/vlayout/modules/Settings/Inventory/resources/Index.js @@ -109,11 +109,17 @@ jQuery.Class("Settings_Inventory_Index_Js", {}, { */ addDetails: function (details) { var container = jQuery('#inventory'); + var currency = jQuery('#currency'); + var symbol = '%'; + if (currency.length > 0) { + var currency = JSON.parse(currency.val()); + symbol = currency.currency_symbol; + } var table = jQuery('.inventoryTable', container); var trElement = jQuery('\n\ \n\ - ' + details.value + '\n\ + ' + details.value + ' ' + symbol + '\n\ \n\
    \n\ \n\ @@ -128,8 +134,14 @@ jQuery.Class("Settings_Inventory_Index_Js", {}, { * Function to update the details in the list after edit */ updateDetails: function (data, currentTrElement) { + var currency = jQuery('#currency'); + var symbol = '%'; + if (currency.length > 0) { + var currency = JSON.parse(currency.val()); + symbol = currency.currency_symbol; + } currentTrElement.find('.name').text(data['name']); - currentTrElement.find('.value').text(data['value']); // + % + currentTrElement.find('.value').text(data['value'] + ' ' + symbol); if (data['status'] == '0') { currentTrElement.find('.status').prop('checked', true); } else { @@ -311,7 +323,7 @@ jQuery.Class("Settings_Inventory_Index_Js", {}, { }); -jQuery(document).ready(function(e){ +jQuery(document).ready(function (e) { var instance = new Settings_Inventory_Index_Js(); instance.registerEvents(); }) diff --git a/layouts/vlayout/modules/Settings/Inventory/resources/Index.min.js b/layouts/vlayout/modules/Settings/Inventory/resources/Index.min.js index 8fd5f1b1f9b7..7c385a426ddb 100644 --- a/layouts/vlayout/modules/Settings/Inventory/resources/Index.min.js +++ b/layouts/vlayout/modules/Settings/Inventory/resources/Index.min.js @@ -1,2 +1,2 @@ -jQuery.Class("Settings_Inventory_Index_Js",{},{duplicateCheckCache:{},edit:function(c,a){var b=jQuery.Deferred();var d=this;var e=jQuery.progressIndicator({position:"html",blockInfo:{enabled:true}});AppConnector.request(c).then(function(g){var f=function(i){d.duplicateCheckCache={};var h=jQuery("#formInventory");var j=app.validationEngineOptions;j.onValidationComplete=function(l,k){if(k){d.saveDetails(l,a);return k}};h.validationEngine(j);h.submit(function(k){k.preventDefault()})};e.progressIndicator({mode:"hide"});app.showModalWindow(g,function(h){if(typeof f=="function"){f(h)}},{})},function(f){b.reject(f)});return b.promise()},saveDetails:function(c,a){var b=this;var e=c.serializeFormData();var d=c.find('[type="submit"]');d.prop("disabled",true);if(typeof e=="undefined"){e={}}b.validateName(e).then(function(f){if(typeof f=="undefined"){d.prop("disabled",false);return false}var g=jQuery.progressIndicator({position:"html",blockInfo:{enabled:true}});e.module=app.getModuleName();e.parent=app.getParentModuleName();e.action="SaveAjax";e.view=app.getViewName();AppConnector.request(e).then(function(h){g.progressIndicator({mode:"hide"});app.hideModalWindow();if(typeof h=="string"){h=JSON.parse(h)}if(c.find(".addView").val()=="true"){b.addDetails(h.result)}else{b.updateDetails(h.result,a)}var i={text:app.vtranslate("JS_SAVE_CHANGES")};Settings_Vtiger_Index_Js.showMessage(i)})},function(g,f){d.prop("disabled",false);return false})},addDetails:function(b){var a=jQuery("#inventory");var c=jQuery(".inventoryTable",a);var d=jQuery('\n \n '+b.value+'\n \n \n ');c.append(d)},updateDetails:function(b,a){a.find(".name").text(b.name);a.find(".value").text(b.value);if(b.status=="0"){a.find(".status").prop("checked",true)}else{a.find(".status").prop("checked",false)}},validateName:function(g){var f=this;var b=jQuery.Deferred();var c=g.name;var e=jQuery("#formInventory");var d=e.find('[name="name"]');if(!(c in f.duplicateCheckCache)){f.checkDuplicateName(g).then(function(h){f.duplicateCheckCache[c]=h.success;if(h.success){f.duplicateCheckCache.message=h.message;d.validationEngine("showPrompt",h.message,"error","bottomLeft",true);b.reject(h)}b.resolve(h)},function(i,h){b.reject(i)})}else{if(f.duplicateCheckCache[c]==true){var a=f.duplicateCheckCache.message;d.validationEngine("showPrompt",a,"error","bottomLeft",true);b.reject()}else{b.resolve()}}return b.promise()},checkDuplicateName:function(d){var a=jQuery.Deferred();var c=d.name;var f=d.id;var b=app.getModuleName();var e={module:b,parent:app.getParentModuleName(),action:"SaveAjax",mode:"checkDuplicateName",name:c,id:f,view:app.getViewName()};AppConnector.request(e).then(function(i){if(typeof i=="string"){i=JSON.parse(i)}var h=i.result;var g=h.success;a.resolve(h)},function(g,h){a.reject()});return a.promise()},updateStatus:function(e){var c=jQuery.Deferred();var a=e.closest("tr");var g=a.data("id");var b=e.is(":checked")?0:1;var d=jQuery.progressIndicator({position:"html",blockInfo:{enabled:true}});var f={module:app.getModuleName(),parent:app.getParentModuleName(),action:"SaveAjax",id:g,view:app.getViewName(),status:b};AppConnector.request(f).then(function(h){d.progressIndicator({mode:"hide"});c.resolve(h)},function(h,i){d.progressIndicator({mode:"hide"});c.reject(h)});return c.promise()},removeInventory:function(a){var c=this;var b=app.vtranslate("JS_DELETE_INVENTORY_CONFIRMATION");Vtiger_Helper_Js.showConfirmationBox({message:b}).then(function(d){var f={};f.view=app.getViewName();f.id=a.data("id");app.saveAjax("deleteInventory",f).then(function(e){Settings_Vtiger_Index_Js.showMessage({type:"success",text:e.result.message});a.remove()})},function(d,e){})},registerActions:function(){var b=this;var a=jQuery("#inventory");a.find(".addInventory").click(function(c){var f=jQuery(c.currentTarget);var d=f.data("url");b.edit(d)});a.on("click",".editInventory",function(f){var d=jQuery(f.currentTarget);var c=d.closest("tr");b.edit(d.data("url"),c)});a.on("click",".removeInventory",function(d){var f=jQuery(d.currentTarget);var c=f.closest("tr");b.removeInventory(c)});a.on("click",'.status[type="checkbox"]',function(d){var c=jQuery(d.currentTarget);b.updateStatus(c).then(function(e){var f={};f.text=app.vtranslate("JS_SAVE_CHANGES");Settings_Vtiger_Index_Js.showMessage(f)},function(e){})})},registerEvents:function(){this.registerActions()}});jQuery(document).ready(function(b){var a=new Settings_Inventory_Index_Js();a.registerEvents()}); \ No newline at end of file +jQuery.Class("Settings_Inventory_Index_Js",{},{duplicateCheckCache:{},edit:function(c,a){var b=jQuery.Deferred();var d=this;var e=jQuery.progressIndicator({position:"html",blockInfo:{enabled:true}});AppConnector.request(c).then(function(g){var f=function(i){d.duplicateCheckCache={};var h=jQuery("#formInventory");var j=app.validationEngineOptions;j.onValidationComplete=function(l,k){if(k){d.saveDetails(l,a);return k}};h.validationEngine(j);h.submit(function(k){k.preventDefault()})};e.progressIndicator({mode:"hide"});app.showModalWindow(g,function(h){if(typeof f=="function"){f(h)}},{})},function(f){b.reject(f)});return b.promise()},saveDetails:function(c,a){var b=this;var e=c.serializeFormData();var d=c.find('[type="submit"]');d.prop("disabled",true);if(typeof e=="undefined"){e={}}b.validateName(e).then(function(f){if(typeof f=="undefined"){d.prop("disabled",false);return false}var g=jQuery.progressIndicator({position:"html",blockInfo:{enabled:true}});e.module=app.getModuleName();e.parent=app.getParentModuleName();e.action="SaveAjax";e.view=app.getViewName();AppConnector.request(e).then(function(h){g.progressIndicator({mode:"hide"});app.hideModalWindow();if(typeof h=="string"){h=JSON.parse(h)}if(c.find(".addView").val()=="true"){b.addDetails(h.result)}else{b.updateDetails(h.result,a)}var i={text:app.vtranslate("JS_SAVE_CHANGES")};Settings_Vtiger_Index_Js.showMessage(i)})},function(g,f){d.prop("disabled",false);return false})},addDetails:function(c){var b=jQuery("#inventory");var a=jQuery("#currency");var e="%";if(a.length>0){var a=JSON.parse(a.val());e=a.currency_symbol}var d=jQuery(".inventoryTable",b);var f=jQuery('\n \n '+c.value+" "+e+'\n \n \n ');d.append(f)},updateDetails:function(d,a){var b=jQuery("#currency");var c="%";if(b.length>0){var b=JSON.parse(b.val());c=b.currency_symbol}a.find(".name").text(d.name);a.find(".value").text(d.value+" "+c);if(d.status=="0"){a.find(".status").prop("checked",true)}else{a.find(".status").prop("checked",false)}},validateName:function(g){var f=this;var b=jQuery.Deferred();var c=g.name;var e=jQuery("#formInventory");var d=e.find('[name="name"]');if(!(c in f.duplicateCheckCache)){f.checkDuplicateName(g).then(function(h){f.duplicateCheckCache[c]=h.success;if(h.success){f.duplicateCheckCache.message=h.message;d.validationEngine("showPrompt",h.message,"error","bottomLeft",true);b.reject(h)}b.resolve(h)},function(i,h){b.reject(i)})}else{if(f.duplicateCheckCache[c]==true){var a=f.duplicateCheckCache.message;d.validationEngine("showPrompt",a,"error","bottomLeft",true);b.reject()}else{b.resolve()}}return b.promise()},checkDuplicateName:function(d){var a=jQuery.Deferred();var c=d.name;var f=d.id;var b=app.getModuleName();var e={module:b,parent:app.getParentModuleName(),action:"SaveAjax",mode:"checkDuplicateName",name:c,id:f,view:app.getViewName()};AppConnector.request(e).then(function(i){if(typeof i=="string"){i=JSON.parse(i)}var h=i.result;var g=h.success;a.resolve(h)},function(g,h){a.reject()});return a.promise()},updateStatus:function(e){var c=jQuery.Deferred();var a=e.closest("tr");var g=a.data("id");var b=e.is(":checked")?0:1;var d=jQuery.progressIndicator({position:"html",blockInfo:{enabled:true}});var f={module:app.getModuleName(),parent:app.getParentModuleName(),action:"SaveAjax",id:g,view:app.getViewName(),status:b};AppConnector.request(f).then(function(h){d.progressIndicator({mode:"hide"});c.resolve(h)},function(h,i){d.progressIndicator({mode:"hide"});c.reject(h)});return c.promise()},removeInventory:function(a){var c=this;var b=app.vtranslate("JS_DELETE_INVENTORY_CONFIRMATION");Vtiger_Helper_Js.showConfirmationBox({message:b}).then(function(d){var f={};f.view=app.getViewName();f.id=a.data("id");app.saveAjax("deleteInventory",f).then(function(e){Settings_Vtiger_Index_Js.showMessage({type:"success",text:e.result.message});a.remove()})},function(d,e){})},registerActions:function(){var b=this;var a=jQuery("#inventory");a.find(".addInventory").click(function(c){var f=jQuery(c.currentTarget);var d=f.data("url");b.edit(d)});a.on("click",".editInventory",function(f){var d=jQuery(f.currentTarget);var c=d.closest("tr");b.edit(d.data("url"),c)});a.on("click",".removeInventory",function(d){var f=jQuery(d.currentTarget);var c=f.closest("tr");b.removeInventory(c)});a.on("click",'.status[type="checkbox"]',function(d){var c=jQuery(d.currentTarget);b.updateStatus(c).then(function(e){var f={};f.text=app.vtranslate("JS_SAVE_CHANGES");Settings_Vtiger_Index_Js.showMessage(f)},function(e){})})},registerEvents:function(){this.registerActions()}});jQuery(document).ready(function(b){var a=new Settings_Inventory_Index_Js();a.registerEvents()}); \ No newline at end of file diff --git a/modules/Settings/Inventory/views/CreditLimits.php b/modules/Settings/Inventory/views/CreditLimits.php index 6314028b10a5..31a3bb6d9e03 100644 --- a/modules/Settings/Inventory/views/CreditLimits.php +++ b/modules/Settings/Inventory/views/CreditLimits.php @@ -27,6 +27,7 @@ public function process(Vtiger_Request $request) $viewer->assign('INVENTORY_DATA', $allData); $viewer->assign('VIEW', $view); $viewer->assign('CURRENT_USER_MODEL', Users_Record_Model::getCurrentUserModel()); + $viewer->assign('CURRENCY', Vtiger_Util_Helper::getBaseCurrency()); $viewer->view('Index.tpl', $qualifiedModuleName); } diff --git a/modules/Settings/Inventory/views/ModalAjax.php b/modules/Settings/Inventory/views/ModalAjax.php index 65ed96de341f..1a82b105f4ea 100644 --- a/modules/Settings/Inventory/views/ModalAjax.php +++ b/modules/Settings/Inventory/views/ModalAjax.php @@ -22,6 +22,7 @@ public function process(Vtiger_Request $request) $viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName); $viewer->assign('RECORD_MODEL', $recordModel); $viewer->assign('TYPE', $type); + $viewer->assign('CURRENCY', Vtiger_Util_Helper::getBaseCurrency()); echo $viewer->view('Modal.tpl', $qualifiedModuleName, true); } } From 669da6aa2b9985e6e1a5b735b05dd4e655e8f92e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Skrzypczak?= Date: Thu, 3 Sep 2015 13:47:47 +0200 Subject: [PATCH 135/489] Added new panels in administration. --- config/version.php | 2 +- install/install_schema/data.sql | 6 +- languages/de_de/Settings/Inventory.php | 28 +++++++- languages/en_us/Settings/Inventory.php | 28 +++++++- languages/nl_nl/Settings/Inventory.php | 28 +++++++- languages/pl_pl/Settings/Inventory.php | 28 +++++++- languages/pt_br/Settings/Inventory.php | 28 +++++++- languages/ru_ru/Settings/Inventory.php | 28 +++++++- .../modules/Settings/Inventory/Config.tpl | 51 +++++++++++++++ .../Settings/Inventory/resources/Config.js | 65 +++++++++++++++++++ .../Inventory/resources/Config.min.js | 2 + .../Settings/Inventory/actions/SaveAjax.php | 22 +++++++ modules/Settings/Inventory/models/Module.php | 61 +++++++++++++++++ .../Inventory/views/DiscountConfiguration.php | 52 +++++++++++++++ .../Inventory/views/TaxConfiguration.php | 11 ++++ 15 files changed, 419 insertions(+), 21 deletions(-) create mode 100644 layouts/vlayout/modules/Settings/Inventory/Config.tpl create mode 100644 layouts/vlayout/modules/Settings/Inventory/resources/Config.js create mode 100644 layouts/vlayout/modules/Settings/Inventory/resources/Config.min.js create mode 100644 modules/Settings/Inventory/models/Module.php create mode 100644 modules/Settings/Inventory/views/DiscountConfiguration.php create mode 100644 modules/Settings/Inventory/views/TaxConfiguration.php diff --git a/config/version.php b/config/version.php index aca91135c702..f3e36ba93e0d 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150903'; -$YetiForce_current_version = '2.2.55'; +$YetiForce_current_version = '2.2.56'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/install/install_schema/data.sql b/install/install_schema/data.sql index 1cf3a186bb14..ead754989c5a 100644 --- a/install/install_schema/data.sql +++ b/install/install_schema/data.sql @@ -21404,11 +21404,13 @@ insert into `vtiger_settings_field`(`fieldid`,`blockid`,`name`,`iconpath`,`desc insert into `vtiger_settings_field`(`fieldid`,`blockid`,`name`,`iconpath`,`description`,`linkto`,`sequence`,`active`,`pinned`) values (88,4,'LBL_CURRENCY_UPDATE','','LBL_CURRENCY_UPDATE_DESCRIPTION','index.php?module=CurrencyUpdate&view=Index&parent=Settings',26,0,0); insert into `vtiger_settings_field`(`fieldid`,`blockid`,`name`,`iconpath`,`description`,`linkto`,`sequence`,`active`,`pinned`) values (89,11,'LBL_CREDITLIMITS','','LBL_CREDITLIMITS_DESCRIPTION','index.php?module=Inventory&parent=Settings&view=CreditLimits',1,0,0); insert into `vtiger_settings_field`(`fieldid`,`blockid`,`name`,`iconpath`,`description`,`linkto`,`sequence`,`active`,`pinned`) values (90,11,'LBL_TAXES','','LBL_TAXES_DESCRIPTION','index.php?module=Inventory&parent=Settings&view=Taxes',2,0,0); -insert into `vtiger_settings_field`(`fieldid`,`blockid`,`name`,`iconpath`,`description`,`linkto`,`sequence`,`active`,`pinned`) values (91,11,'LBL_DISCOUNTS','','LBL_DISCOUNTS_DESCRIPTION','index.php?module=Inventory&parent=Settings&view=Discounts',3,0,0); +insert into `vtiger_settings_field`(`fieldid`,`blockid`,`name`,`iconpath`,`description`,`linkto`,`sequence`,`active`,`pinned`) values (91,11,'LBL_DISCOUNTS','','LBL_DISCOUNTS_DESCRIPTION','index.php?module=Inventory&parent=Settings&view=Discounts',4,0,0); +insert into `vtiger_settings_field`(`fieldid`,`blockid`,`name`,`iconpath`,`description`,`linkto`,`sequence`,`active`,`pinned`) values (92,11,'LBL_TAXCONFIGURATION','','LBL_TAXCONFIGURATION_DESCRIPTION','index.php?module=Inventory&parent=Settings&view=TaxConfiguration',3,0,0); +insert into `vtiger_settings_field`(`fieldid`,`blockid`,`name`,`iconpath`,`description`,`linkto`,`sequence`,`active`,`pinned`) values (93,11,'LBL_DISCOUNTCONFIGURATION','','LBL_DISCOUNTCONFIGURATION_DESCRIPTION','index.php?module=Inventory&parent=Settings&view=DiscountConfiguration',5,0,0); /*Data for the table `vtiger_settings_field_seq` */ -insert into `vtiger_settings_field_seq`(`id`) values (91); +insert into `vtiger_settings_field_seq`(`id`) values (93); /*Data for the table `vtiger_sharedcalendar` */ diff --git a/languages/de_de/Settings/Inventory.php b/languages/de_de/Settings/Inventory.php index 1d288f163ec4..ad63a6af5908 100644 --- a/languages/de_de/Settings/Inventory.php +++ b/languages/de_de/Settings/Inventory.php @@ -1,7 +1,7 @@ 'Credit limits', + 'LBL_CREDITLIMITS' => 'Credit limit base', 'LBL_CREDITLIMITS_DESCRIPTION' => ' ', 'LBL_CREDITLIMITS_SINGLE' => 'Credit limit', 'LBL_ENTER_NAME' => 'Enter the name', @@ -11,17 +11,39 @@ 'LBL_NAME_EXIST' => 'This name already exists.', 'LBL_EDITING' => 'Edit', - 'LBL_TAXES' => 'Taxes', + 'LBL_TAXES' => 'Tax base', 'LBL_TAXES_DESCRIPTION' => ' ', 'LBL_TAXES_SINGLE' => 'Tax', 'LBL_DISCOUNTS_SINGLE' => 'Discount', - 'LBL_DISCOUNTS' => 'Discounts', + 'LBL_DISCOUNTS' => 'Discount base', 'LBL_DISCOUNTS_DESCRIPTION' => ' ', 'LBL_DELETE_OK' => 'Successfully removed the value', + + 'LBL_DISCOUNTCONFIGURATION' => 'Discount configuration', + 'LBL_DISCOUNTCONFIGURATION_DESCRIPTION' => ' ', + 'LBL_TAXCONFIGURATION' => 'Tax configuration', + 'LBL_TAXCONFIGURATION_DESCRIPTION' => ' ', + + 'LBL_CANNOT_BE_COMBINED' => 'Cannot be combined', + 'LBL_IN_TOTAL' => 'In total', + 'LBL_CASCADE' => 'Cascade', + 'LBL_GLOBAL' => 'Global', + 'LBL_GROUP' => 'Group', + 'LBL_INDIVIDUAL' => 'Individual', + 'LBL_REGIONAL' => 'Regional', + + 'LBL_ARE_ACTIVE' => 'Active?', + 'LBL_SUMMATION_TYPE' => 'Summation type', + 'LBL_AVAILABLE_TAXS' => 'Available taxes', + 'LBL_AVAILABLE_DISCOUNTS' => 'Available discounts', + 'LBL_YES' => 'Yes', + 'LBL_NO' => 'No', ]; $jsLanguageStrings = [ 'JS_SAVE_CHANGES' => 'Changes saved successfully.', 'JS_DELETE_INVENTORY_CONFIRMATION' => 'Are you sure you want to delete this value?', 'JS_EDIT' => 'Edit', 'JS_DELETE' => 'Delete', + 'JS_YES' => 'Yes', + 'JS_NO' => 'No', ]; diff --git a/languages/en_us/Settings/Inventory.php b/languages/en_us/Settings/Inventory.php index 1d288f163ec4..ad63a6af5908 100644 --- a/languages/en_us/Settings/Inventory.php +++ b/languages/en_us/Settings/Inventory.php @@ -1,7 +1,7 @@ 'Credit limits', + 'LBL_CREDITLIMITS' => 'Credit limit base', 'LBL_CREDITLIMITS_DESCRIPTION' => ' ', 'LBL_CREDITLIMITS_SINGLE' => 'Credit limit', 'LBL_ENTER_NAME' => 'Enter the name', @@ -11,17 +11,39 @@ 'LBL_NAME_EXIST' => 'This name already exists.', 'LBL_EDITING' => 'Edit', - 'LBL_TAXES' => 'Taxes', + 'LBL_TAXES' => 'Tax base', 'LBL_TAXES_DESCRIPTION' => ' ', 'LBL_TAXES_SINGLE' => 'Tax', 'LBL_DISCOUNTS_SINGLE' => 'Discount', - 'LBL_DISCOUNTS' => 'Discounts', + 'LBL_DISCOUNTS' => 'Discount base', 'LBL_DISCOUNTS_DESCRIPTION' => ' ', 'LBL_DELETE_OK' => 'Successfully removed the value', + + 'LBL_DISCOUNTCONFIGURATION' => 'Discount configuration', + 'LBL_DISCOUNTCONFIGURATION_DESCRIPTION' => ' ', + 'LBL_TAXCONFIGURATION' => 'Tax configuration', + 'LBL_TAXCONFIGURATION_DESCRIPTION' => ' ', + + 'LBL_CANNOT_BE_COMBINED' => 'Cannot be combined', + 'LBL_IN_TOTAL' => 'In total', + 'LBL_CASCADE' => 'Cascade', + 'LBL_GLOBAL' => 'Global', + 'LBL_GROUP' => 'Group', + 'LBL_INDIVIDUAL' => 'Individual', + 'LBL_REGIONAL' => 'Regional', + + 'LBL_ARE_ACTIVE' => 'Active?', + 'LBL_SUMMATION_TYPE' => 'Summation type', + 'LBL_AVAILABLE_TAXS' => 'Available taxes', + 'LBL_AVAILABLE_DISCOUNTS' => 'Available discounts', + 'LBL_YES' => 'Yes', + 'LBL_NO' => 'No', ]; $jsLanguageStrings = [ 'JS_SAVE_CHANGES' => 'Changes saved successfully.', 'JS_DELETE_INVENTORY_CONFIRMATION' => 'Are you sure you want to delete this value?', 'JS_EDIT' => 'Edit', 'JS_DELETE' => 'Delete', + 'JS_YES' => 'Yes', + 'JS_NO' => 'No', ]; diff --git a/languages/nl_nl/Settings/Inventory.php b/languages/nl_nl/Settings/Inventory.php index 1d288f163ec4..ad63a6af5908 100644 --- a/languages/nl_nl/Settings/Inventory.php +++ b/languages/nl_nl/Settings/Inventory.php @@ -1,7 +1,7 @@ 'Credit limits', + 'LBL_CREDITLIMITS' => 'Credit limit base', 'LBL_CREDITLIMITS_DESCRIPTION' => ' ', 'LBL_CREDITLIMITS_SINGLE' => 'Credit limit', 'LBL_ENTER_NAME' => 'Enter the name', @@ -11,17 +11,39 @@ 'LBL_NAME_EXIST' => 'This name already exists.', 'LBL_EDITING' => 'Edit', - 'LBL_TAXES' => 'Taxes', + 'LBL_TAXES' => 'Tax base', 'LBL_TAXES_DESCRIPTION' => ' ', 'LBL_TAXES_SINGLE' => 'Tax', 'LBL_DISCOUNTS_SINGLE' => 'Discount', - 'LBL_DISCOUNTS' => 'Discounts', + 'LBL_DISCOUNTS' => 'Discount base', 'LBL_DISCOUNTS_DESCRIPTION' => ' ', 'LBL_DELETE_OK' => 'Successfully removed the value', + + 'LBL_DISCOUNTCONFIGURATION' => 'Discount configuration', + 'LBL_DISCOUNTCONFIGURATION_DESCRIPTION' => ' ', + 'LBL_TAXCONFIGURATION' => 'Tax configuration', + 'LBL_TAXCONFIGURATION_DESCRIPTION' => ' ', + + 'LBL_CANNOT_BE_COMBINED' => 'Cannot be combined', + 'LBL_IN_TOTAL' => 'In total', + 'LBL_CASCADE' => 'Cascade', + 'LBL_GLOBAL' => 'Global', + 'LBL_GROUP' => 'Group', + 'LBL_INDIVIDUAL' => 'Individual', + 'LBL_REGIONAL' => 'Regional', + + 'LBL_ARE_ACTIVE' => 'Active?', + 'LBL_SUMMATION_TYPE' => 'Summation type', + 'LBL_AVAILABLE_TAXS' => 'Available taxes', + 'LBL_AVAILABLE_DISCOUNTS' => 'Available discounts', + 'LBL_YES' => 'Yes', + 'LBL_NO' => 'No', ]; $jsLanguageStrings = [ 'JS_SAVE_CHANGES' => 'Changes saved successfully.', 'JS_DELETE_INVENTORY_CONFIRMATION' => 'Are you sure you want to delete this value?', 'JS_EDIT' => 'Edit', 'JS_DELETE' => 'Delete', + 'JS_YES' => 'Yes', + 'JS_NO' => 'No', ]; diff --git a/languages/pl_pl/Settings/Inventory.php b/languages/pl_pl/Settings/Inventory.php index 549790e02815..7d4cb62cc39f 100644 --- a/languages/pl_pl/Settings/Inventory.php +++ b/languages/pl_pl/Settings/Inventory.php @@ -1,7 +1,7 @@ 'Limity kredytowe', + 'LBL_CREDITLIMITS' => 'Baza limitów kredytowych', 'LBL_CREDITLIMITS_DESCRIPTION' => ' ', 'LBL_CREDITLIMITS_SINGLE' => 'limit kredytowy', 'LBL_ENTER_NAME' => 'Wprowadź nazwę', @@ -11,17 +11,39 @@ 'LBL_NAME_EXIST' => 'Wprowadzona nazwa jest już zajęta.', 'LBL_EDITING' => 'Edytuj', - 'LBL_TAXES' => 'Podatki', + 'LBL_TAXES' => 'Baza podatków', 'LBL_TAXES_DESCRIPTION' => ' ', 'LBL_TAXES_SINGLE' => 'podatek', 'LBL_DISCOUNTS_SINGLE' => 'rabat', - 'LBL_DISCOUNTS' => 'Rabaty', + 'LBL_DISCOUNTS' => 'Baza rabatów', 'LBL_DISCOUNTS_DESCRIPTION' => ' ', 'LBL_DELETE_OK' => 'Pomyślnie usunięto wartość', + + 'LBL_DISCOUNTCONFIGURATION' => 'Konfiguracja rabatów', + 'LBL_DISCOUNTCONFIGURATION_DESCRIPTION' => ' ', + 'LBL_TAXCONFIGURATION' => 'Konfiguracja podatków', + 'LBL_TAXCONFIGURATION_DESCRIPTION' => ' ', + 'LBL_CANNOT_BE_COMBINED' => 'Nie wolno łączyć', + 'LBL_IN_TOTAL' => 'Sumarycznie', + 'LBL_CASCADE' => 'Kaskadowo', + 'LBL_GLOBAL' => 'Globalny', + 'LBL_GROUP' => 'Grupowy', + 'LBL_INDIVIDUAL' => 'Indywidualny', + 'LBL_REGIONAL' => 'Regionalny', + + 'LBL_ARE_ACTIVE' => 'Aktywne?', + 'LBL_SUMMATION_TYPE' => 'Typ sumowania', + 'LBL_AVAILABLE_TAXS' => 'Dostępne podatki', + 'LBL_AVAILABLE_DISCOUNTS' => 'Dostępne rabaty', + 'LBL_YES' => 'Tak', + 'LBL_NO' => 'Nie', + ]; $jsLanguageStrings = [ 'JS_SAVE_CHANGES' => 'Pomyślnie zapisano zmiany.', 'JS_DELETE_INVENTORY_CONFIRMATION' => 'Czy na pewno chcesz usunąć tę wartość?', 'JS_EDIT' => 'Edycja', 'JS_DELETE' => 'Usuń', + 'JS_YES' => 'Tak', + 'JS_NO' => 'Nie', ]; diff --git a/languages/pt_br/Settings/Inventory.php b/languages/pt_br/Settings/Inventory.php index 1d288f163ec4..ad63a6af5908 100644 --- a/languages/pt_br/Settings/Inventory.php +++ b/languages/pt_br/Settings/Inventory.php @@ -1,7 +1,7 @@ 'Credit limits', + 'LBL_CREDITLIMITS' => 'Credit limit base', 'LBL_CREDITLIMITS_DESCRIPTION' => ' ', 'LBL_CREDITLIMITS_SINGLE' => 'Credit limit', 'LBL_ENTER_NAME' => 'Enter the name', @@ -11,17 +11,39 @@ 'LBL_NAME_EXIST' => 'This name already exists.', 'LBL_EDITING' => 'Edit', - 'LBL_TAXES' => 'Taxes', + 'LBL_TAXES' => 'Tax base', 'LBL_TAXES_DESCRIPTION' => ' ', 'LBL_TAXES_SINGLE' => 'Tax', 'LBL_DISCOUNTS_SINGLE' => 'Discount', - 'LBL_DISCOUNTS' => 'Discounts', + 'LBL_DISCOUNTS' => 'Discount base', 'LBL_DISCOUNTS_DESCRIPTION' => ' ', 'LBL_DELETE_OK' => 'Successfully removed the value', + + 'LBL_DISCOUNTCONFIGURATION' => 'Discount configuration', + 'LBL_DISCOUNTCONFIGURATION_DESCRIPTION' => ' ', + 'LBL_TAXCONFIGURATION' => 'Tax configuration', + 'LBL_TAXCONFIGURATION_DESCRIPTION' => ' ', + + 'LBL_CANNOT_BE_COMBINED' => 'Cannot be combined', + 'LBL_IN_TOTAL' => 'In total', + 'LBL_CASCADE' => 'Cascade', + 'LBL_GLOBAL' => 'Global', + 'LBL_GROUP' => 'Group', + 'LBL_INDIVIDUAL' => 'Individual', + 'LBL_REGIONAL' => 'Regional', + + 'LBL_ARE_ACTIVE' => 'Active?', + 'LBL_SUMMATION_TYPE' => 'Summation type', + 'LBL_AVAILABLE_TAXS' => 'Available taxes', + 'LBL_AVAILABLE_DISCOUNTS' => 'Available discounts', + 'LBL_YES' => 'Yes', + 'LBL_NO' => 'No', ]; $jsLanguageStrings = [ 'JS_SAVE_CHANGES' => 'Changes saved successfully.', 'JS_DELETE_INVENTORY_CONFIRMATION' => 'Are you sure you want to delete this value?', 'JS_EDIT' => 'Edit', 'JS_DELETE' => 'Delete', + 'JS_YES' => 'Yes', + 'JS_NO' => 'No', ]; diff --git a/languages/ru_ru/Settings/Inventory.php b/languages/ru_ru/Settings/Inventory.php index 1d288f163ec4..ad63a6af5908 100644 --- a/languages/ru_ru/Settings/Inventory.php +++ b/languages/ru_ru/Settings/Inventory.php @@ -1,7 +1,7 @@ 'Credit limits', + 'LBL_CREDITLIMITS' => 'Credit limit base', 'LBL_CREDITLIMITS_DESCRIPTION' => ' ', 'LBL_CREDITLIMITS_SINGLE' => 'Credit limit', 'LBL_ENTER_NAME' => 'Enter the name', @@ -11,17 +11,39 @@ 'LBL_NAME_EXIST' => 'This name already exists.', 'LBL_EDITING' => 'Edit', - 'LBL_TAXES' => 'Taxes', + 'LBL_TAXES' => 'Tax base', 'LBL_TAXES_DESCRIPTION' => ' ', 'LBL_TAXES_SINGLE' => 'Tax', 'LBL_DISCOUNTS_SINGLE' => 'Discount', - 'LBL_DISCOUNTS' => 'Discounts', + 'LBL_DISCOUNTS' => 'Discount base', 'LBL_DISCOUNTS_DESCRIPTION' => ' ', 'LBL_DELETE_OK' => 'Successfully removed the value', + + 'LBL_DISCOUNTCONFIGURATION' => 'Discount configuration', + 'LBL_DISCOUNTCONFIGURATION_DESCRIPTION' => ' ', + 'LBL_TAXCONFIGURATION' => 'Tax configuration', + 'LBL_TAXCONFIGURATION_DESCRIPTION' => ' ', + + 'LBL_CANNOT_BE_COMBINED' => 'Cannot be combined', + 'LBL_IN_TOTAL' => 'In total', + 'LBL_CASCADE' => 'Cascade', + 'LBL_GLOBAL' => 'Global', + 'LBL_GROUP' => 'Group', + 'LBL_INDIVIDUAL' => 'Individual', + 'LBL_REGIONAL' => 'Regional', + + 'LBL_ARE_ACTIVE' => 'Active?', + 'LBL_SUMMATION_TYPE' => 'Summation type', + 'LBL_AVAILABLE_TAXS' => 'Available taxes', + 'LBL_AVAILABLE_DISCOUNTS' => 'Available discounts', + 'LBL_YES' => 'Yes', + 'LBL_NO' => 'No', ]; $jsLanguageStrings = [ 'JS_SAVE_CHANGES' => 'Changes saved successfully.', 'JS_DELETE_INVENTORY_CONFIRMATION' => 'Are you sure you want to delete this value?', 'JS_EDIT' => 'Edit', 'JS_DELETE' => 'Delete', + 'JS_YES' => 'Yes', + 'JS_NO' => 'No', ]; diff --git a/layouts/vlayout/modules/Settings/Inventory/Config.tpl b/layouts/vlayout/modules/Settings/Inventory/Config.tpl new file mode 100644 index 000000000000..295bfc1ca6f6 --- /dev/null +++ b/layouts/vlayout/modules/Settings/Inventory/Config.tpl @@ -0,0 +1,51 @@ +{**} +{strip} + +
    +
    +

    {vtranslate($PAGE_LABELS.title,$QUALIFIED_MODULE)}

    {vtranslate($PAGE_LABELS.description,$QUALIFIED_MODULE)} +
    +
    +
    +
    + {assign var=LABEL_CHECKBOX value='LBL_YES'} + {if !$CONFIG.active} + {assign var=LABEL_CHECKBOX value='LBL_NO'} + {/if} + +
    + +
    +
    +
    + +
    + +
    +
    +
    + {if $VIEW eq 'DiscountConfiguration'} + {assign var=FIELD value='discounts'} + {else} + {assign var=FIELD value='taxs'} + {/if} + {assign var=FIELD_VALUE value=explode(',',$CONFIG[$FIELD])} + +
    + +
    +
    +
    +
    +{/strip} diff --git a/layouts/vlayout/modules/Settings/Inventory/resources/Config.js b/layouts/vlayout/modules/Settings/Inventory/resources/Config.js new file mode 100644 index 000000000000..55c6741a96c7 --- /dev/null +++ b/layouts/vlayout/modules/Settings/Inventory/resources/Config.js @@ -0,0 +1,65 @@ +/* {[The file is published on the basis of YetiForce Public License that can be found in the following directory: licenses/License.html]} */ + +jQuery.Class("Settings_Inventory_Config_Js", {}, { + + registerChangeCheckbox: function (content) { + var thisInstance = this; + content.find('input[type="checkbox"]').on('change', function (e) { + var target = $(e.currentTarget); + var value = 0; + if(target.is(':checked')){ + value = 1; + } + var params = {}; + params['param'] = { + 'value': value, + 'param': target.attr('name') + }; + params['view'] = app.getViewName(); + app.saveAjax('saveConfig', params).then(function (data) { + Settings_Vtiger_Index_Js.showMessage({type: 'success', text: app.vtranslate('JS_SAVE_CHANGES')}); + if (value) { + target.parent().removeClass('btn-default').addClass('btn-success').find('.glyphicon').removeClass('glyphicon-unchecked').addClass('glyphicon-check'); + target.next().html('  ' + app.vtranslate('JS_YES')); + } else { + target.parent().removeClass('btn-success').addClass('btn-default').find('.glyphicon').removeClass('glyphicon-check').addClass('glyphicon-unchecked'); + target.next().html('  ' + app.vtranslate('JS_NO')); + ; + } + }); + }); + }, + registerChangeVal: function (content) { + var thisInstance = this; + content.find('select').change(function (e) { + var target = $(e.currentTarget); + var params = {}; + var value = ''; + if(target.attr('multiple') && target.val() != null){ + value = target.val().join(); + }else if(target.val() != null){ + value = target.val(); + } + params['param'] = { + 'value': value, + 'param': target.attr('name') + }; + params['view'] = app.getViewName(); + app.saveAjax('saveConfig', params).then(function (data) { + Settings_Vtiger_Index_Js.showMessage({type: 'success', text: app.vtranslate('JS_SAVE_CHANGES')}); + }); + }); + }, + + registerEvents: function () { + var content = jQuery('#inventoryConfig'); + this.registerChangeVal(content); + this.registerChangeCheckbox(content); + } + +}); + +jQuery(document).ready(function (e) { + var instance = new Settings_Inventory_Config_Js(); + instance.registerEvents(); +}) diff --git a/layouts/vlayout/modules/Settings/Inventory/resources/Config.min.js b/layouts/vlayout/modules/Settings/Inventory/resources/Config.min.js new file mode 100644 index 000000000000..e9f210bb1dfc --- /dev/null +++ b/layouts/vlayout/modules/Settings/Inventory/resources/Config.min.js @@ -0,0 +1,2 @@ + +jQuery.Class("Settings_Inventory_Config_Js",{},{registerChangeCheckbox:function(b){var a=this;b.find('input[type="checkbox"]').on("change",function(f){var d=$(f.currentTarget);var c=0;if(d.is(":checked")){c=1}var g={};g.param={value:c,param:d.attr("name")};g.view=app.getViewName();app.saveAjax("saveConfig",g).then(function(e){Settings_Vtiger_Index_Js.showMessage({type:"success",text:app.vtranslate("JS_SAVE_CHANGES")});if(c){d.parent().removeClass("btn-default").addClass("btn-success").find(".glyphicon").removeClass("glyphicon-unchecked").addClass("glyphicon-check");d.next().html("  "+app.vtranslate("JS_YES"))}else{d.parent().removeClass("btn-success").addClass("btn-default").find(".glyphicon").removeClass("glyphicon-check").addClass("glyphicon-unchecked");d.next().html("  "+app.vtranslate("JS_NO"))}})})},registerChangeVal:function(b){var a=this;b.find("select").change(function(f){var d=$(f.currentTarget);var g={};var c="";if(d.attr("multiple")&&d.val()!=null){c=d.val().join()}else{if(d.val()!=null){c=d.val()}}g.param={value:c,param:d.attr("name")};g.view=app.getViewName();app.saveAjax("saveConfig",g).then(function(e){Settings_Vtiger_Index_Js.showMessage({type:"success",text:app.vtranslate("JS_SAVE_CHANGES")})})})},registerEvents:function(){var a=jQuery("#inventoryConfig");this.registerChangeVal(a);this.registerChangeCheckbox(a)}});jQuery(document).ready(function(b){var a=new Settings_Inventory_Config_Js();a.registerEvents()}); \ No newline at end of file diff --git a/modules/Settings/Inventory/actions/SaveAjax.php b/modules/Settings/Inventory/actions/SaveAjax.php index d82a5b0cc4fd..6c1023eb764c 100644 --- a/modules/Settings/Inventory/actions/SaveAjax.php +++ b/modules/Settings/Inventory/actions/SaveAjax.php @@ -9,6 +9,7 @@ function __construct() parent::__construct(); $this->exposeMethod('checkDuplicateName'); $this->exposeMethod('deleteInventory'); + $this->exposeMethod('saveConfig'); } public function process(Vtiger_Request $request) @@ -87,6 +88,27 @@ public function deleteInventory(Vtiger_Request $request) $response->setResult($result); $response->emit(); } + + public function saveConfig(Vtiger_Request $request) + { + $moduleName = $request->getModule(); + $qualifiedModuleName = $request->getModule(false); + $params = $request->get('param'); + $type = $params['view']; + + $recordModel = Settings_Inventory_Module_Model::getCleanInstance(); + $status = $recordModel->setConfig($type,$params['param']); + + if (!$status) { + $result = array('success' => false); + } else { + $result = array('success' => true); + } + + $response = new Vtiger_Response(); + $response->setResult($result); + $response->emit(); + } public function validateRequest(Vtiger_Request $request) { diff --git a/modules/Settings/Inventory/models/Module.php b/modules/Settings/Inventory/models/Module.php new file mode 100644 index 000000000000..2c967be362ed --- /dev/null +++ b/modules/Settings/Inventory/models/Module.php @@ -0,0 +1,61 @@ + 'a_yf_discounts_config', 'TaxConfiguration' => 'a_yf_taxes_config']; + return $tablename[$type]; + } + + public static function getConfig($type, $name = false) + { + $log = vglobal('log'); + $log->debug('Start ' . __CLASS__ . ':' . __FUNCTION__ . " | Type: " . print_r($type, true) . " | Name: " . print_r($name, true)); + $db = PearDatabase::getInstance(); + $tableName = self::getTableNameFromType($type); + $sql = 'SELECT * FROM `' . $tableName . '`'; + if ($name && !is_array($name)) { + $name = [$name]; + } + $params = []; + if ($name) { + $sql .= ' WHERE `param` IN (' . generateQuestionMarks($name) . ')'; + $params = $name; + } + $result = $db->pquery($sql, $params); + $output = []; + while ($row = $db->fetch_array($result)) { + $output[$row['param']] = $row['value']; + } + $log->debug('End ' . __CLASS__ . ':' . __FUNCTION__); + return $output; + } + + public function setConfig($type,$param) + { + $log = vglobal('log'); + $log->debug('Start ' . __CLASS__ . ':' . __FUNCTION__); + $db = PearDatabase::getInstance(); + $tableName = self::getTableNameFromType($type); + $db->pquery('UPDATE `' . $tableName . '` SET `value` = ? WHERE `param` = ?;', [$param['value'],$param['param']]); + $log->debug('End ' . __CLASS__ . ':' . __FUNCTION__); + return true; + } +} diff --git a/modules/Settings/Inventory/views/DiscountConfiguration.php b/modules/Settings/Inventory/views/DiscountConfiguration.php new file mode 100644 index 000000000000..dac83372dac1 --- /dev/null +++ b/modules/Settings/Inventory/views/DiscountConfiguration.php @@ -0,0 +1,52 @@ +debug('Start ' . __CLASS__ . ':' . __FUNCTION__); + $qualifiedModule = $request->getModule(false); + $view = $this->getView(); + $config = Settings_Inventory_Module_Model::getConfig($view); + $currentUser = Users_Record_Model::getCurrentUserModel(); + + $viewer = $this->getViewer($request); + $viewer->assign('PAGE_LABELS', $this->getPageLabels($request)); + $viewer->assign('VIEW', $view); + $viewer->assign('QUALIFIED_MODULE', $qualifiedModule); + $viewer->assign('USER_MODEL', $currentUser); + $viewer->assign('CONFIG', $config); + $viewer->view('Config.tpl', $qualifiedModule); + $log->debug('End ' . __CLASS__ . ':' . __FUNCTION__); + } + + function getPageLabels(Vtiger_Request $request) + { + $qualifiedModuleName = $request->getModule(false); + $view = $this->getView(); + $translations = []; + $translations['title'] = 'LBL_' . strtoupper($view); + $translations['title_single'] = 'LBL_' . strtoupper($view) . '_SINGLE'; + $translations['description'] = 'LBL_' . strtoupper($view) . '_DESCRIPTION'; + return $translations; + } + + public function getFooterScripts(Vtiger_Request $request) + { + $headerScriptInstances = parent::getFooterScripts($request); + $moduleName = $request->getModule(); + + $jsFileNames = ["modules.Settings.$moduleName.resources.Config"]; + + $jsScriptInstances = $this->checkAndConvertJsScripts($jsFileNames); + $headerScriptInstances = array_merge($headerScriptInstances, $jsScriptInstances); + return $headerScriptInstances; + } +} diff --git a/modules/Settings/Inventory/views/TaxConfiguration.php b/modules/Settings/Inventory/views/TaxConfiguration.php new file mode 100644 index 000000000000..e4cb9af09247 --- /dev/null +++ b/modules/Settings/Inventory/views/TaxConfiguration.php @@ -0,0 +1,11 @@ + Date: Thu, 3 Sep 2015 13:54:42 +0200 Subject: [PATCH 136/489] Fix #1904 --- config/version.php | 2 +- install/install_schema/data.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/version.php b/config/version.php index f3e36ba93e0d..6c1752a25851 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150903'; -$YetiForce_current_version = '2.2.56'; +$YetiForce_current_version = '2.2.57'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/install/install_schema/data.sql b/install/install_schema/data.sql index ead754989c5a..e21f52aa9a2d 100644 --- a/install/install_schema/data.sql +++ b/install/install_schema/data.sql @@ -6037,7 +6037,7 @@ insert into `vtiger_ossmailscanner_config`(`conf_type`,`parameter`,`value`) val insert into `vtiger_ossmailscanner_config`(`conf_type`,`parameter`,`value`) values ('email_list','target','_blank'); insert into `vtiger_ossmailscanner_config`(`conf_type`,`parameter`,`value`) values ('email_list','permissions','vtiger'); insert into `vtiger_ossmailscanner_config`(`conf_type`,`parameter`,`value`) values ('exceptions','crating_mails',NULL); -insert into `vtiger_ossmailscanner_config`(`conf_type`,`parameter`,`value`) values ('exceptions','crating_mails',NULL); +insert into `vtiger_ossmailscanner_config`(`conf_type`,`parameter`,`value`) values ('exceptions','crating_tickets',NULL); /*Data for the table `vtiger_ossmailscanner_folders_uid` */ From 0bb390d3f30de8dff470c47be91ab19976abe6eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Skrzypczak?= Date: Thu, 3 Sep 2015 14:09:28 +0200 Subject: [PATCH 137/489] Improved saving in configuration panels in the Extended Modules block. --- config/version.php | 2 +- layouts/vlayout/modules/Settings/Inventory/Config.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/version.php b/config/version.php index 6c1752a25851..9e6d991347ad 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150903'; -$YetiForce_current_version = '2.2.57'; +$YetiForce_current_version = '2.2.58'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/layouts/vlayout/modules/Settings/Inventory/Config.tpl b/layouts/vlayout/modules/Settings/Inventory/Config.tpl index 295bfc1ca6f6..419b30da5081 100644 --- a/layouts/vlayout/modules/Settings/Inventory/Config.tpl +++ b/layouts/vlayout/modules/Settings/Inventory/Config.tpl @@ -25,7 +25,7 @@
    From 35237c3aaa23d5315896e07dfaf3ff545c032ce5 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Thu, 3 Sep 2015 15:44:07 +0200 Subject: [PATCH 138/489] Redevelopment of the layouts --- config/version.php | 2 +- .../Calendar/CalendarViewPreProcess.tpl | 1 - .../modules/Home/IndexViewPreProcess.tpl | 1 - .../Home/dashboards/DashBoardPreProcess.tpl | 1 - .../modules/OSSMail/IndexViewPreProcess.tpl | 2 - .../OSSMailView/DetailViewPreProcess.tpl | 7 +- .../Settings/Vtiger/SettingsMenuStart.tpl | 4 +- layouts/vlayout/modules/Users/Body.tpl | 19 +++ .../Users/PreferenceDetailViewPreProcess.tpl | 6 +- .../modules/Users/UserEditViewPreProcess.tpl | 2 - .../modules/Users/UserViewPreProcess.tpl | 6 +- .../vlayout/modules/Vtiger/BasicHeader.tpl | 28 ---- layouts/vlayout/modules/Vtiger/Body.tpl | 13 ++ .../vlayout/modules/Vtiger/BodyContent.tpl | 4 + layouts/vlayout/modules/Vtiger/BodyHeader.tpl | 135 ++++++++++++++++ layouts/vlayout/modules/Vtiger/BodyHidden.tpl | 36 +++++ layouts/vlayout/modules/Vtiger/BodyLeft.tpl | 88 +++++++++++ .../vlayout/modules/Vtiger/CommonActions.tpl | 125 --------------- .../modules/Vtiger/DetailViewPreProcess.tpl | 3 +- .../Vtiger/FindDuplicatePreProcess.tpl | 2 - layouts/vlayout/modules/Vtiger/Header.tpl | 1 + .../modules/Vtiger/IndexViewPreProcess.tpl | 1 - .../vlayout/modules/Vtiger/ListViewHeader.tpl | 146 ++++++++++-------- .../modules/Vtiger/ListViewPreProcess.tpl | 30 ++-- layouts/vlayout/modules/Vtiger/Menu.tpl | 22 +++ layouts/vlayout/modules/Vtiger/MenuBar.tpl | 21 --- .../vlayout/modules/Vtiger/SideBarLinks.tpl | 6 - layouts/vlayout/modules/Vtiger/TopMenus.tpl | 11 -- .../vlayout/modules/Vtiger/TopMenusLeft.tpl | 25 --- .../vlayout/modules/Vtiger/TopMenusRight.tpl | 144 ----------------- .../vlayout/modules/Vtiger/UI5EmbedView.tpl | 5 +- .../Vtiger/dashboards/DashBoardPreProcess.tpl | 1 - .../vlayout/modules/Vtiger/menu/Module.tpl | 4 +- .../modules/Vtiger/resources/Header.js | 6 +- .../modules/Vtiger/resources/Header.min.js | 2 +- layouts/vlayout/resources/app.js | 4 +- layouts/vlayout/resources/app.min.js | 2 +- layouts/vlayout/skins/login.css | 3 + layouts/vlayout/skins/login.min.css | 2 +- layouts/vlayout/skins/twilight/style.css | 106 ++++++++++++- layouts/vlayout/skins/twilight/style.min.css | 2 +- modules/Users/views/Login.php | 17 ++ modules/Vtiger/models/Link.php | 9 ++ modules/Vtiger/views/Header.php | 117 ++++++-------- storage/Logo/logo_yetiforce.png | Bin 33546 -> 18264 bytes vtlib/Vtiger/Link.php | 2 + 46 files changed, 614 insertions(+), 560 deletions(-) create mode 100644 layouts/vlayout/modules/Users/Body.tpl delete mode 100644 layouts/vlayout/modules/Vtiger/BasicHeader.tpl create mode 100644 layouts/vlayout/modules/Vtiger/Body.tpl create mode 100644 layouts/vlayout/modules/Vtiger/BodyContent.tpl create mode 100644 layouts/vlayout/modules/Vtiger/BodyHeader.tpl create mode 100644 layouts/vlayout/modules/Vtiger/BodyHidden.tpl create mode 100644 layouts/vlayout/modules/Vtiger/BodyLeft.tpl delete mode 100644 layouts/vlayout/modules/Vtiger/CommonActions.tpl create mode 100644 layouts/vlayout/modules/Vtiger/Menu.tpl delete mode 100644 layouts/vlayout/modules/Vtiger/MenuBar.tpl delete mode 100644 layouts/vlayout/modules/Vtiger/TopMenus.tpl delete mode 100644 layouts/vlayout/modules/Vtiger/TopMenusLeft.tpl delete mode 100644 layouts/vlayout/modules/Vtiger/TopMenusRight.tpl diff --git a/config/version.php b/config/version.php index 9e6d991347ad..def64c48e99a 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150903'; -$YetiForce_current_version = '2.2.58'; +$YetiForce_current_version = '2.2.59'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/layouts/vlayout/modules/Calendar/CalendarViewPreProcess.tpl b/layouts/vlayout/modules/Calendar/CalendarViewPreProcess.tpl index 36a834737a70..e9e0f129c6c1 100644 --- a/layouts/vlayout/modules/Calendar/CalendarViewPreProcess.tpl +++ b/layouts/vlayout/modules/Calendar/CalendarViewPreProcess.tpl @@ -10,7 +10,6 @@ ********************************************************************************/ -->*} {include file="Header.tpl"|vtemplate_path:$MODULE} -{include file="BasicHeader.tpl"|vtemplate_path:$MODULE}
    {assign var=LEFTPANELHIDE value=$CURRENT_USER_MODEL->get('leftpanelhide')} diff --git a/layouts/vlayout/modules/Home/IndexViewPreProcess.tpl b/layouts/vlayout/modules/Home/IndexViewPreProcess.tpl index 72608951b703..cc6d1a81aae7 100644 --- a/layouts/vlayout/modules/Home/IndexViewPreProcess.tpl +++ b/layouts/vlayout/modules/Home/IndexViewPreProcess.tpl @@ -10,7 +10,6 @@ ********************************************************************************/ -->*} {include file="Header.tpl"|vtemplate_path:$MODULE} -{include file="BasicHeader.tpl"|vtemplate_path:$MODULE}
    diff --git a/layouts/vlayout/modules/Home/dashboards/DashBoardPreProcess.tpl b/layouts/vlayout/modules/Home/dashboards/DashBoardPreProcess.tpl index 42d96f5262de..0eeef32ef8c2 100644 --- a/layouts/vlayout/modules/Home/dashboards/DashBoardPreProcess.tpl +++ b/layouts/vlayout/modules/Home/dashboards/DashBoardPreProcess.tpl @@ -11,7 +11,6 @@ -->*} {strip} {include file="Header.tpl"|vtemplate_path:$MODULE} -{include file="BasicHeader.tpl"|vtemplate_path:$MODULE}
    diff --git a/layouts/vlayout/modules/OSSMail/IndexViewPreProcess.tpl b/layouts/vlayout/modules/OSSMail/IndexViewPreProcess.tpl index f2f810d8b7db..ea5420e557dc 100644 --- a/layouts/vlayout/modules/OSSMail/IndexViewPreProcess.tpl +++ b/layouts/vlayout/modules/OSSMail/IndexViewPreProcess.tpl @@ -9,9 +9,7 @@ * All Rights Reserved. *************************************************************************************************************************************/ -->*} - {include file="Header.tpl"|vtemplate_path:$MODULE} -{include file="BasicHeader.tpl"|vtemplate_path:$MODULE}
    diff --git a/layouts/vlayout/modules/OSSMailView/DetailViewPreProcess.tpl b/layouts/vlayout/modules/OSSMailView/DetailViewPreProcess.tpl index b40efa1cda9f..1121c0b80dc9 100644 --- a/layouts/vlayout/modules/OSSMailView/DetailViewPreProcess.tpl +++ b/layouts/vlayout/modules/OSSMailView/DetailViewPreProcess.tpl @@ -10,9 +10,7 @@ *************************************************************************************************************************************/ -->*} {strip} -{include file="Header.tpl"|vtemplate_path:$MODULE_NAME} -{include file="BasicHeader.tpl"|vtemplate_path:$MODULE_NAME} - +{include file="Header.tpl"|vtemplate_path:$MODULE}
    {assign var=LEFTPANELHIDE value=$CURRENT_USER_MODEL->get('leftpanelhide')} @@ -24,5 +22,4 @@
    {include file="DetailViewHeader.tpl"|vtemplate_path:'OSSMailView'} - -{/strip} \ No newline at end of file +{/strip} diff --git a/layouts/vlayout/modules/Settings/Vtiger/SettingsMenuStart.tpl b/layouts/vlayout/modules/Settings/Vtiger/SettingsMenuStart.tpl index 98055a67364d..53465678fa82 100644 --- a/layouts/vlayout/modules/Settings/Vtiger/SettingsMenuStart.tpl +++ b/layouts/vlayout/modules/Settings/Vtiger/SettingsMenuStart.tpl @@ -9,10 +9,8 @@ * ********************************************************************************/ -->*} -{include file="Header.tpl"|vtemplate_path:$MODULE} -{include file="BasicHeader.tpl"|vtemplate_path:$MODULE} - {strip} +{include file="Header.tpl"|vtemplate_path:$MODULE} {if $LOAD_OLD}
    diff --git a/layouts/vlayout/modules/Users/Body.tpl b/layouts/vlayout/modules/Users/Body.tpl new file mode 100644 index 000000000000..b6dac15916c6 --- /dev/null +++ b/layouts/vlayout/modules/Users/Body.tpl @@ -0,0 +1,19 @@ +{**} +{strip} + {if $VIEW != 'Login'} + {include file='BodyHidden.tpl'|@vtemplate_path:$MODULE} + {/if} +
    +
    + {if $VIEW != 'Login'} + {if !empty($CHILD_LINKS)} + + {/if} +
    + {include file='BodyLeft.tpl'|@vtemplate_path:$MODULE} +
    +
    + {include file='BodyHeader.tpl'|@vtemplate_path:$MODULE} + {include file='BodyContent.tpl'|@vtemplate_path:$MODULE} + {/if} + {/strip} diff --git a/layouts/vlayout/modules/Users/PreferenceDetailViewPreProcess.tpl b/layouts/vlayout/modules/Users/PreferenceDetailViewPreProcess.tpl index 0063e187600c..55d6ccf09fb8 100644 --- a/layouts/vlayout/modules/Users/PreferenceDetailViewPreProcess.tpl +++ b/layouts/vlayout/modules/Users/PreferenceDetailViewPreProcess.tpl @@ -9,13 +9,9 @@ * ********************************************************************************/ -->*} - {strip} {include file="Header.tpl"|vtemplate_path:$MODULE} -{include file="BasicHeader.tpl"|vtemplate_path:$MODULE} -
    {include file="PreferenceDetailViewHeader.tpl"|vtemplate_path:$MODULE} - -{/strip} \ No newline at end of file +{/strip} diff --git a/layouts/vlayout/modules/Users/UserEditViewPreProcess.tpl b/layouts/vlayout/modules/Users/UserEditViewPreProcess.tpl index 19513a90a78b..762ded370520 100644 --- a/layouts/vlayout/modules/Users/UserEditViewPreProcess.tpl +++ b/layouts/vlayout/modules/Users/UserEditViewPreProcess.tpl @@ -9,8 +9,6 @@ * ********************************************************************************/ -->*} - {include file="Header.tpl"|vtemplate_path:$MODULE} -{include file="BasicHeader.tpl"|vtemplate_path:$MODULE}
    diff --git a/layouts/vlayout/modules/Users/UserViewPreProcess.tpl b/layouts/vlayout/modules/Users/UserViewPreProcess.tpl index 7efbbcd8c7aa..9ee218bed5aa 100644 --- a/layouts/vlayout/modules/Users/UserViewPreProcess.tpl +++ b/layouts/vlayout/modules/Users/UserViewPreProcess.tpl @@ -9,13 +9,9 @@ * ********************************************************************************/ -->*} - {strip} {include file="Header.tpl"|vtemplate_path:$MODULE} -{include file="BasicHeader.tpl"|vtemplate_path:$MODULE} -
    {include file="UserViewHeader.tpl"|vtemplate_path:$MODULE} - -{/strip} \ No newline at end of file +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/BasicHeader.tpl b/layouts/vlayout/modules/Vtiger/BasicHeader.tpl deleted file mode 100644 index 4d60f229ce14..000000000000 --- a/layouts/vlayout/modules/Vtiger/BasicHeader.tpl +++ /dev/null @@ -1,28 +0,0 @@ -{**} -{strip} - -{/strip} diff --git a/layouts/vlayout/modules/Vtiger/Body.tpl b/layouts/vlayout/modules/Vtiger/Body.tpl new file mode 100644 index 000000000000..57ad0153573b --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/Body.tpl @@ -0,0 +1,13 @@ +{**} +{strip} + {include file='BodyHidden.tpl'|@vtemplate_path:$MODULE} +
    +
    + {assign var=LEFTPANELHIDE value=$CURRENT_USER_MODEL->get('leftpanelhide')} +
    + {include file='BodyLeft.tpl'|@vtemplate_path:$MODULE} +
    +
    + {include file='BodyHeader.tpl'|@vtemplate_path:$MODULE} + {include file='BodyContent.tpl'|@vtemplate_path:$MODULE} +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/BodyContent.tpl b/layouts/vlayout/modules/Vtiger/BodyContent.tpl new file mode 100644 index 000000000000..bb15135bb2a4 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/BodyContent.tpl @@ -0,0 +1,4 @@ +{**} +{strip} +
    + {/strip} diff --git a/layouts/vlayout/modules/Vtiger/BodyHeader.tpl b/layouts/vlayout/modules/Vtiger/BodyHeader.tpl new file mode 100644 index 000000000000..f6645dc3d3fd --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/BodyHeader.tpl @@ -0,0 +1,135 @@ +{**} +{strip} + {assign var='count' value=0} + {assign var="announcement" value=$ANNOUNCEMENT->get('announcement')} +
    +
    +
    +
    + {assign var=IMAGE value=$MODULE|cat:'48.png'} + {if file_exists( vimage_path($IMAGE) )} + {vtranslate($MODULE, $MODULE)} + {/if} +
    +

    {vtranslate($MODULE, $MODULE)}

    +
    +
    +
    + +
    +
    + + + {if !empty($announcement)} +
    +
    + {vtranslate('LBL_ANNOUNCEMENT',$MODULE)} +
    +
    + {/if} +
    +
    + {if !empty($announcement)} +
    + {include file='Announcement.tpl'|@vtemplate_path:$MODULE} + {/if} +
    + {/strip} diff --git a/layouts/vlayout/modules/Vtiger/BodyHidden.tpl b/layouts/vlayout/modules/Vtiger/BodyHidden.tpl new file mode 100644 index 000000000000..d4755b5b6951 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/BodyHidden.tpl @@ -0,0 +1,36 @@ +{**} +{strip} + +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/BodyLeft.tpl b/layouts/vlayout/modules/Vtiger/BodyLeft.tpl new file mode 100644 index 000000000000..9e26dbddb920 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/BodyLeft.tpl @@ -0,0 +1,88 @@ +{**} +{strip} + {assign var="COMPANY_DETAILS" value=Vtiger_CompanyDetails_Model::getInstanceById()} + {assign var="COMPANY_LOGO" value=$COMPANY_DETAILS->getLogo()} +
    +
    +
    + + + +
    +
    +
    + {foreach key=index item=obj from=$HEADER_LINKS} + {assign var="HREF" value='#'} + {assign var="ICON_PATH" value=$obj->getIconPath()} + {assign var="LINK" value=$obj->convertToNativeLink()} + {assign var="GLYPHICON" value=$obj->getGlyphiconIcon()} + {assign var="TITLE" value=$obj->getLabel()} + {assign var="CHILD_LINKS" value=$obj->getChildLinks()} + + {/foreach} +
    +

    {$CURRENT_USER_MODEL->get('first_name')} 

    +

    {$CURRENT_USER_MODEL->get('last_name')} 

    +

    {$COMPANY_DETAILS->get('organizationname')} 

    +
    +
    +
    +
    +
    +
    + 1 +
    +
    + 2 +
    +
    + 3 +
    +
    + 4 +
    +
    +
    + +{/strip} + diff --git a/layouts/vlayout/modules/Vtiger/CommonActions.tpl b/layouts/vlayout/modules/Vtiger/CommonActions.tpl deleted file mode 100644 index 6e406dc2b735..000000000000 --- a/layouts/vlayout/modules/Vtiger/CommonActions.tpl +++ /dev/null @@ -1,125 +0,0 @@ -{**} - -{strip} - {assign var="announcement" value=$ANNOUNCEMENT->get('announcement')} - {assign var='count' value=0} - {assign var="dateFormat" value=$USER_MODEL->get('date_format')} - - - - {if !empty($announcement)} - - {/if} - - - - {assign var="BREADCRUMBS" value=Vtiger_Menu_Model::getBreadcrumbs()} - {if $BREADCRUMBS} - - {/if} - {assign var="MENUSCOLOR" value=Users_Colors_Model::getModulesColors(true)} - {if $MENUSCOLOR} - - {/if} - -{/strip} diff --git a/layouts/vlayout/modules/Vtiger/DetailViewPreProcess.tpl b/layouts/vlayout/modules/Vtiger/DetailViewPreProcess.tpl index 18fef60be39c..e2391195b7c9 100644 --- a/layouts/vlayout/modules/Vtiger/DetailViewPreProcess.tpl +++ b/layouts/vlayout/modules/Vtiger/DetailViewPreProcess.tpl @@ -10,8 +10,7 @@ ********************************************************************************/ -->*} {strip} -{include file="Header.tpl"|vtemplate_path:$MODULE_NAME} -{include file="BasicHeader.tpl"|vtemplate_path:$MODULE_NAME} +{include file="Header.tpl"|vtemplate_path:$MODULE} {if $COLORLISTHANDLERS} -{/if} -
    -
    - {assign var=LEFTPANELHIDE value=$CURRENT_USER_MODEL->get('leftpanelhide')} -
    - {include file="DetailViewSidebar.tpl"|vtemplate_path:$MODULE_NAME} -
    -
    -
    - -
    + {include file="Header.tpl"|vtemplate_path:$MODULE} + {if $COLORLISTHANDLERS} + + {/if} +
    +
    +
    {include file="DetailViewHeader.tpl"|vtemplate_path:$MODULE_NAME} - -{/strip} + {/strip} diff --git a/layouts/vlayout/modules/Vtiger/FindDuplicatePreProcess.tpl b/layouts/vlayout/modules/Vtiger/FindDuplicatePreProcess.tpl index de78efc5b75e..d4efbe11a256 100644 --- a/layouts/vlayout/modules/Vtiger/FindDuplicatePreProcess.tpl +++ b/layouts/vlayout/modules/Vtiger/FindDuplicatePreProcess.tpl @@ -13,15 +13,7 @@ {include file="Header.tpl"|vtemplate_path:$MODULE}
    - {assign var=LEFTPANELHIDE value=$CURRENT_USER_MODEL->get('leftpanelhide')} -
    - {include file="ListViewSidebar.tpl"|vtemplate_path:$MODULE} -
    - -
    -
    - -
      +
    {include file="FindDuplicateHeader.tpl"|vtemplate_path:$MODULE} {/strip} diff --git a/layouts/vlayout/modules/Vtiger/IndexViewPreProcess.tpl b/layouts/vlayout/modules/Vtiger/IndexViewPreProcess.tpl index c782a4c7ceb7..f88f03a5eb1b 100644 --- a/layouts/vlayout/modules/Vtiger/IndexViewPreProcess.tpl +++ b/layouts/vlayout/modules/Vtiger/IndexViewPreProcess.tpl @@ -12,11 +12,4 @@ {include file="Header.tpl"|vtemplate_path:$MODULE}
    - {assign var=LEFTPANELHIDE value=$CURRENT_USER_MODEL->get('leftpanelhide')} -
    - {include file="ListViewSidebar.tpl"|vtemplate_path:$MODULE} -
    -
    -
    - -
    +
    diff --git a/layouts/vlayout/modules/Vtiger/dashboards/DashBoardPreProcess.tpl b/layouts/vlayout/modules/Vtiger/dashboards/DashBoardPreProcess.tpl index 59f7e56ae01e..1f39d187f820 100644 --- a/layouts/vlayout/modules/Vtiger/dashboards/DashBoardPreProcess.tpl +++ b/layouts/vlayout/modules/Vtiger/dashboards/DashBoardPreProcess.tpl @@ -13,14 +13,7 @@ {include file="Header.tpl"|vtemplate_path:$MODULE}
    - {assign var=LEFTPANELHIDE value=$CURRENT_USER_MODEL->get('leftpanelhide')} -
    - {include file="ListViewSidebar.tpl"|vtemplate_path:$MODULE_NAME} -
    -
    +
    -
    - -
      {include file="dashboards/DashBoardHeader.tpl"|vtemplate_path:$MODULE_NAME DASHBOARDHEADER_TITLE=vtranslate($MODULE, $MODULE)} {/strip} From 27ce12920c62932b8912bdc6fd21dea5143f66cb Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Thu, 3 Sep 2015 19:07:34 +0200 Subject: [PATCH 140/489] Revert "Redevelopment of the layouts" This reverts commit 35237c3aaa23d5315896e07dfaf3ff545c032ce5. --- config/version.php | 2 +- .../Calendar/CalendarViewPreProcess.tpl | 1 + .../modules/Home/IndexViewPreProcess.tpl | 1 + .../Home/dashboards/DashBoardPreProcess.tpl | 1 + .../modules/OSSMail/IndexViewPreProcess.tpl | 2 + .../OSSMailView/DetailViewPreProcess.tpl | 7 +- .../Settings/Vtiger/SettingsMenuStart.tpl | 4 +- layouts/vlayout/modules/Users/Body.tpl | 19 --- .../Users/PreferenceDetailViewPreProcess.tpl | 6 +- .../modules/Users/UserEditViewPreProcess.tpl | 2 + .../modules/Users/UserViewPreProcess.tpl | 6 +- .../vlayout/modules/Vtiger/BasicHeader.tpl | 28 ++++ layouts/vlayout/modules/Vtiger/Body.tpl | 13 -- .../vlayout/modules/Vtiger/BodyContent.tpl | 4 - layouts/vlayout/modules/Vtiger/BodyHeader.tpl | 135 ---------------- layouts/vlayout/modules/Vtiger/BodyHidden.tpl | 36 ----- layouts/vlayout/modules/Vtiger/BodyLeft.tpl | 88 ----------- .../vlayout/modules/Vtiger/CommonActions.tpl | 125 +++++++++++++++ .../modules/Vtiger/DetailViewPreProcess.tpl | 45 +++--- .../Vtiger/FindDuplicatePreProcess.tpl | 12 +- layouts/vlayout/modules/Vtiger/Header.tpl | 1 - .../modules/Vtiger/IndexViewPreProcess.tpl | 10 +- .../vlayout/modules/Vtiger/ListViewHeader.tpl | 146 ++++++++---------- .../modules/Vtiger/ListViewPreProcess.tpl | 30 ++-- layouts/vlayout/modules/Vtiger/Menu.tpl | 22 --- layouts/vlayout/modules/Vtiger/MenuBar.tpl | 21 +++ .../vlayout/modules/Vtiger/SideBarLinks.tpl | 6 + layouts/vlayout/modules/Vtiger/TopMenus.tpl | 11 ++ .../vlayout/modules/Vtiger/TopMenusLeft.tpl | 25 +++ .../vlayout/modules/Vtiger/TopMenusRight.tpl | 144 +++++++++++++++++ .../vlayout/modules/Vtiger/UI5EmbedView.tpl | 5 +- .../Vtiger/dashboards/DashBoardPreProcess.tpl | 10 +- .../vlayout/modules/Vtiger/menu/Module.tpl | 4 +- .../modules/Vtiger/resources/Header.js | 6 +- .../modules/Vtiger/resources/Header.min.js | 2 +- layouts/vlayout/resources/app.js | 4 +- layouts/vlayout/resources/app.min.js | 2 +- layouts/vlayout/skins/login.css | 3 - layouts/vlayout/skins/login.min.css | 2 +- layouts/vlayout/skins/twilight/style.css | 106 +------------ layouts/vlayout/skins/twilight/style.min.css | 2 +- modules/Users/views/Login.php | 17 -- modules/Vtiger/models/Link.php | 9 -- modules/Vtiger/views/Header.php | 117 ++++++++------ storage/Logo/logo_yetiforce.png | Bin 18264 -> 33546 bytes vtlib/Vtiger/Link.php | 2 - 46 files changed, 610 insertions(+), 634 deletions(-) delete mode 100644 layouts/vlayout/modules/Users/Body.tpl create mode 100644 layouts/vlayout/modules/Vtiger/BasicHeader.tpl delete mode 100644 layouts/vlayout/modules/Vtiger/Body.tpl delete mode 100644 layouts/vlayout/modules/Vtiger/BodyContent.tpl delete mode 100644 layouts/vlayout/modules/Vtiger/BodyHeader.tpl delete mode 100644 layouts/vlayout/modules/Vtiger/BodyHidden.tpl delete mode 100644 layouts/vlayout/modules/Vtiger/BodyLeft.tpl create mode 100644 layouts/vlayout/modules/Vtiger/CommonActions.tpl delete mode 100644 layouts/vlayout/modules/Vtiger/Menu.tpl create mode 100644 layouts/vlayout/modules/Vtiger/MenuBar.tpl create mode 100644 layouts/vlayout/modules/Vtiger/TopMenus.tpl create mode 100644 layouts/vlayout/modules/Vtiger/TopMenusLeft.tpl create mode 100644 layouts/vlayout/modules/Vtiger/TopMenusRight.tpl diff --git a/config/version.php b/config/version.php index def64c48e99a..9e6d991347ad 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150903'; -$YetiForce_current_version = '2.2.59'; +$YetiForce_current_version = '2.2.58'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/layouts/vlayout/modules/Calendar/CalendarViewPreProcess.tpl b/layouts/vlayout/modules/Calendar/CalendarViewPreProcess.tpl index e9e0f129c6c1..36a834737a70 100644 --- a/layouts/vlayout/modules/Calendar/CalendarViewPreProcess.tpl +++ b/layouts/vlayout/modules/Calendar/CalendarViewPreProcess.tpl @@ -10,6 +10,7 @@ ********************************************************************************/ -->*} {include file="Header.tpl"|vtemplate_path:$MODULE} +{include file="BasicHeader.tpl"|vtemplate_path:$MODULE}
    {assign var=LEFTPANELHIDE value=$CURRENT_USER_MODEL->get('leftpanelhide')} diff --git a/layouts/vlayout/modules/Home/IndexViewPreProcess.tpl b/layouts/vlayout/modules/Home/IndexViewPreProcess.tpl index cc6d1a81aae7..72608951b703 100644 --- a/layouts/vlayout/modules/Home/IndexViewPreProcess.tpl +++ b/layouts/vlayout/modules/Home/IndexViewPreProcess.tpl @@ -10,6 +10,7 @@ ********************************************************************************/ -->*} {include file="Header.tpl"|vtemplate_path:$MODULE} +{include file="BasicHeader.tpl"|vtemplate_path:$MODULE}
    diff --git a/layouts/vlayout/modules/Home/dashboards/DashBoardPreProcess.tpl b/layouts/vlayout/modules/Home/dashboards/DashBoardPreProcess.tpl index 0eeef32ef8c2..42d96f5262de 100644 --- a/layouts/vlayout/modules/Home/dashboards/DashBoardPreProcess.tpl +++ b/layouts/vlayout/modules/Home/dashboards/DashBoardPreProcess.tpl @@ -11,6 +11,7 @@ -->*} {strip} {include file="Header.tpl"|vtemplate_path:$MODULE} +{include file="BasicHeader.tpl"|vtemplate_path:$MODULE}
    diff --git a/layouts/vlayout/modules/OSSMail/IndexViewPreProcess.tpl b/layouts/vlayout/modules/OSSMail/IndexViewPreProcess.tpl index ea5420e557dc..f2f810d8b7db 100644 --- a/layouts/vlayout/modules/OSSMail/IndexViewPreProcess.tpl +++ b/layouts/vlayout/modules/OSSMail/IndexViewPreProcess.tpl @@ -9,7 +9,9 @@ * All Rights Reserved. *************************************************************************************************************************************/ -->*} + {include file="Header.tpl"|vtemplate_path:$MODULE} +{include file="BasicHeader.tpl"|vtemplate_path:$MODULE}
    diff --git a/layouts/vlayout/modules/OSSMailView/DetailViewPreProcess.tpl b/layouts/vlayout/modules/OSSMailView/DetailViewPreProcess.tpl index 1121c0b80dc9..b40efa1cda9f 100644 --- a/layouts/vlayout/modules/OSSMailView/DetailViewPreProcess.tpl +++ b/layouts/vlayout/modules/OSSMailView/DetailViewPreProcess.tpl @@ -10,7 +10,9 @@ *************************************************************************************************************************************/ -->*} {strip} -{include file="Header.tpl"|vtemplate_path:$MODULE} +{include file="Header.tpl"|vtemplate_path:$MODULE_NAME} +{include file="BasicHeader.tpl"|vtemplate_path:$MODULE_NAME} +
    {assign var=LEFTPANELHIDE value=$CURRENT_USER_MODEL->get('leftpanelhide')} @@ -22,4 +24,5 @@
    {include file="DetailViewHeader.tpl"|vtemplate_path:'OSSMailView'} -{/strip} + +{/strip} \ No newline at end of file diff --git a/layouts/vlayout/modules/Settings/Vtiger/SettingsMenuStart.tpl b/layouts/vlayout/modules/Settings/Vtiger/SettingsMenuStart.tpl index 53465678fa82..98055a67364d 100644 --- a/layouts/vlayout/modules/Settings/Vtiger/SettingsMenuStart.tpl +++ b/layouts/vlayout/modules/Settings/Vtiger/SettingsMenuStart.tpl @@ -9,8 +9,10 @@ * ********************************************************************************/ -->*} -{strip} {include file="Header.tpl"|vtemplate_path:$MODULE} +{include file="BasicHeader.tpl"|vtemplate_path:$MODULE} + +{strip} {if $LOAD_OLD}
    diff --git a/layouts/vlayout/modules/Users/Body.tpl b/layouts/vlayout/modules/Users/Body.tpl deleted file mode 100644 index b6dac15916c6..000000000000 --- a/layouts/vlayout/modules/Users/Body.tpl +++ /dev/null @@ -1,19 +0,0 @@ -{**} -{strip} - {if $VIEW != 'Login'} - {include file='BodyHidden.tpl'|@vtemplate_path:$MODULE} - {/if} -
    -
    - {if $VIEW != 'Login'} - {if !empty($CHILD_LINKS)} - - {/if} -
    - {include file='BodyLeft.tpl'|@vtemplate_path:$MODULE} -
    -
    - {include file='BodyHeader.tpl'|@vtemplate_path:$MODULE} - {include file='BodyContent.tpl'|@vtemplate_path:$MODULE} - {/if} - {/strip} diff --git a/layouts/vlayout/modules/Users/PreferenceDetailViewPreProcess.tpl b/layouts/vlayout/modules/Users/PreferenceDetailViewPreProcess.tpl index 55d6ccf09fb8..0063e187600c 100644 --- a/layouts/vlayout/modules/Users/PreferenceDetailViewPreProcess.tpl +++ b/layouts/vlayout/modules/Users/PreferenceDetailViewPreProcess.tpl @@ -9,9 +9,13 @@ * ********************************************************************************/ -->*} + {strip} {include file="Header.tpl"|vtemplate_path:$MODULE} +{include file="BasicHeader.tpl"|vtemplate_path:$MODULE} +
    {include file="PreferenceDetailViewHeader.tpl"|vtemplate_path:$MODULE} -{/strip} + +{/strip} \ No newline at end of file diff --git a/layouts/vlayout/modules/Users/UserEditViewPreProcess.tpl b/layouts/vlayout/modules/Users/UserEditViewPreProcess.tpl index 762ded370520..19513a90a78b 100644 --- a/layouts/vlayout/modules/Users/UserEditViewPreProcess.tpl +++ b/layouts/vlayout/modules/Users/UserEditViewPreProcess.tpl @@ -9,6 +9,8 @@ * ********************************************************************************/ -->*} + {include file="Header.tpl"|vtemplate_path:$MODULE} +{include file="BasicHeader.tpl"|vtemplate_path:$MODULE}
    diff --git a/layouts/vlayout/modules/Users/UserViewPreProcess.tpl b/layouts/vlayout/modules/Users/UserViewPreProcess.tpl index 9ee218bed5aa..7efbbcd8c7aa 100644 --- a/layouts/vlayout/modules/Users/UserViewPreProcess.tpl +++ b/layouts/vlayout/modules/Users/UserViewPreProcess.tpl @@ -9,9 +9,13 @@ * ********************************************************************************/ -->*} + {strip} {include file="Header.tpl"|vtemplate_path:$MODULE} +{include file="BasicHeader.tpl"|vtemplate_path:$MODULE} +
    {include file="UserViewHeader.tpl"|vtemplate_path:$MODULE} -{/strip} + +{/strip} \ No newline at end of file diff --git a/layouts/vlayout/modules/Vtiger/BasicHeader.tpl b/layouts/vlayout/modules/Vtiger/BasicHeader.tpl new file mode 100644 index 000000000000..4d60f229ce14 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/BasicHeader.tpl @@ -0,0 +1,28 @@ +{**} +{strip} + +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/Body.tpl b/layouts/vlayout/modules/Vtiger/Body.tpl deleted file mode 100644 index 57ad0153573b..000000000000 --- a/layouts/vlayout/modules/Vtiger/Body.tpl +++ /dev/null @@ -1,13 +0,0 @@ -{**} -{strip} - {include file='BodyHidden.tpl'|@vtemplate_path:$MODULE} -
    -
    - {assign var=LEFTPANELHIDE value=$CURRENT_USER_MODEL->get('leftpanelhide')} -
    - {include file='BodyLeft.tpl'|@vtemplate_path:$MODULE} -
    -
    - {include file='BodyHeader.tpl'|@vtemplate_path:$MODULE} - {include file='BodyContent.tpl'|@vtemplate_path:$MODULE} -{/strip} diff --git a/layouts/vlayout/modules/Vtiger/BodyContent.tpl b/layouts/vlayout/modules/Vtiger/BodyContent.tpl deleted file mode 100644 index bb15135bb2a4..000000000000 --- a/layouts/vlayout/modules/Vtiger/BodyContent.tpl +++ /dev/null @@ -1,4 +0,0 @@ -{**} -{strip} -
    - {/strip} diff --git a/layouts/vlayout/modules/Vtiger/BodyHeader.tpl b/layouts/vlayout/modules/Vtiger/BodyHeader.tpl deleted file mode 100644 index f6645dc3d3fd..000000000000 --- a/layouts/vlayout/modules/Vtiger/BodyHeader.tpl +++ /dev/null @@ -1,135 +0,0 @@ -{**} -{strip} - {assign var='count' value=0} - {assign var="announcement" value=$ANNOUNCEMENT->get('announcement')} -
    -
    -
    -
    - {assign var=IMAGE value=$MODULE|cat:'48.png'} - {if file_exists( vimage_path($IMAGE) )} - {vtranslate($MODULE, $MODULE)} - {/if} -
    -

    {vtranslate($MODULE, $MODULE)}

    -
    -
    -
    - -
    -
    - -
    - -
    - {assign var=CONFIG value=Settings_Mail_Config_Model::getConfig('mailIcon')} - {assign var=AUTOLOGINUSERS value=OSSMail_Autologin_Model::getAutologinUsers()} - {if $CONFIG['showMailIcon']=='true' && count($AUTOLOGINUSERS) > 0} - {assign var=MAIN_MAIL value=OSSMail_Module_Model::getDefaultMailAccount($AUTOLOGINUSERS)} -
    -
    - - {$ITEM.username} - {$MAIN_MAIL.username} - - - {if $CONFIG['showMailAccounts']=='true'} - - - {/if} -
    -
    - {/if} -
    - {if !empty($announcement)} -
    -
    - {vtranslate('LBL_ANNOUNCEMENT',$MODULE)} -
    -
    - {/if} -
    -
    - {if !empty($announcement)} -
    - {include file='Announcement.tpl'|@vtemplate_path:$MODULE} - {/if} -
    - {/strip} diff --git a/layouts/vlayout/modules/Vtiger/BodyHidden.tpl b/layouts/vlayout/modules/Vtiger/BodyHidden.tpl deleted file mode 100644 index d4755b5b6951..000000000000 --- a/layouts/vlayout/modules/Vtiger/BodyHidden.tpl +++ /dev/null @@ -1,36 +0,0 @@ -{**} -{strip} - -{/strip} diff --git a/layouts/vlayout/modules/Vtiger/BodyLeft.tpl b/layouts/vlayout/modules/Vtiger/BodyLeft.tpl deleted file mode 100644 index 9e26dbddb920..000000000000 --- a/layouts/vlayout/modules/Vtiger/BodyLeft.tpl +++ /dev/null @@ -1,88 +0,0 @@ -{**} -{strip} - {assign var="COMPANY_DETAILS" value=Vtiger_CompanyDetails_Model::getInstanceById()} - {assign var="COMPANY_LOGO" value=$COMPANY_DETAILS->getLogo()} -
    -
    -
    - - - -
    -
    -
    - {foreach key=index item=obj from=$HEADER_LINKS} - {assign var="HREF" value='#'} - {assign var="ICON_PATH" value=$obj->getIconPath()} - {assign var="LINK" value=$obj->convertToNativeLink()} - {assign var="GLYPHICON" value=$obj->getGlyphiconIcon()} - {assign var="TITLE" value=$obj->getLabel()} - {assign var="CHILD_LINKS" value=$obj->getChildLinks()} - - {/foreach} -
    -

    {$CURRENT_USER_MODEL->get('first_name')} 

    -

    {$CURRENT_USER_MODEL->get('last_name')} 

    -

    {$COMPANY_DETAILS->get('organizationname')} 

    -
    -
    -
    -
    -
    -
    - 1 -
    -
    - 2 -
    -
    - 3 -
    -
    - 4 -
    -
    -
    - -{/strip} - diff --git a/layouts/vlayout/modules/Vtiger/CommonActions.tpl b/layouts/vlayout/modules/Vtiger/CommonActions.tpl new file mode 100644 index 000000000000..6e406dc2b735 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/CommonActions.tpl @@ -0,0 +1,125 @@ +{**} + +{strip} + {assign var="announcement" value=$ANNOUNCEMENT->get('announcement')} + {assign var='count' value=0} + {assign var="dateFormat" value=$USER_MODEL->get('date_format')} + + + + {if !empty($announcement)} + + {/if} + + + + {assign var="BREADCRUMBS" value=Vtiger_Menu_Model::getBreadcrumbs()} + {if $BREADCRUMBS} + + {/if} + {assign var="MENUSCOLOR" value=Users_Colors_Model::getModulesColors(true)} + {if $MENUSCOLOR} + + {/if} + +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/DetailViewPreProcess.tpl b/layouts/vlayout/modules/Vtiger/DetailViewPreProcess.tpl index af988300f873..18fef60be39c 100644 --- a/layouts/vlayout/modules/Vtiger/DetailViewPreProcess.tpl +++ b/layouts/vlayout/modules/Vtiger/DetailViewPreProcess.tpl @@ -1,25 +1,34 @@ {**} {strip} - {include file="Header.tpl"|vtemplate_path:$MODULE} - {if $COLORLISTHANDLERS} - - {/if} -
    -
    -
    +{include file="Header.tpl"|vtemplate_path:$MODULE_NAME} +{include file="BasicHeader.tpl"|vtemplate_path:$MODULE_NAME} +{if $COLORLISTHANDLERS} + +{/if} +
    +
    + {assign var=LEFTPANELHIDE value=$CURRENT_USER_MODEL->get('leftpanelhide')} +
    + {include file="DetailViewSidebar.tpl"|vtemplate_path:$MODULE_NAME} +
    +
    +
    + +
    {include file="DetailViewHeader.tpl"|vtemplate_path:$MODULE_NAME} - {/strip} + +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/FindDuplicatePreProcess.tpl b/layouts/vlayout/modules/Vtiger/FindDuplicatePreProcess.tpl index d4efbe11a256..dea3d63a7284 100644 --- a/layouts/vlayout/modules/Vtiger/FindDuplicatePreProcess.tpl +++ b/layouts/vlayout/modules/Vtiger/FindDuplicatePreProcess.tpl @@ -11,9 +11,19 @@ -->*} {strip} {include file="Header.tpl"|vtemplate_path:$MODULE} +{include file="BasicHeader.tpl"|vtemplate_path:$MODULE} +
    -
    + {assign var=LEFTPANELHIDE value=$CURRENT_USER_MODEL->get('leftpanelhide')} +
    + {include file="ListViewSidebar.tpl"|vtemplate_path:$MODULE} +
    + +
    +
    + +
      {include file="FindDuplicateHeader.tpl"|vtemplate_path:$MODULE} {/strip} diff --git a/layouts/vlayout/modules/Vtiger/Header.tpl b/layouts/vlayout/modules/Vtiger/Header.tpl index b3a11b1c1f0e..57735d6d6866 100644 --- a/layouts/vlayout/modules/Vtiger/Header.tpl +++ b/layouts/vlayout/modules/Vtiger/Header.tpl @@ -55,5 +55,4 @@
    - {include file='Body.tpl'|@vtemplate_path:$MODULE} {/strip} diff --git a/layouts/vlayout/modules/Vtiger/IndexViewPreProcess.tpl b/layouts/vlayout/modules/Vtiger/IndexViewPreProcess.tpl index f88f03a5eb1b..bfc8e7ca4fe8 100644 --- a/layouts/vlayout/modules/Vtiger/IndexViewPreProcess.tpl +++ b/layouts/vlayout/modules/Vtiger/IndexViewPreProcess.tpl @@ -10,6 +10,14 @@ ********************************************************************************/ -->*} {include file="Header.tpl"|vtemplate_path:$MODULE} +{include file="BasicHeader.tpl"|vtemplate_path:$MODULE}
    -
    + {assign var=LEFTPANELHIDE value=$CURRENT_USER_MODEL->get('leftpanelhide')} +
    + {include file="ListViewSidebar.tpl"|vtemplate_path:$MODULE} +
    +
    +
    + +
    diff --git a/layouts/vlayout/modules/Vtiger/ListViewHeader.tpl b/layouts/vlayout/modules/Vtiger/ListViewHeader.tpl index fa4674e88b03..a93bab686ca8 100644 --- a/layouts/vlayout/modules/Vtiger/ListViewHeader.tpl +++ b/layouts/vlayout/modules/Vtiger/ListViewHeader.tpl @@ -1,116 +1,92 @@ {**} {strip}
    -
    - {if count($QUICK_LINKS['SIDEBARLINK']) gt 0} - - - {/if} -
    {if count($LISTVIEW_MASSACTIONS) gt 0 || $LISTVIEW_LINKS['LISTVIEW']|@count gt 0} {/if}
    {foreach item=LISTVIEW_BASICACTION from=$LISTVIEW_LINKS['LISTVIEWBASIC']}
    - +
    {/foreach}
    -
    - - {if $CUSTOM_VIEWS|@count gt 0} - - {if Users_Privileges_Model::isPermitted($MODULE, 'CreateCustomFilter')} - -
    -
      -
    • {vtranslate('LBL_CREATE_NEW_FILTER')}
    • -
    -
    +
    + + {if $CUSTOM_VIEWS|@count gt 0} + + + {if Users_Privileges_Model::isPermitted($MODULE, 'CreateCustomFilter')} + +
    +
      +
    • {vtranslate('LBL_CREATE_NEW_FILTER')}
    • +
    +
    {/if} -
    -
    -
    - {include file='ListViewActions.tpl'|@vtemplate_path} -
    - - - - - - + + {else} + + {/if}
    +
    + {include file='ListViewActions.tpl'|@vtemplate_path} +
    + + + + + + + +
    -
    - {/strip} +
    +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/ListViewPreProcess.tpl b/layouts/vlayout/modules/Vtiger/ListViewPreProcess.tpl index ae4002270a3f..8b421cd45878 100644 --- a/layouts/vlayout/modules/Vtiger/ListViewPreProcess.tpl +++ b/layouts/vlayout/modules/Vtiger/ListViewPreProcess.tpl @@ -1,18 +1,26 @@ {**} {strip} - {include file="Header.tpl"|vtemplate_path:$MODULE} -
    -
    -
    +{include file="Header.tpl"|vtemplate_path:$MODULE} +{include file="BasicHeader.tpl"|vtemplate_path:$MODULE} +
    +
    + {assign var=LEFTPANELHIDE value=$CURRENT_USER_MODEL->get('leftpanelhide')} +
    + {include file="ListViewSidebar.tpl"|vtemplate_path:$MODULE} +
    +
    +
    + +
    {include file="ListViewHeader.tpl"|vtemplate_path:$MODULE} - {/strip} +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/Menu.tpl b/layouts/vlayout/modules/Vtiger/Menu.tpl deleted file mode 100644 index 6e847cb39273..000000000000 --- a/layouts/vlayout/modules/Vtiger/Menu.tpl +++ /dev/null @@ -1,22 +0,0 @@ -{**} -{strip} - -{/strip} diff --git a/layouts/vlayout/modules/Vtiger/MenuBar.tpl b/layouts/vlayout/modules/Vtiger/MenuBar.tpl new file mode 100644 index 000000000000..a2e1601d565e --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/MenuBar.tpl @@ -0,0 +1,21 @@ +{**} +{strip} + + + {include file='Announcement.tpl'|@vtemplate_path:$MODULE} + + + +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/SideBarLinks.tpl b/layouts/vlayout/modules/Vtiger/SideBarLinks.tpl index 9231ac2c6781..a2960c7f0e0f 100644 --- a/layouts/vlayout/modules/Vtiger/SideBarLinks.tpl +++ b/layouts/vlayout/modules/Vtiger/SideBarLinks.tpl @@ -11,6 +11,12 @@ -->*} {strip}
    + {assign var=IMAGE value=$MODULE|cat:'.png'} + {if file_exists( vimage_path($IMAGE) )} + {vtranslate($MODULE, $MODULE)} + {/if} +

    {vtranslate($MODULE, $MODULE)}

    +

    {foreach item=SIDEBARLINK from=$QUICK_LINKS['SIDEBARLINK']} {assign var=SIDE_LINK_URL value=decode_html($SIDEBARLINK->getUrl())} diff --git a/layouts/vlayout/modules/Vtiger/TopMenus.tpl b/layouts/vlayout/modules/Vtiger/TopMenus.tpl new file mode 100644 index 000000000000..ff896c9107c1 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/TopMenus.tpl @@ -0,0 +1,11 @@ +{*/*+*********************************************************************************************************************************** + * The contents of this file are subject to the YetiForce Public License Version 1.1 (the "License"); you may not use this file except + * in compliance with the License. + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. + * See the License for the specific language governing rights and limitations under the License. + * The Original Code is YetiForce. + * The Initial Developer of the Original Code is YetiForce. Portions created by YetiForce are Copyright (C) www.yetiforce.com. + * All Rights Reserved. + *************************************************************************************************************************************/*} + {include file='TopMenusRight.tpl'|@vtemplate_path:$MODULE} + {include file='TopMenusLeft.tpl'|@vtemplate_path:$MODULE} diff --git a/layouts/vlayout/modules/Vtiger/TopMenusLeft.tpl b/layouts/vlayout/modules/Vtiger/TopMenusLeft.tpl new file mode 100644 index 000000000000..13173957297e --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/TopMenusLeft.tpl @@ -0,0 +1,25 @@ +{*/*+*********************************************************************************************************************************** + * The contents of this file are subject to the YetiForce Public License Version 1.1 (the "License"); you may not use this file except + * in compliance with the License. + * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. + * See the License for the specific language governing rights and limitations under the License. + * The Original Code is YetiForce. + * The Initial Developer of the Original Code is YetiForce. Portions created by YetiForce are Copyright (C) www.yetiforce.com. + * All Rights Reserved. + *************************************************************************************************************************************/*} +{assign var=PRIVILEGESMODEL value=Users_Privileges_Model::getCurrentUserPrivilegesModel()} +{assign var=TABINDEX value=0} +{foreach key=KEY item=MENU from=$MENUS} + {assign var=TABINDEX value=$TABINDEX+1} + {assign var=CHILDS value=$MENU.childs} + {if $CHILDS|@count neq 0} + {assign var=HASPOPUP value='true'} + {assign var=CLASS value='dropdown'} + {else} + {assign var=CLASS value=''} + {assign var=HASPOPUP value='false'} + {/if} + +{/foreach} \ No newline at end of file diff --git a/layouts/vlayout/modules/Vtiger/TopMenusRight.tpl b/layouts/vlayout/modules/Vtiger/TopMenusRight.tpl new file mode 100644 index 000000000000..d88d072ef695 --- /dev/null +++ b/layouts/vlayout/modules/Vtiger/TopMenusRight.tpl @@ -0,0 +1,144 @@ +{strip} + {if $PAINTEDICON eq 1} + + {/if} + {foreach key=index item=obj from=$HEADER_LINKS} + {assign var="src" value=$obj->getIconPath()} + {assign var="icon" value=$obj->getIcon()} + {assign var="title" value=$obj->getLabel()} + {assign var="childLinks" value=$obj->getChildLinks()} + + {/foreach} + +{if $CHAT_ACTIVE eq true} + +{/if} +{assign var=CONFIG value=Settings_Mail_Config_Model::getConfig('mailIcon')} +{assign var=AUTOLOGINUSERS value=OSSMail_Autologin_Model::getAutologinUsers()} +{if $CONFIG['showMailIcon']=='true' && count($AUTOLOGINUSERS) > 0} + {assign var=MAIN_MAIL value=OSSMail_Module_Model::getDefaultMailAccount($AUTOLOGINUSERS)} + +{/if} +
    + + + + + + + + +
    +{/strip} diff --git a/layouts/vlayout/modules/Vtiger/UI5EmbedView.tpl b/layouts/vlayout/modules/Vtiger/UI5EmbedView.tpl index 965428dd06f5..e766b473cf40 100644 --- a/layouts/vlayout/modules/Vtiger/UI5EmbedView.tpl +++ b/layouts/vlayout/modules/Vtiger/UI5EmbedView.tpl @@ -9,11 +9,12 @@ * ********************************************************************************/ -->*} -{strip} {include file="Header.tpl"|vtemplate_path:$MODULE} +{include file="BasicHeader.tpl"|vtemplate_path:$MODULE} +{strip}
    -{/strip} +{/strip} \ No newline at end of file diff --git a/layouts/vlayout/modules/Vtiger/dashboards/DashBoardPreProcess.tpl b/layouts/vlayout/modules/Vtiger/dashboards/DashBoardPreProcess.tpl index 1f39d187f820..7085f79ecaa2 100644 --- a/layouts/vlayout/modules/Vtiger/dashboards/DashBoardPreProcess.tpl +++ b/layouts/vlayout/modules/Vtiger/dashboards/DashBoardPreProcess.tpl @@ -11,9 +11,17 @@ -->*} {strip} {include file="Header.tpl"|vtemplate_path:$MODULE} +{include file="BasicHeader.tpl"|vtemplate_path:$MODULE}
    -
    + {assign var=LEFTPANELHIDE value=$CURRENT_USER_MODEL->get('leftpanelhide')} +
    + {include file="ListViewSidebar.tpl"|vtemplate_path:$MODULE_NAME} +
    +
    +
    + +
      {include file="dashboards/DashBoardHeader.tpl"|vtemplate_path:$MODULE_NAME DASHBOARDHEADER_TITLE=vtranslate($MODULE, $MODULE)} {/strip} diff --git a/layouts/vlayout/modules/Vtiger/menu/Module.tpl b/layouts/vlayout/modules/Vtiger/menu/Module.tpl index 98a4a4bf784c..31241751a457 100644 --- a/layouts/vlayout/modules/Vtiger/menu/Module.tpl +++ b/layouts/vlayout/modules/Vtiger/menu/Module.tpl @@ -1,8 +1,6 @@ {if vtlib_isModuleActive($MENU.name) AND ($PRIVILEGESMODEL->isAdminUser() || $PRIVILEGESMODEL->hasGlobalReadPermission() || $PRIVILEGESMODEL->hasModulePermission($MENU.tabid) ) }
  • {/if} diff --git a/layouts/vlayout/modules/Vtiger/resources/Header.js b/layouts/vlayout/modules/Vtiger/resources/Header.js index ea42aa3ea26c..89521fea8f31 100644 --- a/layouts/vlayout/modules/Vtiger/resources/Header.js +++ b/layouts/vlayout/modules/Vtiger/resources/Header.js @@ -767,15 +767,15 @@ jQuery.Class("Vtiger_Header_Js", { //Added to support standard resolution 1024x768 if (window.outerWidth <= 1024) { - //$('.headerLinksContainer').css('margin-right', '8px'); + $('.headerLinksContainer').css('margin-right', '8px'); } // setting sidebar Height wrt Content $(document).ajaxComplete(function () { - //Vtiger_Header_Js.getInstance().adjustContentHeight(); + Vtiger_Header_Js.getInstance().adjustContentHeight(); }); $(document).load(function () { - //Vtiger_Header_Js.getInstance().adjustContentHeight(); + Vtiger_Header_Js.getInstance().adjustContentHeight(); }); thisInstance.registerReminderNotice(); } diff --git a/layouts/vlayout/modules/Vtiger/resources/Header.min.js b/layouts/vlayout/modules/Vtiger/resources/Header.min.js index 1ef29c6c3d6e..da9d1c0d7e7d 100644 --- a/layouts/vlayout/modules/Vtiger/resources/Header.min.js +++ b/layouts/vlayout/modules/Vtiger/resources/Header.min.js @@ -1,2 +1,2 @@ -if(/MSIE 6.0/.test(navigator.userAgent)||/MSIE 7.0/.test(navigator.userAgent)||/MSIE 8.0/.test(navigator.userAgent)||/MSIE 9.0/.test(navigator.userAgent)){if(app.getCookie("oldbrowser")!="true"){app.setCookie("oldbrowser",true,365);window.location.href="layouts/vlayout/modules/Vtiger/browsercompatibility/Browser_compatibility.html"}}jQuery.Class("Vtiger_Header_Js",{quickCreateModuleCache:{},self:false,getInstance:function(){if(this.self!=false){return this.self}this.self=new Vtiger_Header_Js();return this.self}},{menuContainer:false,contentContainer:false,quickCreateCallBacks:[],init:function(){this.setMenuContainer(".navbar-fixed-top").setContentsContainer(".mainContainer")},setMenuContainer:function(a){if(a instanceof jQuery){this.menuContainer=a}else{this.menuContainer=jQuery(a)}return this},getMenuContainer:function(){return this.menuContainer},setContentsContainer:function(a){if(a instanceof jQuery){this.contentContainer=a}else{this.contentContainer=jQuery(a)}return this},getContentsContainer:function(){return this.contentContainer},getQuickCreateForm:function(c,b,f){var d=this;var a=jQuery.Deferred();var e;if(typeof f=="undefined"){f={}}if((!f.noCache)||(typeof(f.noCache)=="undefined")){if(typeof Vtiger_Header_Js.quickCreateModuleCache[b]!="undefined"){a.resolve(Vtiger_Header_Js.quickCreateModuleCache[b]);return a.promise()}}e=c;if(typeof f.data!="undefined"){var e={};e.data=f.data;e.url=c}AppConnector.request(e).then(function(g){if((!f.noCache)||(typeof(f.noCache)=="undefined")){Vtiger_Header_Js.quickCreateModuleCache[b]=g}a.resolve(g)});return a.promise()},registerQuickCreateCallBack:function(a){if(typeof a!="function"){return false}this.quickCreateCallBacks.push(a);return true},alignContentsContainer:function(a,f,e){var c=jQuery("nav.navbar-fixed-top").outerHeight();if(!a){var d=jQuery("#announcement").outerHeight();c=(c-d)}var b=this.getContentsContainer();b.animate({"margin-top":c},f,e);return this},quickCreateSave:function(c){var a=jQuery.Deferred();var b=c.serializeFormData();AppConnector.request(b).then(function(d){a.resolve(d)},function(e,d){a.reject(e,d)});return a.promise()},quickCreateGoToFullForm:function(a,b){a.find('input[name="action"]').remove();a.append('');$.each(a.find("[data-validation-engine]"),function(c,d){jQuery(d).removeAttr("data-validation-engine")});a.addClass("not_validation");a.submit()},setAnnouncement:function(){var a=app.cacheGet("announcement.turnoff",false);var c=jQuery("#announcementBtn");var b=this;if(a===true){jQuery("#announcement").hide();c.attr("src",app.vimage_path("btnAnnounceOff.png"));b.alignContentsContainer("69px",0,"linear")}else{jQuery("#announcement").show();c.attr("src",app.vimage_path("btnAnnounce.png"));b.alignContentsContainer("92px",0,"linear")}},registerAnnouncement:function(){var a=this;var b=jQuery("#announcementBtn");var c="announcement.turnoff";b.click(function(g,d){var f=jQuery("#announcement").css("display");if(f=="none"){jQuery("#announcement").show();a.alignContentsContainer(true,200,"linear");b.attr("src",app.vimage_path("btnAnnounce.png"));if(!d){app.cacheSet(c,false)}}else{a.alignContentsContainer(false,200,"linear");jQuery("#announcement").hide();b.attr("src",app.vimage_path("btnAnnounceOff.png"));if(!d){app.cacheSet(c,true)}}});if(app.cacheGet(c,false)){b.trigger("click",true)}},registerCalendarButtonClickEvent:function(){var c=jQuery("#calendarBtn");var a=c.data("dateFormat");var b=c.data("date");var d=app.convertToDatePickerFormat(a);c.on("click",function(g){g.stopImmediatePropagation();c.closest("div.nav").find("div.open").removeClass("open");var f=jQuery("#"+c.data("datepickerId"));if(jQuery(f).is(":visible")){c.DatePickerHide()}else{c.DatePickerShow()}});c.DatePicker({format:d,date:b,calendars:1,starts:1,className:"globalCalendar"})},registerHelpInfo:function(a){if(typeof a=="undefined"){a=jQuery('form[name="QuickCreate"]')}app.showPopoverElementView(a.find(".HelpInfoPopover"))},handleQuickCreateData:function(b,c){if(typeof c=="undefined"){c={}}var a=this;app.showModalWindow(b,function(k){var e=k.find('form[name="QuickCreate"]');a.registerHelpInfo(e);var h=e.find('[name="module"]').val();var g=Vtiger_Edit_Js.getInstanceByModuleName(h);g.registerBasicEvents(e);a.registerChangeNearCalendarEvent(e,h);e.validationEngine(app.validationEngineOptions);if(typeof c.callbackPostShown!="undefined"){c.callbackPostShown(e)}a.registerQuickCreatePostLoadEvents(e,c);a.toggleTimesInputs(e);app.registerEventForDatePickerFields(e);var j=e.find(".quickCreateContent");var f=j.height();var i=parseInt(f);if(i>300){app.showScrollBar(jQuery(".quickCreateContent"),{height:"300px"})}var d={};d.toolbar="Basic";d.height="5em";jQuery.each(k.find(".ckEditorSource"),function(m,l){var n=new Vtiger_CkEditor_Js();n.loadCkEditor(jQuery(l),d)})})},getNearCalendarEvent:function(f,b){var j=this;typeActive=f.find("ul li.active a").data("tab-name");var e=f.find('[name="assigned_user_id"]');var g=f.find('[name="date_start"]');var c=g.val();var h=g.data("date-format");if(typeof c=="undefined"){return}var l=Vtiger_Helper_Js.convertToDateString(c,h,"-1"," ");var a=Vtiger_Helper_Js.convertToDateString(c,h," "," ");var i=Vtiger_Helper_Js.convertToDateString(c,h,"+1"," ");var k=Vtiger_Helper_Js.convertToDateString(i,"yyyy-mm-dd","+1"," ");var d={module:"Calendar",action:"Calendar",mode:"getEvents",start:l,end:k,user:e.val()};AppConnector.request(d).then(function(m){if(typeof m.result!="undefined"&&m.result.length>0){m=m.result;f.find(".modal-body").css({"max-height":"500px","overflow-y":"auto"});for(var n in m){icon="glyphicon glyphicon-calendar";linkHtml="";hidden="";if(m[n]["set"]=="Task"){icon="icon-tasks"}if(m[n]["linkl"]){linkHtml='
    '+m[n]["linkl"]+"
    "}if(m[n]["start"].indexOf(l)>-1){f.find("#prev_events .table").append('
    '+m[n]["title"]+"
    "+linkHtml+"")}else{if(m[n]["start"].indexOf(a)>-1){f.find("#cur_events .table").append('
    '+m[n]["title"]+"
    "+linkHtml+"")}else{if(m[n]["start"].indexOf(i)>-1){f.find("#next_events .table").append('
    '+m[n]["title"]+"
    "+linkHtml+"")}}}}}else{f.find(".modal-body").css({"max-height":"","overflow-y":""})}})},registerChangeNearCalendarEvent:function(e,c){var d=this;if(!e||c!="Calendar"||typeof c=="undefined"){return}var b=e.find('[name="assigned_user_id"]');var a=e.find('[name="date_start"]');b.on("change",function(h){var f=jQuery(h.currentTarget);var g=f.closest("form");g.find(".addedNearCalendarEvent").remove();d.getNearCalendarEvent(g,c)});a.on("change",function(h){var f=jQuery(h.currentTarget);var g=f.closest("form");g.find(".addedNearCalendarEvent").remove();d.getNearCalendarEvent(g,c)});e.find("ul li a").on("click",function(h){var f=jQuery(h.currentTarget);var g=f.closest("form");g.find(".addedNearCalendarEvent").remove();d.getNearCalendarEvent(g,c)});d.getNearCalendarEvent(e,c)},toggleTimesInputs:function(a){a.find(":checkbox").change(function(){var b=$(this).attr("name");if("allday"==b){var c=$(this).is(":checked");if(c){a.find(".active .time").hide()}else{a.find(".active .time").show()}}})},registerQuickCreatePostLoadEvents:function(b,d){var a=this;var c=d.callbackFunction;var e=d.goToFullFormcallback;if(typeof c=="undefined"){c=function(){}}b.on("submit",function(k){var i=jQuery(k.currentTarget);if(i.hasClass("not_validation")){return true}var f=i.find('[name="module"]').val();if(typeof i.data("submit")!="undefined"){return false}else{var h=i.data("jqv").InvalidFields;jQuery('textarea[id$="_qc"]').each(function(){var m=jQuery(this).attr("id");var n=CKEDITOR.instances[m].getData();jQuery(this).val(n)});if(h.length>0){i.removeData("submit");i.closest("#globalmodal").find(".modal-header h3").progressIndicator({mode:"hide"});k.preventDefault();return}else{i.data("submit","true");i.closest("#globalmodal").find(".modal-header h3").progressIndicator({smallLoadingImage:true,imageContainerCss:{display:"inline","margin-left":"18%",position:"absolute"}})}var j=jQuery.Event(Vtiger_Edit_Js.recordPreSave);i.trigger(j,{value:"edit",module:f});if(!(j.isDefaultPrevented())){var g=a;var l=Vtiger_Edit_Js.getInstanceByModuleName(f);if(typeof(l.quickCreateSave)==="function"){g=l}g.quickCreateSave(i).then(function(r){app.hideModalWindow();var s=app.getModuleName();var m=app.getViewName();if((f==s)&&(m=="List")){var p=new Vtiger_List_Js();p.getListViewRecords()}c(r);var o=a.quickCreateCallBacks;for(var n=0;n :not(.ui-autocomplete-category)")},_renderMenu:function(d,c){var e=this,b="";$.each(c,function(g,h){var f;if(h.category!=b){d.append("
  • "+h.category+"
  • ");b=h.category}e._renderItemData(d,h)})},_renderItemData:function(b,c){return this._renderItem(b,c).data("ui-autocomplete-item",c)},_renderItem:function(b,c){return $("
  • ").data("item.autocomplete",c).append($("")[this.options.html?"html":"text"](c.label)).appendTo(b)},});jQuery("#globalSearchValue").gsAutocomplete({minLength:jQuery("#gsMinLength").val(),source:function(c,b){var d=new Vtiger_BasicSearch_Js();d.reduceNumberResults=jQuery("#gsAmountResponse").val();d.returnHtml=false;d.search(c.term).then(function(h){var h=jQuery.parseJSON(h);var g=h.result;var f=new Array();for(var i in g){var e=g[i];f.push(e)}b(f)})},select:function(d,e){var c=e.item;if(c.permitted){var b="index.php?module="+c.module+"&view=Detail&record="+c.id;window.location.href=b}},close:function(b,c){jQuery("#globalSearchValue").val("")}})}},labelSearch:function(c){var d=c.val();if(d==""){alert(app.vtranslate("JS_PLEASE_ENTER_SOME_VALUE"));c.focus();return false}var b=new Vtiger_BasicSearch_Js();var a=jQuery.progressIndicator();b.search(d).then(function(e){b.showSearchResults(e);a.progressIndicator({mode:"hide"})})},adjustContentHeight:function(){navTop=jQuery("nav.navbar-fixed-top").outerHeight();navBottom=jQuery("footer.navbar-fixed-bottom").outerHeight();if(app.getViewName()==="Detail"||app.getViewName()==="ExtensionImport"){if(jQuery("div.detailViewInfo > .related").outerHeight()>jQuery("div.detailViewInfo > div.details ").outerHeight()){jQuery("div.detailViewInfo > div.details").css("min-height",jQuery(".detailViewInfo > .related").outerHeight())}bodyHeight=jQuery("div.detailViewContainer").outerHeight();jQuery("div.detailViewContainer").css("height",jQuery("div.bodyContents").outerHeight())}else{if(app.getViewName()==="Edit"){bodyHeight=jQuery(".editViewContainer").outerHeight()}else{if(app.getViewName()==="List"){bodyHeight=jQuery(".remindersNoticeContainer").outerHeight()-5;jQuery(".contentsDiv").css("min-height",bodyHeight);jQuery(".bodyContents").css("min-height",bodyHeight)}else{if(app.getViewName()==="Calendar"){bodyHeight=jQuery(".calendarViewContainer").outerHeight();jQuery(".contentsDiv").css("height",bodyHeight)}else{if(app.getViewName()==="DashBoard"){bodyHeight=jQuery(".remindersNoticeContainer").outerHeight()-55;jQuery("div.gridster").css("min-height",jQuery(".contentsDiv").outerHeight()+14);jQuery("div.bodyContents").css("min-height",bodyHeight)}else{if(app.getViewName()==="Index"){bodyHeight=jQuery(".mainContainer > .col-md-2").outerHeight();jQuery(".mainContainer").css("min-height",bodyHeight)}else{bodyHeight=jQuery(".bodyContents").css("min-height")}}}}}}var a={"min-height":bodyHeight,"margin-bottom":navBottom+"px","margin-top":navTop+"px"};jQuery(".mainContainer").css(a);jQuery(".mainContainer > .col-md-2 ").css({"margin-bottom":navBottom+"px",});jQuery(".contentsDiv").css({"margin-bottom":navBottom+"px",});Vtiger_Helper_Js.showHorizontalTopScrollBar()},recentPageViews:function(){var m=20;var p="";var l="javascript:void();";var g=localStorage.history;if(g!=""&&g!=null){var a=g.toString().split(",");var o=a[a.length-1].toString().split("|");p=o[0];l=o[1]}var e='";$(".showHistoryBtn").after(e);this.registerClearHistory()},getHistoryLabel:function(){var a="";$(".breadcrumbsLinks span").each(function(b){a+=$(this).text()});return a},registerClearHistory:function(){$(".historyBtn .clearHistory").click(function(){localStorage.history="";var a='
  • '+app.vtranslate("JS_CLEAR_HISTORY")+"
  • ";$(".historyBtn .dropdown-menu").html(a)})},registerHotKeys:function(){$(".hotKey").each(function(b){var a=this;var c=$(a).data("hotkeys");if(c!=""){Mousetrap.bind(c,function(){a.click()})}})},quickCreateModule:function(c,e){var d=this;if(typeof e=="undefined"){e={}}if(typeof e.callbackFunction=="undefined"){e.callbackFunction=function(){}}var b="index.php?module="+c+"&view=QuickCreateAjax";if(app.getViewName()==="Detail"||app.getViewName()==="Edit"){b+="&sourceModule="+app.getModuleName();b+="&sourceRecord="+app.getRecordId()}var a=jQuery.progressIndicator();d.getQuickCreateForm(b,c,e).then(function(f){d.handleQuickCreateData(f,e);a.progressIndicator({mode:"hide"})})},registerReminderNotice:function(){$("#page").before('
    ');var a=$(".remindersNoticeContainer");$(".remindersNotice").click(function(){a.toggleClass("toggled")});a.css("top",$(".commonActionsContainer").height()+3);a.height($(window).height()-$("footer.navbar-default").height()-$(".commonActionsContainer").height())},registerEvents:function(){var a=this;a.recentPageViews();jQuery("#globalSearch").click(function(){var b=new Vtiger_AdvanceSearch_Js();b.initiateSearch().then(function(){b.selectBasicSearchValue()})});jQuery("#searchIcon").on("click",function(d){var c=jQuery("#globalSearchValue");var b=jQuery.Event("keypress");b.which=13;c.trigger(b)});a.registerAnnouncement();this.setAnnouncement();a.registerHotKeys();jQuery("#moreMenu").click(function(d){var f=jQuery(d.currentTarget);var b=jQuery(".moreMenus",f);var c=jQuery(".modulesList > li",a.getMenuContainer()).length;if(c<5){b.css("left",0).addClass("leftAligned")}});jQuery("#basicSearchModulesList").change(function(){jQuery("#globalSearchValue").focus()});a.basicSearch();jQuery("#quickCreateModules,#compactquickCreate,#topMenus").on("click",".quickCreateModule",function(c,d){var b=jQuery(c.currentTarget).data("name");a.quickCreateModule(b)});if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){jQuery("#basicSearchModulesList_chosen").find(".chzn-results").css({"max-height":"350px","overflow-y":"scroll"})}else{app.showScrollBar(jQuery("#basicSearchModulesList_chosen").find(".chzn-results"),{height:"450px",railVisible:true,alwaysVisible:true,size:"6px"});if(window.outerWidth<=1024){}$(document).ajaxComplete(function(){});$(document).load(function(){});a.registerReminderNotice()}}});jQuery(document).ready(function(){Vtiger_Header_Js.getInstance().registerEvents()}); \ No newline at end of file +if(/MSIE 6.0/.test(navigator.userAgent)||/MSIE 7.0/.test(navigator.userAgent)||/MSIE 8.0/.test(navigator.userAgent)||/MSIE 9.0/.test(navigator.userAgent)){if(app.getCookie("oldbrowser")!="true"){app.setCookie("oldbrowser",true,365);window.location.href="layouts/vlayout/modules/Vtiger/browsercompatibility/Browser_compatibility.html"}}jQuery.Class("Vtiger_Header_Js",{quickCreateModuleCache:{},self:false,getInstance:function(){if(this.self!=false){return this.self}this.self=new Vtiger_Header_Js();return this.self}},{menuContainer:false,contentContainer:false,quickCreateCallBacks:[],init:function(){this.setMenuContainer(".navbar-fixed-top").setContentsContainer(".mainContainer")},setMenuContainer:function(a){if(a instanceof jQuery){this.menuContainer=a}else{this.menuContainer=jQuery(a)}return this},getMenuContainer:function(){return this.menuContainer},setContentsContainer:function(a){if(a instanceof jQuery){this.contentContainer=a}else{this.contentContainer=jQuery(a)}return this},getContentsContainer:function(){return this.contentContainer},getQuickCreateForm:function(c,b,f){var d=this;var a=jQuery.Deferred();var e;if(typeof f=="undefined"){f={}}if((!f.noCache)||(typeof(f.noCache)=="undefined")){if(typeof Vtiger_Header_Js.quickCreateModuleCache[b]!="undefined"){a.resolve(Vtiger_Header_Js.quickCreateModuleCache[b]);return a.promise()}}e=c;if(typeof f.data!="undefined"){var e={};e.data=f.data;e.url=c}AppConnector.request(e).then(function(g){if((!f.noCache)||(typeof(f.noCache)=="undefined")){Vtiger_Header_Js.quickCreateModuleCache[b]=g}a.resolve(g)});return a.promise()},registerQuickCreateCallBack:function(a){if(typeof a!="function"){return false}this.quickCreateCallBacks.push(a);return true},alignContentsContainer:function(a,f,e){var c=jQuery("nav.navbar-fixed-top").outerHeight();if(!a){var d=jQuery("#announcement").outerHeight();c=(c-d)}var b=this.getContentsContainer();b.animate({"margin-top":c},f,e);return this},quickCreateSave:function(c){var a=jQuery.Deferred();var b=c.serializeFormData();AppConnector.request(b).then(function(d){a.resolve(d)},function(e,d){a.reject(e,d)});return a.promise()},quickCreateGoToFullForm:function(a,b){a.find('input[name="action"]').remove();a.append('');$.each(a.find("[data-validation-engine]"),function(c,d){jQuery(d).removeAttr("data-validation-engine")});a.addClass("not_validation");a.submit()},setAnnouncement:function(){var a=app.cacheGet("announcement.turnoff",false);var c=jQuery("#announcementBtn");var b=this;if(a===true){jQuery("#announcement").hide();c.attr("src",app.vimage_path("btnAnnounceOff.png"));b.alignContentsContainer("69px",0,"linear")}else{jQuery("#announcement").show();c.attr("src",app.vimage_path("btnAnnounce.png"));b.alignContentsContainer("92px",0,"linear")}},registerAnnouncement:function(){var a=this;var b=jQuery("#announcementBtn");var c="announcement.turnoff";b.click(function(g,d){var f=jQuery("#announcement").css("display");if(f=="none"){jQuery("#announcement").show();a.alignContentsContainer(true,200,"linear");b.attr("src",app.vimage_path("btnAnnounce.png"));if(!d){app.cacheSet(c,false)}}else{a.alignContentsContainer(false,200,"linear");jQuery("#announcement").hide();b.attr("src",app.vimage_path("btnAnnounceOff.png"));if(!d){app.cacheSet(c,true)}}});if(app.cacheGet(c,false)){b.trigger("click",true)}},registerCalendarButtonClickEvent:function(){var c=jQuery("#calendarBtn");var a=c.data("dateFormat");var b=c.data("date");var d=app.convertToDatePickerFormat(a);c.on("click",function(g){g.stopImmediatePropagation();c.closest("div.nav").find("div.open").removeClass("open");var f=jQuery("#"+c.data("datepickerId"));if(jQuery(f).is(":visible")){c.DatePickerHide()}else{c.DatePickerShow()}});c.DatePicker({format:d,date:b,calendars:1,starts:1,className:"globalCalendar"})},registerHelpInfo:function(a){if(typeof a=="undefined"){a=jQuery('form[name="QuickCreate"]')}app.showPopoverElementView(a.find(".HelpInfoPopover"))},handleQuickCreateData:function(b,c){if(typeof c=="undefined"){c={}}var a=this;app.showModalWindow(b,function(k){var e=k.find('form[name="QuickCreate"]');a.registerHelpInfo(e);var h=e.find('[name="module"]').val();var g=Vtiger_Edit_Js.getInstanceByModuleName(h);g.registerBasicEvents(e);a.registerChangeNearCalendarEvent(e,h);e.validationEngine(app.validationEngineOptions);if(typeof c.callbackPostShown!="undefined"){c.callbackPostShown(e)}a.registerQuickCreatePostLoadEvents(e,c);a.toggleTimesInputs(e);app.registerEventForDatePickerFields(e);var j=e.find(".quickCreateContent");var f=j.height();var i=parseInt(f);if(i>300){app.showScrollBar(jQuery(".quickCreateContent"),{height:"300px"})}var d={};d.toolbar="Basic";d.height="5em";jQuery.each(k.find(".ckEditorSource"),function(m,l){var n=new Vtiger_CkEditor_Js();n.loadCkEditor(jQuery(l),d)})})},getNearCalendarEvent:function(f,b){var j=this;typeActive=f.find("ul li.active a").data("tab-name");var e=f.find('[name="assigned_user_id"]');var g=f.find('[name="date_start"]');var c=g.val();var h=g.data("date-format");if(typeof c=="undefined"){return}var l=Vtiger_Helper_Js.convertToDateString(c,h,"-1"," ");var a=Vtiger_Helper_Js.convertToDateString(c,h," "," ");var i=Vtiger_Helper_Js.convertToDateString(c,h,"+1"," ");var k=Vtiger_Helper_Js.convertToDateString(i,"yyyy-mm-dd","+1"," ");var d={module:"Calendar",action:"Calendar",mode:"getEvents",start:l,end:k,user:e.val()};AppConnector.request(d).then(function(m){if(typeof m.result!="undefined"&&m.result.length>0){m=m.result;f.find(".modal-body").css({"max-height":"500px","overflow-y":"auto"});for(var n in m){icon="glyphicon glyphicon-calendar";linkHtml="";hidden="";if(m[n]["set"]=="Task"){icon="icon-tasks"}if(m[n]["linkl"]){linkHtml='
    '+m[n]["linkl"]+"
    "}if(m[n]["start"].indexOf(l)>-1){f.find("#prev_events .table").append('
    '+m[n]["title"]+"
    "+linkHtml+"")}else{if(m[n]["start"].indexOf(a)>-1){f.find("#cur_events .table").append('
    '+m[n]["title"]+"
    "+linkHtml+"")}else{if(m[n]["start"].indexOf(i)>-1){f.find("#next_events .table").append('
    '+m[n]["title"]+"
    "+linkHtml+"")}}}}}else{f.find(".modal-body").css({"max-height":"","overflow-y":""})}})},registerChangeNearCalendarEvent:function(e,c){var d=this;if(!e||c!="Calendar"||typeof c=="undefined"){return}var b=e.find('[name="assigned_user_id"]');var a=e.find('[name="date_start"]');b.on("change",function(h){var f=jQuery(h.currentTarget);var g=f.closest("form");g.find(".addedNearCalendarEvent").remove();d.getNearCalendarEvent(g,c)});a.on("change",function(h){var f=jQuery(h.currentTarget);var g=f.closest("form");g.find(".addedNearCalendarEvent").remove();d.getNearCalendarEvent(g,c)});e.find("ul li a").on("click",function(h){var f=jQuery(h.currentTarget);var g=f.closest("form");g.find(".addedNearCalendarEvent").remove();d.getNearCalendarEvent(g,c)});d.getNearCalendarEvent(e,c)},toggleTimesInputs:function(a){a.find(":checkbox").change(function(){var b=$(this).attr("name");if("allday"==b){var c=$(this).is(":checked");if(c){a.find(".active .time").hide()}else{a.find(".active .time").show()}}})},registerQuickCreatePostLoadEvents:function(b,d){var a=this;var c=d.callbackFunction;var e=d.goToFullFormcallback;if(typeof c=="undefined"){c=function(){}}b.on("submit",function(k){var i=jQuery(k.currentTarget);if(i.hasClass("not_validation")){return true}var f=i.find('[name="module"]').val();if(typeof i.data("submit")!="undefined"){return false}else{var h=i.data("jqv").InvalidFields;jQuery('textarea[id$="_qc"]').each(function(){var m=jQuery(this).attr("id");var n=CKEDITOR.instances[m].getData();jQuery(this).val(n)});if(h.length>0){i.removeData("submit");i.closest("#globalmodal").find(".modal-header h3").progressIndicator({mode:"hide"});k.preventDefault();return}else{i.data("submit","true");i.closest("#globalmodal").find(".modal-header h3").progressIndicator({smallLoadingImage:true,imageContainerCss:{display:"inline","margin-left":"18%",position:"absolute"}})}var j=jQuery.Event(Vtiger_Edit_Js.recordPreSave);i.trigger(j,{value:"edit",module:f});if(!(j.isDefaultPrevented())){var g=a;var l=Vtiger_Edit_Js.getInstanceByModuleName(f);if(typeof(l.quickCreateSave)==="function"){g=l}g.quickCreateSave(i).then(function(r){app.hideModalWindow();var s=app.getModuleName();var m=app.getViewName();if((f==s)&&(m=="List")){var p=new Vtiger_List_Js();p.getListViewRecords()}c(r);var o=a.quickCreateCallBacks;for(var n=0;n :not(.ui-autocomplete-category)")},_renderMenu:function(d,c){var e=this,b="";$.each(c,function(g,h){var f;if(h.category!=b){d.append("
  • "+h.category+"
  • ");b=h.category}e._renderItemData(d,h)})},_renderItemData:function(b,c){return this._renderItem(b,c).data("ui-autocomplete-item",c)},_renderItem:function(b,c){return $("
  • ").data("item.autocomplete",c).append($("")[this.options.html?"html":"text"](c.label)).appendTo(b)},});jQuery("#globalSearchValue").gsAutocomplete({minLength:jQuery("#gsMinLength").val(),source:function(c,b){var d=new Vtiger_BasicSearch_Js();d.reduceNumberResults=jQuery("#gsAmountResponse").val();d.returnHtml=false;d.search(c.term).then(function(h){var h=jQuery.parseJSON(h);var g=h.result;var f=new Array();for(var i in g){var e=g[i];f.push(e)}b(f)})},select:function(d,e){var c=e.item;if(c.permitted){var b="index.php?module="+c.module+"&view=Detail&record="+c.id;window.location.href=b}},close:function(b,c){jQuery("#globalSearchValue").val("")}})}},labelSearch:function(c){var d=c.val();if(d==""){alert(app.vtranslate("JS_PLEASE_ENTER_SOME_VALUE"));c.focus();return false}var b=new Vtiger_BasicSearch_Js();var a=jQuery.progressIndicator();b.search(d).then(function(e){b.showSearchResults(e);a.progressIndicator({mode:"hide"})})},adjustContentHeight:function(){navTop=jQuery("nav.navbar-fixed-top").outerHeight();navBottom=jQuery("footer.navbar-fixed-bottom").outerHeight();if(app.getViewName()==="Detail"||app.getViewName()==="ExtensionImport"){if(jQuery("div.detailViewInfo > .related").outerHeight()>jQuery("div.detailViewInfo > div.details ").outerHeight()){jQuery("div.detailViewInfo > div.details").css("min-height",jQuery(".detailViewInfo > .related").outerHeight())}bodyHeight=jQuery("div.detailViewContainer").outerHeight();jQuery("div.detailViewContainer").css("height",jQuery("div.bodyContents").outerHeight())}else{if(app.getViewName()==="Edit"){bodyHeight=jQuery(".editViewContainer").outerHeight()}else{if(app.getViewName()==="List"){bodyHeight=jQuery(".remindersNoticeContainer").outerHeight()-5;jQuery(".contentsDiv").css("min-height",bodyHeight);jQuery(".bodyContents").css("min-height",bodyHeight)}else{if(app.getViewName()==="Calendar"){bodyHeight=jQuery(".calendarViewContainer").outerHeight();jQuery(".contentsDiv").css("height",bodyHeight)}else{if(app.getViewName()==="DashBoard"){bodyHeight=jQuery(".remindersNoticeContainer").outerHeight()-55;jQuery("div.gridster").css("min-height",jQuery(".contentsDiv").outerHeight()+14);jQuery("div.bodyContents").css("min-height",bodyHeight)}else{if(app.getViewName()==="Index"){bodyHeight=jQuery(".mainContainer > .col-md-2").outerHeight();jQuery(".mainContainer").css("min-height",bodyHeight)}else{bodyHeight=jQuery(".bodyContents").css("min-height")}}}}}}var a={"min-height":bodyHeight,"margin-bottom":navBottom+"px","margin-top":navTop+"px"};jQuery(".mainContainer").css(a);jQuery(".mainContainer > .col-md-2 ").css({"margin-bottom":navBottom+"px",});jQuery(".contentsDiv").css({"margin-bottom":navBottom+"px",});Vtiger_Helper_Js.showHorizontalTopScrollBar()},recentPageViews:function(){var m=20;var p="";var l="javascript:void();";var g=localStorage.history;if(g!=""&&g!=null){var a=g.toString().split(",");var o=a[a.length-1].toString().split("|");p=o[0];l=o[1]}var e='";$(".showHistoryBtn").after(e);this.registerClearHistory()},getHistoryLabel:function(){var a="";$(".breadcrumbsLinks span").each(function(b){a+=$(this).text()});return a},registerClearHistory:function(){$(".historyBtn .clearHistory").click(function(){localStorage.history="";var a='
  • '+app.vtranslate("JS_CLEAR_HISTORY")+"
  • ";$(".historyBtn .dropdown-menu").html(a)})},registerHotKeys:function(){$(".hotKey").each(function(b){var a=this;var c=$(a).data("hotkeys");if(c!=""){Mousetrap.bind(c,function(){a.click()})}})},quickCreateModule:function(c,e){var d=this;if(typeof e=="undefined"){e={}}if(typeof e.callbackFunction=="undefined"){e.callbackFunction=function(){}}var b="index.php?module="+c+"&view=QuickCreateAjax";if(app.getViewName()==="Detail"||app.getViewName()==="Edit"){b+="&sourceModule="+app.getModuleName();b+="&sourceRecord="+app.getRecordId()}var a=jQuery.progressIndicator();d.getQuickCreateForm(b,c,e).then(function(f){d.handleQuickCreateData(f,e);a.progressIndicator({mode:"hide"})})},registerReminderNotice:function(){$("#page").before('
    ');var a=$(".remindersNoticeContainer");$(".remindersNotice").click(function(){a.toggleClass("toggled")});a.css("top",$(".commonActionsContainer").height()+3);a.height($(window).height()-$("footer.navbar-default").height()-$(".commonActionsContainer").height())},registerEvents:function(){var a=this;a.recentPageViews();jQuery("#globalSearch").click(function(){var b=new Vtiger_AdvanceSearch_Js();b.initiateSearch().then(function(){b.selectBasicSearchValue()})});jQuery("#searchIcon").on("click",function(d){var c=jQuery("#globalSearchValue");var b=jQuery.Event("keypress");b.which=13;c.trigger(b)});a.registerAnnouncement();this.setAnnouncement();a.registerHotKeys();jQuery("#moreMenu").click(function(d){var f=jQuery(d.currentTarget);var b=jQuery(".moreMenus",f);var c=jQuery(".modulesList > li",a.getMenuContainer()).length;if(c<5){b.css("left",0).addClass("leftAligned")}});jQuery("#basicSearchModulesList").change(function(){jQuery("#globalSearchValue").focus()});a.basicSearch();jQuery("#quickCreateModules,#compactquickCreate,#topMenus").on("click",".quickCreateModule",function(c,d){var b=jQuery(c.currentTarget).data("name");a.quickCreateModule(b)});if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){jQuery("#basicSearchModulesList_chosen").find(".chzn-results").css({"max-height":"350px","overflow-y":"scroll"})}else{app.showScrollBar(jQuery("#basicSearchModulesList_chosen").find(".chzn-results"),{height:"450px",railVisible:true,alwaysVisible:true,size:"6px"});if(window.outerWidth<=1024){$(".headerLinksContainer").css("margin-right","8px")}$(document).ajaxComplete(function(){Vtiger_Header_Js.getInstance().adjustContentHeight()});$(document).load(function(){Vtiger_Header_Js.getInstance().adjustContentHeight()});a.registerReminderNotice()}}});jQuery(document).ready(function(){Vtiger_Header_Js.getInstance().registerEvents()}); \ No newline at end of file diff --git a/layouts/vlayout/resources/app.js b/layouts/vlayout/resources/app.js index 37b78c0ad2e5..78f8bdb4acc2 100644 --- a/layouts/vlayout/resources/app.js +++ b/layouts/vlayout/resources/app.js @@ -1131,13 +1131,13 @@ jQuery(document).ready(function () { app.showSelectizeElementView(jQuery('body').find('select.selectize')); app.showPopoverElementView(jQuery('body').find('.popoverTooltip')); app.showBtnSwitch(jQuery('body').find('.switchBtn')); - //app.setContentsHeight(); + app.setContentsHeight(); //Updating row height app.updateRowHeight(); jQuery(window).resize(function () { - //app.setContentsHeight(); + app.setContentsHeight(); }) String.prototype.toCamelCase = function () { diff --git a/layouts/vlayout/resources/app.min.js b/layouts/vlayout/resources/app.min.js index 29500dd6846a..9b98cbb82a39 100644 --- a/layouts/vlayout/resources/app.min.js +++ b/layouts/vlayout/resources/app.min.js @@ -1,2 +1,2 @@ -var app={languageString:[],weekDaysArray:{Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6},cacheParams:[],getModuleName:function(){return jQuery("#module").val()},getParentModuleName:function(){return jQuery("#parent").val()},getViewName:function(){return jQuery("#view").val()},getRecordId:function(){var a=jQuery('[name="view"]').val();var b;if(a=="Edit"){b=jQuery('[name="record"]').val()}else{if(a=="Detail"){b=jQuery("#recordId").val()}}return b},getContentsContainer:function(){return jQuery(".bodyContents")},changeSelectElementView:function(e,b,a){var f=this;var d=jQuery();if(typeof e=="undefined"){e=jQuery("body")}if(b=="select2"){return app.showSelect2ElementView(e,a)}if(b=="selectize"){return app.showSelectizeElementView(e,a)}d=jQuery(".chzn-select",e);if(e.is("select.chzn-select")){d=e}d.each(function(){if($(this).prop("id").length==0){$(this).attr("id","sel"+f.generateRandomChar()+f.generateRandomChar()+f.generateRandomChar())}});d.filter("[multiple]").filter('[data-validation-engine*="validate"]').on("change",function(i){jQuery(i.currentTarget).trigger("focusout")});var h={no_results_text:app.vtranslate("JS_NO_RESULTS_FOUND")+":"};var c=app.getModuleName();if(d.filter("[multiple]")&&c!="Install"){h.placeholder_text_multiple=" "+app.vtranslate("JS_SELECT_SOME_OPTIONS")}if(c!="Install"){h.placeholder_text_single=" "+app.vtranslate("JS_SELECT_AN_OPTION")}d.chosen(h);d.each(function(){var i=$(this);if(i.attr("readonly")=="readonly"){i.on("chosen:updated",function(){if(i.attr("readonly")){var j=i.is(":disabled");i.attr("disabled","disabled");i.data("chosen").search_field_disabled();if(j){i.attr("disabled","disabled")}else{i.removeAttr("disabled")}}});i.trigger("chosen:updated")}});var g=jQuery(".chosen-container-multi .default").css("width","100%");return g},destroyChosenElement:function(b){var a=jQuery();if(typeof b=="undefined"){b=jQuery("body")}a=jQuery(".chzn-select",b);if(b.is("select.chzn-select")){a=b}a.css("display","block").removeClass("chzn-done").data("chosen",null).next().remove();return a},showSelect2ElementView:function(c,f){if(typeof f=="undefined"){f={}}var d=c.data();if(d!=null){f=jQuery.extend(d,f)}f.language={};f.theme="bootstrap";f.width="100%";f.language.noResults=function(g){return app.vtranslate("JS_NO_RESULTS_FOUND")};if(typeof f.customSortOptGroup!="undefined"&&f.customSortOptGroup){jQuery("optgroup",c).each(function(){var h=jQuery(this);var g=h.children().toArray().sort(function(k,j){var l=jQuery(k).text();var i=jQuery(j).text();return l=b){a.updateResults()}})},getSerializedData:function(h,j){if(typeof j=="undefined"){j="string"}h=jQuery(h);var i=h.children().serialize();if(j=="string"){return i}var g={};var b=i.split("&");for(var e in b){var f=b[e];var a=f.split("=");var d=a[0];var c=a[1];g[d]=decodeURIComponent(c)}return g},showModalWindow:function(g,d,a,f){if(typeof g=="object"&&g!=null&&!(g instanceof jQuery)){f=g.css;a=g.cb;d=g.url;g=g.data}if(typeof d=="function"){if(typeof a=="object"){f=a}a=d;d=false}else{if(typeof d=="object"){a=function(){};f=d;d=false}}if(typeof a!="function"){a=function(){}}var h="globalmodal";var b=jQuery("#"+h);if(b.length){b.remove()}var c=jQuery(".modal-backdrop");if(c.length){c.remove()}b=jQuery("
    ");b.attr("id",h);var e=function(i){var j={show:true,};if(jQuery("#backgroundClosingModal").val()!=1){j.backdrop="static"}if(typeof f=="object"){b.css(f);j=jQuery.extend(j,f)}b.html(i);$.fn.modal.Constructor.prototype.enforceFocus=function(k){$(document).off("focusin.bs.modal").on("focusin.bs.modal",$.proxy(function(l){if($(l.target).hasClass("select2-search__field")){return true}if(this.$element[0]!==l.target&&!this.$element.has(l.target).length){this.$element.trigger("focus")}},this))};b.find(".modal:first").modal(j);jQuery("body").append(b);app.changeSelectElementView(b);app.showSelect2ElementView(b.find("select.select2"));app.showSelectizeElementView(b.find("select.selectize"));app.registerEventForDatePickerFields(b);a(b)};if(g){e(g)}else{jQuery.get(d).then(function(i){e(i)})}return b},hideModalWindow:function(d){var c="globalmodal";var b=jQuery("#"+c);if(b.length<=0){return}if(typeof d!="function"){d=function(){}}var a=b.find(".modal");a.modal("hide");a.one("hidden.bs.modal",d)},isHidden:function(a){if(a.css("display")=="none"){return true}return false},validationEngineOptions:{scroll:false,promptPosition:"topLeft",prettySelect:true,useSuffix:"_chosen",usePrefix:"s2id_",},validationEngineOptionsForRecord:{scroll:false,promptPosition:"topLeft",prettySelect:true,useSuffix:"_chosen",usePrefix:"s2id_",validateNonVisibleFields:true,onBeforePromptType:function(a){var b=a.closest(".blockContainer");if(b.find("tbody").is(":hidden")){b.find(".blockHeader").click()}},},formAlignmentAfterValidation:function(d){var c=d.find(".formError:not('.greenPopup'):first");if(c.length>0){var a=c.offset().top;var b=a-105;jQuery("html").animate({scrollTop:b},"slow")}},convertToDatePickerFormat:function(a){switch(a){case"yyyy-mm-dd":return"Y-m-d";break;case"mm-dd-yyyy":return"m-d-Y";break;case"dd-mm-yyyy":return"d-m-Y";break;case"yyyy.mm.dd":return"Y.m.d";break;case"mm.dd.yyyy":return"m.d.Y";break;case"dd.mm.yyyy":return"d.m.Y";break;case"yyyy/mm/dd":return"Y/m/d";break;case"mm/dd/yyyy":return"m/d/Y";break;case"dd/mm/yyyy":return"d/m/Y";break}},convertTojQueryDatePickerFormat:function(b){var e=0;var g="-";if(b.indexOf("-")!=-1){g="-"}if(b.indexOf(".")!=-1){g="."}if(b.indexOf("/")!=-1){g="/"}var f=b.split(g);for(var e in f){var d=f[e];var a=d.length;if(a==4){var c=d.substring(0,2);f[e]=c}}var h=f.join(g);return h},getDateInVtigerFormat:function(a,c){var d=app.convertTojQueryDatePickerFormat(a);var b=jQuery.datepicker.formatDate(d,c);return b},getDateInDBInsertFormat:function(a,g){var b=0;var k="-";if(a.indexOf("-")!=-1){k="-"}if(a.indexOf(".")!=-1){k="."}if(a.indexOf("/")!=-1){k="/"}var j=a.split(k);var h=g.split(k);var f="";var d="";var e="";for(b in j){var c=j[b];switch(c){case"dd":f=h[b];break;case"mm":d=h[b];break;case"yyyy":e=h[b];break}}return e+"-"+d+"-"+f},registerEventForTextAreaFields:function(a){if(typeof a=="undefined"){a=jQuery("body")}a=jQuery(a);if(a.is("textarea")){var b=a}else{var b=jQuery("textarea",a)}if(b.length==0){return}b.autosize()},registerEventForDatePickerFields:function(l,c,d){if(typeof l=="undefined"){l=jQuery("body")}if(typeof c=="undefined"){c=true}l=jQuery(l);if(l.hasClass("dateField")){var j=l}else{var j=jQuery(".dateField",l)}if(j.length==0){return}if(c==true){var f=j.closest(".date");jQuery(".input-group-addon",f).on("click",function(n){var m=jQuery(n.currentTarget);m.closest(".date").find("input.dateField").get(0).focus()})}var a=j.data("dateFormat");var e=app.convertToDatePickerFormat(a);var i=jQuery("body").data("language");var b=i.split("_");var h=jQuery("#start_day").val();if(h==""||typeof(h)=="undefined"){var k=1}else{k=this.weekDaysArray[h]}var g={format:e,calendars:1,locale:$.fn.datepicker.dates[b[0]],starts:k,eventName:"focus",onChange:function(p){var m=jQuery(this).data("datepicker").el;m=jQuery(m);var n=jQuery("#"+jQuery(this).data("datepicker").id);var o=n.find("table.datepickerViewDays");if(o.length>0&&m.val()!=p){m.DatePickerHide();m.blur()}m.val(p).trigger("change").focusout()},onBeforeShow:function(m){j.each(function(n,o){var p=jQuery(o);if(p[0]!=document.activeElement){p.DatePickerHide();p.blur()}})},};if(typeof d!="undefined"){var g=jQuery.extend(g,d)}j.each(function(n,p){var q=jQuery(p);var m=new Date();var o=app.getDateInVtigerFormat(a,m);if(q.val()!=""){o=q.val()}g.date=o;g.current=o;q.DatePicker(g)})},registerEventForDateFields:function(a){if(typeof a=="undefined"){a=jQuery("body")}a=jQuery(a);if(a.hasClass("dateField")){var b=a}else{var b=jQuery(".dateField",a)}b.datepicker({autoclose:true}).on("changeDate",function(f){var e=jQuery(f.currentTarget);var c=e.data("dateFormat");var g=app.getDateInVtigerFormat(c,f.date);var d=jQuery.datepicker.formatDate(g,f.date);e.val(d)})},registerEventForTimeFields:function(b,a,f){if(typeof cotainer=="undefined"){b=jQuery("body")}if(typeof a=="undefined"){a=true}b=jQuery(b);if(b.hasClass("timepicker-default")){var c=b}else{var c=b.find(".timepicker-default")}if(a==true){var d=c.closest(".time");jQuery(".input-group-addon",d).on("click",function(i){var h=jQuery(i.currentTarget);h.closest(".time").find(".timepicker-default").focus()})}if(typeof f=="undefined"){f={}}var g=c.data("format");if(g=="24"){g="H:i"}else{g="h:i A"}var e={timeFormat:g,className:"timePicker"};var f=jQuery.extend(e,f);c.timepicker(f);return b},destroyTimeFields:function(a){if(typeof cotainer=="undefined"){a=jQuery("body")}if(a.hasClass("timepicker-default")){var b=a}else{var b=a.find(".timepicker-default")}b.data("timepicker-list",null);return a},getChosenElementFromSelect:function(a){var b=a.attr("id");var c=b+"_chosen";return jQuery("#"+c)},getSelect2ElementFromSelect:function(a){var b=a.attr("id");var c="select2-"+b+"-container";return jQuery("#"+c).closest(".select2-container")},getSelectElementFromChosen:function(c){var b=c.attr("id");var a=b.split("_chosen");var d=a["0"];return jQuery("#"+d)},setInheritWidth:function(a){jQuery(a).each(function(b,c){var d=jQuery(c).parent().width();jQuery(c).width(d)})},initGuiders:function(a){},showScrollBar:function(b,a){if(typeof a=="undefined"){a={}}if(typeof a.height=="undefined"){a.height=b.css("height")}return b.slimScroll(a)},showHorizontalScrollBar:function(b,a){if(typeof a=="undefined"){a={}}var c={horizontalScroll:true,theme:"dark-thick",advanced:{autoExpandHorizontalScroll:true}};if(typeof a!="undefined"){var c=jQuery.extend(c,a)}return b.mCustomScrollbar(c)},vtranslate:function(b){if(app.languageString[b]!=undefined){return app.languageString[b]}else{var a=jQuery("#js_strings").text();if(a!=""){app.languageString=JSON.parse(a);if(b in app.languageString){return app.languageString[b]}}}return b},setContentsHeight:function(){var a=parseInt(jQuery(".mainContainer").css("margin-top"))+21;jQuery(".bodyContents").css("min-height",(jQuery(window).innerHeight()-a))},vimage_path:function(a){return jQuery("body").data("skinpath")+"/images/"+a},cacheNSKey:function(a){return"vtiger6."+a},cacheGet:function(b,a){b=this.cacheNSKey(b);return jQuery.jStorage.get(b,a)},cacheSet:function(a,b){a=this.cacheNSKey(a);jQuery.jStorage.set(a,b)},cacheClear:function(a){a=this.cacheNSKey(a);return jQuery.jStorage.deleteKey(a)},htmlEncode:function(a){if(a){return jQuery("
    ").text(a).html()}else{return""}},htmlDecode:function(a){if(a){return $("
    ").html(a).text()}else{return""}},placeAtCenter:function(a){a.css("position","absolute");a.css("top",((jQuery(window).height()-a.outerHeight())/2)+jQuery(window).scrollTop()+"px");a.css("left",((jQuery(window).width()-a.outerWidth())/2)+jQuery(window).scrollLeft()+"px")},getvalidationEngineOptions:function(a){return app.validationEngineOptions},notifyPostAjaxReady:function(){jQuery(document).trigger("postajaxready")},listenPostAjaxReady:function(a){jQuery(document).on("postajaxready",a)},setFormValues:function(b){for(var a in b){jQuery(a).val(b[a])}},setRTEValues:function(c){for(var a in c){var b=CKEDITOR.instances[a];if(b){b.setData(c[a])}}},getPageController:function(){var c=app.getModuleName();var a=app.getViewName();var e=app.getParentModuleName();var d=e+"_"+c+"_"+a+"_Js";if(typeof window[d]=="undefined"){d=e+"_Vtiger_"+a+"_Js"}if(typeof window[d]=="undefined"){d=c+"_"+a+"_Js"}var b=jQuery("#extendModules").val();if(typeof window[d]=="undefined"&&b!=undefined){d=b+"_"+a+"_Js"}if(typeof window[d]=="undefined"){d="Vtiger_"+a+"_Js"}if(typeof window[d]!="undefined"){return new window[d]()}},getDecodedValue:function(a){return jQuery("
    ").html(a).text()},getColorContrast:function(f){var d=parseInt(f.substr(0,2),16);var c=parseInt(f.substr(2,2),16);var a=parseInt(f.substr(4,2),16);var e=((d*299)+(c*587)+(a*114))/1000;return(e>=128)?"light":"dark"},updateRowHeight:function(){var c=jQuery("#row_type").val();if(c.length<=0){var b=app.cacheGet("widthType","mediumWidthType");var e=b;switch(e){case"narrowWidthType":e="narrow";break;case"wideWidthType":e="wide";break;default:e="medium"}var a=jQuery("#current_user_id").val();var d={module:"Users",action:"SaveAjax",record:a,value:e,field:"rowheight"};AppConnector.request(d).then(function(){jQuery(c).val(e)})}},getCookie:function(b){var c=document.cookie;var d=c.indexOf(" "+b+"=");if(d==-1){d=c.indexOf(b+"=")}if(d==-1){c=null}else{d=c.indexOf("=",d)+1;var a=c.indexOf(";",d);if(a==-1){a=c.length}c=unescape(c.substring(d,a))}return c},setCookie:function(a,d,b){var e=new Date();e.setDate(e.getDate()+b);var c=escape(d)+((b==null)?"":"; expires="+e.toUTCString());document.cookie=a+"="+c},getUrlVar:function(b){var a=function(){var d={};var c=window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(e,f,g){d[f]=g});return d};return a()[b]},getStringDate:function(b){var c=b.getDate();var a=b.getMonth()+1;var e=b.getFullYear();c=(c<=9)?("0"+c):c;a=(a<=9)?("0"+a):a;return e+"-"+a+"-"+c},formatDate:function(b){var j=b.getFullYear(),a=b.getMonth()+1,g=b.getDate(),f=b.getHours(),c=b.getMinutes(),e=b.getSeconds();return j+"-"+this.formatDateZ(a)+"-"+this.formatDateZ(g)+" "+this.formatDateZ(f)+":"+this.formatDateZ(c)+":"+this.formatDateZ(e)},formatDateZ:function(a){return(a<=9?"0"+a:a)},saveAjax:function(d,c){var a=jQuery.Deferred();var b={};b.module=app.getModuleName();b.parent=app.getParentModuleName();b.action="SaveAjax";b.mode=d;b.param=c;AppConnector.request(b).then(function(e){a.resolve(e)},function(e){a.reject()});return a.promise()},showBtnSwitch:function(a,b){if(typeof b=="undefined"){b={}}a.bootstrapSwitch(b);return a},generateRandomChar:function(){var c,b,a;c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ";a=Math.floor(Math.random()*c.length);return b=c.substring(a,a+1)},getMainParams:function(b){if(app.cacheParams[b]!=undefined){return app.cacheParams[b]}var a=$("#"+b).val();app.cacheParams[b]=a;return a},parseNumberToShow:function(b){if(b==undefined){b=0}var c=parseInt(app.getMainParams("numberOfCurrencyDecimal"));var a=app.getMainParams("currencyDecimalSeparator");b=parseFloat(b).toFixed(c);if(a!="."){b=b.toString().replace(".",a)}return b},parseNumberToFloat:function(a){var b=parseInt(app.getMainParams("numberOfCurrencyDecimal"));if(a==undefined){a=0}if(app.getMainParams("currencyDecimalSeparator")==","){a=a.toString().replace(/\s/g,"").replace(",",".")}return parseFloat(a)},errorLog:function(a,b,c){console.error(a,b,c)},};jQuery(document).ready(function(){app.changeSelectElementView();app.showSelect2ElementView(jQuery("body").find("select.select2"));app.showSelectizeElementView(jQuery("body").find("select.selectize"));app.showPopoverElementView(jQuery("body").find(".popoverTooltip"));app.showBtnSwitch(jQuery("body").find(".switchBtn"));app.updateRowHeight();jQuery(window).resize(function(){});String.prototype.toCamelCase=function(){var b=this.valueOf();return b.charAt(0).toUpperCase()+b.slice(1).toLowerCase()};if(/MSIE/.test(navigator.userAgent)||(/Trident/).test(navigator.userAgent)){jQuery("textarea").resizable()}var a=app.getPageController();if(a){a.registerEvents()}});function resizeUI5IframeReset(){jQuery("#ui5frame").height(650)}function resizeUI5Iframe(a){jQuery("#ui5frame").height(parseInt(a,10)+15)}; \ No newline at end of file +var app={languageString:[],weekDaysArray:{Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6},cacheParams:[],getModuleName:function(){return jQuery("#module").val()},getParentModuleName:function(){return jQuery("#parent").val()},getViewName:function(){return jQuery("#view").val()},getRecordId:function(){var a=jQuery('[name="view"]').val();var b;if(a=="Edit"){b=jQuery('[name="record"]').val()}else{if(a=="Detail"){b=jQuery("#recordId").val()}}return b},getContentsContainer:function(){return jQuery(".bodyContents")},changeSelectElementView:function(e,b,a){var f=this;var d=jQuery();if(typeof e=="undefined"){e=jQuery("body")}if(b=="select2"){return app.showSelect2ElementView(e,a)}if(b=="selectize"){return app.showSelectizeElementView(e,a)}d=jQuery(".chzn-select",e);if(e.is("select.chzn-select")){d=e}d.each(function(){if($(this).prop("id").length==0){$(this).attr("id","sel"+f.generateRandomChar()+f.generateRandomChar()+f.generateRandomChar())}});d.filter("[multiple]").filter('[data-validation-engine*="validate"]').on("change",function(i){jQuery(i.currentTarget).trigger("focusout")});var h={no_results_text:app.vtranslate("JS_NO_RESULTS_FOUND")+":"};var c=app.getModuleName();if(d.filter("[multiple]")&&c!="Install"){h.placeholder_text_multiple=" "+app.vtranslate("JS_SELECT_SOME_OPTIONS")}if(c!="Install"){h.placeholder_text_single=" "+app.vtranslate("JS_SELECT_AN_OPTION")}d.chosen(h);d.each(function(){var i=$(this);if(i.attr("readonly")=="readonly"){i.on("chosen:updated",function(){if(i.attr("readonly")){var j=i.is(":disabled");i.attr("disabled","disabled");i.data("chosen").search_field_disabled();if(j){i.attr("disabled","disabled")}else{i.removeAttr("disabled")}}});i.trigger("chosen:updated")}});var g=jQuery(".chosen-container-multi .default").css("width","100%");return g},destroyChosenElement:function(b){var a=jQuery();if(typeof b=="undefined"){b=jQuery("body")}a=jQuery(".chzn-select",b);if(b.is("select.chzn-select")){a=b}a.css("display","block").removeClass("chzn-done").data("chosen",null).next().remove();return a},showSelect2ElementView:function(c,f){if(typeof f=="undefined"){f={}}var d=c.data();if(d!=null){f=jQuery.extend(d,f)}f.language={};f.theme="bootstrap";f.width="100%";f.language.noResults=function(g){return app.vtranslate("JS_NO_RESULTS_FOUND")};if(typeof f.customSortOptGroup!="undefined"&&f.customSortOptGroup){jQuery("optgroup",c).each(function(){var h=jQuery(this);var g=h.children().toArray().sort(function(k,j){var l=jQuery(k).text();var i=jQuery(j).text();return l=b){a.updateResults()}})},getSerializedData:function(h,j){if(typeof j=="undefined"){j="string"}h=jQuery(h);var i=h.children().serialize();if(j=="string"){return i}var g={};var b=i.split("&");for(var e in b){var f=b[e];var a=f.split("=");var d=a[0];var c=a[1];g[d]=decodeURIComponent(c)}return g},showModalWindow:function(g,d,a,f){if(typeof g=="object"&&g!=null&&!(g instanceof jQuery)){f=g.css;a=g.cb;d=g.url;g=g.data}if(typeof d=="function"){if(typeof a=="object"){f=a}a=d;d=false}else{if(typeof d=="object"){a=function(){};f=d;d=false}}if(typeof a!="function"){a=function(){}}var h="globalmodal";var b=jQuery("#"+h);if(b.length){b.remove()}var c=jQuery(".modal-backdrop");if(c.length){c.remove()}b=jQuery("
    ");b.attr("id",h);var e=function(i){var j={show:true,};if(jQuery("#backgroundClosingModal").val()!=1){j.backdrop="static"}if(typeof f=="object"){b.css(f);j=jQuery.extend(j,f)}b.html(i);$.fn.modal.Constructor.prototype.enforceFocus=function(k){$(document).off("focusin.bs.modal").on("focusin.bs.modal",$.proxy(function(l){if($(l.target).hasClass("select2-search__field")){return true}if(this.$element[0]!==l.target&&!this.$element.has(l.target).length){this.$element.trigger("focus")}},this))};b.find(".modal:first").modal(j);jQuery("body").append(b);app.changeSelectElementView(b);app.showSelect2ElementView(b.find("select.select2"));app.showSelectizeElementView(b.find("select.selectize"));app.registerEventForDatePickerFields(b);a(b)};if(g){e(g)}else{jQuery.get(d).then(function(i){e(i)})}return b},hideModalWindow:function(d){var c="globalmodal";var b=jQuery("#"+c);if(b.length<=0){return}if(typeof d!="function"){d=function(){}}var a=b.find(".modal");a.modal("hide");a.one("hidden.bs.modal",d)},isHidden:function(a){if(a.css("display")=="none"){return true}return false},validationEngineOptions:{scroll:false,promptPosition:"topLeft",prettySelect:true,useSuffix:"_chosen",usePrefix:"s2id_",},validationEngineOptionsForRecord:{scroll:false,promptPosition:"topLeft",prettySelect:true,useSuffix:"_chosen",usePrefix:"s2id_",validateNonVisibleFields:true,onBeforePromptType:function(a){var b=a.closest(".blockContainer");if(b.find("tbody").is(":hidden")){b.find(".blockHeader").click()}},},formAlignmentAfterValidation:function(d){var c=d.find(".formError:not('.greenPopup'):first");if(c.length>0){var a=c.offset().top;var b=a-105;jQuery("html").animate({scrollTop:b},"slow")}},convertToDatePickerFormat:function(a){switch(a){case"yyyy-mm-dd":return"Y-m-d";break;case"mm-dd-yyyy":return"m-d-Y";break;case"dd-mm-yyyy":return"d-m-Y";break;case"yyyy.mm.dd":return"Y.m.d";break;case"mm.dd.yyyy":return"m.d.Y";break;case"dd.mm.yyyy":return"d.m.Y";break;case"yyyy/mm/dd":return"Y/m/d";break;case"mm/dd/yyyy":return"m/d/Y";break;case"dd/mm/yyyy":return"d/m/Y";break}},convertTojQueryDatePickerFormat:function(b){var e=0;var g="-";if(b.indexOf("-")!=-1){g="-"}if(b.indexOf(".")!=-1){g="."}if(b.indexOf("/")!=-1){g="/"}var f=b.split(g);for(var e in f){var d=f[e];var a=d.length;if(a==4){var c=d.substring(0,2);f[e]=c}}var h=f.join(g);return h},getDateInVtigerFormat:function(a,c){var d=app.convertTojQueryDatePickerFormat(a);var b=jQuery.datepicker.formatDate(d,c);return b},getDateInDBInsertFormat:function(a,g){var b=0;var k="-";if(a.indexOf("-")!=-1){k="-"}if(a.indexOf(".")!=-1){k="."}if(a.indexOf("/")!=-1){k="/"}var j=a.split(k);var h=g.split(k);var f="";var d="";var e="";for(b in j){var c=j[b];switch(c){case"dd":f=h[b];break;case"mm":d=h[b];break;case"yyyy":e=h[b];break}}return e+"-"+d+"-"+f},registerEventForTextAreaFields:function(a){if(typeof a=="undefined"){a=jQuery("body")}a=jQuery(a);if(a.is("textarea")){var b=a}else{var b=jQuery("textarea",a)}if(b.length==0){return}b.autosize()},registerEventForDatePickerFields:function(l,c,d){if(typeof l=="undefined"){l=jQuery("body")}if(typeof c=="undefined"){c=true}l=jQuery(l);if(l.hasClass("dateField")){var j=l}else{var j=jQuery(".dateField",l)}if(j.length==0){return}if(c==true){var f=j.closest(".date");jQuery(".input-group-addon",f).on("click",function(n){var m=jQuery(n.currentTarget);m.closest(".date").find("input.dateField").get(0).focus()})}var a=j.data("dateFormat");var e=app.convertToDatePickerFormat(a);var i=jQuery("body").data("language");var b=i.split("_");var h=jQuery("#start_day").val();if(h==""||typeof(h)=="undefined"){var k=1}else{k=this.weekDaysArray[h]}var g={format:e,calendars:1,locale:$.fn.datepicker.dates[b[0]],starts:k,eventName:"focus",onChange:function(p){var m=jQuery(this).data("datepicker").el;m=jQuery(m);var n=jQuery("#"+jQuery(this).data("datepicker").id);var o=n.find("table.datepickerViewDays");if(o.length>0&&m.val()!=p){m.DatePickerHide();m.blur()}m.val(p).trigger("change").focusout()},onBeforeShow:function(m){j.each(function(n,o){var p=jQuery(o);if(p[0]!=document.activeElement){p.DatePickerHide();p.blur()}})},};if(typeof d!="undefined"){var g=jQuery.extend(g,d)}j.each(function(n,p){var q=jQuery(p);var m=new Date();var o=app.getDateInVtigerFormat(a,m);if(q.val()!=""){o=q.val()}g.date=o;g.current=o;q.DatePicker(g)})},registerEventForDateFields:function(a){if(typeof a=="undefined"){a=jQuery("body")}a=jQuery(a);if(a.hasClass("dateField")){var b=a}else{var b=jQuery(".dateField",a)}b.datepicker({autoclose:true}).on("changeDate",function(f){var e=jQuery(f.currentTarget);var c=e.data("dateFormat");var g=app.getDateInVtigerFormat(c,f.date);var d=jQuery.datepicker.formatDate(g,f.date);e.val(d)})},registerEventForTimeFields:function(b,a,f){if(typeof cotainer=="undefined"){b=jQuery("body")}if(typeof a=="undefined"){a=true}b=jQuery(b);if(b.hasClass("timepicker-default")){var c=b}else{var c=b.find(".timepicker-default")}if(a==true){var d=c.closest(".time");jQuery(".input-group-addon",d).on("click",function(i){var h=jQuery(i.currentTarget);h.closest(".time").find(".timepicker-default").focus()})}if(typeof f=="undefined"){f={}}var g=c.data("format");if(g=="24"){g="H:i"}else{g="h:i A"}var e={timeFormat:g,className:"timePicker"};var f=jQuery.extend(e,f);c.timepicker(f);return b},destroyTimeFields:function(a){if(typeof cotainer=="undefined"){a=jQuery("body")}if(a.hasClass("timepicker-default")){var b=a}else{var b=a.find(".timepicker-default")}b.data("timepicker-list",null);return a},getChosenElementFromSelect:function(a){var b=a.attr("id");var c=b+"_chosen";return jQuery("#"+c)},getSelect2ElementFromSelect:function(a){var b=a.attr("id");var c="select2-"+b+"-container";return jQuery("#"+c).closest(".select2-container")},getSelectElementFromChosen:function(c){var b=c.attr("id");var a=b.split("_chosen");var d=a["0"];return jQuery("#"+d)},setInheritWidth:function(a){jQuery(a).each(function(b,c){var d=jQuery(c).parent().width();jQuery(c).width(d)})},initGuiders:function(a){},showScrollBar:function(b,a){if(typeof a=="undefined"){a={}}if(typeof a.height=="undefined"){a.height=b.css("height")}return b.slimScroll(a)},showHorizontalScrollBar:function(b,a){if(typeof a=="undefined"){a={}}var c={horizontalScroll:true,theme:"dark-thick",advanced:{autoExpandHorizontalScroll:true}};if(typeof a!="undefined"){var c=jQuery.extend(c,a)}return b.mCustomScrollbar(c)},vtranslate:function(b){if(app.languageString[b]!=undefined){return app.languageString[b]}else{var a=jQuery("#js_strings").text();if(a!=""){app.languageString=JSON.parse(a);if(b in app.languageString){return app.languageString[b]}}}return b},setContentsHeight:function(){var a=parseInt(jQuery(".mainContainer").css("margin-top"))+21;jQuery(".bodyContents").css("min-height",(jQuery(window).innerHeight()-a))},vimage_path:function(a){return jQuery("body").data("skinpath")+"/images/"+a},cacheNSKey:function(a){return"vtiger6."+a},cacheGet:function(b,a){b=this.cacheNSKey(b);return jQuery.jStorage.get(b,a)},cacheSet:function(a,b){a=this.cacheNSKey(a);jQuery.jStorage.set(a,b)},cacheClear:function(a){a=this.cacheNSKey(a);return jQuery.jStorage.deleteKey(a)},htmlEncode:function(a){if(a){return jQuery("
    ").text(a).html()}else{return""}},htmlDecode:function(a){if(a){return $("
    ").html(a).text()}else{return""}},placeAtCenter:function(a){a.css("position","absolute");a.css("top",((jQuery(window).height()-a.outerHeight())/2)+jQuery(window).scrollTop()+"px");a.css("left",((jQuery(window).width()-a.outerWidth())/2)+jQuery(window).scrollLeft()+"px")},getvalidationEngineOptions:function(a){return app.validationEngineOptions},notifyPostAjaxReady:function(){jQuery(document).trigger("postajaxready")},listenPostAjaxReady:function(a){jQuery(document).on("postajaxready",a)},setFormValues:function(b){for(var a in b){jQuery(a).val(b[a])}},setRTEValues:function(c){for(var a in c){var b=CKEDITOR.instances[a];if(b){b.setData(c[a])}}},getPageController:function(){var c=app.getModuleName();var a=app.getViewName();var e=app.getParentModuleName();var d=e+"_"+c+"_"+a+"_Js";if(typeof window[d]=="undefined"){d=e+"_Vtiger_"+a+"_Js"}if(typeof window[d]=="undefined"){d=c+"_"+a+"_Js"}var b=jQuery("#extendModules").val();if(typeof window[d]=="undefined"&&b!=undefined){d=b+"_"+a+"_Js"}if(typeof window[d]=="undefined"){d="Vtiger_"+a+"_Js"}if(typeof window[d]!="undefined"){return new window[d]()}},getDecodedValue:function(a){return jQuery("
    ").html(a).text()},getColorContrast:function(f){var d=parseInt(f.substr(0,2),16);var c=parseInt(f.substr(2,2),16);var a=parseInt(f.substr(4,2),16);var e=((d*299)+(c*587)+(a*114))/1000;return(e>=128)?"light":"dark"},updateRowHeight:function(){var c=jQuery("#row_type").val();if(c.length<=0){var b=app.cacheGet("widthType","mediumWidthType");var e=b;switch(e){case"narrowWidthType":e="narrow";break;case"wideWidthType":e="wide";break;default:e="medium"}var a=jQuery("#current_user_id").val();var d={module:"Users",action:"SaveAjax",record:a,value:e,field:"rowheight"};AppConnector.request(d).then(function(){jQuery(c).val(e)})}},getCookie:function(b){var c=document.cookie;var d=c.indexOf(" "+b+"=");if(d==-1){d=c.indexOf(b+"=")}if(d==-1){c=null}else{d=c.indexOf("=",d)+1;var a=c.indexOf(";",d);if(a==-1){a=c.length}c=unescape(c.substring(d,a))}return c},setCookie:function(a,d,b){var e=new Date();e.setDate(e.getDate()+b);var c=escape(d)+((b==null)?"":"; expires="+e.toUTCString());document.cookie=a+"="+c},getUrlVar:function(b){var a=function(){var d={};var c=window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(e,f,g){d[f]=g});return d};return a()[b]},getStringDate:function(b){var c=b.getDate();var a=b.getMonth()+1;var e=b.getFullYear();c=(c<=9)?("0"+c):c;a=(a<=9)?("0"+a):a;return e+"-"+a+"-"+c},formatDate:function(b){var j=b.getFullYear(),a=b.getMonth()+1,g=b.getDate(),f=b.getHours(),c=b.getMinutes(),e=b.getSeconds();return j+"-"+this.formatDateZ(a)+"-"+this.formatDateZ(g)+" "+this.formatDateZ(f)+":"+this.formatDateZ(c)+":"+this.formatDateZ(e)},formatDateZ:function(a){return(a<=9?"0"+a:a)},saveAjax:function(d,c){var a=jQuery.Deferred();var b={};b.module=app.getModuleName();b.parent=app.getParentModuleName();b.action="SaveAjax";b.mode=d;b.param=c;AppConnector.request(b).then(function(e){a.resolve(e)},function(e){a.reject()});return a.promise()},showBtnSwitch:function(a,b){if(typeof b=="undefined"){b={}}a.bootstrapSwitch(b);return a},generateRandomChar:function(){var c,b,a;c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ";a=Math.floor(Math.random()*c.length);return b=c.substring(a,a+1)},getMainParams:function(b){if(app.cacheParams[b]!=undefined){return app.cacheParams[b]}var a=$("#"+b).val();app.cacheParams[b]=a;return a},parseNumberToShow:function(b){if(b==undefined){b=0}var c=parseInt(app.getMainParams("numberOfCurrencyDecimal"));var a=app.getMainParams("currencyDecimalSeparator");b=parseFloat(b).toFixed(c);if(a!="."){b=b.toString().replace(".",a)}return b},parseNumberToFloat:function(a){var b=parseInt(app.getMainParams("numberOfCurrencyDecimal"));if(a==undefined){a=0}if(app.getMainParams("currencyDecimalSeparator")==","){a=a.toString().replace(/\s/g,"").replace(",",".")}return parseFloat(a)},errorLog:function(a,b,c){console.error(a,b,c)},};jQuery(document).ready(function(){app.changeSelectElementView();app.showSelect2ElementView(jQuery("body").find("select.select2"));app.showSelectizeElementView(jQuery("body").find("select.selectize"));app.showPopoverElementView(jQuery("body").find(".popoverTooltip"));app.showBtnSwitch(jQuery("body").find(".switchBtn"));app.setContentsHeight();app.updateRowHeight();jQuery(window).resize(function(){app.setContentsHeight()});String.prototype.toCamelCase=function(){var b=this.valueOf();return b.charAt(0).toUpperCase()+b.slice(1).toLowerCase()};if(/MSIE/.test(navigator.userAgent)||(/Trident/).test(navigator.userAgent)){jQuery("textarea").resizable()}var a=app.getPageController();if(a){a.registerEvents()}});function resizeUI5IframeReset(){jQuery("#ui5frame").height(650)}function resizeUI5Iframe(a){jQuery("#ui5frame").height(parseInt(a,10)+15)}; \ No newline at end of file diff --git a/layouts/vlayout/skins/login.css b/layouts/vlayout/skins/login.css index 2627dc2f1e1c..cb73ba7edc21 100644 --- a/layouts/vlayout/skins/login.css +++ b/layouts/vlayout/skins/login.css @@ -19,6 +19,3 @@ html,body{ .login-form .form-group.first-group{ margin-bottom: 5px; } -.img-responsive.logo{ - margin: auto; -} diff --git a/layouts/vlayout/skins/login.min.css b/layouts/vlayout/skins/login.min.css index 80a29a8e5340..b49eda03a945 100644 --- a/layouts/vlayout/skins/login.min.css +++ b/layouts/vlayout/skins/login.min.css @@ -1,2 +1,2 @@ -@media(min-width:768px){.visible-phone{visibility:hidden}}@media(max-width:767px){.visible-phone{visibility:visible}}.login-area{max-width:400px;padding:15px;margin:0 auto}html,body{background:#ddecf0}.login-form .form-group.first-group{margin-bottom:5px}.img-responsive.logo{margin:auto} \ No newline at end of file +@media(min-width:768px){.visible-phone{visibility:hidden}}@media(max-width:767px){.visible-phone{visibility:visible}}.login-area{max-width:400px;padding:15px;margin:0 auto}html,body{background:#ddecf0}.login-form .form-group.first-group{margin-bottom:5px} \ No newline at end of file diff --git a/layouts/vlayout/skins/twilight/style.css b/layouts/vlayout/skins/twilight/style.css index 6fc9c8f93251..a7e983bbffdc 100644 --- a/layouts/vlayout/skins/twilight/style.css +++ b/layouts/vlayout/skins/twilight/style.css @@ -40,7 +40,6 @@ body { width: 100%; - height: 100%; font-family: 'Open Sans', 'Lucida Grande', Verdana, Tahoma, Arial, sans-serif !important; font-size: 12px !important; background: #ffffff; @@ -1482,6 +1481,9 @@ th.htColHeader, padding-left: 5px; line-height: 20px; } +.contentsDiv > div { + padding: 0 20px; +} #settingsQuickWidgetContainer .widgetContainer.accordion-body { border-bottom: none !important; border-bottom: 3px solid #dddddd; @@ -3407,7 +3409,7 @@ span[name=existingImages] img{ font-size: 20px; } .globalSearchInput{ - width: 150px; + width: 300px; } #groupsDetailContainer strong{ line-height: 21px; @@ -3672,103 +3674,3 @@ span[name=existingImages] img{ .checkboxForm{ padding-top: 7px; } - - - -.leftPanel{ - background-color: #2f333f; -} -.leftPanel a{ - color: #e3e9f0; -} -.bodyHeader{ - background-color: #444853; -} -.mainPanel{ - -} -.noSpaces{ - padding: 0; - margin: 0; -} -html,body,.baseContainer -{ - height:100%; -} -#page -{ - display:table; - width: 100%; - height: 100%; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.container-fluid-main{ - height: 100%; -} -.container-fluid-main, .leftPanel .row{ - padding: 0; - margin: 0; -} -.leftPanel, .basePanel, .bodyContents, .mainContainer,.contentsDiv{ - min-height: 100%; - height: 100%; -} -.bodyContent{ - min-height: 100%; - height: 100%; - overflow: auto; - margin-top: -48px; - padding-top: 48px; -} -.leftPanel -{ - display: table-cell; -} -.basePanel -{ - display: table-cell; -} -.userDetailsContainer{ - background-color: #a44042; - padding-right: 0; -} -.userActionContainer{ - background-color: #ad5154; - padding-right: 0; -} -.companyLogoContainer{ - display: block; - width: 50px; - padding: 5px; -} -.userDetails, .bodyHeader{ - color: #fff; -} -.bodyHeader .moduleIcon{ - width: 34px; - margin: 7px; - background-color: #fff; -} -.mainModuleTitle{ - margin: 10px 0; - text-transform: uppercase; -} -ul.headerLink{ - display: inline-block; - margin-right: 5px; - margin-top: 5px; -} -ul.headerLink li{ - list-style-type: none; -} -.userDetails{ - padding-right: 0; -} -.userDetails .name{ - line-height: 15px; - font-size: 15px; -} -.menuContainer{ - overflow: auto; -} diff --git a/layouts/vlayout/skins/twilight/style.min.css b/layouts/vlayout/skins/twilight/style.min.css index f6c594391a3c..e688a35ef2f0 100644 --- a/layouts/vlayout/skins/twilight/style.min.css +++ b/layouts/vlayout/skins/twilight/style.min.css @@ -1,2 +1,2 @@ -@media print{.noprint{display:none}}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}.hide-text{overflow:hidden;text-indent:100%;white-space:nowrap}.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot');src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.woff') format('woff'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.ttf') format('truetype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg')}body{width:100%;height:100%;font-family:'Open Sans','Lucida Grande',Verdana,Tahoma,Arial,sans-serif!important;font-size:12px!important;background:#fff;color:#2b2b2b}hr{margin:8px 0;border-bottom:1px solid #ddd}.navbar.navbar-fixed-top .navbar-collapse{padding-right:15px!important}.navbar-nav.navbar-left .open ul{display:none}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background:0}.navbar-default .navbar-nav>li:hover{background:#e7e7e7}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background:0}.navbar-inverse .navbar-nav>li:hover{background:#080808}.navbar-nav .hovernav:hover>.dropdown-menu{display:block}#collapsedMenu{display:block;position:relative}#collapsedMenu a{color:#fff}#collapsedMenu .dropdown-menu .shortDropdown{max-height:300px;overflow-y:scroll;padding:10px;position:relative;z-index:10000;-webkit-overflow-scrolling:touch;-webkit-transform:translateZ(0)}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames{margin-bottom:2px}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a{font-size:.9em;padding:3%!important;color:#2b2b2b!important}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a:hover{text-decoration:none;background:#404952;color:#fff!important}.moreMenus{width:52em;padding:24%;left:0;border-radius:2px}.moreMenus.leftAligned:after,.moreMenus.leftAligned:before{left:21px!important}.moreMenus strong{font-size:1.1em;color:#2b2b2b}.moreMenus:after,.moreMenus:before{left:292px!important}.announcement{// display:none;background:#fafad2;// padding:2px 0;// border-bottom:1px solid #ccc;// max-height:24px;// width:100%}.announcement .marStyle{// width:100%}#headerLinks{padding:10px 0 7px;min-width:240px;float:right!important}#headerLinks .headerLinksContainer{margin-right:10px}#headerLinks .headerLinksContainer>[class*="span"]{float:left;margin-left:15px}#headerLinks .headerLinksContainer .dropdown.open .dropdown-toggle{background:transparent}#headerLinks .headerLinksContainer ul.dropdown-menu{top:30px}#headerLinks .headerLinksContainer ul.dropdown-menu:after,#headerLinks .headerLinksContainer ul.dropdown-menu:before{right:15px;left:auto}#headerLinks .headerLinksContainer>span a img,#headerLinks .headerLinksContainer>span a.userName{color:#fff;cursor:pointer;text-decoration:none!important}#headerLinks .headerLinksContainer>span a img .caret,#headerLinks .headerLinksContainer>span a.userName .caret{border-top:4px solid #fff}.dropdown-menu.pull-right{right:0;left:auto;cursor:pointer}.themeMenuContainer{min-width:110px;width:110px;left:-84px!important;padding:10px 0}.themeMenuContainer .themeMenu{padding:0 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement{cursor:pointer;margin:5px;height:20px;width:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement:hover{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}.themeMenuContainer .themeMenu .themeSelected{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}@media screen and (min-width:1161px){#mediumNav,#shortNav,#headerLinksCompact{display:none}#largeNav{margin-left:10px;margin-right:0}}@media screen and (max-width:1160px) and (min-width:960px){.companyLogo{width:100%}.customFilterMainSpan .select2-container{width:300px!important}*{zoom:1!important}}@media screen and (max-width:960px){.bodyContents{margin:0!important}#centerPanel{width:100%!important}.col-md-3#headerLinks{padding:5px 5px 0}.menuBar .col-md-9,.col-md-3#headerLinks{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-width:80px}.menuBar .col-md-9 .qCreate,.col-md-3#headerLinks .qCreate{display:inline-block;margin:0}.menuBar .col-md-9 .qCreate img,.col-md-3#headerLinks .qCreate img{margin-bottom:3px;margin-right:5px}.menuBar .col-md-9 .qCreate ul li.title,.col-md-3#headerLinks .qCreate ul li.title{padding:5px 0 0 15px}.menuBar .col-md-9 li.tabs:first-child>a,.col-md-3#headerLinks li.tabs:first-child>a{padding:10px 12px 9px}.customFilterMainSpan .select2-container{width:300px!important}#quickCreateModules{width:100%!important;padding:0!important}.CompactQC{max-height:300px;overflow-y:scroll;overflow-x:hidden}.CompactQC a:hover{text-decoration:none}}.commonActionsContainer .quickActions{height:3em}.commonActionsContainer .quickActions img{height:60%;margin:40% auto}.commonActionsContainer .quickActions #companyLogo-container img{height:98%;margin:0 auto}.commonActionsContainer .actionsContainer{background:#f3f3f3}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown{min-width:715px;top:28px;margin:0;padding-top:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a{padding:2px;border:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mainContainer{min-height:500px;margin-top:103px;background:#eeeff2;min-width:1200px}.mainContainer>.col-md-2{// padding:0 1.06383%;height:auto!important;// min-width:174px}.mainContainer .contentsDiv{min-height:500px;background:#fafafb;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;border-left:1px solid #e6e6e6;position:relative}.mainContainer #leftPanel{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.toggleButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;left:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-left:0;display:inline-block}.toggleButton .glyphicon-chevron-left{background-position:-434px -72px!important}.toggleButton .glyphicon-chevron-right{background-position:-460px -72px!important}.toggleRightPanelButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;right:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-right:0;display:inline-block}.quickLinksDiv{margin:10px 0}.quickLinksDiv p{font-size:1.2em;padding:3% 0 0 6%;height:40px;cursor:pointer;box-shadow:0 0 0 1px #ddd;border-top:1px solid #fff!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);position:relative;border-radius:2px}.quickLinksDiv p a{color:#2b2b2b}.quickLinksDiv p a:hover{text-decoration:none}.quickLinksDiv p.selectedQuickLink{background-color:#2a2f35;background-image:-moz-linear-gradient(top,#2a2f35,#2a2f35);background-image:-ms-linear-gradient(top,#2a2f35,#2a2f35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#2a2f35),to(#2a2f35));background-image:-webkit-linear-gradient(top,#2a2f35,#2a2f35);background-image:-o-linear-gradient(top,#2a2f35,#2a2f35);background-image:linear-gradient(top,#2a2f35,#2a2f35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2a2f35',endColorstr='#2a2f35',GradientType=0);border-color:#2a2f35 #2a2f35 #08090a;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);background-image:none;position:relative;border:1px solid #fff;box-shadow:4px 0 3px -4px #000 inset}.quickLinksDiv p.selectedQuickLink a{color:#fff}.quickLinksDiv p.selectedQuickLink a:after{border-bottom:19px solid rgba(0,0,0,0);border-left:10px solid #2a2f35;border-top:19px solid rgba(0,0,0,0);content:" ";display:inline-block;position:absolute;left:100%;top:0}.quickWidgetContainer li a{overflow:hidden;white-space:normal;padding:5px;margin:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.quickWidgetContainer .quickWidget{margin-bottom:10px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.sidebarTitleBlock{padding:12px 0}.sidebarTitleBlock a{color:#373737!important}.sidebarTitleBlock a:hover{text-decoration:none}#selectAllMsgDiv,#deSelectAllMsgDiv{display:none;background-color:#fafad2;padding:.01%;text-align:center}.blockUI form,#globalmodal form{margin:0}.dashboardContainer .dashboardHeading{background:#f5f5f5}.gridster>*{margin:0 0 0 15px!important}.contentsDiv .gridster{padding:0}.dashboardContainer{padding:0}.dashboardContainer .dashboardHeading hr{border-bottom:1px solid #ddd}.widgetsList{max-height:400px;overflow-y:auto;overflow-x:hidden}.widgetsList li{display:block}.widgetsList li a{white-space:normal;word-wrap:break-word}.dashboard_notebookWidget_view .row{margin-bottom:5px}.gridster{margin-left:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.gridster ul{width:auto;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:460px}.gridster ul{list-style:none}.gridster ul li.dashboardWidget{background:#fff;border-radius:1px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.gridster ul li.dashboardWidget .dashboardWidgetHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd;color:#444;cursor:move;padding:5px}.gridster ul li.dashboardWidget .dashboardWidgetHeader table{height:28px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .dashboardTitle{text-align:left;padding-left:10px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .widgeticons{opacity:.5;padding-right:6px}.gridster ul li.dashboardWidget .filterContainer{position:absolute;border:1px solid #ddd;background:#fff;margin-left:-7px;margin-right:3px;margin-top:4px;padding:8px 0;border-radius:0 0 5px 5px;box-shadow:0 5px 8px -5px #888}.gridster ul li.dashboardWidget .filterContainer div span{margin-top:6px}.gridster ul li.dashboardWidget .filterContainer .col-md-5{margin-top:3px}.gridster ul li.dashboardWidget .dashboardWidgetContent{padding:10px 0;line-height:20px}.gridster ul li.dashboardWidget .dashboardWidgetContent .dashboard_notebookWidget_viewarea{height:200px}.gridster ul li.dashboardWidget .widgeticons{min-width:50px;height:30px;margin-right:30px}.gridster ul li.dashboardWidget .widgeticons a{cursor:pointer;text-decoration:none}.gridster ul .widgetChartContainer{margin-left:10px}.listViewPageDiv{margin:11px 0}.customFilterMainSpan{width:100%}.customFilterMainSpan .select2-container{width:95%!important}.select2-container .select2-choice{border-radius:2px;background:#fff;border-color:#ddd;font-size:14px;letter-spacing:.01em;color:#2b2b2b}.select2-container .select2-choice div{border-radius:0;border-left:0;background:#fff}.select2-drop{border-color:#ddd}.select2-dropdown ul.filterActions{list-style:none!important;padding-left:15px}.select2-dropdown ul.filterActions li{cursor:pointer}.ui-autocomplete .ui-menu-item #ui-active-menuitem{background:#404952;border-radius:0}li.ui-timepicker-selected,.ui-timepicker-list li:hover,.ui-timepicker-list:hover .ui-timepicker-selected:hover{background:#404952}#relatedTabOrder .select2-input{min-width:200px}.alphabetSorting .alphabetSearch a{vertical-align:middle;display:inline-block;margin-bottom:2px}.alphabetSorting .alphabetSearch:hover{background:#eeeff2}.listViewActions .settingsIcon{display:inline-block;margin-left:5px}.listViewActions>.btn-group{min-width:105px}#listViewPageJumpDropDown,#relatedListPageJumpDropDown{left:-60px}.pageNumbers{display:inline-block;margin-right:5px;margin-top:6px;vertical-align:top}.pageNumbers .totalNumberOfRecords{margin:0 5px}.contents-topscroll,#reportDetails{overflow-x:auto!important;overflow-y:visible}.contents-bottomscroll{overflow-x:auto!important}.bottomscroll-div,.topscroll-div{display:table;min-width:100%}.listViewLoadingImageBlock{background:0;border-radius:0;box-shadow:none;text-align:center}.detailViewContainer{padding:0 20px}.userPreferences .contents{padding-left:0!important}.userPreferences .details{border-right:0!important}.detailViewTitle{padding:1% 0 0 1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .recordLabel{font-size:16px;font-weight:bold}.detailViewTitle .detailViewButtoncontainer{margin-top:8px}.detailViewTitle .detailViewPagingButton{margin-top:8px;padding-right:10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .btn-toolbar{margin:0}.detailview-table th,.detailview-table td{vertical-align:middle}.detailview-table th label,.detailview-table td label{margin-bottom:3px}.detailViewInfo{box-shadow:0 -4px 4px -4px #959595;margin-top:5px}.detailViewInfo .details{// min-height:600px;padding-right:1.5%;border-right:4px solid #404952;padding-bottom:10px;padding-top:10px}.detailViewInfo .related .nav-pills .active>a,.detailViewInfo .related .nav-pills .active>a:hover{background:#404952;border-radius:1px;margin-top:0;margin-bottom:2px}.fieldLabel{width:20%;background:#f7f7f9}.fieldLabel label.marginRight10px{text-align:right}.summaryView{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.summaryView .summary-table tr.summaryViewEntries:last-child .fieldValue,.summaryView .summary-table tr.summaryViewEntries:last-child .fieldLabel{border-bottom:1px solid #ddd}.summaryView .summaryViewEntries .fieldLabel{vertical-align:top;padding:5px 0 5px 5%;border-top:1px solid #ddd;border-right:1px solid #ddd}.summaryView .summaryViewEntries .fieldValue{vertical-align:top;padding:5px 0 5px 5px;border-top:1px solid #ddd}.summaryView .summaryViewEntries:hover .summaryViewEdit{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryView .summaryViewEntries .summaryViewEdit{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryView .toggleViewByMode{margin:8px 0;padding-right:0}.summaryView .toggleViewByMode .changeDetailViewMode{white-space:normal!important}.summaryWidgetContainer{border-radius:2px;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border:1px solid #eaeaea;background:#fff;margin-bottom:10px;padding:15px}.commentContainer .commentTitle{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;margin-bottom:10px}.commentContainer .commentTitle textarea{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordDetails .squeezedWell{padding:3% 0;min-height:105px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordEditView .contentHeader{padding:.5% 0 1% 0}.recordEditView .table .fieldLabel,.recordEditView .table .fieldValue{vertical-align:middle}.recordEditView .table tbody tr:hover td,.recordEditView .table tbody tr:hover th{background:#f7f7f9}.commentContainer{border-radius:2px}.commentContainer hr{margin:0!important}.commentContainer .addCommentBlock .commentsControls{display:inline-block}.commentContainer .commentsList>.liStyleNone>.commentDetails .commentDiv{width:100%}.commentContainer .commentDetails{background:#fff;border:1px solid #ddd;margin-bottom:5px;border-radius:2px;padding:10px 10px 5px;display:inline-block;min-width:354px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentContainer .commentorInfo p{margin-bottom:0}.commentContainer .addCommentBlock{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border:1px solid #ddd;padding:12px 12px 5px;min-height:115px;margin-top:15px;display:block}.commentContainer .addCommentBlock .commentcontent{padding:8px!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;resize:none}.commentContainer .commentInfoContent{padding:1px 0;word-wrap:break-word}.commentTitle .col-md-1{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentTitle .col-md-1 img{width:32px;height:32px}.commentsList>ul{margin-left:0}.singleComment .editedStatus{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:5px 0 5px 32px}.singleComment .editedStatus p{margin-bottom:0}.singleComment .commentActionsDiv{display:none}.singleComment .commentActionsDiv p{margin-bottom:0}.singleComment:hover .commentActionsDiv{display:block;margin-bottom:3px}.recentComments{margin:0;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recentComments .commentDiv{min-width:100%}.recentComments .addCommentBlock{border:0;margin-top:0;display:block}.recentComments .commentDetails{display:block}.singleComment:hover .commentActions .replyComment{display:inline-block}.commentActionsContainer a:hover{text-decoration:none}.commentActionsContainer .editStatus{padding:5px 2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentActionsContainer .editStatus p{margin-bottom:0}.table{background:#fff}.table-bordered{border-radius:1px;margin-bottom:0}.table-bordered th{border-top:1px solid #fff!important}.table th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;color:#444}.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td,.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td{border-left:0;border-right:0}.listViewEntriesTable tbody tr td:first-child{border-left:0 none}.equalSplit td:nth-child(odd){width:20%}.equalSplit td:nth-child(even){width:30%}td.fieldValue input,td.fieldValue .input-group{margin-bottom:0}.actionImage,.actionImages{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.listViewHeaders a{color:#444}.listViewEntriesDiv .listViewHeaders th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd}.listViewEntriesDiv,.listViewEntriesDiv td{overflow:visible}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues{color:#444}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues:hover{text-decoration:none}.listViewEntriesTable td.listViewEntryValue,.listViewEntries td{vertical-align:middle;cursor:pointer;overflow:visible;padding:5px}.listViewEntriesTable td.listViewEntryValue:hover .actionImages,.listViewEntries td:hover .actionImages,.listViewEntriesTable td.listViewEntryValue:hover .actions,.listViewEntries td:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryViewEntries .summaryViewEdit,.activityStatus .editStatus,.activityDescription .editDescription,.addedCalendars .actionImage{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryViewEntries:hover .fieldValue .summaryViewEdit,.activityStatus:hover .editStatus,.activityDescription:hover .editDescription,.addedCalendars:hover .actionImage{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewEntriesTable tr:hover td .actions .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewBasicAction.dropdown-menu{width:100%}.listViewBasicAction.dropdown-menu input{border-radius:2px;height:24px;margin-bottom:0;margin-top:-2px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.emptyRecordsDiv{width:100%;border:1px solid #ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.emptyRecordsDiv td{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.CustomFilterViewTitle{padding-top:1%}#CustomView .filterActions{padding-bottom:20px;overflow:hidden}.filterConditionsDiv{padding-bottom:0}.conditionGroup .header{margin-bottom:20px;font-size:1.2em}.conditionGroup .contents .conditionRow{margin-bottom:10px}.conditionGroup .contents .conditionRow select{width:90%}.conditionGroup .contents .conditionRow .chzn-results li{line-height:20px}.conditionGroup .deleteCondition{vertical-align:bottom}.searchUIBasic{border-collapse:separate!important;border-spacing:10px!important;margin:0 10%}.searchUIBasic .importContents{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.searchUIBasic .listRow .listViewHeaders>td{color:#404952}.searchUIBasic .listRow .defaultInputTextContainer{max-width:87%!important;margin-bottom:0!important}#lineItemTab.table tr:first-child:hover th ~ td{background-color:#f3f3f4;background-image:-moz-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-ms-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f3f3f4),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-o-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:linear-gradient(top,#f3f3f4,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f4',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}#lineItemTab.table tr:nth-child(2):hover td{background:0}.lineItemTable tr td{width:0}.lineItemTable tr td div.finalDiscountUI,.lineItemTable tr td div.discountUI,.lineItemTable tr td div#shipping_handling_div,.lineItemTable tr td div.taxUI,.lineItemTable tr td div.finalTaxUI{border:2px solid #c4c4c4;border-radius:2px}.lineItemTable tr td div.finalDiscountUI table tr td,.lineItemTable tr td div.discountUI table tr td,.lineItemTable tr td div#shipping_handling_div table tr td,.lineItemTable tr td div.taxUI table tr td,.lineItemTable tr td div.finalTaxUI table tr td,.lineItemTable tr td div.finalDiscountUI table tr th,.lineItemTable tr td div.discountUI table tr th,.lineItemTable tr td div#shipping_handling_div table tr th,.lineItemTable tr td div.taxUI table tr th,.lineItemTable tr td div.finalTaxUI table tr th{border-left:0}.lineItemTable tr:hover td{width:0}.lineItemTable tr:hover td div.finalDiscountUI table tr td{background:none!important}.lineItemTable tr:hover td div.discountUI table tr td{background:none!important}.lineItemTable tr:hover td div#shipping_handling_div table tr td{background:none!important}.lineItemTable tr:hover td span.taxDivContainer div table tr td{background:none!important}.lineItemTable tr:hover td div.finalTaxUI table tr td{background:none!important}.lineItemResult{width:70.5%!important}.lineItemResult a:hover{color:#404952}.lineItemInputBox{width:45%;float:right;text-align:right}.discountUI,.taxUI,.finalDiscountUI,.finalTaxUI,#shipping_handling_div{position:absolute;left:46%;width:30%;z-index:500;box-shadow:1px 0 7px #ddd;border-radius:6px}.discountUI table.table,.taxUI table.table,.finalDiscountUI table.table,.finalTaxUI table.table,#shipping_handling_div table.table{margin-bottom:0}.discountUI .table tbody tr:first-child th:first-child,.taxUI .table tbody tr:first-child th:first-child,.finalDiscountUI .table tbody tr:first-child th:first-child,.finalTaxUI .table tbody tr:first-child th:first-child,#shipping_handling_div .table tbody tr:first-child th:first-child{border-radius:4px 0 0 0!important}.discountUI .table tbody tr:first-child th:last-child,.taxUI .table tbody tr:first-child th:last-child,.finalDiscountUI .table tbody tr:first-child th:last-child,.finalTaxUI .table tbody tr:first-child th:last-child,#shipping_handling_div .table tbody tr:first-child th:last-child{border-radius:0 4px 0 0!important}.LineItemDirectPriceReduction{width:65%!important}th.htColHeader,.handsontable thead th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd;padding:6px 2px}.contentHeader{padding:15px;padding-left:5px;line-height:20px}#settingsQuickWidgetContainer .widgetContainer.accordion-body{border-bottom:none!important;border-bottom:3px solid #ddd}#settingsQuickWidgetContainer .widgetContainer.accordion-body>div:hover{background:#eeeff2}#settingsShortCutsContainer{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:1% 3%}#settingsShortCutsContainer .moduleBlock{min-height:60px}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin{display:inline-block;opacity:.4}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin:hover{opacity:.8}.settingsIndexPage .settingsSummary{text-align:center;margin-top:10px}.settingsIndexPage .settingsSummary a{display:inline-block;background:#f3f3f4;color:#444;border-radius:2px;min-width:200px;padding:20px 0 10px;border:1px solid #ddd}.settingsIndexPage .settingsSummary a .summaryText{display:inline-block;margin-top:20px;font-size:15px}.settingsIndexPage .settingsSummary a:hover .summaryText,.settingsIndexPage .settingsSummary a:hover .summaryCount{color:#404952}.settingsIndexPage .moduleBlock h5{font-size:1.2em;margin-bottom:5px}.settingsIndexPage .moduleBlock:hover{background:#f3f3f4}#userPageHeader{padding:8px 0 0}#userPageHeader #userHeading h3{margin-top:10px}.treeView li{border-left:4px solid #ddd;list-style:none;padding-top:15px}.treeView li .toolbar-handle{margin-left:10px;position:relative}.treeView li .toolbar-handle .btn{margin:0}.treeView li .toolbar-handle a:before{background:none repeat scroll 0 0 #ddd;content:" ";display:inline-block;height:4px;left:-10px;position:absolute;top:12px;width:10px}.treeView .btn{margin-bottom:10px}.profilesEditView tr.blockHeader th{text-align:center}.profilesEditView tr.blockHeader th:first-child{text-align:left}.profilesEditView input{margin-right:5px}.profilesEditView tr td.row table.table{border-left:none;margin-bottom:20px}.profilesEditView tr:hover td.row{background:0}.profilesEditView tr:hover td.row table.table tr td{background:0}.profilesEditView tr:hover td.row table.table tr:hover td{background:0}.profilesEditView tr:hover td.row table.table td{background:#f3f3f4}#s2id_memberList li>div,.groupMembersColors li>div{margin-left:10px}#s2id_memberList .Users,.groupMembersColors .Users{background-color:#f99984!important;padding:5px;margin-bottom:2px;background-image:none}#s2id_memberList .Groups,.groupMembersColors .Groups{background-color:#acd5ff!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .Roles,.groupMembersColors .Roles{background-color:#ffec98!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .RoleAndSubordinates,.groupMembersColors .RoleAndSubordinates{background-color:#c4dea2!important;background-image:none;padding:5px;margin-bottom:2px}.collectiveGroupMembers{border:1px solid #ddd;border-top:0}.collectiveGroupMembers ul{padding:0;margin:0}.collectiveGroupMembers ul li{padding:4px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.collectiveGroupMembers ul li a{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;margin:0}.collectiveGroupMembers ul li.groupLabel{background-color:#f3f3f4;border-bottom:1px solid #ddd;border-top:1px solid #ddd;padding:10px 5px;margin:0;color:#444}.mini-slider-control{width:50px}.mini-slider-control+div{margin-left:15px}.mini-slider-control .ui-slider-handle{border:0;border-radius:50%;height:16px;top:-2px;width:16px;cursor:pointer}.mini-slider-control .ui-slider-handle:focus{outline:0}.ui-widget-content{border-radius:6px;border-color:#fff;box-shadow:0 0 3px -1px inset;margin-top:2px;margin-left:5px;height:12px}.ui-slider-disabled{opacity:.5;border-color:#ddd;box-shadow:none;cursor:not-allowed}.ui-slider-disabled .ui-slider-handle{cursor:not-allowed}.ui-slider-disabled+div{opacity:.5;cursor:not-allowed}.mini-slider-control[data-value="0"] .ui-slider-handle{background:#7d7e7d;background:-moz-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#7d7e7d),color-stop(100%,#0e0e0e));background:-webkit-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-o-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-ms-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:linear-gradient(to bottom,#7d7e7d 0,#0e0e0e 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7d7e7d',endColorstr='#0e0e0e',GradientType=0)}.mini-slider-control[data-value="1"] .ui-slider-handle{background:#ffb76b;background:-moz-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ffb76b),color-stop(0%,#ffa73d),color-stop(49%,#ff7c00),color-stop(100%,#ff7f04));background:-webkit-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-o-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-ms-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:linear-gradient(to bottom,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffb76b',endColorstr='#ff7f04',GradientType=0)}.mini-slider-control[data-value="2"] .ui-slider-handle{background:#bfd255;background:-moz-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#bfd255),color-stop(79%,#8eb92a),color-stop(100%,#72aa00),color-stop(100%,#9ecb2d));background:-webkit-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-o-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-ms-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:linear-gradient(to bottom,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bfd255',endColorstr='#9ecb2d',GradientType=0)}#moduleManagerContents{padding-bottom:10px}#moduleManagerContents .moduleManagerBlock .btn-group.open .dropdown-menu{left:-144%}#moduleManagerContents .modulesTable td{width:50%}#importModules .contents .row{margin-bottom:2.2%}.extensionWidgetContainer{background-color:#fff;border:1px solid #ddd;min-height:200px;padding:2%;background:#fafafa;box-shadow:0 0 10px -4px #777}.extensionWidgetContainer .extension_contents{margin-top:2%;background:#fff;padding:10px;box-sizing:border-box;max-height:160px}.extension_contents:hover{border-radius:4px}.thumbnailImage{height:130px;width:130px;float:right}.extensionWidgetContainer .extension_contents .slimScrollDiv{padding-right:10px}.extensionWidgetContainer .extension_header .font-x-x-large{font-size:1.5em;padding-left:3px;font-weight:bold;color:#404952}.extensionWidgetContainer .extensionDescription{line-height:20px}.extensionWidgetContainer .extensionInfo{padding-top:5px}.extensionWidgetContainer .extensionInfo .rating,.extensionDetails .rating{vertical-align:middle;margin-top:2px;display:inline-block}.extensionDetails .authorInfo{margin:3px 0}.extensionDetails .extensionDetailActions{padding:15px 0}.extensionWidgetContainer .tab-pane .bx-wrapper .imageSlider{margin:0}.sliderImage{width:90%;height:360px}.opacity .actions{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.opacity:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.sharingAccessDetails{margin-bottom:30px}.sharingAccessDetails td,.sharingAccessDetails th{text-align:center;vertical-align:middle!important}.sharingAccessDetails tr td:first-child,.sharingAccessDetails tr th:first-child{text-align:left}.sharingAccessDetails td.row>div{display:block}.sharingAccessDetails .customRuleContainer:hover{background:0}.sharingAccessDetails hr{border-bottom:1px solid #bcbcbc}.sharingAccessDetails .title{padding:1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.sharingAccessDetails .title .rulehead{padding-top:5px}.sharingAccessDetails .customRuleEntries:hover .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.layoutContent{border-top:4px solid #404952}.layoutContent #moduleBlocks .editFieldsTable{margin-bottom:20px}.layoutContent #moduleBlocks .editFieldsTable .fieldLabel{background:0}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockLabel{padding-top:13px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group{margin-top:5px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group .dropdown-menu{left:-100%}.layoutContent .relatedTabModulesList{padding:2% 1%}.fieldDetailsForm .search-choice-close{padding:0}.border1px{border:1px solid #ddd}.blockFieldsList .opacity{margin-left:.5%!important}.blockFieldsList .opacity .dropdown-menu a{padding:0!important}.blockFieldsList .opacity a.dropdown-toggle.editFieldDetails{box-shadow:none}.blockFieldsList .editFields .dropdown-menu{z-index:1000003;padding:0;left:-215px;position:absolute}.blockFieldsList .editFieldsWidget .dropdown-menu{z-index:1000003;padding:0;left:-315px;position:absolute}.blockFieldsList .editFields .dropdown-menu .modal-header{border-width:0;border-bottom-width:1px}.blockFieldsList .editFields .dropdown-menu .modal-header .cancel{padding-right:0;font-weight:bold}.blockFieldsList .editFields:hover{background:#f3f3f4!important}#modulePickListValuesContainer .layoutContent{padding-left:2%}#modulePickListValuesContainer .layoutContent .selectedCell,#modulePickListValuesContainer .layoutContent .selectedListItem{background:#a5afb9;white-space:nowrap}#modulePickListValuesContainer .layoutContent .pickListValue{cursor:pointer}.nonEditableValuesDiv .nonEditablePicklistValues{margin-left:0}.nonEditableValuesDiv .nonEditablePicklistValues li{padding:3px 15px;margin-bottom:2px;background:#e0f2ff}.popover{z-index:1000023!important}.popover-content .fieldLabel{width:35%;white-space:normal}#dependencyGraph .tableHeading{text-align:center;padding-top:30px;font-size:1.2em;font-weight:bold}#dependencyGraph .depandencyTable{border:1px solid #ddd;background:#f3f3f4}#dependencyGraph .depandencyTable .blockHeader{border-bottom:1px solid #ddd}#dependencyGraph .depandencyTable .picklistValueMapping{border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping{text-align:center;border-left:1px solid #ddd;border-right:1px solid #ddd;background:#fff}#dependencyGraph .dependencyMapping .mCSB_container{margin-bottom:16px!important}#dependencyGraph .dependencyMapping .pickListDependencyTable{border:0}#dependencyGraph .dependencyMapping .pickListDependencyTable .blockHeader th{background:#f3f3f4;border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping .pickListDependencyTable .selectedCell{background:#a5afb9}.webformFieldInfo{margin-bottom:250px}.targetFieldsTableContainer input[type="text"]{min-width:100px}#customRecordNumbering.table thead th{vertical-align:middle}.addMailBoxBlock{margin-left:83px;padding:0!important;font-size:12px}.addMailBoxStep{background:#fff;padding:30px 0;border:1px solid #ddd;border-radius:1px;min-height:170px}.mailConveterDesc{height:350px;width:96%;border:1.5px solid;border-radius:2px;border-color:#ddd;font-size:11pt;margin-top:55px;margin-left:20px;background:#fff}#mailBoxLabel{margin-top:15px;margin-left:-18px;font-size:12pt;width:75px}.mailBoxDropdownWrapper{height:49px;width:70%;background:url('../images/mailbox-icon.png') no-repeat 5px 5px;overflow:hidden;border:1px solid #ddd}.mailBoxDropdown{background:transparent url('../images/downArrowBlue.png') no-repeat 236px 13px;width:110%;height:50px;font-size:14pt;color:#0065a6;padding:10px 55px;padding-right:0}#mailConverterDragIcon{margin-top:12px}#mailConverterBody{padding-top:20px;margin-left:0}.ruleHead{padding:6px 0;background:#d8d8dc}.mailConverterRuleBlock{font-size:14px;line-height:30px;border:1.5px solid;border-color:#ddd}.mailConverterRuleLegend{font-size:14px;color:#0065a6;margin-bottom:10px;background:#f3f3f4}#mailConverterStats{font-size:10pt;margin-top:5px;margin-left:-10px}.addMailBoxBlock{border-color:#ddd;margin-left:83px;margin-top:20px;padding-top:30px;padding-left:200px;padding-bottom:20px;padding-right:30px;font-size:11pt}.taskTypeUi>.row{margin:10px 0}#taskListContainer .listViewEntriesTable tr td:last-child{border-left:1px solid #ddd}#workflow_step2>.row{padding:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:400px}#open_email_con .detailViewTitle{padding:0}#open_email_con .detailViewTitle .detailViewPagingButton{margin-top:0;padding-right:0}#foldersList .list-group{padding-right:0}.massEditTable th+th,.massEditTable td+td,.massEditTable th+td,.massEditTable td+th{border-left:0}.nav.massEditTabs{margin-bottom:0;border-bottom:0}.nav.massEditTabs li.active a{background:#404952;color:#fff;margin-left:10px}.nav.massEditTabs li a:hover{border-bottom:1px solid #404952}.massEditContent{border-top:3px solid #404952}.calendarSettingsContainer{width:700px}.calendarSettingsContainer .control-label{width:26%}#calendarSettings{margin:1px 0 3px}.calendarMassEdit{min-width:400px}.fc-state-default .fc-button-effect{top:100%!important}.fc-event-style1,.fc-event-style1 .fc-event-skin{background:#17309a;border-color:#17309a;font-weight:normal;text-shadow:none}.fc-event-style2,.fc-event-style2 .fc-event-skin{background:#3a87ad;border-color:#3a87ad;font-weight:normal;text-shadow:none}.fc-event-style3,.fc-event-style3 .fc-event-skin{background:#aa6705;border-color:#aa6705;font-weight:normal;text-shadow:none}.fc-event-style4,.fc-event-style4 .fc-event-skin{background:#953b39;border-color:#953b39;font-weight:normal;text-shadow:none}.fc-event-style5,.fc-event-style5 .fc-event-skin{background:#545252;border-color:#545252;font-weight:normal;text-shadow:none}.fc-event-style6,.fc-event-style6 .fc-event-skin{background:#87865d;border-color:#87865d;font-weight:normal;text-shadow:none}.fc-event-style7,.fc-event-style7 .fc-event-calendarMassEditskin{background:#c71585;border-color:#c71585;font-weight:normal;text-shadow:none}.fc-event-style8,.fc-event-style8 .fc-event-skin{background:#006400;border-color:#006400;font-weight:normal;text-shadow:none}#calendarview th{color:#000}.fc-agenda-divider+div{overflow-y:visible!important}.fc-button{display:inline-block;padding:6px .4em!important;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.fc-button:active .fc-button-inner{background:transparent}.fc-button:active .fc-button-inner .fc-button-content{color:#fff}.fc-button.fc-state-active .fc-button-inner .fc-button-content,.fc-button:active .fc-button-inner .fc-button-content{color:#000!important;background:transparent;background-image:none}.fc-header-title h2{font-size:15px;line-height:20px}.fc-widget-header th{padding:4px 0!important}.fc-widget-header{color:#666;background:#eee;border-color:#ccc}.fc-content{background:#fff;margin-top:15px}.fc-content td:hover{background:#f3f3f3}.btn:focus{outline:0}.reminderPostpone.btn-primary{background:#404952}.reminderPostpone.btn-primary:hover{background:#1e2327}.saveButton{margin-right:5px}.addCustomRule{float:right}.importMore{background:#fff}.lastImport{background:#fff}.undoImport{background:#da4f49}.close{border:0;background:none repeat scroll 0 0 transparent;border:0 none;cursor:pointer}.resetButton{margin-top:0!important}.vtGlyph{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("../images/vtGlyph.png");background-position:0 0;background-repeat:no-repeat;*margin-right:.3em}.vticon-pageJump{background-position:0 0}.vticon-call-inbound{background-position:-14px 0}.vticon-call-outbound{background-position:-28px 0}#massEdit .cancelLinkContainer{padding:5px 0;margin-left:.5em}.ui-pnotify{z-index:1000023}.feedback{z-index:10002}.feedback .handle{z-index:10003;display:block;position:fixed;bottom:50px;left:-30px;left:0\9;bottom:100px\9;background:#2c2c2c;color:white;padding:7px 15px;border:1px solid gray;text-decoration:none;outline:0;-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-o-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg);-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.00000000, M12=1.00000000, M21=-1.00000000, M22=0.00000000,sizingMethod='auto expand')";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0,M12=1,M21=-1,M22=0,sizingMethod='auto expand')}.feedback .handle:hover{text-decoration:none}.vtFooter{text-align:center}.vtFooter p{background:#404952;color:#fff;border-top:1px solid #ddd;padding:1px 0;font-size:.9em;margin-bottom:0}.vtFooter p a{color:#fff}.imageHolder{background:url('../images/loadback.png') repeat-y;background-position:center;padding:10px 0}.breadcrumbContainer{padding:2% 2% 0 2%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;height:auto}.breadcrumb{display:inline-block;height:auto;height:40px}.crumbs{height:40px;margin:0;padding:0 20px 0 0;display:inline-block;font-family:sans-serif}.crumbs li:after{content:'\0000a0';width:0;height:0;border-left:18px solid #ececec;border-top:20px solid transparent;border-bottom:20px solid transparent;display:inline-block;position:relative;top:-20px;left:18px;zoom:1}.crumbs li{height:0;border-top:20px solid #ececec;border-bottom:20px solid #ececec;border-left:20px solid transparent;display:inline-block;box-shadow:0 1px #ddd;margin-right:5px}.crumbs li a{display:inline-block;float:left;margin-top:-13px;font-size:14px;font-weight:bold;color:#666;text-decoration:none}.crumbs li.active{height:0;border-top:20px solid #404952;border-bottom:20px solid #404952;box-shadow:0 1px #404952}.crumbs li.active:after{border-left:18px solid #404952!important}.stepText{display:inline-block;white-space:nowrap;overflow:hidden;font-size:13px;vertical-align:bottom}.active .stepText,.active .stepNum{color:#fff}.stepNum{display:inline-block;padding:0 5px;overflow:hidden;font-size:20px;vertical-align:top;margin-top:5px}.greyStar{background-image:url("../images/stars.png");background-position:20px 20px;height:20px;width:20px;display:inline-block}.yellowStar{background-image:url('../images/stars.png');background-position:0 20px;width:20px;height:20px;display:inline-block}.blockUI{border-radius:2px!important;border:0!important}textarea.col-md-11{width:100%!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.popover .popover-inner{border-radius:2px;font-size:.8em;box-shadow:0}.popover .popover-inner .popover-title{color:#444;font-size:15px}.popover .popover-inner .close{color:#000!important;margin-top:3px;opacity:.5!important}.popover .popover-inner .close:hover{opacity:1!important}.popover .popover-inner td{padding:3px 5px;overflow-wrap:break-word}.popover .popover-inner .detailViewInfo{margin-top:0;box-shadow:0}.popover .popover-inner .detailViewInfo .fieldLabel label{font-size:1em}#findDuplicate>.control-group{margin-bottom:0;width:400px}#moveReports .modal-body{padding:20px 40px}#composeEmailContainer{padding:0 20px}#composeEmailContainer .MultiFile-wrap{display:inline-block}#composeEmailContainer .MultiFile-intercepted .ui-wrapper{min-height:400px}#transferOwnershipContainer .select2-container.select2-container-multi{max-width:220px}.fieldInfo.in{overflow:visible!important;height:auto!important}.moduleSelection{border-radius:2px 2px 0 0!important;border:1px solid #ddd!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);color:#444}.convertLeadModules{margin-bottom:2%;border:1px none}.moduleBlock{border-radius:0!important}.overflowVisible{overflow:visible!important}.convertLeadError{border:3px solid #999;background-color:#fff;width:55%;position:relative;z-index:10000000}.convertLeadError table td{border-bottom:1px solid #ccc;nowrap:nowrap;width:70%}.chzn-container{vertical-align:middle}.chzn-container .chzn-results li{margin-right:7px}.chzn-container .chzn-results .highlighted{background:#404952}.select2-results .select2-highlighted{background:#404952}.select2-result-label i{background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.ui-autocomplete-loading{background:url('../images/load.gif') no-repeat right center}.ui-autocomplete{height:auto!important;border-radius:1px!important}.dropdown-menu.pull-right:after,.dropdown-menu.pull-right:before{right:3px;left:auto;top:-5px;border-bottom-width:6px}span.wrapper a{color:#08c!important;font-size:15px!important;font-weight:bold}a{color:#353c44}a:hover{color:#1e2327;text-decoration:none;cursor:pointer}a:active,a:focus{outline:0}.well{border-radius:2px;padding:15px}.verticalBottomSpacing{margin-bottom:10px}.mergeTables{margin-bottom:0}.font-x-x-large{font-size:18px;line-height:28px}form{margin:0}.fc-state-default .fc-button-effect span{background:0}.dateField{width:183px}.form-horizontal [class^="icon-"],.form-horizontal [class*=" icon-"]{vertical-align:baseline}.timePicker{width:8.5em!important;z-index:1000029!important}.datepicker{z-index:1000029!important}.colorpicker{z-index:1029!important}.colorpicker input{width:30px!important}.colorpicker input[type="text"],.colorpicker input{color:#898989!important}.colorpicker_hex input{width:45px!important}.modal-body.accordion{margin-bottom:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}//.modal-open{// overflow:hidden;//}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.removeNoFileChosen{color:transparent!important}.modelContainer .modal-header{border-radius:2px 2px 0 0}.modelContainer form{border-radius:0 0 2px 2px}.hide{display:none}i{cursor:pointer;text-decoration:none!important}.marginbottomZero{margin-bottom:0!important}.marginLeftZero{margin-left:0!important}.marginRightZero{margin-right:0!important}.clearfix{clear:both!important}textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%}.textOverflowEllipsis{overflow:hidden;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;//width:9em}.margin0px{margin:0!important}.padding10{padding:10px;padding-bottom:0}.padding20{padding:20px}.pushDown{margin-top:5px}.boxSizingBorderBox{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.boxSizingContentBox{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.cursorPointer{cursor:pointer;text-decoration:none!important}.zeroOpacity{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.dullOpacity{opacity:.8;-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80)}.fullOpacity{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.redColor{color:red}.highlightBackgroundColor{background:#eeeff2}.contentsBackground{background:#fff;border:1px solid #ddd}.textAlignCenter{text-align:center}.textAlignRight{text-align:right}.alignMiddle{vertical-align:middle!important}.alignTop{vertical-align:top}.padding1per{padding:1%}.paddingTop20{padding-top:20px}.padding20px{padding:20px}.padding-bottom1per{padding-bottom:1%}.marginBottom10px{margin-bottom:10px}.displayInlineBlock{display:inline-block}.backgroundImageNone{background-image:none}.liStyleNone{list-style:none outside none}.fontBold{font-weight:bold!important}.livesupport_tab,#userfeedback{display:none!important}#reportDetails table tr td.summary{border-bottom:0;border-top:0}#portalDetailViewHttpError{padding-bottom:7px;margin-top:50px;color:red;text-align:center}.slidesjs-pagination{list-style:none}.slidesjs-pagination li a{display:block;width:13px;height:0;padding-top:13px;background-image:url('../images/pagination.png');background-position:0 0;float:left;overflow:hidden}.slidesjs-pagination li a.active,.slidesjs-pagination li a:hover.active{background-position:0 -13px}.extensionStorebtn{background:#f08c39;background-image:-webkit-linear-gradient(top,#f08c39,#e68b3c);background-image:-moz-linear-gradient(top,#f08c39,#e68b3c);background-image:-ms-linear-gradient(top,#f08c39,#e68b3c);background-image:-o-linear-gradient(top,#f08c39,#e68b3c);background-image:linear-gradient(to bottom,#f08c39,#e68b3c);-webkit-border-radius:2;-moz-border-radius:2;border-radius:2px;text-shadow:0 0 1px #595959;color:#fff;font-size:14px;font-weight:bold;padding:8px 20px 8px 20px;text-decoration:none;border:0}.extensionStorebtn:hover{background:#fc9f3c;background-image:-webkit-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-moz-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-ms-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-o-linear-gradient(top,#fc9f3c,#f08a3c);background-image:linear-gradient(to bottom,#fc9f3c,#f08a3c);text-decoration:none}.extensionSearch{padding:8px 12px 8px 30px!important;margin:6px 0 14px 0;box-shadow:inset 2px 2px 10px #ddd;border-radius:2px!important;background:url('../images/search.png') no-repeat;background-position:5px 6px}.banner-container{border-bottom:1px solid #fff;box-sizing:border-box}.banner{margin:0 90px}.bx-wrapper{margin:0 auto 35px!important;padding-top:17px!important}.bx-wrapper li a{display:block}.bx-wrapper a img{height:100px;width:auto;margin:0 auto}.wide,.table td.wide,.listViewEntries td.wide,td.listViewEntryValue.wide{padding:8px!important}.medium,.table td.medium,.listViewEntries td.medium,td.listViewEntryValue.medium{padding:5px 6px!important}.narrow,.table td.narrow,.listViewEntries td.narrow,td.listViewEntryValue.narrow{padding:2px 4px!important}.table thead th.narrow{vertical-align:middle}td.listViewEntryValue .row input{padding:0;margin-bottom:0}.listViewContentDiv{position:relative}.fieldLabel .pull-right{text-align:right}#tagRecordText{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;width:80%!important}#tagRecord{margin-left:5px!important}.tag{float:right!important}.cut-string{text-overflow:ellipsis;-o-text-overflow:ellipsis;-webkit-text-overflow:ellipsis;width:200px;white-space:nowrap;overflow:hidden}.paddingLRZero{padding-left:0;padding-right:0}.paddingRightZero{padding-right:0}.detailViewToolbar{margin-top:5px}.input-group.input-group-sm>.input-group-addon img{width:15px}table tr td .input-sm{min-width:50px}.modal-footer.backgroundColor{background-color:#f5f5f5}.panel-title{font-size:14px}.quickWidgetContainer .panel-body{padding-bottom:0;padding-top:0}tr.summaryViewEntries,#detailView table{font-size:13px}table.listViewEntriesTable{font-size:13px;margin-top:5px}.no-margin{margin:0}.companyLogo img{max-height:200px;max-width:250px}.navbar-inverse .navbar-nav>li>a{color:#fff;padding:15px 12px}.navbar-inverse .navbar-nav .dropdown-menu>li>a{padding:3px 15px;font-size:12px}.headerCalendar .month h3{font-size:18px;font-weight:bold;margin:5px 0 0 0}.columnsSelect{width:100%!important}.marginBottom5{margin-bottom:5px}.editViewContainer .recordEditView table.blockContainer tr td.fieldValue{width:30%}.recordEditView[name=QuickCreate] .quickCreateContent table tr td.fieldValue,#massEditContainer .massEditContent table tr td.fieldValue,#tab_accounts td.functionList{width:30%}.btn{white-space:normal}.valuesAssignedToRole{border:1px solid #adadad;overflow:hidden;text-overflow:ellipsis;padding:6px}table.dataTable .form-control{width:100%!important}#breadcrumb .stepNum{margin-top:0}#breadcrumb .stepText{position:relative;top:-4px}.fc button{height:auto!important}.fc-toolbar{margin-bottom:0!important}.fc-center,.fc-left,.fc-right{margin-bottom:1em}.calendarRightPanel{padding-left:5px;padding-right:5px}.calendarRightPanel ul li{margin-bottom:2px;margin-left:5px}.calendarRightPanel ul li:hover{background-color:#eee!important;border-radius:5px}.square9{width:12px;height:12px;margin:4px}.panel-dark{border-color:#737373}.panel-dark>.panel-heading{color:#fff;background-color:#737373;border-color:#737373}.panel-dark>.panel-heading+.panel-collapse>.panel-body{border-top-color:#737373}.panel-dark>.panel-heading .badge{color:#737373;background-color:#fff}.panel-dark>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#737373}.calendarRightPanel .widgetContainer ul{margin-top:5px;margin-bottom:5px}.paddingLeft5px{padding-left:5px}.marginBottom5px{margin-bottom:5px}.detailview-table .fieldValue .summaryViewEdit{display:none}.detailview-table .fieldValue:hover .summaryViewEdit{display:inherit}.icon-in-history-widget{font-size:17px;padding:4px}#prefPageHeader .logo img{height:70px;width:70px}#myPrefHeading h3{margin-top:12px}.list-user-img{width:50px;height:40px}span[name=existingImages] img{height:200px;width:300px}.narrow.fieldValue .chosen-container-single .chosen-single{height:26px;line-height:26px}.narrow.fieldValue input{height:26px}.narrow.fieldValue .input-group-addon{padding:4px 10px}.narrow.fieldValue .chosen-container-single .chosen-single div b{background-position-y:4px}.image-in-button{width:18px}.fc-time-grid .fc-time-grid-event.fc-event{min-height:27px;min-width:100px}.fc-time-grid-event.fc-short .fc-title{font-size:1em}.paddingTBZero{padding-top:0;padding-bottom:0}.dashboardWidgetContent a .glyphicon{top:-3px}.detailViewTitle .popover{min-width:130px;text-align:center}.cursorDefault{cursor:default!important}.remindersNoticeContainer{position:fixed;right:0;top:109px;z-index:1029;width:0;height:100%;bottom:30px;overflow-y:auto;background:rgba(0,0,0,0.4);border-left:1px solid #797979;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;overflow-y:auto}.remindersNoticeContainer.toggled{width:380px}.remindersContent{margin:5px 8px 0 8px}.activityTypeIcon{height:20px}.remindersNoticeContainer .panel{margin-bottom:10px}.remindersNoticeContainer .panel-body{padding:10px}.remindersNoticeContainer .actionRow a.btn{margin-right:3%}.remindersNotice{color:#fff;padding:15px 12px}.remindersNotice .glyphicon{font-size:20px}.cancelLink.btn[type='reset'],.cancel.btn[type='reset'],.cancelLink.btn[type='button']{float:right;margin-left:5px;margin-bottom:0}.activityWidgetContainer .popover{min-width:240px}.filterActionImage{margin-left:8px}#tagRecord{line-height:25px}#tagsList .btn-info{margin-left:5px}#tagRecordInput{padding-left:15px;padding-right:15px}.clearReferenceSelection,.createReferenceRecord{padding:0 6px}.relatedPopup{padding:0 4px}.popupContainer .popupModuleName{margin-top:0}.mailRows hr{margin:0}.paddingLeftMd{padding-left:15px}.widget_header div:nth-child(2).btn-toolbar,.editViewContainer .contentHeader.row div:nth-child(2),.contentsDiv ul#tabs.nav,.marginTop20{margin-top:20px}.fieldLabel .referenceMandatory{margin-right:-12px}.ui-widget-content{padding:.8em}.ui-autocomplete .ui-autocomplete-category{font-weight:bold;line-height:1.5}.ui-autocomplete .ui-autocomplete-category:first-child{margin:.8em 0 .2em}.ui-autocomplete .ui-menu-item{padding:.2em .8em}.ui-autocomplete .ui-state-focus{border:0;background:#ebebeb}.widgetHr{margin-top:0}.headerLinksMails .btn-group{margin-top:11px}.finalDiscountUI,.finalTaxUI{bottom:5px}.sideBarTitle{font-size:20px}.globalSearchInput{width:150px}#groupsDetailContainer strong{line-height:21px}#addTaskContainer #taskStatus{margin-left:10px}.scanerMailActionsButtons{min-width:96px}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#404040}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active,.ui-menu .ui-menu-item a.ui-widget-content{font-weight:bold;margin:0;background-color:#428bca;border-color:#357ebd;color:#fff;display:block}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style:none}#layoutEditorButtons{margin-bottom:10px;margin-top:-10px}.individualTaxContainer{text-align:left!important}.roundedCorners :not(:first-child){padding-left:0}.roundedCorners label{font-weight:normal;min-height:40px}.paginationDiv .pagination{margin:0}.paginationDiv .pagination li{cursor:pointer}.paginationDiv .pagination>li>span,.paginationDiv .pagination>li>a{padding:8px 8px}.paginationDiv #listViewPageJumpDropDown{left:192px;top:80%}.paginationDiv .listViewBasicAction.dropdown-menu{width:35%}.listViewEntriesTable .picklistSearchField{min-width:150px}.listViewEntriesTable .boolenSearchField{min-width:90px}.listViewEntriesTable .searchField{min-width:100px}.pageInfo{border:1px solid #ddd;color:#337ab7;margin-left:5px;list-style:none;padding:8px 5px}.listViewEntriesDiv .listViewEntriesCheckBox{margin-left:2px}#widgetsManagementEditorContainer .modal-footer .btn{margin:5px}#widgetsManagementEditorContainer .fieldDetailsForm .modal-footer{padding:0}#widgetsManagementEditorContainer .fieldDetailsForm .filter{padding-top:5px;margin-left:5px}.dashboardContainer .dashboardHeading .dropdown-menu{left:-82px}#VtEmailTaskContainer .addTime{text-align:left}.summaryWidgetContainer.summaryWidgetBlock{padding:0}.summaryWidgetContainer .container-fluid{padding:0 5px 0 5px}.summaryWidgetContainer .widgetTitle{padding-left:10px}.summaryWidgetContainer .widgetHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-top:1px solid #fff;border-bottom:1px solid #ddd;text-shadow:0 1px #fff;color:#444;padding-bottom:4px}.summaryWidgetContainer .widgetHeader h4{margin:0}.summaryWidgetContainer .widgetContent{padding:5px;font-size:13px}.mailsList .container-fluid>.row{border-bottom:1px solid #ddd;margin-right:-10px;margin-left:-10px;padding:4px 0}.mailsList .container-fluid>.row:last-child{border-bottom:0}.mailsList .smalSeparator{display:block;height:5px;width:70px}.summaryWidgetContainer .widgetContent hr{margin:4px 0}.mailsList .row{background-color:#fff}.mailsList .row.even{background-color:#faf8f8}.mailsList .mailTitle{margin:0}.mailsList .mainSubject{font-weight:800;font-size:13px}.mailsList .mainFrom{font-size:16px}.mailsList .mailActions{margin-top:3px;z-index:1020;position:relative}.mailsList .mailActions a{margin-left:3px}.mailsList .mailActions a:first-child{margin-left:0}.mailsList .mailBodyContent{overflow:auto}.mailsList .mailBodyContent p{margin:0}.rowHr{margin:4px 0}.firstLetter{color:#fff;background-color:#5bc0de;border-color:#46b8da;display:block;padding:6px 8px;height:32px;width:32px;font-size:16px;text-align:center;margin:0 7px 3px 0;-webkit-box-shadow:0 0 8px -1px rgba(156,156,156,1);-moz-box-shadow:0 0 8px -1px rgba(156,156,156,1);box-shadow:0 0 8px -1px rgba(156,156,156,1)}.modal-blg{width:90%}.modal-blg iframe{height:420px}#emailPreview{margin:10px 0}.modalViewBody .mailsList{max-height:630px;overflow:auto}.domain{padding-left:2px;padding-right:2px;background:rgba(91,234,81,0.54)!important;border-radius:4px}.inventoryItems .input-group{max-width:200px}.inventoryItems .rowName .input-group{max-width:400px}.inventoryItems td,.inventoryItems th{border:1px solid #ddd}.inventoryItems tfoot td.hideTd{border:0;background:#fafafb}.inventorySummaryContainer .panel-body,.inventorySummaryContainer .panel-footer{padding:0}.inventorySummaryContainer .panel-body .form-group,.inventorySummaryContainer .panel-footer .form-group{margin:0}.inventorySummaryContainer .input-group .form-control{background-color:#f5f5f5}.inventorySummaryContainer .panel-body .percent{min-width:55px}.inventoryItems tfoot{font-weight:800}.inventorySummaryContainer img{max-width:15px}.autologinContainer .chosen-container-multi .chosen-choices{padding-left:6px}.checkboxForm{padding-top:7px}.leftPanel{background-color:#2f333f}.leftPanel a{color:#e3e9f0}.bodyHeader{background-color:#444853}.noSpaces{padding:0;margin:0}html,body,.baseContainer{height:100%}#page{display:table;width:100%;height:100%;-moz-box-sizing:border-box;box-sizing:border-box}.container-fluid-main{height:100%}.container-fluid-main,.leftPanel .row{padding:0;margin:0}.leftPanel,.basePanel,.bodyContents,.mainContainer,.contentsDiv{min-height:100%;height:100%}.bodyContent{min-height:100%;height:100%;overflow:auto;margin-top:-48px;padding-top:48px}.leftPanel{display:table-cell}.basePanel{display:table-cell}.userDetailsContainer{background-color:#a44042;padding-right:0}.userActionContainer{background-color:#ad5154;padding-right:0}.companyLogoContainer{display:block;width:50px;padding:5px}.userDetails,.bodyHeader{color:#fff}.bodyHeader .moduleIcon{width:34px;margin:7px;background-color:#fff}.mainModuleTitle{margin:10px 0;text-transform:uppercase}ul.headerLink{display:inline-block;margin-right:5px;margin-top:5px}ul.headerLink li{list-style-type:none}.userDetails{padding-right:0}.userDetails .name{line-height:15px;font-size:15px}.menuContainer{overflow:auto} \ No newline at end of file +@media print{.noprint{display:none}}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}.hide-text{overflow:hidden;text-indent:100%;white-space:nowrap}.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot');src:url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.woff') format('woff'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.ttf') format('truetype'),url('../../../../layouts/vlayout/resources/fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg')}body{width:100%;font-family:'Open Sans','Lucida Grande',Verdana,Tahoma,Arial,sans-serif!important;font-size:12px!important;background:#fff;color:#2b2b2b}hr{margin:8px 0;border-bottom:1px solid #ddd}.navbar.navbar-fixed-top .navbar-collapse{padding-right:15px!important}.navbar-nav.navbar-left .open ul{display:none}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background:0}.navbar-default .navbar-nav>li:hover{background:#e7e7e7}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background:0}.navbar-inverse .navbar-nav>li:hover{background:#080808}.navbar-nav .hovernav:hover>.dropdown-menu{display:block}#collapsedMenu{display:block;position:relative}#collapsedMenu a{color:#fff}#collapsedMenu .dropdown-menu .shortDropdown{max-height:300px;overflow-y:scroll;padding:10px;position:relative;z-index:10000;-webkit-overflow-scrolling:touch;-webkit-transform:translateZ(0)}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames{margin-bottom:2px}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a{font-size:.9em;padding:3%!important;color:#2b2b2b!important}#collapsedMenu .dropdown-menu .shortDropdown .moduleNames a:hover{text-decoration:none;background:#404952;color:#fff!important}.moreMenus{width:52em;padding:24%;left:0;border-radius:2px}.moreMenus.leftAligned:after,.moreMenus.leftAligned:before{left:21px!important}.moreMenus strong{font-size:1.1em;color:#2b2b2b}.moreMenus:after,.moreMenus:before{left:292px!important}.announcement{// display:none;background:#fafad2;// padding:2px 0;// border-bottom:1px solid #ccc;// max-height:24px;// width:100%}.announcement .marStyle{// width:100%}#headerLinks{padding:10px 0 7px;min-width:240px;float:right!important}#headerLinks .headerLinksContainer{margin-right:10px}#headerLinks .headerLinksContainer>[class*="span"]{float:left;margin-left:15px}#headerLinks .headerLinksContainer .dropdown.open .dropdown-toggle{background:transparent}#headerLinks .headerLinksContainer ul.dropdown-menu{top:30px}#headerLinks .headerLinksContainer ul.dropdown-menu:after,#headerLinks .headerLinksContainer ul.dropdown-menu:before{right:15px;left:auto}#headerLinks .headerLinksContainer>span a img,#headerLinks .headerLinksContainer>span a.userName{color:#fff;cursor:pointer;text-decoration:none!important}#headerLinks .headerLinksContainer>span a img .caret,#headerLinks .headerLinksContainer>span a.userName .caret{border-top:4px solid #fff}.dropdown-menu.pull-right{right:0;left:auto;cursor:pointer}.themeMenuContainer{min-width:110px;width:110px;left:-84px!important;padding:10px 0}.themeMenuContainer .themeMenu{padding:0 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement{cursor:pointer;margin:5px;height:20px;width:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.themeMenuContainer .themeMenu .themeElement:hover{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}.themeMenuContainer .themeMenu .themeSelected{border:1px solid #000;background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")!important;background-position:-286px 2px}@media screen and (min-width:1161px){#mediumNav,#shortNav,#headerLinksCompact{display:none}#largeNav{margin-left:10px;margin-right:0}}@media screen and (max-width:1160px) and (min-width:960px){.companyLogo{width:100%}.customFilterMainSpan .select2-container{width:300px!important}*{zoom:1!important}}@media screen and (max-width:960px){.bodyContents{margin:0!important}#centerPanel{width:100%!important}.col-md-3#headerLinks{padding:5px 5px 0}.menuBar .col-md-9,.col-md-3#headerLinks{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-width:80px}.menuBar .col-md-9 .qCreate,.col-md-3#headerLinks .qCreate{display:inline-block;margin:0}.menuBar .col-md-9 .qCreate img,.col-md-3#headerLinks .qCreate img{margin-bottom:3px;margin-right:5px}.menuBar .col-md-9 .qCreate ul li.title,.col-md-3#headerLinks .qCreate ul li.title{padding:5px 0 0 15px}.menuBar .col-md-9 li.tabs:first-child>a,.col-md-3#headerLinks li.tabs:first-child>a{padding:10px 12px 9px}.customFilterMainSpan .select2-container{width:300px!important}#quickCreateModules{width:100%!important;padding:0!important}.CompactQC{max-height:300px;overflow-y:scroll;overflow-x:hidden}.CompactQC a:hover{text-decoration:none}}.commonActionsContainer .quickActions{height:3em}.commonActionsContainer .quickActions img{height:60%;margin:40% auto}.commonActionsContainer .quickActions #companyLogo-container img{height:98%;margin:0 auto}.commonActionsContainer .actionsContainer{background:#f3f3f3}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown{min-width:715px;top:28px;margin:0;padding-top:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a{padding:2px;border:0}.commonActionsContainer .dropdown-menu.commonActionsButtonDropDown a span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mainContainer{min-height:500px;margin-top:103px;background:#eeeff2;min-width:1200px}.mainContainer>.col-md-2{// padding:0 1.06383%;height:auto!important;// min-width:174px}.mainContainer .contentsDiv{min-height:500px;background:#fafafb;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;border-left:1px solid #e6e6e6;position:relative}.mainContainer #leftPanel{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.toggleButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;left:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-left:0;display:inline-block}.toggleButton .glyphicon-chevron-left{background-position:-434px -72px!important}.toggleButton .glyphicon-chevron-right{background-position:-460px -72px!important}.toggleRightPanelButton{background:#eeeff2;font-weight:bold;padding:5px 2px!important;position:absolute;top:20px;right:-1px;cursor:pointer;width:15px;z-index:100;border:1px solid #ddd;border-right:0;display:inline-block}.quickLinksDiv{margin:10px 0}.quickLinksDiv p{font-size:1.2em;padding:3% 0 0 6%;height:40px;cursor:pointer;box-shadow:0 0 0 1px #ddd;border-top:1px solid #fff!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);position:relative;border-radius:2px}.quickLinksDiv p a{color:#2b2b2b}.quickLinksDiv p a:hover{text-decoration:none}.quickLinksDiv p.selectedQuickLink{background-color:#2a2f35;background-image:-moz-linear-gradient(top,#2a2f35,#2a2f35);background-image:-ms-linear-gradient(top,#2a2f35,#2a2f35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#2a2f35),to(#2a2f35));background-image:-webkit-linear-gradient(top,#2a2f35,#2a2f35);background-image:-o-linear-gradient(top,#2a2f35,#2a2f35);background-image:linear-gradient(top,#2a2f35,#2a2f35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#2a2f35',endColorstr='#2a2f35',GradientType=0);border-color:#2a2f35 #2a2f35 #08090a;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);background-image:none;position:relative;border:1px solid #fff;box-shadow:4px 0 3px -4px #000 inset}.quickLinksDiv p.selectedQuickLink a{color:#fff}.quickLinksDiv p.selectedQuickLink a:after{border-bottom:19px solid rgba(0,0,0,0);border-left:10px solid #2a2f35;border-top:19px solid rgba(0,0,0,0);content:" ";display:inline-block;position:absolute;left:100%;top:0}.quickWidgetContainer li a{overflow:hidden;white-space:normal;padding:5px;margin:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.quickWidgetContainer .quickWidget{margin-bottom:10px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.sidebarTitleBlock{padding:12px 0}.sidebarTitleBlock a{color:#373737!important}.sidebarTitleBlock a:hover{text-decoration:none}#selectAllMsgDiv,#deSelectAllMsgDiv{display:none;background-color:#fafad2;padding:.01%;text-align:center}.blockUI form,#globalmodal form{margin:0}.dashboardContainer .dashboardHeading{background:#f5f5f5}.gridster>*{margin:0 0 0 15px!important}.contentsDiv .gridster{padding:0}.dashboardContainer{padding:0}.dashboardContainer .dashboardHeading hr{border-bottom:1px solid #ddd}.widgetsList{max-height:400px;overflow-y:auto;overflow-x:hidden}.widgetsList li{display:block}.widgetsList li a{white-space:normal;word-wrap:break-word}.dashboard_notebookWidget_view .row{margin-bottom:5px}.gridster{margin-left:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.gridster ul{width:auto;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:460px}.gridster ul{list-style:none}.gridster ul li.dashboardWidget{background:#fff;border-radius:1px;border:1px solid #ddd;-webkit-box-shadow:0 0 3px -1px #ddd;-moz-box-shadow:0 0 3px -1px #ddd;box-shadow:0 0 3px -1px #ddd}.gridster ul li.dashboardWidget .dashboardWidgetHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd;color:#444;cursor:move;padding:5px}.gridster ul li.dashboardWidget .dashboardWidgetHeader table{height:28px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .dashboardTitle{text-align:left;padding-left:10px}.gridster ul li.dashboardWidget .dashboardWidgetHeader .widgeticons{opacity:.5;padding-right:6px}.gridster ul li.dashboardWidget .filterContainer{position:absolute;border:1px solid #ddd;background:#fff;margin-left:-7px;margin-right:3px;margin-top:4px;padding:8px 0;border-radius:0 0 5px 5px;box-shadow:0 5px 8px -5px #888}.gridster ul li.dashboardWidget .filterContainer div span{margin-top:6px}.gridster ul li.dashboardWidget .filterContainer .col-md-5{margin-top:3px}.gridster ul li.dashboardWidget .dashboardWidgetContent{padding:10px 0;line-height:20px}.gridster ul li.dashboardWidget .dashboardWidgetContent .dashboard_notebookWidget_viewarea{height:200px}.gridster ul li.dashboardWidget .widgeticons{min-width:50px;height:30px;margin-right:30px}.gridster ul li.dashboardWidget .widgeticons a{cursor:pointer;text-decoration:none}.gridster ul .widgetChartContainer{margin-left:10px}.listViewPageDiv{margin:11px 0}.customFilterMainSpan{width:100%}.customFilterMainSpan .select2-container{width:95%!important}.select2-container .select2-choice{border-radius:2px;background:#fff;border-color:#ddd;font-size:14px;letter-spacing:.01em;color:#2b2b2b}.select2-container .select2-choice div{border-radius:0;border-left:0;background:#fff}.select2-drop{border-color:#ddd}.select2-dropdown ul.filterActions{list-style:none!important;padding-left:15px}.select2-dropdown ul.filterActions li{cursor:pointer}.ui-autocomplete .ui-menu-item #ui-active-menuitem{background:#404952;border-radius:0}li.ui-timepicker-selected,.ui-timepicker-list li:hover,.ui-timepicker-list:hover .ui-timepicker-selected:hover{background:#404952}#relatedTabOrder .select2-input{min-width:200px}.alphabetSorting .alphabetSearch a{vertical-align:middle;display:inline-block;margin-bottom:2px}.alphabetSorting .alphabetSearch:hover{background:#eeeff2}.listViewActions .settingsIcon{display:inline-block;margin-left:5px}.listViewActions>.btn-group{min-width:105px}#listViewPageJumpDropDown,#relatedListPageJumpDropDown{left:-60px}.pageNumbers{display:inline-block;margin-right:5px;margin-top:6px;vertical-align:top}.pageNumbers .totalNumberOfRecords{margin:0 5px}.contents-topscroll,#reportDetails{overflow-x:auto!important;overflow-y:visible}.contents-bottomscroll{overflow-x:auto!important}.bottomscroll-div,.topscroll-div{display:table;min-width:100%}.listViewLoadingImageBlock{background:0;border-radius:0;box-shadow:none;text-align:center}.detailViewContainer{padding:0 20px}.userPreferences .contents{padding-left:0!important}.userPreferences .details{border-right:0!important}.detailViewTitle{padding:1% 0 0 1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .recordLabel{font-size:16px;font-weight:bold}.detailViewTitle .detailViewButtoncontainer{margin-top:8px}.detailViewTitle .detailViewPagingButton{margin-top:8px;padding-right:10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.detailViewTitle .btn-toolbar{margin:0}.detailview-table th,.detailview-table td{vertical-align:middle}.detailview-table th label,.detailview-table td label{margin-bottom:3px}.detailViewInfo{box-shadow:0 -4px 4px -4px #959595;margin-top:5px}.detailViewInfo .details{// min-height:600px;padding-right:1.5%;border-right:4px solid #404952;padding-bottom:10px;padding-top:10px}.detailViewInfo .related .nav-pills .active>a,.detailViewInfo .related .nav-pills .active>a:hover{background:#404952;border-radius:1px;margin-top:0;margin-bottom:2px}.fieldLabel{width:20%;background:#f7f7f9}.fieldLabel label.marginRight10px{text-align:right}.summaryView{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.summaryView .summary-table tr.summaryViewEntries:last-child .fieldValue,.summaryView .summary-table tr.summaryViewEntries:last-child .fieldLabel{border-bottom:1px solid #ddd}.summaryView .summaryViewEntries .fieldLabel{vertical-align:top;padding:5px 0 5px 5%;border-top:1px solid #ddd;border-right:1px solid #ddd}.summaryView .summaryViewEntries .fieldValue{vertical-align:top;padding:5px 0 5px 5px;border-top:1px solid #ddd}.summaryView .summaryViewEntries:hover .summaryViewEdit{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryView .summaryViewEntries .summaryViewEdit{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryView .toggleViewByMode{margin:8px 0;padding-right:0}.summaryView .toggleViewByMode .changeDetailViewMode{white-space:normal!important}.summaryWidgetContainer{border-radius:2px;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border:1px solid #eaeaea;background:#fff;margin-bottom:10px;padding:15px}.commentContainer .commentTitle{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;margin-bottom:10px}.commentContainer .commentTitle textarea{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordDetails .squeezedWell{padding:3% 0;min-height:105px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recordEditView .contentHeader{padding:.5% 0 1% 0}.recordEditView .table .fieldLabel,.recordEditView .table .fieldValue{vertical-align:middle}.recordEditView .table tbody tr:hover td,.recordEditView .table tbody tr:hover th{background:#f7f7f9}.commentContainer{border-radius:2px}.commentContainer hr{margin:0!important}.commentContainer .addCommentBlock .commentsControls{display:inline-block}.commentContainer .commentsList>.liStyleNone>.commentDetails .commentDiv{width:100%}.commentContainer .commentDetails{background:#fff;border:1px solid #ddd;margin-bottom:5px;border-radius:2px;padding:10px 10px 5px;display:inline-block;min-width:354px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentContainer .commentorInfo p{margin-bottom:0}.commentContainer .addCommentBlock{background-color:#eeeff2;background-image:-moz-linear-gradient(top,#eeeff2,#eeeff2);background-image:-ms-linear-gradient(top,#eeeff2,#eeeff2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#eeeff2),to(#eeeff2));background-image:-webkit-linear-gradient(top,#eeeff2,#eeeff2);background-image:-o-linear-gradient(top,#eeeff2,#eeeff2);background-image:linear-gradient(top,#eeeff2,#eeeff2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeff2',endColorstr='#eeeff2',GradientType=0);border-color:#eeeff2 #eeeff2 #c3c6d1;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border:1px solid #ddd;padding:12px 12px 5px;min-height:115px;margin-top:15px;display:block}.commentContainer .addCommentBlock .commentcontent{padding:8px!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;resize:none}.commentContainer .commentInfoContent{padding:1px 0;word-wrap:break-word}.commentTitle .col-md-1{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentTitle .col-md-1 img{width:32px;height:32px}.commentsList>ul{margin-left:0}.singleComment .editedStatus{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:5px 0 5px 32px}.singleComment .editedStatus p{margin-bottom:0}.singleComment .commentActionsDiv{display:none}.singleComment .commentActionsDiv p{margin-bottom:0}.singleComment:hover .commentActionsDiv{display:block;margin-bottom:3px}.recentComments{margin:0;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.recentComments .commentDiv{min-width:100%}.recentComments .addCommentBlock{border:0;margin-top:0;display:block}.recentComments .commentDetails{display:block}.singleComment:hover .commentActions .replyComment{display:inline-block}.commentActionsContainer a:hover{text-decoration:none}.commentActionsContainer .editStatus{padding:5px 2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.commentActionsContainer .editStatus p{margin-bottom:0}.table{background:#fff}.table-bordered{border-radius:1px;margin-bottom:0}.table-bordered th{border-top:1px solid #fff!important}.table th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;color:#444}.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td,.listViewEntriesTable.table-bordered th,.listViewEntriesTable.table-bordered td{border-left:0;border-right:0}.listViewEntriesTable tbody tr td:first-child{border-left:0 none}.equalSplit td:nth-child(odd){width:20%}.equalSplit td:nth-child(even){width:30%}td.fieldValue input,td.fieldValue .input-group{margin-bottom:0}.actionImage,.actionImages{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.listViewHeaders a{color:#444}.listViewEntriesDiv .listViewHeaders th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd}.listViewEntriesDiv,.listViewEntriesDiv td{overflow:visible}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues{color:#444}.listViewEntriesTable .listViewHeaders a.listViewHeaderValues:hover{text-decoration:none}.listViewEntriesTable td.listViewEntryValue,.listViewEntries td{vertical-align:middle;cursor:pointer;overflow:visible;padding:5px}.listViewEntriesTable td.listViewEntryValue:hover .actionImages,.listViewEntries td:hover .actionImages,.listViewEntriesTable td.listViewEntryValue:hover .actions,.listViewEntries td:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.summaryViewEntries .summaryViewEdit,.activityStatus .editStatus,.activityDescription .editDescription,.addedCalendars .actionImage{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.summaryViewEntries:hover .fieldValue .summaryViewEdit,.activityStatus:hover .editStatus,.activityDescription:hover .editDescription,.addedCalendars:hover .actionImage{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewEntriesTable tr:hover td .actions .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.listViewBasicAction.dropdown-menu{width:100%}.listViewBasicAction.dropdown-menu input{border-radius:2px;height:24px;margin-bottom:0;margin-top:-2px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.emptyRecordsDiv{width:100%;border:1px solid #ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.emptyRecordsDiv td{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;text-align:center;font-size:16px;padding:5% 0}.CustomFilterViewTitle{padding-top:1%}#CustomView .filterActions{padding-bottom:20px;overflow:hidden}.filterConditionsDiv{padding-bottom:0}.conditionGroup .header{margin-bottom:20px;font-size:1.2em}.conditionGroup .contents .conditionRow{margin-bottom:10px}.conditionGroup .contents .conditionRow select{width:90%}.conditionGroup .contents .conditionRow .chzn-results li{line-height:20px}.conditionGroup .deleteCondition{vertical-align:bottom}.searchUIBasic{border-collapse:separate!important;border-spacing:10px!important;margin:0 10%}.searchUIBasic .importContents{border:1px solid #eaeaea;-webkit-box-shadow:1px 1px 3px #ddd;-moz-box-shadow:1px 1px 3px #ddd;box-shadow:1px 1px 3px #ddd;border-radius:2px;background:#fff;margin-bottom:10px;padding:25px 20px 5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.searchUIBasic .listRow .listViewHeaders>td{color:#404952}.searchUIBasic .listRow .defaultInputTextContainer{max-width:87%!important;margin-bottom:0!important}#lineItemTab.table tr:first-child:hover th ~ td{background-color:#f3f3f4;background-image:-moz-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-ms-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f3f3f4),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:-o-linear-gradient(top,#f3f3f4,#f3f3f4);background-image:linear-gradient(top,#f3f3f4,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f4',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}#lineItemTab.table tr:nth-child(2):hover td{background:0}.lineItemTable tr td{width:0}.lineItemTable tr td div.finalDiscountUI,.lineItemTable tr td div.discountUI,.lineItemTable tr td div#shipping_handling_div,.lineItemTable tr td div.taxUI,.lineItemTable tr td div.finalTaxUI{border:2px solid #c4c4c4;border-radius:2px}.lineItemTable tr td div.finalDiscountUI table tr td,.lineItemTable tr td div.discountUI table tr td,.lineItemTable tr td div#shipping_handling_div table tr td,.lineItemTable tr td div.taxUI table tr td,.lineItemTable tr td div.finalTaxUI table tr td,.lineItemTable tr td div.finalDiscountUI table tr th,.lineItemTable tr td div.discountUI table tr th,.lineItemTable tr td div#shipping_handling_div table tr th,.lineItemTable tr td div.taxUI table tr th,.lineItemTable tr td div.finalTaxUI table tr th{border-left:0}.lineItemTable tr:hover td{width:0}.lineItemTable tr:hover td div.finalDiscountUI table tr td{background:none!important}.lineItemTable tr:hover td div.discountUI table tr td{background:none!important}.lineItemTable tr:hover td div#shipping_handling_div table tr td{background:none!important}.lineItemTable tr:hover td span.taxDivContainer div table tr td{background:none!important}.lineItemTable tr:hover td div.finalTaxUI table tr td{background:none!important}.lineItemResult{width:70.5%!important}.lineItemResult a:hover{color:#404952}.lineItemInputBox{width:45%;float:right;text-align:right}.discountUI,.taxUI,.finalDiscountUI,.finalTaxUI,#shipping_handling_div{position:absolute;left:46%;width:30%;z-index:500;box-shadow:1px 0 7px #ddd;border-radius:6px}.discountUI table.table,.taxUI table.table,.finalDiscountUI table.table,.finalTaxUI table.table,#shipping_handling_div table.table{margin-bottom:0}.discountUI .table tbody tr:first-child th:first-child,.taxUI .table tbody tr:first-child th:first-child,.finalDiscountUI .table tbody tr:first-child th:first-child,.finalTaxUI .table tbody tr:first-child th:first-child,#shipping_handling_div .table tbody tr:first-child th:first-child{border-radius:4px 0 0 0!important}.discountUI .table tbody tr:first-child th:last-child,.taxUI .table tbody tr:first-child th:last-child,.finalDiscountUI .table tbody tr:first-child th:last-child,.finalTaxUI .table tbody tr:first-child th:last-child,#shipping_handling_div .table tbody tr:first-child th:last-child{border-radius:0 4px 0 0!important}.LineItemDirectPriceReduction{width:65%!important}th.htColHeader,.handsontable thead th{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom:1px solid #ddd;padding:6px 2px}.contentHeader{padding:15px;padding-left:5px;line-height:20px}.contentsDiv>div{padding:0 20px}#settingsQuickWidgetContainer .widgetContainer.accordion-body{border-bottom:none!important;border-bottom:3px solid #ddd}#settingsQuickWidgetContainer .widgetContainer.accordion-body>div:hover{background:#eeeff2}#settingsShortCutsContainer{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;padding:1% 3%}#settingsShortCutsContainer .moduleBlock{min-height:60px}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin{display:inline-block;opacity:.4}#settingsShortCutsContainer .col-md-3.moduleBlock:hover .unpin:hover{opacity:.8}.settingsIndexPage .settingsSummary{text-align:center;margin-top:10px}.settingsIndexPage .settingsSummary a{display:inline-block;background:#f3f3f4;color:#444;border-radius:2px;min-width:200px;padding:20px 0 10px;border:1px solid #ddd}.settingsIndexPage .settingsSummary a .summaryText{display:inline-block;margin-top:20px;font-size:15px}.settingsIndexPage .settingsSummary a:hover .summaryText,.settingsIndexPage .settingsSummary a:hover .summaryCount{color:#404952}.settingsIndexPage .moduleBlock h5{font-size:1.2em;margin-bottom:5px}.settingsIndexPage .moduleBlock:hover{background:#f3f3f4}#userPageHeader{padding:8px 0 0}#userPageHeader #userHeading h3{margin-top:10px}.treeView li{border-left:4px solid #ddd;list-style:none;padding-top:15px}.treeView li .toolbar-handle{margin-left:10px;position:relative}.treeView li .toolbar-handle .btn{margin:0}.treeView li .toolbar-handle a:before{background:none repeat scroll 0 0 #ddd;content:" ";display:inline-block;height:4px;left:-10px;position:absolute;top:12px;width:10px}.treeView .btn{margin-bottom:10px}.profilesEditView tr.blockHeader th{text-align:center}.profilesEditView tr.blockHeader th:first-child{text-align:left}.profilesEditView input{margin-right:5px}.profilesEditView tr td.row table.table{border-left:none;margin-bottom:20px}.profilesEditView tr:hover td.row{background:0}.profilesEditView tr:hover td.row table.table tr td{background:0}.profilesEditView tr:hover td.row table.table tr:hover td{background:0}.profilesEditView tr:hover td.row table.table td{background:#f3f3f4}#s2id_memberList li>div,.groupMembersColors li>div{margin-left:10px}#s2id_memberList .Users,.groupMembersColors .Users{background-color:#f99984!important;padding:5px;margin-bottom:2px;background-image:none}#s2id_memberList .Groups,.groupMembersColors .Groups{background-color:#acd5ff!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .Roles,.groupMembersColors .Roles{background-color:#ffec98!important;background-image:none;padding:5px;margin-bottom:2px}#s2id_memberList .RoleAndSubordinates,.groupMembersColors .RoleAndSubordinates{background-color:#c4dea2!important;background-image:none;padding:5px;margin-bottom:2px}.collectiveGroupMembers{border:1px solid #ddd;border-top:0}.collectiveGroupMembers ul{padding:0;margin:0}.collectiveGroupMembers ul li{padding:4px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.collectiveGroupMembers ul li a{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%;margin:0}.collectiveGroupMembers ul li.groupLabel{background-color:#f3f3f4;border-bottom:1px solid #ddd;border-top:1px solid #ddd;padding:10px 5px;margin:0;color:#444}.mini-slider-control{width:50px}.mini-slider-control+div{margin-left:15px}.mini-slider-control .ui-slider-handle{border:0;border-radius:50%;height:16px;top:-2px;width:16px;cursor:pointer}.mini-slider-control .ui-slider-handle:focus{outline:0}.ui-widget-content{border-radius:6px;border-color:#fff;box-shadow:0 0 3px -1px inset;margin-top:2px;margin-left:5px;height:12px}.ui-slider-disabled{opacity:.5;border-color:#ddd;box-shadow:none;cursor:not-allowed}.ui-slider-disabled .ui-slider-handle{cursor:not-allowed}.ui-slider-disabled+div{opacity:.5;cursor:not-allowed}.mini-slider-control[data-value="0"] .ui-slider-handle{background:#7d7e7d;background:-moz-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#7d7e7d),color-stop(100%,#0e0e0e));background:-webkit-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-o-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:-ms-linear-gradient(top,#7d7e7d 0,#0e0e0e 100%);background:linear-gradient(to bottom,#7d7e7d 0,#0e0e0e 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#7d7e7d',endColorstr='#0e0e0e',GradientType=0)}.mini-slider-control[data-value="1"] .ui-slider-handle{background:#ffb76b;background:-moz-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#ffb76b),color-stop(0%,#ffa73d),color-stop(49%,#ff7c00),color-stop(100%,#ff7f04));background:-webkit-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-o-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:-ms-linear-gradient(top,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);background:linear-gradient(to bottom,#ffb76b 0,#ffa73d 0,#ff7c00 49%,#ff7f04 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffb76b',endColorstr='#ff7f04',GradientType=0)}.mini-slider-control[data-value="2"] .ui-slider-handle{background:#bfd255;background:-moz-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#bfd255),color-stop(79%,#8eb92a),color-stop(100%,#72aa00),color-stop(100%,#9ecb2d));background:-webkit-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-o-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:-ms-linear-gradient(top,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);background:linear-gradient(to bottom,#bfd255 0,#8eb92a 79%,#72aa00 100%,#9ecb2d 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bfd255',endColorstr='#9ecb2d',GradientType=0)}#moduleManagerContents{padding-bottom:10px}#moduleManagerContents .moduleManagerBlock .btn-group.open .dropdown-menu{left:-144%}#moduleManagerContents .modulesTable td{width:50%}#importModules .contents .row{margin-bottom:2.2%}.extensionWidgetContainer{background-color:#fff;border:1px solid #ddd;min-height:200px;padding:2%;background:#fafafa;box-shadow:0 0 10px -4px #777}.extensionWidgetContainer .extension_contents{margin-top:2%;background:#fff;padding:10px;box-sizing:border-box;max-height:160px}.extension_contents:hover{border-radius:4px}.thumbnailImage{height:130px;width:130px;float:right}.extensionWidgetContainer .extension_contents .slimScrollDiv{padding-right:10px}.extensionWidgetContainer .extension_header .font-x-x-large{font-size:1.5em;padding-left:3px;font-weight:bold;color:#404952}.extensionWidgetContainer .extensionDescription{line-height:20px}.extensionWidgetContainer .extensionInfo{padding-top:5px}.extensionWidgetContainer .extensionInfo .rating,.extensionDetails .rating{vertical-align:middle;margin-top:2px;display:inline-block}.extensionDetails .authorInfo{margin:3px 0}.extensionDetails .extensionDetailActions{padding:15px 0}.extensionWidgetContainer .tab-pane .bx-wrapper .imageSlider{margin:0}.sliderImage{width:90%;height:360px}.opacity .actions{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.opacity:hover .actions{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.sharingAccessDetails{margin-bottom:30px}.sharingAccessDetails td,.sharingAccessDetails th{text-align:center;vertical-align:middle!important}.sharingAccessDetails tr td:first-child,.sharingAccessDetails tr th:first-child{text-align:left}.sharingAccessDetails td.row>div{display:block}.sharingAccessDetails .customRuleContainer:hover{background:0}.sharingAccessDetails hr{border-bottom:1px solid #bcbcbc}.sharingAccessDetails .title{padding:1%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.sharingAccessDetails .title .rulehead{padding-top:5px}.sharingAccessDetails .customRuleEntries:hover .actionImages{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.layoutContent{border-top:4px solid #404952}.layoutContent #moduleBlocks .editFieldsTable{margin-bottom:20px}.layoutContent #moduleBlocks .editFieldsTable .fieldLabel{background:0}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);text-shadow:0 1px #fff;border-top:1px solid #fff;border-bottom:1px solid #ddd}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockLabel{padding-top:13px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group{margin-top:5px}.layoutContent #moduleBlocks .editFieldsTable .layoutBlockHeader .blockActions .btn-group .dropdown-menu{left:-100%}.layoutContent .relatedTabModulesList{padding:2% 1%}.fieldDetailsForm .search-choice-close{padding:0}.border1px{border:1px solid #ddd}.blockFieldsList .opacity{margin-left:.5%!important}.blockFieldsList .opacity .dropdown-menu a{padding:0!important}.blockFieldsList .opacity a.dropdown-toggle.editFieldDetails{box-shadow:none}.blockFieldsList .editFields .dropdown-menu{z-index:1000003;padding:0;left:-215px;position:absolute}.blockFieldsList .editFieldsWidget .dropdown-menu{z-index:1000003;padding:0;left:-315px;position:absolute}.blockFieldsList .editFields .dropdown-menu .modal-header{border-width:0;border-bottom-width:1px}.blockFieldsList .editFields .dropdown-menu .modal-header .cancel{padding-right:0;font-weight:bold}.blockFieldsList .editFields:hover{background:#f3f3f4!important}#modulePickListValuesContainer .layoutContent{padding-left:2%}#modulePickListValuesContainer .layoutContent .selectedCell,#modulePickListValuesContainer .layoutContent .selectedListItem{background:#a5afb9;white-space:nowrap}#modulePickListValuesContainer .layoutContent .pickListValue{cursor:pointer}.nonEditableValuesDiv .nonEditablePicklistValues{margin-left:0}.nonEditableValuesDiv .nonEditablePicklistValues li{padding:3px 15px;margin-bottom:2px;background:#e0f2ff}.popover{z-index:1000023!important}.popover-content .fieldLabel{width:35%;white-space:normal}#dependencyGraph .tableHeading{text-align:center;padding-top:30px;font-size:1.2em;font-weight:bold}#dependencyGraph .depandencyTable{border:1px solid #ddd;background:#f3f3f4}#dependencyGraph .depandencyTable .blockHeader{border-bottom:1px solid #ddd}#dependencyGraph .depandencyTable .picklistValueMapping{border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping{text-align:center;border-left:1px solid #ddd;border-right:1px solid #ddd;background:#fff}#dependencyGraph .dependencyMapping .mCSB_container{margin-bottom:16px!important}#dependencyGraph .dependencyMapping .pickListDependencyTable{border:0}#dependencyGraph .dependencyMapping .pickListDependencyTable .blockHeader th{background:#f3f3f4;border-bottom:1px solid #ddd}#dependencyGraph .dependencyMapping .pickListDependencyTable .selectedCell{background:#a5afb9}.webformFieldInfo{margin-bottom:250px}.targetFieldsTableContainer input[type="text"]{min-width:100px}#customRecordNumbering.table thead th{vertical-align:middle}.addMailBoxBlock{margin-left:83px;padding:0!important;font-size:12px}.addMailBoxStep{background:#fff;padding:30px 0;border:1px solid #ddd;border-radius:1px;min-height:170px}.mailConveterDesc{height:350px;width:96%;border:1.5px solid;border-radius:2px;border-color:#ddd;font-size:11pt;margin-top:55px;margin-left:20px;background:#fff}#mailBoxLabel{margin-top:15px;margin-left:-18px;font-size:12pt;width:75px}.mailBoxDropdownWrapper{height:49px;width:70%;background:url('../images/mailbox-icon.png') no-repeat 5px 5px;overflow:hidden;border:1px solid #ddd}.mailBoxDropdown{background:transparent url('../images/downArrowBlue.png') no-repeat 236px 13px;width:110%;height:50px;font-size:14pt;color:#0065a6;padding:10px 55px;padding-right:0}#mailConverterDragIcon{margin-top:12px}#mailConverterBody{padding-top:20px;margin-left:0}.ruleHead{padding:6px 0;background:#d8d8dc}.mailConverterRuleBlock{font-size:14px;line-height:30px;border:1.5px solid;border-color:#ddd}.mailConverterRuleLegend{font-size:14px;color:#0065a6;margin-bottom:10px;background:#f3f3f4}#mailConverterStats{font-size:10pt;margin-top:5px;margin-left:-10px}.addMailBoxBlock{border-color:#ddd;margin-left:83px;margin-top:20px;padding-top:30px;padding-left:200px;padding-bottom:20px;padding-right:30px;font-size:11pt}.taskTypeUi>.row{margin:10px 0}#taskListContainer .listViewEntriesTable tr td:last-child{border-left:1px solid #ddd}#workflow_step2>.row{padding:20px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;min-height:400px}#open_email_con .detailViewTitle{padding:0}#open_email_con .detailViewTitle .detailViewPagingButton{margin-top:0;padding-right:0}#foldersList .list-group{padding-right:0}.massEditTable th+th,.massEditTable td+td,.massEditTable th+td,.massEditTable td+th{border-left:0}.nav.massEditTabs{margin-bottom:0;border-bottom:0}.nav.massEditTabs li.active a{background:#404952;color:#fff;margin-left:10px}.nav.massEditTabs li a:hover{border-bottom:1px solid #404952}.massEditContent{border-top:3px solid #404952}.calendarSettingsContainer{width:700px}.calendarSettingsContainer .control-label{width:26%}#calendarSettings{margin:1px 0 3px}.calendarMassEdit{min-width:400px}.fc-state-default .fc-button-effect{top:100%!important}.fc-event-style1,.fc-event-style1 .fc-event-skin{background:#17309a;border-color:#17309a;font-weight:normal;text-shadow:none}.fc-event-style2,.fc-event-style2 .fc-event-skin{background:#3a87ad;border-color:#3a87ad;font-weight:normal;text-shadow:none}.fc-event-style3,.fc-event-style3 .fc-event-skin{background:#aa6705;border-color:#aa6705;font-weight:normal;text-shadow:none}.fc-event-style4,.fc-event-style4 .fc-event-skin{background:#953b39;border-color:#953b39;font-weight:normal;text-shadow:none}.fc-event-style5,.fc-event-style5 .fc-event-skin{background:#545252;border-color:#545252;font-weight:normal;text-shadow:none}.fc-event-style6,.fc-event-style6 .fc-event-skin{background:#87865d;border-color:#87865d;font-weight:normal;text-shadow:none}.fc-event-style7,.fc-event-style7 .fc-event-calendarMassEditskin{background:#c71585;border-color:#c71585;font-weight:normal;text-shadow:none}.fc-event-style8,.fc-event-style8 .fc-event-skin{background:#006400;border-color:#006400;font-weight:normal;text-shadow:none}#calendarview th{color:#000}.fc-agenda-divider+div{overflow-y:visible!important}.fc-button{display:inline-block;padding:6px .4em!important;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.fc-button:active .fc-button-inner{background:transparent}.fc-button:active .fc-button-inner .fc-button-content{color:#fff}.fc-button.fc-state-active .fc-button-inner .fc-button-content,.fc-button:active .fc-button-inner .fc-button-content{color:#000!important;background:transparent;background-image:none}.fc-header-title h2{font-size:15px;line-height:20px}.fc-widget-header th{padding:4px 0!important}.fc-widget-header{color:#666;background:#eee;border-color:#ccc}.fc-content{background:#fff;margin-top:15px}.fc-content td:hover{background:#f3f3f3}.btn:focus{outline:0}.reminderPostpone.btn-primary{background:#404952}.reminderPostpone.btn-primary:hover{background:#1e2327}.saveButton{margin-right:5px}.addCustomRule{float:right}.importMore{background:#fff}.lastImport{background:#fff}.undoImport{background:#da4f49}.close{border:0;background:none repeat scroll 0 0 transparent;border:0 none;cursor:pointer}.resetButton{margin-top:0!important}.vtGlyph{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("../images/vtGlyph.png");background-position:0 0;background-repeat:no-repeat;*margin-right:.3em}.vticon-pageJump{background-position:0 0}.vticon-call-inbound{background-position:-14px 0}.vticon-call-outbound{background-position:-28px 0}#massEdit .cancelLinkContainer{padding:5px 0;margin-left:.5em}.ui-pnotify{z-index:1000023}.feedback{z-index:10002}.feedback .handle{z-index:10003;display:block;position:fixed;bottom:50px;left:-30px;left:0\9;bottom:100px\9;background:#2c2c2c;color:white;padding:7px 15px;border:1px solid gray;text-decoration:none;outline:0;-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-o-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg);-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.00000000, M12=1.00000000, M21=-1.00000000, M22=0.00000000,sizingMethod='auto expand')";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0,M12=1,M21=-1,M22=0,sizingMethod='auto expand')}.feedback .handle:hover{text-decoration:none}.vtFooter{text-align:center}.vtFooter p{background:#404952;color:#fff;border-top:1px solid #ddd;padding:1px 0;font-size:.9em;margin-bottom:0}.vtFooter p a{color:#fff}.imageHolder{background:url('../images/loadback.png') repeat-y;background-position:center;padding:10px 0}.breadcrumbContainer{padding:2% 2% 0 2%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;height:auto}.breadcrumb{display:inline-block;height:auto;height:40px}.crumbs{height:40px;margin:0;padding:0 20px 0 0;display:inline-block;font-family:sans-serif}.crumbs li:after{content:'\0000a0';width:0;height:0;border-left:18px solid #ececec;border-top:20px solid transparent;border-bottom:20px solid transparent;display:inline-block;position:relative;top:-20px;left:18px;zoom:1}.crumbs li{height:0;border-top:20px solid #ececec;border-bottom:20px solid #ececec;border-left:20px solid transparent;display:inline-block;box-shadow:0 1px #ddd;margin-right:5px}.crumbs li a{display:inline-block;float:left;margin-top:-13px;font-size:14px;font-weight:bold;color:#666;text-decoration:none}.crumbs li.active{height:0;border-top:20px solid #404952;border-bottom:20px solid #404952;box-shadow:0 1px #404952}.crumbs li.active:after{border-left:18px solid #404952!important}.stepText{display:inline-block;white-space:nowrap;overflow:hidden;font-size:13px;vertical-align:bottom}.active .stepText,.active .stepNum{color:#fff}.stepNum{display:inline-block;padding:0 5px;overflow:hidden;font-size:20px;vertical-align:top;margin-top:5px}.greyStar{background-image:url("../images/stars.png");background-position:20px 20px;height:20px;width:20px;display:inline-block}.yellowStar{background-image:url('../images/stars.png');background-position:0 20px;width:20px;height:20px;display:inline-block}.blockUI{border-radius:2px!important;border:0!important}textarea.col-md-11{width:100%!important;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.popover .popover-inner{border-radius:2px;font-size:.8em;box-shadow:0}.popover .popover-inner .popover-title{color:#444;font-size:15px}.popover .popover-inner .close{color:#000!important;margin-top:3px;opacity:.5!important}.popover .popover-inner .close:hover{opacity:1!important}.popover .popover-inner td{padding:3px 5px;overflow-wrap:break-word}.popover .popover-inner .detailViewInfo{margin-top:0;box-shadow:0}.popover .popover-inner .detailViewInfo .fieldLabel label{font-size:1em}#findDuplicate>.control-group{margin-bottom:0;width:400px}#moveReports .modal-body{padding:20px 40px}#composeEmailContainer{padding:0 20px}#composeEmailContainer .MultiFile-wrap{display:inline-block}#composeEmailContainer .MultiFile-intercepted .ui-wrapper{min-height:400px}#transferOwnershipContainer .select2-container.select2-container-multi{max-width:220px}.fieldInfo.in{overflow:visible!important;height:auto!important}.moduleSelection{border-radius:2px 2px 0 0!important;border:1px solid #ddd!important;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);color:#444}.convertLeadModules{margin-bottom:2%;border:1px none}.moduleBlock{border-radius:0!important}.overflowVisible{overflow:visible!important}.convertLeadError{border:3px solid #999;background-color:#fff;width:55%;position:relative;z-index:10000000}.convertLeadError table td{border-bottom:1px solid #ccc;nowrap:nowrap;width:70%}.chzn-container{vertical-align:middle}.chzn-container .chzn-results li{margin-right:7px}.chzn-container .chzn-results .highlighted{background:#404952}.select2-results .select2-highlighted{background:#404952}.select2-result-label i{background-image:url("../../../../libraries/bootstrap/img/glyphicons-halflings-white.png")}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.ui-autocomplete-loading{background:url('../images/load.gif') no-repeat right center}.ui-autocomplete{height:auto!important;border-radius:1px!important}.dropdown-menu.pull-right:after,.dropdown-menu.pull-right:before{right:3px;left:auto;top:-5px;border-bottom-width:6px}span.wrapper a{color:#08c!important;font-size:15px!important;font-weight:bold}a{color:#353c44}a:hover{color:#1e2327;text-decoration:none;cursor:pointer}a:active,a:focus{outline:0}.well{border-radius:2px;padding:15px}.verticalBottomSpacing{margin-bottom:10px}.mergeTables{margin-bottom:0}.font-x-x-large{font-size:18px;line-height:28px}form{margin:0}.fc-state-default .fc-button-effect span{background:0}.dateField{width:183px}.form-horizontal [class^="icon-"],.form-horizontal [class*=" icon-"]{vertical-align:baseline}.timePicker{width:8.5em!important;z-index:1000029!important}.datepicker{z-index:1000029!important}.colorpicker{z-index:1029!important}.colorpicker input{width:30px!important}.colorpicker input[type="text"],.colorpicker input{color:#898989!important}.colorpicker_hex input{width:45px!important}.modal-body.accordion{margin-bottom:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}//.modal-open{// overflow:hidden;//}.select2-container-multi .select2-choices .select2-search-choice{cursor:move}.removeNoFileChosen{color:transparent!important}.modelContainer .modal-header{border-radius:2px 2px 0 0}.modelContainer form{border-radius:0 0 2px 2px}.hide{display:none}i{cursor:pointer;text-decoration:none!important}.marginbottomZero{margin-bottom:0!important}.marginLeftZero{margin-left:0!important}.marginRightZero{margin-right:0!important}.clearfix{clear:both!important}textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word;width:100%}.textOverflowEllipsis{overflow:hidden;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap;//width:9em}.margin0px{margin:0!important}.padding10{padding:10px;padding-bottom:0}.padding20{padding:20px}.pushDown{margin-top:5px}.boxSizingBorderBox{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;word-wrap:break-word}.boxSizingContentBox{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.cursorPointer{cursor:pointer;text-decoration:none!important}.zeroOpacity{opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0)}.dullOpacity{opacity:.8;-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80)}.fullOpacity{opacity:1;-ms-filter:"alpha(opacity=100)";filter:alpha(opacity=100)}.redColor{color:red}.highlightBackgroundColor{background:#eeeff2}.contentsBackground{background:#fff;border:1px solid #ddd}.textAlignCenter{text-align:center}.textAlignRight{text-align:right}.alignMiddle{vertical-align:middle!important}.alignTop{vertical-align:top}.padding1per{padding:1%}.paddingTop20{padding-top:20px}.padding20px{padding:20px}.padding-bottom1per{padding-bottom:1%}.marginBottom10px{margin-bottom:10px}.displayInlineBlock{display:inline-block}.backgroundImageNone{background-image:none}.liStyleNone{list-style:none outside none}.fontBold{font-weight:bold!important}.livesupport_tab,#userfeedback{display:none!important}#reportDetails table tr td.summary{border-bottom:0;border-top:0}#portalDetailViewHttpError{padding-bottom:7px;margin-top:50px;color:red;text-align:center}.slidesjs-pagination{list-style:none}.slidesjs-pagination li a{display:block;width:13px;height:0;padding-top:13px;background-image:url('../images/pagination.png');background-position:0 0;float:left;overflow:hidden}.slidesjs-pagination li a.active,.slidesjs-pagination li a:hover.active{background-position:0 -13px}.extensionStorebtn{background:#f08c39;background-image:-webkit-linear-gradient(top,#f08c39,#e68b3c);background-image:-moz-linear-gradient(top,#f08c39,#e68b3c);background-image:-ms-linear-gradient(top,#f08c39,#e68b3c);background-image:-o-linear-gradient(top,#f08c39,#e68b3c);background-image:linear-gradient(to bottom,#f08c39,#e68b3c);-webkit-border-radius:2;-moz-border-radius:2;border-radius:2px;text-shadow:0 0 1px #595959;color:#fff;font-size:14px;font-weight:bold;padding:8px 20px 8px 20px;text-decoration:none;border:0}.extensionStorebtn:hover{background:#fc9f3c;background-image:-webkit-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-moz-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-ms-linear-gradient(top,#fc9f3c,#f08a3c);background-image:-o-linear-gradient(top,#fc9f3c,#f08a3c);background-image:linear-gradient(to bottom,#fc9f3c,#f08a3c);text-decoration:none}.extensionSearch{padding:8px 12px 8px 30px!important;margin:6px 0 14px 0;box-shadow:inset 2px 2px 10px #ddd;border-radius:2px!important;background:url('../images/search.png') no-repeat;background-position:5px 6px}.banner-container{border-bottom:1px solid #fff;box-sizing:border-box}.banner{margin:0 90px}.bx-wrapper{margin:0 auto 35px!important;padding-top:17px!important}.bx-wrapper li a{display:block}.bx-wrapper a img{height:100px;width:auto;margin:0 auto}.wide,.table td.wide,.listViewEntries td.wide,td.listViewEntryValue.wide{padding:8px!important}.medium,.table td.medium,.listViewEntries td.medium,td.listViewEntryValue.medium{padding:5px 6px!important}.narrow,.table td.narrow,.listViewEntries td.narrow,td.listViewEntryValue.narrow{padding:2px 4px!important}.table thead th.narrow{vertical-align:middle}td.listViewEntryValue .row input{padding:0;margin-bottom:0}.listViewContentDiv{position:relative}.fieldLabel .pull-right{text-align:right}#tagRecordText{-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;width:80%!important}#tagRecord{margin-left:5px!important}.tag{float:right!important}.cut-string{text-overflow:ellipsis;-o-text-overflow:ellipsis;-webkit-text-overflow:ellipsis;width:200px;white-space:nowrap;overflow:hidden}.paddingLRZero{padding-left:0;padding-right:0}.paddingRightZero{padding-right:0}.detailViewToolbar{margin-top:5px}.input-group.input-group-sm>.input-group-addon img{width:15px}table tr td .input-sm{min-width:50px}.modal-footer.backgroundColor{background-color:#f5f5f5}.panel-title{font-size:14px}.quickWidgetContainer .panel-body{padding-bottom:0;padding-top:0}tr.summaryViewEntries,#detailView table{font-size:13px}table.listViewEntriesTable{font-size:13px;margin-top:5px}.no-margin{margin:0}.companyLogo img{max-height:200px;max-width:250px}.navbar-inverse .navbar-nav>li>a{color:#fff;padding:15px 12px}.navbar-inverse .navbar-nav .dropdown-menu>li>a{padding:3px 15px;font-size:12px}.headerCalendar .month h3{font-size:18px;font-weight:bold;margin:5px 0 0 0}.columnsSelect{width:100%!important}.marginBottom5{margin-bottom:5px}.editViewContainer .recordEditView table.blockContainer tr td.fieldValue{width:30%}.recordEditView[name=QuickCreate] .quickCreateContent table tr td.fieldValue,#massEditContainer .massEditContent table tr td.fieldValue,#tab_accounts td.functionList{width:30%}.btn{white-space:normal}.valuesAssignedToRole{border:1px solid #adadad;overflow:hidden;text-overflow:ellipsis;padding:6px}table.dataTable .form-control{width:100%!important}#breadcrumb .stepNum{margin-top:0}#breadcrumb .stepText{position:relative;top:-4px}.fc button{height:auto!important}.fc-toolbar{margin-bottom:0!important}.fc-center,.fc-left,.fc-right{margin-bottom:1em}.calendarRightPanel{padding-left:5px;padding-right:5px}.calendarRightPanel ul li{margin-bottom:2px;margin-left:5px}.calendarRightPanel ul li:hover{background-color:#eee!important;border-radius:5px}.square9{width:12px;height:12px;margin:4px}.panel-dark{border-color:#737373}.panel-dark>.panel-heading{color:#fff;background-color:#737373;border-color:#737373}.panel-dark>.panel-heading+.panel-collapse>.panel-body{border-top-color:#737373}.panel-dark>.panel-heading .badge{color:#737373;background-color:#fff}.panel-dark>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#737373}.calendarRightPanel .widgetContainer ul{margin-top:5px;margin-bottom:5px}.paddingLeft5px{padding-left:5px}.marginBottom5px{margin-bottom:5px}.detailview-table .fieldValue .summaryViewEdit{display:none}.detailview-table .fieldValue:hover .summaryViewEdit{display:inherit}.icon-in-history-widget{font-size:17px;padding:4px}#prefPageHeader .logo img{height:70px;width:70px}#myPrefHeading h3{margin-top:12px}.list-user-img{width:50px;height:40px}span[name=existingImages] img{height:200px;width:300px}.narrow.fieldValue .chosen-container-single .chosen-single{height:26px;line-height:26px}.narrow.fieldValue input{height:26px}.narrow.fieldValue .input-group-addon{padding:4px 10px}.narrow.fieldValue .chosen-container-single .chosen-single div b{background-position-y:4px}.image-in-button{width:18px}.fc-time-grid .fc-time-grid-event.fc-event{min-height:27px;min-width:100px}.fc-time-grid-event.fc-short .fc-title{font-size:1em}.paddingTBZero{padding-top:0;padding-bottom:0}.dashboardWidgetContent a .glyphicon{top:-3px}.detailViewTitle .popover{min-width:130px;text-align:center}.cursorDefault{cursor:default!important}.remindersNoticeContainer{position:fixed;right:0;top:109px;z-index:1029;width:0;height:100%;bottom:30px;overflow-y:auto;background:rgba(0,0,0,0.4);border-left:1px solid #797979;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease;overflow-y:auto}.remindersNoticeContainer.toggled{width:380px}.remindersContent{margin:5px 8px 0 8px}.activityTypeIcon{height:20px}.remindersNoticeContainer .panel{margin-bottom:10px}.remindersNoticeContainer .panel-body{padding:10px}.remindersNoticeContainer .actionRow a.btn{margin-right:3%}.remindersNotice{color:#fff;padding:15px 12px}.remindersNotice .glyphicon{font-size:20px}.cancelLink.btn[type='reset'],.cancel.btn[type='reset'],.cancelLink.btn[type='button']{float:right;margin-left:5px;margin-bottom:0}.activityWidgetContainer .popover{min-width:240px}.filterActionImage{margin-left:8px}#tagRecord{line-height:25px}#tagsList .btn-info{margin-left:5px}#tagRecordInput{padding-left:15px;padding-right:15px}.clearReferenceSelection,.createReferenceRecord{padding:0 6px}.relatedPopup{padding:0 4px}.popupContainer .popupModuleName{margin-top:0}.mailRows hr{margin:0}.paddingLeftMd{padding-left:15px}.widget_header div:nth-child(2).btn-toolbar,.editViewContainer .contentHeader.row div:nth-child(2),.contentsDiv ul#tabs.nav,.marginTop20{margin-top:20px}.fieldLabel .referenceMandatory{margin-right:-12px}.ui-widget-content{padding:.8em}.ui-autocomplete .ui-autocomplete-category{font-weight:bold;line-height:1.5}.ui-autocomplete .ui-autocomplete-category:first-child{margin:.8em 0 .2em}.ui-autocomplete .ui-menu-item{padding:.2em .8em}.ui-autocomplete .ui-state-focus{border:0;background:#ebebeb}.widgetHr{margin-top:0}.headerLinksMails .btn-group{margin-top:11px}.finalDiscountUI,.finalTaxUI{bottom:5px}.sideBarTitle{font-size:20px}.globalSearchInput{width:300px}#groupsDetailContainer strong{line-height:21px}#addTaskContainer #taskStatus{margin-left:10px}.scanerMailActionsButtons{min-width:96px}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#404040}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active,.ui-menu .ui-menu-item a.ui-widget-content{font-weight:bold;margin:0;background-color:#428bca;border-color:#357ebd;color:#fff;display:block}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:normal}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style:none}#layoutEditorButtons{margin-bottom:10px;margin-top:-10px}.individualTaxContainer{text-align:left!important}.roundedCorners :not(:first-child){padding-left:0}.roundedCorners label{font-weight:normal;min-height:40px}.paginationDiv .pagination{margin:0}.paginationDiv .pagination li{cursor:pointer}.paginationDiv .pagination>li>span,.paginationDiv .pagination>li>a{padding:8px 8px}.paginationDiv #listViewPageJumpDropDown{left:192px;top:80%}.paginationDiv .listViewBasicAction.dropdown-menu{width:35%}.listViewEntriesTable .picklistSearchField{min-width:150px}.listViewEntriesTable .boolenSearchField{min-width:90px}.listViewEntriesTable .searchField{min-width:100px}.pageInfo{border:1px solid #ddd;color:#337ab7;margin-left:5px;list-style:none;padding:8px 5px}.listViewEntriesDiv .listViewEntriesCheckBox{margin-left:2px}#widgetsManagementEditorContainer .modal-footer .btn{margin:5px}#widgetsManagementEditorContainer .fieldDetailsForm .modal-footer{padding:0}#widgetsManagementEditorContainer .fieldDetailsForm .filter{padding-top:5px;margin-left:5px}.dashboardContainer .dashboardHeading .dropdown-menu{left:-82px}#VtEmailTaskContainer .addTime{text-align:left}.summaryWidgetContainer.summaryWidgetBlock{padding:0}.summaryWidgetContainer .container-fluid{padding:0 5px 0 5px}.summaryWidgetContainer .widgetTitle{padding-left:10px}.summaryWidgetContainer .widgetHeader{background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-ms-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f6f6f6),to(#f3f3f4));background-image:-webkit-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:-o-linear-gradient(top,#f6f6f6,#f3f3f4);background-image:linear-gradient(top,#f6f6f6,#f3f3f4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6',endColorstr='#f3f3f4',GradientType=0);border-color:#f3f3f4 #f3f3f4 #cbcbcf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-top:1px solid #fff;border-bottom:1px solid #ddd;text-shadow:0 1px #fff;color:#444;padding-bottom:4px}.summaryWidgetContainer .widgetHeader h4{margin:0}.summaryWidgetContainer .widgetContent{padding:5px;font-size:13px}.mailsList .container-fluid>.row{border-bottom:1px solid #ddd;margin-right:-10px;margin-left:-10px;padding:4px 0}.mailsList .container-fluid>.row:last-child{border-bottom:0}.mailsList .smalSeparator{display:block;height:5px;width:70px}.summaryWidgetContainer .widgetContent hr{margin:4px 0}.mailsList .row{background-color:#fff}.mailsList .row.even{background-color:#faf8f8}.mailsList .mailTitle{margin:0}.mailsList .mainSubject{font-weight:800;font-size:13px}.mailsList .mainFrom{font-size:16px}.mailsList .mailActions{margin-top:3px;z-index:1020;position:relative}.mailsList .mailActions a{margin-left:3px}.mailsList .mailActions a:first-child{margin-left:0}.mailsList .mailBodyContent{overflow:auto}.mailsList .mailBodyContent p{margin:0}.rowHr{margin:4px 0}.firstLetter{color:#fff;background-color:#5bc0de;border-color:#46b8da;display:block;padding:6px 8px;height:32px;width:32px;font-size:16px;text-align:center;margin:0 7px 3px 0;-webkit-box-shadow:0 0 8px -1px rgba(156,156,156,1);-moz-box-shadow:0 0 8px -1px rgba(156,156,156,1);box-shadow:0 0 8px -1px rgba(156,156,156,1)}.modal-blg{width:90%}.modal-blg iframe{height:420px}#emailPreview{margin:10px 0}.modalViewBody .mailsList{max-height:630px;overflow:auto}.domain{padding-left:2px;padding-right:2px;background:rgba(91,234,81,0.54)!important;border-radius:4px}.inventoryItems .input-group{max-width:200px}.inventoryItems .rowName .input-group{max-width:400px}.inventoryItems td,.inventoryItems th{border:1px solid #ddd}.inventoryItems tfoot td.hideTd{border:0;background:#fafafb}.inventorySummaryContainer .panel-body,.inventorySummaryContainer .panel-footer{padding:0}.inventorySummaryContainer .panel-body .form-group,.inventorySummaryContainer .panel-footer .form-group{margin:0}.inventorySummaryContainer .input-group .form-control{background-color:#f5f5f5}.inventorySummaryContainer .panel-body .percent{min-width:55px}.inventoryItems tfoot{font-weight:800}.inventorySummaryContainer img{max-width:15px}.autologinContainer .chosen-container-multi .chosen-choices{padding-left:6px}.checkboxForm{padding-top:7px} \ No newline at end of file diff --git a/modules/Users/views/Login.php b/modules/Users/views/Login.php index b7add7e239c2..891f09d3e442 100644 --- a/modules/Users/views/Login.php +++ b/modules/Users/views/Login.php @@ -18,23 +18,6 @@ function checkPermission(Vtiger_Request $request) { return true; } - function preProcess (Vtiger_Request $request, $display=true) { - parent::preProcess($request, false); - $viewer = $this->getViewer($request); - - $selectedModule = $request->getModule(); - $companyDetails = Vtiger_CompanyDetails_Model::getInstanceById(); - $companyLogo = $companyDetails->getLogo(); - $viewer->assign('MODULE', $selectedModule); - $viewer->assign('MODULE_NAME', $selectedModule); - $viewer->assign('VIEW', $request->get('view')); - $viewer->assign('COMPANY_LOGO',$companyLogo); - $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel()); - if($display) { - $this->preProcessDisplay($request); - } - } - public function postProcess(Vtiger_Request $request) { } function process (Vtiger_Request $request) { diff --git a/modules/Vtiger/models/Link.php b/modules/Vtiger/models/Link.php index d85196f33f32..713013355d84 100644 --- a/modules/Vtiger/models/Link.php +++ b/modules/Vtiger/models/Link.php @@ -79,15 +79,6 @@ public function getIcon() { return $this->linkicon; } - - /** - * Function to get the link glyphicon name - * @return - */ - public function getGlyphiconIcon() - { - return $this->glyphicon; - } /** * Function to check whether link has icon or not diff --git a/modules/Vtiger/views/Header.php b/modules/Vtiger/views/Header.php index 1ba86a3cc55b..503df1674a55 100644 --- a/modules/Vtiger/views/Header.php +++ b/modules/Vtiger/views/Header.php @@ -1,25 +1,24 @@ - List of Vtiger_Link_Model instances */ - function getHeaderLinks() - { + function getHeaderLinks() { $userModel = Users_Record_Model::getCurrentUserModel(); $headerLinks = []; + + $userPersonalSettingsLinks = array( + 'linktype' => 'HEADERLINK', + 'linklabel' => $userModel->getDisplayName(), + 'linkurl' => '', + 'linkicon' => '', + 'childlinks' => array( + array( + 'linktype' => 'HEADERLINK', + 'linklabel' => 'LBL_MY_PREFERENCES', + 'linkurl' => $userModel->getPreferenceDetailViewUrl(), + 'linkicon' => '', + ), + array( + 'linktype' => 'HEADERLINK', + 'linklabel' => 'LBL_SIGN_OUT', + 'linkurl' => '?module=Users&parent=Settings&action=Logout', + 'linkicon' => '', + ) + ) + ); + array_push($headerLinks, $userPersonalSettingsLinks); if ($userModel->isAdminUser()) { $crmSettingsLink = array( 'linktype' => 'HEADERLINK', 'linklabel' => 'LBL_SYSTEM_SETTINGS', - 'linkurl' => 'index.php?module=Vtiger&parent=Settings&view=Index', - 'glyphicon' => 'glyphicon glyphicon-cog', + 'linkurl' => '', + 'linkicon' => 'setting.png', + 'childlinks' => array( + array( + 'linktype' => 'HEADERLINK', + 'linklabel' => 'LBL_SYSTEM_SETTINGS', + 'linkurl' => '?module=Vtiger&parent=Settings&view=Index', + 'linkicon' => '', + ), + array( + 'linktype' => 'HEADERLINK', + 'linklabel' => 'LBL_MANAGE_USERS', + 'linkurl' => '?module=Users&parent=Settings&view=List', + 'linkicon' => '', + ), + ) ); array_push($headerLinks, $crmSettingsLink); } - $userPersonalSettingsLinks = array( - 'linktype' => 'HEADERLINK', - 'linklabel' => 'LBL_SIGN_OUT', - 'linkurl' => 'index.php?module=Users&parent=Settings&action=Logout', - 'glyphicon' => 'glyphicon glyphicon-off', - ); - array_push($headerLinks, $userPersonalSettingsLinks); - $headerLinkInstances = []; + $headerLinkInstances = array(); + + $index = 0; foreach ($headerLinks as $headerLink) { $headerLinkInstance = Vtiger_Link_Model::getInstanceFromValues($headerLink); - if (isset($headerLink['childlinks'])) { - foreach ($headerLink['childlinks'] as $childLink) { - $headerLinkInstance->addChildLink(Vtiger_Link_Model::getInstanceFromValues($childLink)); - } + foreach ($headerLink['childlinks'] as $childLink) { + $headerLinkInstance->addChildLink(Vtiger_Link_Model::getInstanceFromValues($childLink)); } - $headerLinkInstances[] = $headerLinkInstance; + $headerLinkInstances[$index++] = $headerLinkInstance; } $headerLinks = Vtiger_Link_Model::getAllByType(Vtiger_Link::IGNORE_MODULE, array('HEADERLINK')); foreach ($headerLinks as $headerType => $headerLinks) { foreach ($headerLinks as $headerLink) { - $headerLinkInstances[] = Vtiger_Link_Model::getInstanceFromLinkObject($headerLink); + $headerLinkInstances[$index++] = Vtiger_Link_Model::getInstanceFromLinkObject($headerLink); } } return $headerLinkInstances; @@ -89,12 +115,11 @@ function getHeaderLinks() * @param Vtiger_Request $request * @return - List of Vtiger_JsScript_Model instances */ - function getFooterScripts(Vtiger_Request $request) - { + function getFooterScripts(Vtiger_Request $request) { $headerScriptInstances = parent::getFooterScripts($request); $headerScripts = Vtiger_Link_Model::getAllByType(Vtiger_Link::IGNORE_MODULE, array('HEADERSCRIPT')); - foreach ($headerScripts as $headerType => $headerScripts) { - foreach ($headerScripts as $headerScript) { + foreach($headerScripts as $headerType => $headerScripts) { + foreach($headerScripts as $headerScript) { if ($this->checkFileUriInRelocatedMouldesFolder($headerScript->linkurl)) { $headerScriptInstances[] = Vtiger_JsScript_Model::getInstanceFromLinkObject($headerScript); } @@ -108,21 +133,21 @@ function getFooterScripts(Vtiger_Request $request) * @param Vtiger_Request $request * @return - List of Vtiger_CssScript_Model instances */ - function getHeaderCss(Vtiger_Request $request) - { + function getHeaderCss(Vtiger_Request $request) { $headerCssInstances = parent::getHeaderCss($request); $headerCss = Vtiger_Link_Model::getAllByType(Vtiger_Link::IGNORE_MODULE, array('HEADERCSS')); $selectedThemeCssPath = Vtiger_Theme::getStylePath(); //TODO : check the filename whether it is less or css and add relative less - $isLessType = (strpos($selectedThemeCssPath, ".less") !== false) ? true : false; + $isLessType = (strpos($selectedThemeCssPath, ".less") !== false)? true:false; $cssScriptModel = new Vtiger_CssScript_Model(); $headerCssInstances[] = $cssScriptModel->set('href', $selectedThemeCssPath) - ->set('rel', $isLessType ? - Vtiger_CssScript_Model::LESS_REL : - Vtiger_CssScript_Model::DEFAULT_REL); + ->set('rel', + $isLessType? + Vtiger_CssScript_Model::LESS_REL : + Vtiger_CssScript_Model::DEFAULT_REL); - foreach ($headerCss as $headerType => $cssLinks) { - foreach ($cssLinks as $cssLink) { + foreach($headerCss as $headerType => $cssLinks) { + foreach($cssLinks as $cssLink) { if ($this->checkFileUriInRelocatedMouldesFolder($cssLink->linkurl)) { $headerCssInstances[] = Vtiger_CssScript_Model::getInstanceFromLinkObject($cssLink); } @@ -135,14 +160,14 @@ function getHeaderCss(Vtiger_Request $request) * Function to get the Announcement * @return Vtiger_Base_Model - Announcement */ - function getAnnouncement() - { + function getAnnouncement() { //$announcement = Vtiger_Cache::get('announcement', 'value'); $model = new Vtiger_Base_Model(); //if(!$announcement) { - $announcement = get_announcements(); - //Vtiger_Cache::set('announcement', 'value', $announcement); + $announcement = get_announcements(); + //Vtiger_Cache::set('announcement', 'value', $announcement); //} return $model->set('announcement', $announcement); } + } diff --git a/storage/Logo/logo_yetiforce.png b/storage/Logo/logo_yetiforce.png index 040995f8826e4c9bcc77c73f4f0486cb784e8fdd..186682d3778d1323e236c7d48b593f2f21cdb364 100644 GIT binary patch delta 18920 zcma&Nby!qi)IT~wmxO?Xl!SCMG*Xg+^bnE)0sq_IpOcVUo86OI83yhtPWn+PD-zp9%fVz zW20~g5|stDgpmYAa&#o<;NGsD#os(n0`Zs;AYz>AmyE7gkHDbQ07*$sCKPrn2<$b6 zj{`zIOGEL|zP-7(A(vtTMuvbS4=!s9XTt4W@Q!p|knN|pX9HHpK*)^K6kjmN_#-1Z_){#1fy_Ew0rW}&R64BxP7ws>1Kqb#>k9faWvGVgoz$O{yb0=ob7z(8`Jvz&O11Goh%<%?t^ zvzTI_F%I_|Yy$%xy2nE*l$`fPEFc!CPk1`KQ>X+2h3=sb2SA`tvE;Y*9$tA35tR=O ziA2{CnQ?ElVcjrUS}tF&43{9DfIy3G0VCI3yw%i52`r@JbvDZm#w%0&Pwpp?Hec>N zsReynpEfu|+@YiR`2*1S>(|Qf-&3kxa>f?l4g9ZdJIqi9SFg_kBri{n(5*|%fdVfA zl`u}x9Rq*W^Js_Ta6>F-S7Vee>+x?cAC56~saQ6`IqolOk-mvmNPT}OkjE4u7suYs zGJ5lJX@TnkD!m{KsAkaaxb35?!F%A^@DtK|&^JZ7( zO6d~|2x+4d_XY$qRbb}P{a!88ivt2Fd4AMwuhHv5bwV2dmg_ZfW-{~^wDL*`ra)F4wHF??; zE71oM2)YbwQR4p?_(e$?X z4VUkNF_T8f3$QhQfT&dE>W-3*J{@(^ezeY2lqRH1{V4w1^h<{?*kT{K7&!Yve`oye z{4MyK<~QSkF@Tq0`Q%ORsm{`4?eF%gR4c?QLMvF-$pW%^IjP!ng`agvgky~4%0Aa= zS7^O0BolH^6&nnuP*KY(%T5@hent7}#IE9xTNBA#0-Z+E4};PEb)`Q^f1rOo2?)c; zgL}hmA5*10zERw2Mmk-9jnY@;AFU1+qgLBkz_>sqc$4gL6U`?Rm z;MFZE&M%%X#@9R4>(`AbGS%@ff2t>_vs{GxGqFUkIOF-I4vmg&kwoF!V%tJzU76ef z!>b4^!%p>1P5E4{PgQ2iEjkaQUEZvOr*`w}}%zL0t&zqN@&abi*;yhOP~ zt3+w@t4R5FK}P;p#b(2cKqA>*RW=hgCEJ)G%#1aiUpjLIcm)*Cq{NTPd5RtKXg)V9 zc(yqe>?CKlnj$mRoeSo@zpkCr`tx4tUOAo@94QgN0jz2QW~>>4p$C%P!f%`}$!t=zJodXOUo$v=|cGI3k%d{xs_8z4vxKCd zfwDlLG34UZ$B(fsT1I@v`uNMQZQ1vq8fD34V}i|mKFyY2Q>=npRhUD% zn8#jn8rCG#B-6uVV>mDl&w#7ER-+Z;;V1`0oL;vsTy7t}UCLO(U-qR;=Iwid@cum1 z@i(-9qKJo-OFZ$3dboz@$30nMjzWs}EC*zsEYW!09S=KfnRrJ;M#87$O*rT@4wN~b z`NVC-wg`JOcMIlmtu%(P6@6$?CsdzH6VIeb^9^;f-7|52cuf+<0|z`G0hc9#3*$f3dYTuxT5N_%4=MlF2!^ zJy899<^wE!H|u7bw1adpt}ZW3&4BwMeD!Ooz1SDYH{LUN%jB4xVft95k`3?bI2^|{ zOSTP?$^*W#`aE+8G;RML)LsjA*u>YvTLD7-H)kieUueR44Hs%H&ciZjq{$=RmEWJC zOdO6O*F;QZ1(rOZs6XCDv8o~wrn(d=w z#TnkD!N)Vr!FBSDIc<^+E!G9!h6W{MbaQq8>YnS0?2OLUT1=igjqK3)wj2v>jn4qa zEhksf-&$w%zf_o zs~t1Jxv50dOW%5(vFpiAC_<-lguXW^daZ$Ad$@y)BVsw15r1sCyD@$okp z(B#8QD?#oV5J+MxRy>+TnA?g^fS&;-#=|cx41)=9F$nPS3-R*t^YROF^NWcK35oOZ z#cnspGeSb+3&Gy;`H(2EP`nUSj97@9PmEhYSeO5nL`+;jDBcIk7QX_$ciX|w$IU08 zd)q2_`w@u8z+jF?LopvZzqGUQRhuxD7b|Mghg#^L@c?51YZhq zzvL4V<`%Qyx8Sz2wzPr?!$d6wE%_yRy&MtGo{6i(GveHjU&46&NKnK=h+ouFm|Mt# z55~>UZ!N?vCLn0dEhc6uXl)6D@rek;b7MYX7PS(DSqh21!xs<7PG{!lw}HL1u(aV86co1M zwh$5$;}(5sAcd5pDsVTY&%H=;GCIpFv;(@oBhXcb7?ACoq4! zDxLsTuJ{Xfy7lROoDG2iAskIsO zOQ>FANC@-Gw*J|(Yf<+>zV%cIwG+3KfnEPhZ-zNn-=^Y{V!(YPT_?qa=Pj`u4r7S& zy=TP`#t`8423M3Z^OT z5JH^2_yLorF`Zx*@)~Ok_jNf3$sJn^6G;LL=^w+M(NG?4FKH`1_q)~)$P%fXzyhRg zAiZ~MHQSymgASs_aQs#ta4WuH+Le)S=R zztxWv!6eBFQo2toA+vjv7FZG(o7t8{hIq|uPJtk)WaoP}&ULG{GAd$EG-W&|pdQP^ z<3{G;)Zk$~ClYpWEd^?LaEi^xzI#fnSAA=&)=f^NQa#+cQ5y1S7pk@PAPVm z=mV1M)=*}&g7=Yk1euZldq_Fw0W4>>;6Vjg5I*;oC)@(%>vR7RLy@3;V(1F)_ zbOG<}_51ZrE7j6_@96G4qt*5}{Iib;W&lKTjl|jFhgOd#+h*)7hPMb&r4E0iAp*C#yMm8g%e;B0v2Y<9|%C%Rjy0(otG}^Di9iZ0XTIusC*oP&PhW{{*C-xj+-W4WvBoOo8x} zsiRz4g{dWq*Z*h4N&{9|aK_KS|Af>eUXc+3M#oXe5&P?Z45m*RDg%NOrJ!47tN%Qo z7d0$&TAh{uzqb+mC|SbmtrP6968wKov0D`SRNJ2APZO1Jqw$}nYW%@SvcG@8GicL) zBoS*E=7n@pAc+#ZTg7gH%N@f?FYmpU=>Y={CDi}gm=D>_A4(mcR23CJ`Nzh^u&q?7 zm73=N9_4bo<&W_b7SSdD$5&-VS!(AAYvKQL{Sr*)$*@`czqi@1`pqYF{+HG|^S1L5 z(nc@%Rs}|Ik^sbUmhNj3 z5&8nvh8)y;_>XznFUX;{FMb2{6y>XNE8YlpR1V7RWz@e}XphRg4NSJcVW|93A!jz> zDG!34Pi6dHgoi%E5~ZCv{L5o5fpF`Y%Bcn1`prPcBlsf=21IDd z^5=?@9&+mY!=j^NkQr1hgrGleippG}V=uWYjQEUhH6 zJO7XJqFF%(6TU3>n0w!Fb5f;$^KKi%H<_10!d%^(b*65>FmQe04DPL%agqX~SDir= zVLyE_>3@wH>b4yD?}jH1DI_aA`c2t4taYo4axGGVeyVkz)2m{YhgH~G?R=+Do%ce- zbKKSaJr<8a{auWVvZIM0t?*qSp;=2OQ7Wyu|2*wQYO|qCeA$}48055}Df1SoSROD8 zD^j&|^W|50L9zT=x5O8H1boF=D-+^qQuB{ZS$8x<;H37;PhsP}-E`Bl->5(Gc4clk zE`FX*^r^_Sm@=)ubBuBzQUZMX{E_aK<1dlK1UtZ&ZL%v$im)0u{27aC-w3)TQuu;t zV#ZS$hAuN9Yunl}w<{MSnN$pO@R?q>FFp2Tcc%-zD{;9mP*-tS{XH_b9C&@i;o3pr z&7TXRJU3w2=`rq=uU_7TCG&ICL-5u}IQgYUc?74gINU^`Yc9)irRe;`_wWrEV%EDWgd|zW zi+9CdnCdZ&l^no3;HTS>Jx93EQU>@^|9yej6o1vb41n5l|*}(F8gm)Tk zW6Z9h{TCD4i);zFT}~w9Ai(EqKgk}N=J|Ikw7>1>w{q9C@oaMKM{W+JC5dL<`QhbTg&ak zz?r~(rZe@Am^|TQRohc{DTw4V66!_t0QZvamA-IipZd+Uj-+nbYg-ay)&hYD||vZ^95?)%D}HCnQ`M zwM~?sQ|vF(DUg?klfob)N^hnM{8t`Ea2jG!!hO4r!eL3T0*ws<5Yj|)X|s1_GZv@8 z3~Z%WRw9_KfNvsLnR$u!b3D@h=Yw+O#RJ5rVmEiJ4^~g8nz{P!4fPlNI5xV|?8$p<|CKpqlwNNW%1bXV%YqzN z^sJqH5oDhHKjbT~i|o0E`UH}mweuCyRs}zHt6rJobiv>e+o(P!^^WhLcw9tsSp) zJK%X^$4?a>n1=GEVG6vm;_l@~5uja8?)Xzv7^0ad5edfV35W0YI=@a_G4V|A!oHXS z;fNA1?y-cFyWpE}0tdmI=0bZ`|KW+-u#p`8Wl4z@{UiVZriIe}i`iRUr=?5Gz)2+= zy9qyFAF{v>MR$vaTjRsD!|#6%riB)1prVrKO^B@mEB;$g+;;U)6wAqs8!ezN(LLYr zD7&g2D;V6WjbWnrx`2a=72UCKmiAZ%Xkd5>x%i(k3B9jA%H`67lkiu>4}uQ`p6T7K z^GS+WV|UAoTbJJBe1pJR+11DxBxdbt32LAj38vW9f_TX#F z_(Ux!+CmOu_6}Id7{N0fEs6x5&qSDY+DB)0Y`vd8a3RbC5GNde1j2)n!{pxliQliE zi}MXW#I9qhyncD$;0 zcK4(xB9Su*)4QlWCZN*7h;Cp{yx!?y3)o541hP3B`#~Rh&BJpWS?9S3E_+cu`s#Z&i9bNoc7% zgj*p4N9htIr-+P+xlp=&ECkVBVX8rP-=EA-VmmT~W_}T1*;$7ItAC(3`3Tu*L$NEK zf9rQ8`CMu1A7E%b&z2|bf+;5qlhbo64joF@p zPaf=j%Qdi<5StiKAX}07%-)}7h}!_F>m!xo(nt7kK-&$v@jRC z30>!n86!EzLvAP3?V<|(0CU#F++vgyaQ6zKXdqg{W`p3)$QsmW$caiQmxTal4Nkb34M3w>wTSw)kSAH`;ZK@L0^8r^Ll&*jbKI?{fBL$w2$t}u|n ztH<}{!p|uY4n1xa{tzdPQBHSwNXqneoTIJcr76Oexn?6r6?Y$oX3KQ7LejG}h&e&h zH^pF-+!=U`3Y|C&vi$fB2`c43L|h1>`yeN7&iKP!&i?%t0TzI=`O$F9-t+?KdRfeq z7$FDQ%%PfryyhN05mrjc%pO-i?MlxSk&C88u-d4R48O z`yKGHasyyp+FZai*${)pz2wdd0G%eT%}S!xsIPAmD5RVMAiyxH>TBx~V20q&;(r~K zoKH)Z%s7({PqJix9M@4wec1zx#OV&^FENId+1|Vz!_rvwX7gPu~C8C+o`>+qHC8@U(Gb% zgT`jK>!28uAH!HRigWs<6?!Jq)!94{|E}PuqoUrQ1$btEv0g|OEU6DwYnDh(E4lPA z8x%e?cXk+kckF>`b5@m0m^?ih!pz)DpSgFcP5`+7sCV0#+1YW^{t%{gTefdLZo-9` zRxjpQxFJO5rsWa+P1p!!HMaP)?}FOyP+-IEQBsQ~redZkE-l@mzm&o9f^nE)-h4zO z#eEk##J$?NwiA5Rb*5_@w$0By)9FB>0cZD*oAp$$anGeDyChV?j`VZW>RReVrfaKd zDS*2u#EsY&bcbJ=;|9Z5&9uxY62aMI1>F&-JQi_m5GD zl$D#N&As$8pLg&sr>Q2@%5=e;t-QrB#i6w5GfhKlK}J$qs#tDby!N)8r_GEPEJ?YH zx`uLF3gxnN6qEk2)A^drSoO*t)%Y0&Sfj8Vn6>LbL;LBzDX(%g-rlBl?y9bKvMP+; zoH_HU9*)Vkbd%ikou&2F8GZh=Ug6W&-K7e-QSQj1@~{3NwFN;Q&Ay`%n5-9>*I;dR zFY;opZLG^D8Gpp4e0KQ-y+c2lx_?DF9ZZAQ^ClxyF?YD^fDX&Nc}N{g#O(%YSJ|@Q0NDc2* zVj|2l8PNgg;hnRPb^RaFEJr+UFrUnW;I~g359l_&OBN1XkN1{OaR4eT5T}OCWnZxo z$<`;#NlfR6_{MMEz18JyGB}qrRNzdvrN{Qub5ni{l`&+Fc~9{?%mapU0v!*cc|FN~ z7{6%t;g5juXwWy*&$89FWH>Ap%sr%?811IWWEtn$E6DU9ZFzAO6a>(}b3CPk@%H|0 z?yt)G>3fJ(;x`0#!Ui&<_vkdTMFlOJJicemhP?ib0eFZ6?XSSmV;Vo+exr6G znD4ADl4({s%F*(O7E=7&ipQmT@#?2an1kasnFjiNT9N&HS2XY(+&+O1n-= za>uDJH^C@FM&Mn&+|%ZTGnh?LxySk=rOFjAm58NX&SaLgfe&5AjkIBg?YoHVMtvSN zZm0KW*=Ym|__Vtz_mkA#Htz(Z6iLGC<*=YxD3jL#$|0OdD;%Ms{^$)k)X^KDE`hTN zyMLnQ&#LTOP zVO{;;drK6V2Ia@csrpT=x~dBtD^hJ_2pXHK>71a8-Hyb3O7ESbbj3VYF7tg#6f~Ko za#cFSZs%d*M<+kRW}!n4mu78tAHtt6FVtAKH}x6JZL@2qDu)AY)pO3b>)G4g@^ zYQ+36;M7^ZRT)~Dy`_6}FR^!zi}1&wFvnrlea)M(&F`?W zqcY0M^k{#Q%(D*LT+YL%@TCi>Ip)5}`e{DOWI^`9d#_n+egUI%V-Dq6!^32+L*tXR zG#G#w&tXfl0eYu7QlY*?IH)Hp!;9l>g+&Qj-k)@DC&)E(;s}~$0QQBi(7w_kjYjmd z4CW!gQ`e5NK`rnBf6RK=(OA8=>y4875qmMJfSIxO^AxU%HPS3b>rADFuE9;*qO7-7 z)@`3weg;lyZP1Hz~5UWR-AnSf0s~MW?i-;7Cw3=w09UVujX874~w-`tqdDzXQI1E{-dx| zh0@P#quQSSyT4PP{Zf4I#c*RIioWWvOpLZs*I&rw&iT21mh;36cp)Pk6Sg%z3z1|fbz|~%ZaN5>*HZrCsKquE>=VvWDVgca`2i*kB8i; zQ$pKFpy5;y7p~#!Z>|>PlM58C0E%}t_>dl5u%p;i`2E1m;+p-QrSzi$i-`e-o1~-J zPt6t83cCGdsEXVS%QYPo`Kc$LVT55YZ*EiJNK#eas9MGo3H)jy%F)b8o@~-L3k+V9 zA2FT2c(ROR?{N1*pm@JVj^>UoNc!8{7Vv!qMk#C0h*tx?M3IdvRh@tF2E=ywJJbKn z70}C`sj(GyJe~yj@i$hSNYC8|Ak~pl{;Sv3$nBELsIj>L;qWXAwc7FU`m}f9^_VEC9ZZDSVzY2dl$gsdrsT@mkQe%1 z$a4HlzSBdAv03~0jYPZ4erwRi4)UR0?zmGh%%!stjqkq6Q1_n zbJ8Lt%>yg8EcuKxRNjYfaPO+chzKd7#EY~o!SNHBVFIhv{6qwb0Wkg4lsAUEgDEiN zdM*9BXc_w>g`NT7J@X<0r@!e7SitWJ<$J~_kLIt@rhPZ>{+yU~B#X9CR`{im0!jRaktG zy-;h*L(zUgK78gexeAm-vp+UK)%H$}T-2dS_7_WT`kB%C%Wso|-HGEP!z-`P7hupCW7#GJ&|d`<;E{38t7~1Ts@>ITF}NF;*3n2;e~|3{P;=3!fQ!z3`=g-9a~F^ zPYh2j&+bdeon}1an+)!tyjC(jc4AifCc`<{%c00MhZ8WgSQHqWgKzK zCwAJwy}oLi&%Nlr3cxmQ!d)_f5qB>JPlqaE%f@!OFOZx9$phiE7&)8 z_A4ry7E9=ft^*r6Z}s%EFI&uA`S8(YBuU)Mtkdz5YrLTAn9-mQ_TT0-`nY)xGUg&B z(`M2iUumkJ04lM*7X$Cv<2_4Pmsao^8iF3IT9I&mvi>P*X!4uoqWQt@W^TyDB!Dy2 zbgxe6a7>`9_vL^yYk0xFQf^|0)6_xKZr*WJ^5z?{#9&}&9O-Io(NE6wVr$iOKvwdd zp}}%;X;##k7Uq5eQ&6=`qJ_r!*%>O)vcKqL@{>s~S`*uieB^f#0a@0EUA2#Nzx&T0 zP~5L#SoOVWEm@W`3UswqPcf;oC}n5K@Ygc!jYUSrSgK7;c6pf<=%i*T(3-qkNx-u- zRy{P_G!_R4IjmrH3Ho{ZeI96Ej0=Xjluv>F(PSI4yhpqw&LJ(2WAsn79roWJ_3F$n zk+O)faRoD_V?S?PSa}MLZye)q8!e;?0_qdr@@@JUiIMk{8}!L>eGy|1j42>%k=dA^ zI&gY{->_eL&=!wW%SZa&_Y%p!ppI4yV2!04Xj%bEn#cagFs-X$6tI8=M;3ItulzA0 zzjM6gufv$l_|()Ag}!2Dv$!aD=Y|jsI0J$CDp5N#6fB3;0f;Wm>4(@Lj~%nI6ZsS zMNd55`w%sr>1vCPN#zc;R_qC`qv;^sbeh0UkXYf5uVwp$t1K@EN;`TERddBncdHYj|_VTCn8T{5R zzwD;J|)bk|Qt#Ayv_-yXb~0ATFIxpR$6G4E`KNN%!A-ofto?0M8y_Ni$;A{5%! zhe%h)jZkC)l3pjshW^`<{FI_NAX5U?zpOD_)udM0XmC~~UpIF(Gy`#r!LnZnIlm2je z&pneKfysu!Li9p*zpP1hr4!>~?kWxaswkH*2p}Xz&?9>3>`<*|oUqt$%)bMOULO6~ z?38pox8r)k644UUD19I68$j@8H^(J(Evs;DBKU$d-S0*OU3*^amkP+zHC+w0w`cRh3SEI;d(41466@T)Yn_@-CQ`!NJ6#Lu z|8@VV+qlhCYj~)nnvco-RbQK`wCu9lxF?Iv)|5dxMOm!ZK#TKLRkC^iFPxaiNBcsx zGsX6CN+!~oF3>(|3}?3Fye7ZoTGqZnt7Mus)qE5B2Iki;5`;5wc!Y$58t;{HQ=Mye zuCQ`VS=zTR);fuUsXh>+qoYTD8+1&#E$u4ph?p(*XOmEHbR& z%JaB&IGctU;8b~i_9e}{dmEbcjZErn>-X99Tvw7=4XqQ~)SCcXG%t(k@*?&8?nLIY z9W3DW5=lNU*$tkBnB?xdM4DEQfNvwjNo0>=Uoks~`^wMQr+D>a9CT0Nb& zjv*mCUU9WTiMwMH7_S%4=ArCG3)q!^R-=(B4#K?Kg?olr^lIJ`Sqg}b9X58UJ|5hb zKLkur$ae#Q+W=ktp6sZ=y|k*P!=jD4`u>dN%Z$j;-^_`oba`X(;4WjLL+Gi%?t*2$ z*}ezhx2ekd@{4c!WZmmc@xsZH$2+<$#4}K#(you&Qxk5XZWcviqg`s5%Vac_KsmyZ znLW#|WSYTNj6FC0Wy8wH4&zLf_OOq2P<7r_r~#)4j%ZyW5vxdR1PajBkFJ;6{fWC` zlA9Mq-`erDa9L=aJ~AbUM(mC4@6wcSRTiv(8tez&GkV8$$#A{?!u~^rZUHtB{OPI# zr6-}+dc#D5aa8|b4g7{J2-n+R?qkhZiR9m<2U{^_?F6oG~Us}s)k}sl_4iNc+p9bula64rm;AuHEcQ-c7@K zh8pkeuW=?Gz_bsDW%i>Osp0+wwCU$R87zpOX5pk$*o*U-#+;p|vp5%7$20$9m1(Qa znUc>Da7n_Ij6P1r%VMOmd$y5iBrZnO|GR}gqW<~5VS%ZNg<&FT%VsZ{qgO;LO(d!A ziBJ}ZT5qvmoWn2ZVEbczPCJHkx5!&J9zuf*vdX;gZ2;yB-HHY*c}I2+xPGTK6fTZC zzxzyA#n_6XId7<{S9oZ%?7GMrgI!6bM#0r^@9}mV5!f z?(|6p*_Cs4WS2e&s`Nu&Lodm0Sbu2=koW7i)o1!oK{Or~%Kqtz6KXSNhp%C?lVP0V` z;m1>i!nUQ<5WEp`3iwky`%TNo=t<$@MYa(SAL~Cujo5dR;D`=#(u5KarU^g&S?HhO zD)}wjRT;H^#$L2LFYc&B*nFs(3@N8P4d^<#0M*4_rD66?%7tiD6Qo6ruBEY{6+%v# zV8)vbn%xo3R6N@|jGUV_CJ}aCljbz{mD;P5vu4IotEdwsu!c-S4%@#c$eQTk^7tx& z!sb3H4P^Otp9yc(Cpt#iPz=lGTxB$f-|r%bNYh)w=(pH>Wnx$*rpdj%jPRW!N^ikP zMU>lX`HL9y#KzF@rcC{baG#jRX$zlLD88i%JvrCc2=lt-fRR27feEc_7sjKl(OOZ{ zRoPxjH-WE!Qbgpt^v&*UbH(r)JKS2j{jaZI29jwl&b(oC6qB6Xr`4P$!giJH?H!ku zz#}a%k|T^QEJf&?ivck`-w;{^@-Ge&*G_Ttq6*)n8N;ks;B5m3-QAW!o-ZDx9eDgD zs!K3r?4+r+Qmj?=;NJ7=o0R-Q&l!ke(pMv#A4KyUSX=S!cJ-60^&%mu@Q&70{U!NE zet19E5KTd{rTy_(`kJS`e?N!De73v@*-zR^?(`Vp6nm(t?U$nWQ6<<2y&*;IO4M%r z;F)$LC5Z-g6Es@$Q|FEycd_>VrW}=< z`Nd)HX)XCCqyjto3koLRYJ+w9EH-KID>Y|lj+oa3*XST=Q1JT+#w%$7rW7tr8%$bf zaGi<@6)R{N8ZD!iGDANe{weny8W^QBpO|?7&@QM$c>KztbkXLlf7ycSg&K{mti9Ym zICSy-e5wqbyhK%52<4M&REdwoAL582AL?j_y^z}NS0eRk)AWkojXS9O%SG|nul^0EPww4 zQ9fSuskFPvDhmd-^DF$S={<&ab_NlKvx)dxetZ+gL))#YWNPx zV7whFq_tMH4&bO{3feTK{c*NC0;d9qs6KwH*YJL8&N+L316D99F#JI1`QT^PmZ8(JtEil>{O%6&2pv?_2+GvmXdV;g3+`1K{UnxauTIp^>AI7HOF63K6TJW=?}?w3 z`8|w1sB@!iFW08O-7ZJdFL}N!3sXVG99&;LJ_yEF`zEyHQ5Y4c`9~z^kTu|oMt}29 zoq2vC1nUX4>!V5m^r-?G9WsBYk8#m<`_|L*xW+VdgNPy&1-p|{1!>FZvBhZH3%Dhw z2^)f7B*f%~zGR@o5N$@ySt1Wa%eoI6qs$=DyW6HlN6OEMiWW~#8tyM1FzwwNZj2}M z87?5Deffs-TmOxIAMJpVULQ5eR(n3N98a{40#Sou;wFjdm$>I&A^_L5&)R8V3$1<| zB23WOCJd7CB+K*@NAmu(^Y-VwefX2T>wF2b8t-9hrSBZACsO}_(`g}Vr4D)?rBBfdLvhdhdR2g? zKnA)4bvl{S{O5vBJz4LMjG6oC_a%p~W;K0+R(4oK?Oh-5McuE@Ax8~EqBSvEnZcCY zl%N9Qfc%>ZOZ^6=su}>Svg`~mZ!(?iBXwA{&u4T+flGgxuShM__WDg%;p|3>b8d3I zHZG9!!1VY~SB(1tm6z#itRU1_5%MT7_+3kzkGAdtrPt6yc^ChCYKsOKw=+9Omh_@$ zJ@;CN%dveM%=>^q}3kjpyh4JB+8 z#I$+ySn1EKu(rF}_24`m46SmPYSWuwN}r*t;8(Y=wR{`Q^n6CPM>g6VI`4u`M=nDH z&B)Tv^UA{|v^L4$(HZ=3rdIdLqs`AdmkeC;erBgPmIJo7RW$Eq2)B$8gHWUlae5b@ z21V7m%eb@3D?lTYVv|<>sN4>x6}&aP5y966Y6(>QFp1yRnHY}y049xXlD$eS_5x*? zOs~TT@Hn+} zEynQ3s)sD2eZjX?ZP)93XdG3=PA*{vs>7V%7H#F-Q+hp_?-}QFc)ORB#{$Ul9 za8VD~84H{;*c@!P0q#{OW;w%3#_1R7t9sPQlR}hutlUDSI zTDWMl7So?I%Ng9pkTUY384NR5GbU3#y>=N^BVg05P}C}_T`JLV!>)=+d;W8j?dUBE zH`DdreLI-lA|!~+EBNf zpl$d4c^vVs&GI7e={F+{uFM@VnTo6nb^I5of_D!Hk3lcevZP*ExN;e6ZSCpE$&7FAt?ucMY?JAXOWoV0V zB85S#{l-(l$uje0PA(pmo6C6^;@4fz z9q+dWv_3+VZ!QBJLGR8@nO9yGHGB#W-z3|DSq7B%R)6=Dek}lJ7+~W!8!o7%ZNLr@ z;(Mq}uNp zrU?6T%14PzsZCRjHjhNQVUw`nxdQxtUa|U+B-IkK0NY}*gsziHWce=T+0des005;x z9p4K&sXyW;?msyJ-V9_L3_wQLP50U=#?DRuC`^kb>oxxpq@Y`rzG>%5xN-6Ka|-ou zsmO}%hzs2fYNT+a%cg4tx#l%JsBXcmD!CZw)hEAR|1OgDz3$>Q_-Vr%2c?q~_4O3m zX^yf!<^x4^HfgITU)|1CaEq0WmUKa}-2pRItHjKA{3{G@z%6cZI@5#b^-!gbtLOAP z=_i^u0B>ddocYyNfK72)<8YA%x@AjYjuReoHskc%q^}rb23lnudiw^;DC(@?ooRc$7ah0@Q zunNNR41@fr+0&Cif$txOjZY7m@-n+5^ay6%`@AdHn0~(B<^<*h zPr3T~bB5|yYC18i-?hNa(;j-PqBJK-6mXxSJmje*s3U$%9ZIk_fA zWqRq#!3((-7UasC1T7=OW4$fx(A1*}t-LQL!J7OcmLuwaSMKF@P=y0n7^3Z6Y$@k& zuD{O>v78TMR{iZar40Fhhnp9J>Rshdo{wepl&)kU1`H1^`4fC1W$(3^hH;XTInIvdG z=5B)hwo384>2U(K)pOl?qAy?H3}-<(f@mDh-*GR0_e-#4voQMd!hmO-mR%0sz>;=f zDjv`Z9O&W#w|kU4bo&K8@{`@RS?KUr$IKw79aBYT@Y$5N0i&KCp83 z6Elm7^%+wpH@m+LYM)C<&j#z2Fc$cz6BOH3IgTvHeCKY!A`;&Wxi1e2nACKW-aK;S zFpKCe*s}JH^P>=$9g6} zy_l2u>+Yrc1ZK^Br2)p>C}?&4d1K61Y%FG#9_spfF5r1B!Ys#gT>pOAJ&Sh}G&$|S zEWDdyK`&#mAedopT+0=dX^9)R-o%!FcxPj-CQB(}uiSbQaId+}DFIhsyaY`0ojk8C zzKLnI9Y_cvgos5Y6h^`)mmzgb?*2;J$=~)*jIS_1)XRZS82xsq<8IJ0XM+qB`PEBhrk2?SVI< zLF#*f=lBv0`w{(6Iy|3TpA>UKg1Aw>EGToyQyGIFP+n3p`qUub}`_qgZWt8OQR5JIG1 zz=3UBb7=$A_j3&_;4a3p>kA=&gb<=m1RTJ(fcNUWz8~=%f3(iay#V;Gx|%wn=dIVcytmJvj1Fmw{7>Fgz-38c; zXgBIDhaV8UfwvGs2q97~;BW%&^Vt4lQS+)3X8*d;+m&q#jITjG&!aJx z$Au6=h=vt#3xLCcYnwn+cL8@}iG$y*@LG$ot$V8eh&PWaH2Wq z1Gl;lz+hL7?c9I20ww}&Wn8n@iP5XwXQjHC5JCtME=k(V-pAU1z*JxpZ25196Ljyn z&mzp4_8Kr7%c&MeN|JUb;Fbex0F!~kfTNu7I=JtP0h`(5%Jf%YOW-=-ddzCL9P@4K z#{B4NO*6LSx)HYIx|aJ4cF!W`p2Hl>XK*IA1YI)P%w7l~gh;r66G8|fgb>xyq$&_X z2qA=!fD=LpA%qZ25^zEYA%qY@0!|1agb+dkP6#1{5JE`62_b|KLI?>sA%qY@2njeL ngb+dqAps|Z5JCtc{QUm_Qoa=jH;gv;00000NkvXXu0mjfj3L3I delta 3881 zcma)9X*3iL_nt9B7?c@H)*1$pG5d_6$c$kUvi8fGv8E8&i$)@pWf<9aBeYlwSu;sl zvZo|_WzF`(FB0|l{?B>8yziIy!@bWr_dfSI=eg(H5BJ_(o==HDtvEANLt#N_K>z?C ze3q_naeyfYk;cz=kO@nJ83!QXOSka{05lZ;6~K@Z-5>yfyu^MWn5aZVx}b@q<0P^M zhCm|WN$SV3Xbb^`#-VU%Bo?QIM{D7+Y&xWg9V-;d1_?#8fx-zu0y{~VEKES6iAW5= z3WL!?W7(gCRoI3i!bc9OWF#7Ag~4fI&{_mC+f_t~y)P{K-wk;Y1RE;u#J(#cg+QZS zoQZB|29m7l?uukM<6RCCmWXt9Clj#lE(8}m8qIz!LQ^EVxiBz9G66}zVqK6Jj2i*T zAY;%-7iY2?150#g5E$%}htD9~an2+cvMV0RaA#nUBxgM4Kw6WG{1?d;gCV+MG%@U? z!&CnoQ3^`<54(;~^Mf^1LDB49F$wlH(Yybfg#)4gUc|q(LfK!%Q0zu=JrM4|?Y=nq z|4~!IhnGko;0Wwe2`mVMC$h&SNFWRW{aixw8VcOq_3RKk&On1Hv~X5m&no2ea_-F< zYnoh#uIv$|6SOzr_%njO0t%ilhlXf6Ml?H5&yqMB z$nN4#?jlnaI_Nbmd+wpUqyE!CpF@p2V|yZhf`OJBle+vh(24<*1A@l1WLm0Qs)|B{ z)Ej*(Q#znFv@+??EtGxXo5@(L@E+gAt9oQUkjH#WrCOjRqRRz=6thv_awunzt)XE3E4&%1dKcZ?4NH)id>dG>=DDscDXu6cF6{-54 zIZWPhFTKs|RN91jTEGak<>SkNo%~WN-Q4 zm+*c-DH*}Zw?Xf&MA@>uFMWF+J!utzimaip71r^Ie}zs<&tzXOrYh`~@+w@BN7kYK zwmBZtR?zq7>q(&wZNbS@8aH3=$lxJvKk`J!KdFUYo91s7ieylY2D{ z;(22I(hPQsXH{+UXKDc`13i|koc42BaQasy>GGkVo0b~D)tUm?V%64Wu}|l9deT<< z@&@-8q4}+Gwzw-|&E`oUN!t^g_stp?Q{dw5vYnlYLkcax9`()84#8e`**&OsSng)S zJ08(o{&Dk}46{vJM)2ngS;RjW=Cj+!KH4}{&Te9_yfjIXD09$5zLS05`BLNK+i1K@ zNO>D(yD-h1v%?lFkrjdCk!x-oIJG_@1G8az7$OMpGjHyY*d70O96Daho568G&naL>S>y z2s-&SqMbf&yK+_5Rp;1ZqGh>_r^93=Rn_c=tBAM4tZ%@zgNFcn=F^Sr6T0&fhthdQ zero#QO43{7gS`trdOEgE4RuN_uR&y0&Vw!`EZS1uC2f5GByjHe0(lTFNCiz~p`swF+zwqS1PnY=i2zS2^E4DskDy=)@ zcW8j~5^m@@n0re;U(+eOPUqwB4~fSxP*)y*yrL%>2)w`(vvcZqDfcz8h7QK7#Xu&% zJ-yphZx=-y_FCH!H+NOEd%<%5!kqiz>Z*8u*di255W3I0%CQ6NR)rt?!lnMMHruOTo_z=Lj)|ze>b~TtR0yYr*&40d7d9^4&<-8r*2-0nZ zuhd+;^Ft^3fBtXbmBcs|(I3jZ`2lBk)eLB^)DXoI+07I1YdJ^Zc_3SQDR!+FF;Q;#&W|%v5)_NJUVjo7 znQ6Qy8RW|J6S+Z^ZwQ4 zZ|^(4yJski5)S(Wy|LM;kH*_r^8QjdHg2i%*Nr~`=5oQjUsgY_$FE-V)JhN74Ur3= z@zxE9*Z*^NdawRuGOXTDYb0Er8y;Zz=V?k=6f=tTuo%Vvq5M-Wwg`F$U)NV)pITZ% zqu(58s$9CT)zj2&61-)IDmOr;mQv^iBVCV_d~Wcc;*sV2%pq7jNQMqw590t1a~rrx zve3a^Ze~_L86y5j#hQZsduu#V#?*JhthzN2XZp+{h4P46`OCv&OJ5SxyHXZyliQrg zWaN8gN7o4NH|bP@600ui@0)jtn$)b`98yCJw9+1eL_tY1a}v~fIg|q?E^~!)q43MG zC1;%4omuU)xCKhv8~rl<)4sO@X0J<(J53mDi+0X^K)yMCFmRPR>vcI`h0zDe+Xl6Tfsq1@m|q=l%gRNRe81bd zsI~QCy{RF{LrQb)2EL=qG=+7cfZ6|9pe#V#A_rVU^qrJeSM;z64Un1WfQB>2{KbqD zWFO<;4?Lh%)J<{{?8*5xj?8GCpl1xQ*sgneHO{D|B)j?|y{`?sxca9F^5J!R;7AD4 zLK$(ahkA{|m0uVOIU03~ua7KpuFJ+&BbT&nmipdqd}|==rE<>`0K%3YIGOPNjR)^i zfp+tzm=#~7F&!8p+ye8N05g{cRFM-|y%dT+PCj_#qeRR1tB=h^yfRr7G}XoO7QM$! z_tW!Ui$Up84bJI>%|#vcxo0mZ`Nflt*$G~fQBel)TG0^xfR!cmj5Avc-g0JLwt?u& zulCMGt&t!Z1>Q|J{&ME87j@l1iem)0w_>hUlZBaNR1Jt4dJ#EKWvXv#qtMx|lAQ?O*l;W{D`8zs+=`V5!J9QPQ&*Whn|2QX>_40=};kFsR() zcK(rQk>*hE86{j_lq*XmB2Xk1cMtX9sBAj{zG9%+p38tE4NE$@qr^Zkx`uUy#5fJ! z(8#ij%hf#fCYkA9GtP#c;FN1fk5)iDwWbl8o%0j1bI;z0ix`-|E)EQm}dAo(ks8j zp7$3>o5^URTSS9>Zk|t6f+O_k|I}Br?C6SVykaKICYDZ{oNh_j!pN$_wi%C`t>%W@{f<+<9fLe7MN`Xf2zJ<@P){gF{`f54(+_Eii49oy(j-1gN!Qo zYP*vF+bmyOrFtI}Pq_J@n+&+((*17n;M$Q7Zj|d8)}6C86HCI|q!b=oJb{p$oIFaG z%4A`&a5q<1O83F#Bnzl2!Ym97lsWN7HFu@}7>8sJUzd`#gQpj8mS(D7L2-)wKP92W A_y7O^ diff --git a/vtlib/Vtiger/Link.php b/vtlib/Vtiger/Link.php index 72b71d782397..c624470e6bb9 100644 --- a/vtlib/Vtiger/Link.php +++ b/vtlib/Vtiger/Link.php @@ -24,7 +24,6 @@ class Vtiger_Link var $linklabel; var $linkurl; var $linkicon; - var $glyphicon; var $sequence; var $status = false; var $handler_path; @@ -53,7 +52,6 @@ function initialize($valuemap) $this->linklabel = $valuemap['linklabel']; $this->linkurl = decode_html($valuemap['linkurl']); $this->linkicon = decode_html($valuemap['linkicon']); - $this->glyphicon = $valuemap['glyphicon']; $this->sequence = $valuemap['sequence']; $this->status = $valuemap['status']; $this->handler_path = $valuemap['handler_path']; From c8f188f117b75361f7b50db7fd5cde5620e98067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Skrzypczak?= Date: Fri, 4 Sep 2015 09:29:08 +0200 Subject: [PATCH 141/489] Added 'Managing the advanced block' template in the 'Edit Fields' panel. --- config/version.php | 2 +- languages/de_de/Settings/LayoutEditor.php | 8 +++ languages/en_us/Settings/LayoutEditor.php | 8 +++ languages/nl_nl/Settings/LayoutEditor.php | 8 +++ languages/pl_pl/Settings/LayoutEditor.php | 8 +++ languages/pt_br/Settings/LayoutEditor.php | 8 +++ languages/ru_ru/Settings/LayoutEditor.php | 8 +++ .../modules/Settings/LayoutEditor/Index.tpl | 31 +++++--- .../Settings/LayoutEditor/Inventory.tpl | 62 ++++++++++++++++ .../LayoutEditor/resources/LayoutEditor.js | 71 +++++++++++++------ .../resources/LayoutEditor.min.js | 2 +- layouts/vlayout/resources/app.js | 6 ++ layouts/vlayout/resources/app.min.js | 2 +- layouts/vlayout/skins/twilight/style.css | 6 +- layouts/vlayout/skins/twilight/style.min.css | 2 +- modules/Settings/LayoutEditor/views/Index.php | 2 +- 16 files changed, 196 insertions(+), 38 deletions(-) create mode 100644 layouts/vlayout/modules/Settings/LayoutEditor/Inventory.tpl diff --git a/config/version.php b/config/version.php index 9e6d991347ad..def64c48e99a 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150903'; -$YetiForce_current_version = '2.2.58'; +$YetiForce_current_version = '2.2.59'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/languages/de_de/Settings/LayoutEditor.php b/languages/de_de/Settings/LayoutEditor.php index 594b2a2e8bf5..c2fdf729a24e 100644 --- a/languages/de_de/Settings/LayoutEditor.php +++ b/languages/de_de/Settings/LayoutEditor.php @@ -101,6 +101,14 @@ 'PLL_DEPENDENTS_LIST' => 'abhängige Einträge', 'PLL_ADD' => 'Hinzufügen', 'PLL_SELECT' => 'Auswählen', + + // inventory tab + 'LBL_MANAGING_AN_ADVANCED_BLOCK' => 'Managing an advanced block', + 'LBL_HEADLINE' => 'Headline', + 'LBL_BASIC_VERSE' => 'Basic verse', + 'LBL_ADDITIONAL_VERSE' => 'Additional verse', + 'LBL_ADVANCED_MODULE' => 'Advanced', + 'LBL_BASIC_MODULE' => 'Basic', ]; $jsLanguageStrings = [ diff --git a/languages/en_us/Settings/LayoutEditor.php b/languages/en_us/Settings/LayoutEditor.php index 0395c6801e76..2dce391dd990 100644 --- a/languages/en_us/Settings/LayoutEditor.php +++ b/languages/en_us/Settings/LayoutEditor.php @@ -97,6 +97,14 @@ 'PLL_DEPENDENTS_LIST' => 'One to many', 'PLL_ADD' => 'Add', 'PLL_SELECT' => 'Select', + + // inventory tab + 'LBL_MANAGING_AN_ADVANCED_BLOCK' => 'Managing an advanced block', + 'LBL_HEADLINE' => 'Headline', + 'LBL_BASIC_VERSE' => 'Basic verse', + 'LBL_ADDITIONAL_VERSE' => 'Additional verse', + 'LBL_ADVANCED_MODULE' => 'Advanced', + 'LBL_BASIC_MODULE' => 'Basic', ]; $jsLanguageStrings = [ diff --git a/languages/nl_nl/Settings/LayoutEditor.php b/languages/nl_nl/Settings/LayoutEditor.php index 0395c6801e76..2dce391dd990 100644 --- a/languages/nl_nl/Settings/LayoutEditor.php +++ b/languages/nl_nl/Settings/LayoutEditor.php @@ -97,6 +97,14 @@ 'PLL_DEPENDENTS_LIST' => 'One to many', 'PLL_ADD' => 'Add', 'PLL_SELECT' => 'Select', + + // inventory tab + 'LBL_MANAGING_AN_ADVANCED_BLOCK' => 'Managing an advanced block', + 'LBL_HEADLINE' => 'Headline', + 'LBL_BASIC_VERSE' => 'Basic verse', + 'LBL_ADDITIONAL_VERSE' => 'Additional verse', + 'LBL_ADVANCED_MODULE' => 'Advanced', + 'LBL_BASIC_MODULE' => 'Basic', ]; $jsLanguageStrings = [ diff --git a/languages/pl_pl/Settings/LayoutEditor.php b/languages/pl_pl/Settings/LayoutEditor.php index f5a08e88bf81..299b9f9d1e1f 100644 --- a/languages/pl_pl/Settings/LayoutEditor.php +++ b/languages/pl_pl/Settings/LayoutEditor.php @@ -98,6 +98,14 @@ 'PLL_DEPENDENTS_LIST' => 'Jeden do wielu', 'PLL_ADD' => 'Tworzenie', 'PLL_SELECT' => 'Wybieranie', + + // inventory tab + 'LBL_MANAGING_AN_ADVANCED_BLOCK' => 'Zarządzanie blokiem zaawansowanym', + 'LBL_HEADLINE' => 'Nagłówek', + 'LBL_BASIC_VERSE' => 'Wiersz podstawowy', + 'LBL_ADDITIONAL_VERSE' => 'Wiersz dodatkowy', + 'LBL_ADVANCED_MODULE' => 'Zaawansowany', + 'LBL_BASIC_MODULE' => 'Podstawowy', ]; $jsLanguageStrings = [ diff --git a/languages/pt_br/Settings/LayoutEditor.php b/languages/pt_br/Settings/LayoutEditor.php index ec165c5e3546..fc150beff055 100644 --- a/languages/pt_br/Settings/LayoutEditor.php +++ b/languages/pt_br/Settings/LayoutEditor.php @@ -97,6 +97,14 @@ 'PLL_DEPENDENTS_LIST' => 'Um para muitos', 'PLL_ADD' => 'Adicionar', 'PLL_SELECT' => 'Selecionar', + + // inventory tab + 'LBL_MANAGING_AN_ADVANCED_BLOCK' => 'Managing an advanced block', + 'LBL_HEADLINE' => 'Headline', + 'LBL_BASIC_VERSE' => 'Basic verse', + 'LBL_ADDITIONAL_VERSE' => 'Additional verse', + 'LBL_ADVANCED_MODULE' => 'Advanced', + 'LBL_BASIC_MODULE' => 'Basic', ]; $jsLanguageStrings = [ diff --git a/languages/ru_ru/Settings/LayoutEditor.php b/languages/ru_ru/Settings/LayoutEditor.php index 0b353f8ea3a5..2d8c5aa08331 100644 --- a/languages/ru_ru/Settings/LayoutEditor.php +++ b/languages/ru_ru/Settings/LayoutEditor.php @@ -102,6 +102,14 @@ 'PLL_DEPENDENTS_LIST' => 'Один ко многим', 'PLL_ADD' => 'Добавление', 'PLL_SELECT' => 'Выбор', + + // inventory tab + 'LBL_MANAGING_AN_ADVANCED_BLOCK' => 'Managing an advanced block', + 'LBL_HEADLINE' => 'Headline', + 'LBL_BASIC_VERSE' => 'Basic verse', + 'LBL_ADDITIONAL_VERSE' => 'Additional verse', + 'LBL_ADVANCED_MODULE' => 'Advanced', + 'LBL_BASIC_MODULE' => 'Basic', ]; $jsLanguageStrings = [ diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/Index.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/Index.tpl index f22c06cf7176..f1671c0636b6 100644 --- a/layouts/vlayout/modules/Settings/LayoutEditor/Index.tpl +++ b/layouts/vlayout/modules/Settings/LayoutEditor/Index.tpl @@ -6,6 +6,7 @@ * The Initial Developer of the Original Code is vtiger. * Portions created by vtiger are Copyright (C) vtiger. * All Rights Reserved. +* Contributor(s): YetiForce.com ********************************************************************************/ -->*} {strip}
    +
    -
    +

    {vtranslate('LBL_FIELDS_AND_LAYOUT_EDITOR', $QUALIFIED_MODULE)}

    -
    - +
    +
    + +
    +
    + +

    @@ -33,6 +40,9 @@
    @@ -53,7 +63,7 @@
    {/if} -
    +
    {foreach key=BLOCK_LABEL_KEY item=BLOCK_MODEL from=$BLOCKS} {assign var=FIELDS_LIST value=$BLOCK_MODEL->getLayoutBlockActiveFields()} {assign var=BLOCK_ID value=$BLOCK_MODEL->get('id')} @@ -835,6 +845,11 @@
    + {if $INVENTORY_BLOCK} +
    + {include file='Inventory.tpl'|@vtemplate_path:$QUALIFIED_MODULE} +
    + {/if}
    diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/Inventory.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/Inventory.tpl new file mode 100644 index 000000000000..7078aeb87011 --- /dev/null +++ b/layouts/vlayout/modules/Settings/LayoutEditor/Inventory.tpl @@ -0,0 +1,62 @@ +{**} +
    + + + +
    +
    +
    +
    +
    + +
    +
    + {vtranslate('LBL_HEADLINE', $QUALIFIED_MODULE)} +
    +
    +
    +
      +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    + {vtranslate('LBL_BASIC_VERSE', $QUALIFIED_MODULE)} +
    +
    +
    +
      +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    + {vtranslate('LBL_ADDITIONAL_VERSE', $QUALIFIED_MODULE)} +
    +
    +
    +
      +
    +
    +
    +
    diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.js b/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.js index 505fdf8d6a12..6ee7f65d347d 100644 --- a/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.js +++ b/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.js @@ -82,7 +82,7 @@ jQuery.Class('Settings_LayoutEditor_Js', { updateBlocksListByOrder: function () { var thisInstance = this; var contents = jQuery('#layoutEditorContainer').find('.contents'); - contents.find('.editFieldsTable').each(function (index, domElement) { + contents.find('.editFieldsTable.blockSortable').each(function (index, domElement) { var blockTable = jQuery(domElement); var blockId = blockTable.data('blockId'); var actualBlockSequence = blockTable.data('sequence'); @@ -346,35 +346,52 @@ jQuery.Class('Settings_LayoutEditor_Js', { var thisInstance = this; var contents = jQuery('#layoutEditorContainer').find('.contents'); var table = contents.find('.editFieldsTable'); - table.find('ul[name=sortable1], ul[name=sortable2]').sortable({ - 'containment': '#moduleBlocks', - 'revert': true, - 'tolerance': 'pointer', - 'cursor': 'move', - 'connectWith': '.connectedSortable', - 'update': function (e, ui) { - var currentField = ui['item']; - thisInstance.showSaveFieldSequenceButton(); - thisInstance.createUpdatedBlocksList(currentField); - // rearrange the older block fields - if (ui.sender) { - var olderBlock = ui.sender.closest('.editFieldsTable'); - thisInstance.reArrangeBlockFields(olderBlock); + table.each(function(){ + var containment = jQuery(this).closest('.moduleBlocks'); + jQuery(this).find('ul[name=sortable1], ul[name=sortable2]').sortable({ + 'containment': containment, + 'revert': true, + 'tolerance': 'pointer', + 'cursor': 'move', + 'connectWith': containment.find('.connectedSortable'), + 'update': function (e, ui) { + var currentField = ui['item']; + if(currentField.closest('.moduleBlocks').hasClass('inventoryBlock')){ + thisInstance.showSaveFieldSequenceButton(thisInstance.getInventoryViewLayout()); + }else{ + thisInstance.showSaveFieldSequenceButton(thisInstance.getDetailViewLayout()); + thisInstance.createUpdatedBlocksList(currentField); + // rearrange the older block fields + if (ui.sender) { + var olderBlock = ui.sender.closest('.editFieldsTable'); + thisInstance.reArrangeBlockFields(olderBlock); + } + } + } - } - }); + }); + }) + + }, + getDetailViewLayout: function(){ + return jQuery('#detailViewLayout'); + }, + getInventoryViewLayout: function(){ + return jQuery('#inventoryViewLayout'); }, /** * Function to show the save button of fieldSequence */ - showSaveFieldSequenceButton: function () { + showSaveFieldSequenceButton: function (layout) { var thisInstance = this; - var layout = jQuery('#detailViewLayout'); var saveButton = layout.find('.saveFieldSequence'); - if (app.isHidden(saveButton)) { - thisInstance.updatedBlocksList = []; - thisInstance.updatedBlockFieldsList = []; + if (app.isHidden(saveButton) || app.isInvisible(saveButton)) { + if(!saveButton.hasClass('inventorySequence')){ + thisInstance.updatedBlocksList = []; + thisInstance.updatedBlockFieldsList = []; + } saveButton.removeClass('hide'); + saveButton.removeClass('invisible'); var params = {}; params['text'] = app.vtranslate('JS_SAVE_THE_CHANGES_TO_UPDATE_FIELD_SEQUENCE'); Settings_Vtiger_Index_Js.showMessage(params); @@ -1692,6 +1709,14 @@ jQuery.Class('Settings_LayoutEditor_Js', { addClickOutSideEvent: function (element, callbackFunction) { element.one('clickoutside', callbackFunction); }, + registerSwitch: function () { + var container = jQuery('#layoutEditorContainer'); + app.showBtnSwitch(container.find('.switchBtn')) + var inventoryNav = container.find('.inventoryNav'); + container.find('#inventorySwitch').on('switchChange.bootstrapSwitch', function (event, state) { + window.location.reload(); + }); + }, /** * register events for layout editor */ @@ -1712,6 +1737,8 @@ jQuery.Class('Settings_LayoutEditor_Js', { thisInstance.registerRelatedListEvents(); thisInstance.makeRelatedModuleSortable(); } + + thisInstance.registerSwitch(); } }); diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.min.js b/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.min.js index 8553ece9dc6c..8935dbe004d1 100644 --- a/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.min.js +++ b/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.min.js @@ -1,2 +1,2 @@ -jQuery.Class("Settings_LayoutEditor_Js",{},{updatedBlockSequence:{},reactiveFieldsList:[],inActiveFieldsList:false,updatedBlockFieldsList:[],updatedBlocksList:[],blockNamesList:[],setInactiveFieldsList:function(){var c=this;var b=jQuery("#layoutEditorContainer").find(".contents");var a=b.find(".inActiveFieldsArray");if(0c.children().length+1){var d=a.children(":last");c.append(d)}}},createUpdatedBlockFieldsList:function(){var h=this;var b=jQuery("#layoutEditorContainer").find(".contents");for(var e in h.updatedBlocksList){var d=h.updatedBlocksList[e];var k=b.find(".block_"+d);var g=k.find("ul[name=sortable1]");var c=g.find(".editFields");var f=1;c.each(function(n,o){var m=jQuery(o);var l=m.data("fieldId");h.updatedBlockFieldsList.push({fieldid:l,sequence:f,block:d});f=f+2});var a=k.find("ul[name=sortable2]");var i=a.find(".editFields");var j=2;i.each(function(n,o){var m=jQuery(o);var l=m.data("fieldId");h.updatedBlockFieldsList.push({fieldid:l,sequence:j,block:d});j=j+2})}},registerFieldSequenceSaveClick:function(){var b=this;var a=jQuery("#detailViewLayout");a.on("click",".saveFieldSequence",function(){b.hideSaveFieldSequenceButton();b.createUpdatedBlockFieldsList();b.updateFieldSequence()})},updateFieldSequence:function(){var a=this;var b=jQuery.progressIndicator({position:"html",blockInfo:{enabled:true}});var c={};c.module=app.getModuleName();c.parent=app.getParentModuleName();c.action="Field";c.mode="move";c.updatedFields=a.updatedBlockFieldsList;AppConnector.request(c).then(function(d){b.progressIndicator({mode:"hide"});window.location.reload();var e={};e.text=app.vtranslate("JS_FIELD_SEQUENCE_UPDATED");Settings_Vtiger_Index_Js.showMessage(e)},function(d){b.progressIndicator({mode:"hide"})})},registerAddCustomFieldEvent:function(){var b=this;var a=jQuery("#layoutEditorContainer").find(".contents");a.find(".addCustomField").click(function(f){var c=jQuery(f.currentTarget).closest(".editFieldsTable").data("blockId");var g=a.find(".createFieldModal").clone(true,true);g.removeClass("hide").show();var d=function(h){app.showSelect2ElementView(h.find("select"),{width:"100%"});var e=h.find(".createCustomFieldForm");e.attr("id","createFieldForm");var j={tags:[],tokenSeparators:[","]};app.showSelect2ElementView(e.find('[name="pickListValues"]'),j);b.registerFieldTypeChangeEvent(e);var i=app.getvalidationEngineOptions(true);i.onValidationComplete=function(m,l){if(l){var p=jQuery('[name="fieldType"]',m).val();var o=jQuery('[name="fieldName"]',m).val();if(p=="Picklist"||p=="MultiSelectCombo"){var r=jQuery("#picklistUi",m);var t=r.val();var z=t.length;var n=/["]/;if(o.toLowerCase()==="status"){var A=app.vtranslate("JS_RESERVED_PICKLIST_NAME");jQuery('[name="fieldName"]',m).validationEngine("showPrompt",A,"error","bottomLeft",true);return false}for(var s=0;s0){var v=app.getSelect2ElementFromSelect(r);var A=app.vtranslate("JS_DUPLICATES_VALUES_FOUND");v.validationEngine("showPrompt",A,"error","bottomLeft",true);return false}}if(p=="Tree"){var k=m.find("select.TreeList");if(k.val()=="-"){var A=app.vtranslate("JS_FIELD_CAN_NOT_BE_EMPTY");m.find(".select2-container.TreeList").validationEngine("showPrompt",A,"error","bottomLeft",true);return false}}var u=m.find(":submit");u.attr("disabled","disabled");b.addCustomField(c,m).then(function(E){var B=E.result;var F={};if(E.success){app.hideModalWindow();F.text=app.vtranslate("JS_CUSTOM_FIELD_ADDED");Settings_Vtiger_Index_Js.showMessage(F);b.showCustomField(B)}else{var D=E.error["message"];if(E.error["code"]!=513){var C=m.find('[name="fieldName"]')}else{var C=m.find('[name="fieldLabel"]')}C.validationEngine("showPrompt",D,"error","topLeft",true);u.removeAttr("disabled")}})}return false};e.validationEngine(i)};app.showModalWindow(g,function(e){if(typeof d=="function"){d(e)}},{width:"1000px"})})},setBlocksListArray:function(c){var b=this;b.blockNamesList=[];var a=c.find('[name="beforeBlockId"]');a.find("option").each(function(e,g){var f=jQuery(g);var d=f.data("label");b.blockNamesList.push(d)})},addCustomField:function(c,e){var d=this;var a=e.closest("#globalmodal").find(".modal-header h3");var b=jQuery.Deferred();a.progressIndicator({smallLoadingImage:true,imageContainerCss:{display:"inline","margin-left":"18%",position:"absolute"}});var f=e.serializeFormData();f.module=app.getModuleName();f.parent=app.getParentModuleName();f.action="Field";f.mode="add";f.blockid=c;f.sourceModule=jQuery("#selectedModuleName").val();AppConnector.request(f).then(function(g){a.progressIndicator({mode:"hide"});b.resolve(g)},function(g){a.progressIndicator({mode:"hide"});b.reject(g)});return b.promise()},registerFieldTypeChangeEvent:function(f){var e=this;var b=f.find('[name="fieldLength"]');var d=[{name:"DecimalMaxLength"}];var a=[{name:"MaxLength"}];var c=[{name:"FloatingDigits"}];b.data("validator",a);f.find('[name="fieldType"]').on("change",function(o){var i=jQuery(o.currentTarget);var p=f.find('[name="fieldLength"]');var l=i.find("option:selected");f.find(".supportedType").addClass("hide");if(l.data("lengthsupported")){f.find(".lengthsupported").removeClass("hide");p.data("validator",a)}if(l.data("decimalsupported")){var k=f.find(".decimalsupported");k.removeClass("hide");var g=k.find('[name="decimal"]');var j=l.data("maxfloatingdigits");if(typeof j!="undefined"){g.data("validator",c);p.data("validator",d)}if(l.data("decimalreadonly")){g.val(j).attr("readonly",true)}else{g.removeAttr("readonly").val("")}}if(l.data("predefinedvalueexists")){var h=f.find(".preDefinedValueExists");h.removeClass("hide")}if(l.data("picklistoption")){var n=f.find(".picklistOption");n.removeClass("hide")}if(l.data("predefinedmodulelist")){var m=f.find(".preDefinedModuleList");m.removeClass("hide")}if(l.data("predefinedtreelist")){var q=f.find(".preDefinedTreeList");q.removeClass("hide")}})},showCustomField:function(l){var j=this;var d=jQuery("#layoutEditorContainer").find(".contents");var i=d.find(".block_"+l.blockid);var k=d.find(".newCustomFieldCopy").clone(true,true);var h=k.find("div.marginLeftZero.border1px");h.addClass("opacity editFields").attr("data-field-id",l.id).attr("data-block-id",l.blockid);h.find(".deleteCustomField, .saveFieldDetails").attr("data-field-id",l.id);h.find(".fieldLabel").html(l.label);if(!l.customField){h.find(".deleteCustomField").remove()}if(jQuery.inArray(l.type,["string","phone","currency","url","integer","double"])==-1){h.find(".maskField").remove()}var f=i.find(".blockFieldsList");var g=f.find("ul[name=sortable1]");var c=g.children().length;var e=f.find("ul[name=sortable2]");var b=e.children().length;if(c>b){e.append(k.removeClass("hide newCustomFieldCopy"))}else{g.append(k.removeClass("hide newCustomFieldCopy"))}var a=k.find("form.fieldDetailsForm");j.setFieldDetails(l,a);j.makeFieldsListSortable()},setFieldDetails:function(a,f){var e=this;f.find(".modal-header").html(jQuery(""+a.label+''));var g=f.find(".defaultValueUi");if(a.mandatory){f.find('[name="mandatory"]').filter(":checkbox").attr("checked",true)}if(a.presence){f.find('[name="presence"]').filter(":checkbox").attr("checked",true)}if(a.quickcreate){f.find('[name="quickcreate"]').filter(":checkbox").attr("checked",true)}if(a.isQuickCreateDisabled){f.find('[name="quickcreate"]').filter(":checkbox").attr("readonly","readonly").addClass("optionDisabled")}if(a.isSummaryField){f.find('[name="summaryfield"]').filter(":checkbox").attr("checked",true)}if(a.isSummaryFieldDisabled){f.find('[name="summaryfield"]').filter(":checkbox").attr("readonly","readonly").addClass("optionDisabled")}if(a.masseditable){f.find('[name="masseditable"]').filter(":checkbox").attr("checked",true)}if(a.isMassEditDisabled){f.find('[name="masseditable"]').filter(":checkbox").attr("readonly","readonly").addClass("optionDisabled")}if(a.isDefaultValueDisabled){f.find('[name="defaultvalue"]').filter(":checkbox").attr("readonly","readonly").addClass("optionDisabled")}if(a.defaultvalue){f.find('[name="defaultvalue"]').filter(":checkbox").attr("checked",true);g.removeClass("zeroOpacity")}else{g.addClass("zeroOpacity")}var b=Vtiger_Field_Js.getInstance(a);var h=b.getUiTypeSpecificHtml();g.html(h);g.find(".chzn-select").removeClass("chzn-select");var d=g.find(".timepicker-default");d.removeClass("timePicker timepicker-default");d.attr("data-toregister","time");var c=g.find(".dateField");c.removeClass("dateField");c.attr("data-toregister","date");g.find("[data-validation-engine]").attr("data-validation-engine","validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]");g.find("[name*="+a.name+"]").attr("name","fieldDefaultValue");g.find('[name="fieldDefaultValue"]').attr("disabled","disabled");g.find("input").addClass("input-medium");g.find(".select2").addClass("row")},registerAddCustomBlockEvent:function(){var b=this;var a=jQuery("#layoutEditorContainer").find(".contents");a.find(".addCustomBlock").click(function(f){var d=a.find(".addBlockModal").clone(true,true);var c=function(h){h.find(".addBlockModal").removeClass("hide").show();app.showSelect2ElementView(h.find("select"));var g=h.find(".addCustomBlockForm");b.setBlocksListArray(g);var e=g.find('[name="label"]');var i=app.validationEngineOptions;i.onValidationComplete=function(l,k){if(k){var m=l.serializeFormData();if(jQuery.inArray(m.label,b.blockNamesList)==-1){b.saveBlockDetails(l).then(function(o){var p={};if(o.success){var n=o.result;b.displayNewCustomBlock(n);b.updateNewSequenceForBlocks(n.sequenceList);b.appendNewBlockToBlocksList(n,l);b.makeFieldsListSortable();p.text=app.vtranslate("JS_CUSTOM_BLOCK_ADDED")}else{p.text=o.error["message"];p.type="error"}Settings_Vtiger_Index_Js.showMessage(p)});app.hideModalWindow();return k}else{var j=app.vtranslate("JS_BLOCK_NAME_EXISTS");e.validationEngine("showPrompt",j,"error","topLeft",true);f.preventDefault();return}}};g.validationEngine(i);g.submit(function(j){j.preventDefault()})};app.showModalWindow(d,function(e){if(typeof c=="function"){c(e)}},{width:"1000px"})})},saveBlockDetails:function(c){var b=this;var a=jQuery.Deferred();var d=jQuery.progressIndicator({position:"html",blockInfo:{enabled:true}});var e=c.serializeFormData();e.module=app.getModuleName();e.parent=app.getParentModuleName();e.sourceModule=jQuery("#selectedModuleName").val();e.action="Block";e.mode="save";AppConnector.request(e).then(function(f){d.progressIndicator({mode:"hide"});a.resolve(f)},function(f){d.progressIndicator({mode:"hide"});a.reject(f)});return a.promise()},displayNewCustomBlock:function(a){var e=this;var d=jQuery("#layoutEditorContainer").find(".contents");var b=a.beforeBlockId;var f=d.find(".block_"+b);var c=d.find(".newCustomBlockCopy").clone(true,true);c.data("blockId",a.id).find(".blockLabel").append(jQuery(""+a.label+""));c.find(".blockVisibility").data("blockId",a.id);if(a.isAddCustomFieldEnabled){c.find(".addCustomField").removeClass("hide")}f.after(c.removeClass("hide newCustomBlockCopy").addClass("editFieldsTable block_"+a.id));c.find(".blockFieldsList").sortable({connectWith:".blockFieldsList"})},updateNewSequenceForBlocks:function(a){var b=jQuery("#layoutEditorContainer").find(".contents");jQuery.each(a,function(c,d){b.find(".block_"+c).data("sequence",d)})},appendNewBlockToBlocksList:function(a,e){var d=jQuery("#layoutEditorContainer").find(".contents");var f=d.find(".addBlockModal");var b=f.find('[name="beforeBlockId"]');var c=jQuery("
    - {if $INVENTORY_BLOCK} + {if $IS_INVENTORY}
    {include file='Inventory.tpl'|@vtemplate_path:$QUALIFIED_MODULE}
    diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/Inventory.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/Inventory.tpl index 7078aeb87011..f3fe55453c26 100644 --- a/layouts/vlayout/modules/Settings/LayoutEditor/Inventory.tpl +++ b/layouts/vlayout/modules/Settings/LayoutEditor/Inventory.tpl @@ -1,16 +1,17 @@ {**} -
    +
    -
    +{assign var='INVENTORY_BLOKS' value=$INVENTORY_MODAL->getFields(1)} +
    -
    @@ -19,16 +20,31 @@
    -
      +
        + {foreach item=FIELD_MODEL key=NAME from=$INVENTORY_BLOKS[1]} +
      • +
        + + +    + {vtranslate($FIELD_MODEL->get('label'), $SELECTED_MODULE_NAME)} + + + + + +
        +
      • + {/foreach}
    -
    +
    -
    @@ -37,16 +53,31 @@
    -
      +
        + {foreach item=FIELD_MODEL key=NAME from=$INVENTORY_BLOKS[2]} +
      • +
        + + +    + {vtranslate($FIELD_MODEL->get('label'), $SELECTED_MODULE_NAME)} + + + + + +
        +
      • + {/foreach}
    -
    +
    -
    @@ -55,8 +86,36 @@
    -
      +
        + {foreach item=FIELD_MODEL key=NAME from=$INVENTORY_BLOKS[3]} +
      • +
        + + +    + {vtranslate($FIELD_MODEL->get('label'), $SELECTED_MODULE_NAME)} + + + + + +
        +
      • + {/foreach}
    +
  • +
    + + +    + + + + + + +
    +
  • diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Comment.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Comment.tpl new file mode 100644 index 000000000000..809114543679 --- /dev/null +++ b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Comment.tpl @@ -0,0 +1,24 @@ +{**} +
    + +
    + {assign var='LABEL' value=$MODULE_MODEL->getDefaultLabel()} + {if $MODULE_MODEL->get('label') } + {assign var='LABEL' value=$MODULE_MODEL->get('label')} + {/if} + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Currency.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Currency.tpl new file mode 100644 index 000000000000..809114543679 --- /dev/null +++ b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Currency.tpl @@ -0,0 +1,24 @@ +{**} +
    + +
    + {assign var='LABEL' value=$MODULE_MODEL->getDefaultLabel()} + {if $MODULE_MODEL->get('label') } + {assign var='LABEL' value=$MODULE_MODEL->get('label')} + {/if} + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Discount.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Discount.tpl new file mode 100644 index 000000000000..809114543679 --- /dev/null +++ b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Discount.tpl @@ -0,0 +1,24 @@ +{**} +
    + +
    + {assign var='LABEL' value=$MODULE_MODEL->getDefaultLabel()} + {if $MODULE_MODEL->get('label') } + {assign var='LABEL' value=$MODULE_MODEL->get('label')} + {/if} + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/DiscountMode.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/DiscountMode.tpl new file mode 100644 index 000000000000..809114543679 --- /dev/null +++ b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/DiscountMode.tpl @@ -0,0 +1,24 @@ +{**} +
    + +
    + {assign var='LABEL' value=$MODULE_MODEL->getDefaultLabel()} + {if $MODULE_MODEL->get('label') } + {assign var='LABEL' value=$MODULE_MODEL->get('label')} + {/if} + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/GrossPrice.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/GrossPrice.tpl new file mode 100644 index 000000000000..809114543679 --- /dev/null +++ b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/GrossPrice.tpl @@ -0,0 +1,24 @@ +{**} +
    + +
    + {assign var='LABEL' value=$MODULE_MODEL->getDefaultLabel()} + {if $MODULE_MODEL->get('label') } + {assign var='LABEL' value=$MODULE_MODEL->get('label')} + {/if} + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Margin.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Margin.tpl new file mode 100644 index 000000000000..809114543679 --- /dev/null +++ b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Margin.tpl @@ -0,0 +1,24 @@ +{**} +
    + +
    + {assign var='LABEL' value=$MODULE_MODEL->getDefaultLabel()} + {if $MODULE_MODEL->get('label') } + {assign var='LABEL' value=$MODULE_MODEL->get('label')} + {/if} + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/MarginP.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/MarginP.tpl new file mode 100644 index 000000000000..809114543679 --- /dev/null +++ b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/MarginP.tpl @@ -0,0 +1,24 @@ +{**} +
    + +
    + {assign var='LABEL' value=$MODULE_MODEL->getDefaultLabel()} + {if $MODULE_MODEL->get('label') } + {assign var='LABEL' value=$MODULE_MODEL->get('label')} + {/if} + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Name.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Name.tpl new file mode 100644 index 000000000000..809114543679 --- /dev/null +++ b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Name.tpl @@ -0,0 +1,24 @@ +{**} +
    + +
    + {assign var='LABEL' value=$MODULE_MODEL->getDefaultLabel()} + {if $MODULE_MODEL->get('label') } + {assign var='LABEL' value=$MODULE_MODEL->get('label')} + {/if} + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/NetPrice.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/NetPrice.tpl new file mode 100644 index 000000000000..809114543679 --- /dev/null +++ b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/NetPrice.tpl @@ -0,0 +1,24 @@ +{**} +
    + +
    + {assign var='LABEL' value=$MODULE_MODEL->getDefaultLabel()} + {if $MODULE_MODEL->get('label') } + {assign var='LABEL' value=$MODULE_MODEL->get('label')} + {/if} + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Purchase.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Purchase.tpl new file mode 100644 index 000000000000..809114543679 --- /dev/null +++ b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Purchase.tpl @@ -0,0 +1,24 @@ +{**} +
    + +
    + {assign var='LABEL' value=$MODULE_MODEL->getDefaultLabel()} + {if $MODULE_MODEL->get('label') } + {assign var='LABEL' value=$MODULE_MODEL->get('label')} + {/if} + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Quantity.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Quantity.tpl new file mode 100644 index 000000000000..809114543679 --- /dev/null +++ b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Quantity.tpl @@ -0,0 +1,24 @@ +{**} +
    + +
    + {assign var='LABEL' value=$MODULE_MODEL->getDefaultLabel()} + {if $MODULE_MODEL->get('label') } + {assign var='LABEL' value=$MODULE_MODEL->get('label')} + {/if} + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Reference.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Reference.tpl new file mode 100644 index 000000000000..809114543679 --- /dev/null +++ b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Reference.tpl @@ -0,0 +1,24 @@ +{**} +
    + +
    + {assign var='LABEL' value=$MODULE_MODEL->getDefaultLabel()} + {if $MODULE_MODEL->get('label') } + {assign var='LABEL' value=$MODULE_MODEL->get('label')} + {/if} + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Tax.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Tax.tpl new file mode 100644 index 000000000000..809114543679 --- /dev/null +++ b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Tax.tpl @@ -0,0 +1,24 @@ +{**} +
    + +
    + {assign var='LABEL' value=$MODULE_MODEL->getDefaultLabel()} + {if $MODULE_MODEL->get('label') } + {assign var='LABEL' value=$MODULE_MODEL->get('label')} + {/if} + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/TaxMode.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/TaxMode.tpl new file mode 100644 index 000000000000..809114543679 --- /dev/null +++ b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/TaxMode.tpl @@ -0,0 +1,24 @@ +{**} +
    + +
    + {assign var='LABEL' value=$MODULE_MODEL->getDefaultLabel()} + {if $MODULE_MODEL->get('label') } + {assign var='LABEL' value=$MODULE_MODEL->get('label')} + {/if} + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/TotalPrice.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/TotalPrice.tpl new file mode 100644 index 000000000000..809114543679 --- /dev/null +++ b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/TotalPrice.tpl @@ -0,0 +1,24 @@ +{**} +
    + +
    + {assign var='LABEL' value=$MODULE_MODEL->getDefaultLabel()} + {if $MODULE_MODEL->get('label') } + {assign var='LABEL' value=$MODULE_MODEL->get('label')} + {/if} + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/UnitPrice.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/UnitPrice.tpl new file mode 100644 index 000000000000..809114543679 --- /dev/null +++ b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/UnitPrice.tpl @@ -0,0 +1,24 @@ +{**} +
    + +
    + {assign var='LABEL' value=$MODULE_MODEL->getDefaultLabel()} + {if $MODULE_MODEL->get('label') } + {assign var='LABEL' value=$MODULE_MODEL->get('label')} + {/if} + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Value.tpl b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Value.tpl new file mode 100644 index 000000000000..809114543679 --- /dev/null +++ b/layouts/vlayout/modules/Settings/LayoutEditor/inventoryTypes/Value.tpl @@ -0,0 +1,24 @@ +{**} +
    + +
    + {assign var='LABEL' value=$MODULE_MODEL->getDefaultLabel()} + {if $MODULE_MODEL->get('label') } + {assign var='LABEL' value=$MODULE_MODEL->get('label')} + {/if} + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.js b/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.js index 6ee7f65d347d..4edf239a6539 100644 --- a/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.js +++ b/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.js @@ -1709,12 +1709,131 @@ jQuery.Class('Settings_LayoutEditor_Js', { addClickOutSideEvent: function (element, callbackFunction) { element.one('clickoutside', callbackFunction); }, + /** + * Function to register switch + */ registerSwitch: function () { var container = jQuery('#layoutEditorContainer'); app.showBtnSwitch(container.find('.switchBtn')) var inventoryNav = container.find('.inventoryNav'); container.find('#inventorySwitch').on('switchChange.bootstrapSwitch', function (event, state) { - window.location.reload(); + var switchBtn = jQuery(event.currentTarget); + var message = app.vtranslate('LBL_EXTENDED_MODULE'); + Vtiger_Helper_Js.showConfirmationBox({'message': message}).then( + function (e) { + var progressIndicatorElement = jQuery.progressIndicator({ + 'message': app.vtranslate('JS_CHANGING_SETTINGS'), + 'position': 'html', + 'blockInfo': { + 'enabled': true + } + }); + var params = {}; + params['module'] = container.find('[name="layoutEditorModules"]').val(); + params['status'] = !state; + app.saveAjax('setInventory', params).then(function (data) { + if(data.result){ + //Settings_Vtiger_Index_Js.showMessage({type: 'success', text: data.result.message}); + window.location.reload(); + } + }); + //window.location.reload(); + }, + function (error, err) { + switchBtn.bootstrapSwitch('toggleState', true); + } + ); + + }); + }, + /** + * Function to adding inventory field + */ + registerAddInventoryField: function () { + var thisInstance = this; + var container = thisInstance.getInventoryViewLayout(); + container.find('.addInventoryField').click(function (e) { + var currentTarget = jQuery(e.currentTarget); + var selectedModule = jQuery('#layoutEditorContainer').find('[name="layoutEditorModules"]').val(); + var blockId = currentTarget.closest('.inventoryBlock').data('block-id'); + var progress = jQuery.progressIndicator(); + app.showModalWindow(null, "index.php?module=LayoutEditor&parent=Settings&view=CreateInventoryFields&mode=step1&type=" + selectedModule, function (container) { + app.showScrollBar(container.find('.well'), { + height: '300px' + }); + thisInstance.registerStep1(container,blockId); + progress.progressIndicator({'mode': 'hide'}); + }); + }); + }, + /** + * Function to editing inventory field + */ + registerEditInventoryField: function () { + var thisInstance = this; + var container = thisInstance.getInventoryViewLayout(); + container.find('.editInventoryField').on('click', function (e) { + var currentTarget = jQuery(e.currentTarget); + var selectedModule = jQuery('#layoutEditorContainer').find('[name="layoutEditorModules"]').val(); + var blockId = currentTarget.closest('.inventoryBlock').data('block-id'); + var editField = currentTarget.closest('.editFields'); + var mType = editField.data('name'); + var id = editField.data('id'); + var progress = jQuery.progressIndicator(); + app.showModalWindow(null, "index.php?module=LayoutEditor&parent=Settings&view=CreateInventoryFields&mode=step2&type=" + selectedModule + "&mtype=" + mType + "&id=" + id, function (container) { + thisInstance.registerStep2(container,blockId); + progress.progressIndicator({'mode': 'hide'}); + }); + }); + }, + /** + * Function to adding inventory field first step + */ + registerStep1: function (container,blockId) { + var thisInstance = this; + container.find('.nextButton').click(function (e) { + var progress = jQuery.progressIndicator(); + var selectedModule = jQuery('#layoutEditorContainer').find('[name="layoutEditorModules"]').val(); + app.showModalWindow(null, "index.php?module=LayoutEditor&parent=Settings&view=CreateInventoryFields&mode=step2&type=" + selectedModule + "&mtype=" + container.find('select.type').val(), function (container) { + thisInstance.registerStep2(container,blockId); + progress.progressIndicator({'mode': 'hide'}); + }); + }); + }, + /** + * Function to save inventory field + */ + registerStep2: function (container,blockId) { + var thisInstance = this; + var containerInventory = thisInstance.getInventoryViewLayout(); + var form = container.find('form'); + var selectedModule = jQuery('#layoutEditorContainer').find('[name="layoutEditorModules"]').val(); + form.validationEngine(app.validationEngineOptions); + form.on('submit',function (e) { + var formData = form.serializeFormData(); + var errorExists = form.validationEngine('validate'); + if(errorExists != false){ + formData.block = blockId; + formData.module = selectedModule; + app.saveAjax('saveInventoryField', formData).then(function (data) { + var result = data.result; + if(result && result.edit){ + app.hideModalWindow(); + var liElement = containerInventory.find('[data-id="' + result.data.id + '"]'); + liElement.find('.fieldLabel').text(result.data.label); + //Settings_Vtiger_Index_Js.showMessage({type: 'success', text: data.result.message}); + }else if(result){ + app.hideModalWindow(); + var newLiElement = containerInventory.find('.newLiElement').clone(true, true); + newLiElement.removeClass('hide newLiElement').find('.editFields').attr('data-id',result.data.id).attr('data-sequence',result.data.sequence).attr('data-name',result.data.invtype).find('.fieldLabel').text(result.data.label); + containerInventory.find('[data-block-id="' + result.data.block + '"] .connectedSortable').append(newLiElement); + + } + }); + } + }); + container.find('form').submit(function( event ) { + event.preventDefault(); }); }, /** @@ -1739,6 +1858,8 @@ jQuery.Class('Settings_LayoutEditor_Js', { } thisInstance.registerSwitch(); + thisInstance.registerAddInventoryField(); + thisInstance.registerEditInventoryField(); } }); diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.min.js b/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.min.js index 8935dbe004d1..6b65fabfe198 100644 --- a/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.min.js +++ b/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.min.js @@ -1,2 +1,2 @@ -jQuery.Class("Settings_LayoutEditor_Js",{},{updatedBlockSequence:{},reactiveFieldsList:[],inActiveFieldsList:false,updatedBlockFieldsList:[],updatedBlocksList:[],blockNamesList:[],setInactiveFieldsList:function(){var c=this;var b=jQuery("#layoutEditorContainer").find(".contents");var a=b.find(".inActiveFieldsArray");if(0c.children().length+1){var d=a.children(":last");c.append(d)}}},createUpdatedBlockFieldsList:function(){var h=this;var b=jQuery("#layoutEditorContainer").find(".contents");for(var e in h.updatedBlocksList){var d=h.updatedBlocksList[e];var k=b.find(".block_"+d);var g=k.find("ul[name=sortable1]");var c=g.find(".editFields");var f=1;c.each(function(n,o){var m=jQuery(o);var l=m.data("fieldId");h.updatedBlockFieldsList.push({fieldid:l,sequence:f,block:d});f=f+2});var a=k.find("ul[name=sortable2]");var i=a.find(".editFields");var j=2;i.each(function(n,o){var m=jQuery(o);var l=m.data("fieldId");h.updatedBlockFieldsList.push({fieldid:l,sequence:j,block:d});j=j+2})}},registerFieldSequenceSaveClick:function(){var b=this;var a=jQuery("#detailViewLayout");a.on("click",".saveFieldSequence",function(){b.hideSaveFieldSequenceButton();b.createUpdatedBlockFieldsList();b.updateFieldSequence()})},updateFieldSequence:function(){var a=this;var b=jQuery.progressIndicator({position:"html",blockInfo:{enabled:true}});var c={};c.module=app.getModuleName();c.parent=app.getParentModuleName();c.action="Field";c.mode="move";c.updatedFields=a.updatedBlockFieldsList;AppConnector.request(c).then(function(d){b.progressIndicator({mode:"hide"});window.location.reload();var e={};e.text=app.vtranslate("JS_FIELD_SEQUENCE_UPDATED");Settings_Vtiger_Index_Js.showMessage(e)},function(d){b.progressIndicator({mode:"hide"})})},registerAddCustomFieldEvent:function(){var b=this;var a=jQuery("#layoutEditorContainer").find(".contents");a.find(".addCustomField").click(function(f){var c=jQuery(f.currentTarget).closest(".editFieldsTable").data("blockId");var g=a.find(".createFieldModal").clone(true,true);g.removeClass("hide").show();var d=function(h){app.showSelect2ElementView(h.find("select"),{width:"100%"});var e=h.find(".createCustomFieldForm");e.attr("id","createFieldForm");var j={tags:[],tokenSeparators:[","]};app.showSelect2ElementView(e.find('[name="pickListValues"]'),j);b.registerFieldTypeChangeEvent(e);var i=app.getvalidationEngineOptions(true);i.onValidationComplete=function(m,l){if(l){var p=jQuery('[name="fieldType"]',m).val();var o=jQuery('[name="fieldName"]',m).val();if(p=="Picklist"||p=="MultiSelectCombo"){var r=jQuery("#picklistUi",m);var t=r.val();var z=t.length;var n=/["]/;if(o.toLowerCase()==="status"){var A=app.vtranslate("JS_RESERVED_PICKLIST_NAME");jQuery('[name="fieldName"]',m).validationEngine("showPrompt",A,"error","bottomLeft",true);return false}for(var s=0;s0){var v=app.getSelect2ElementFromSelect(r);var A=app.vtranslate("JS_DUPLICATES_VALUES_FOUND");v.validationEngine("showPrompt",A,"error","bottomLeft",true);return false}}if(p=="Tree"){var k=m.find("select.TreeList");if(k.val()=="-"){var A=app.vtranslate("JS_FIELD_CAN_NOT_BE_EMPTY");m.find(".select2-container.TreeList").validationEngine("showPrompt",A,"error","bottomLeft",true);return false}}var u=m.find(":submit");u.attr("disabled","disabled");b.addCustomField(c,m).then(function(E){var B=E.result;var F={};if(E.success){app.hideModalWindow();F.text=app.vtranslate("JS_CUSTOM_FIELD_ADDED");Settings_Vtiger_Index_Js.showMessage(F);b.showCustomField(B)}else{var D=E.error["message"];if(E.error["code"]!=513){var C=m.find('[name="fieldName"]')}else{var C=m.find('[name="fieldLabel"]')}C.validationEngine("showPrompt",D,"error","topLeft",true);u.removeAttr("disabled")}})}return false};e.validationEngine(i)};app.showModalWindow(g,function(e){if(typeof d=="function"){d(e)}},{width:"1000px"})})},setBlocksListArray:function(c){var b=this;b.blockNamesList=[];var a=c.find('[name="beforeBlockId"]');a.find("option").each(function(e,g){var f=jQuery(g);var d=f.data("label");b.blockNamesList.push(d)})},addCustomField:function(c,e){var d=this;var a=e.closest("#globalmodal").find(".modal-header h3");var b=jQuery.Deferred();a.progressIndicator({smallLoadingImage:true,imageContainerCss:{display:"inline","margin-left":"18%",position:"absolute"}});var f=e.serializeFormData();f.module=app.getModuleName();f.parent=app.getParentModuleName();f.action="Field";f.mode="add";f.blockid=c;f.sourceModule=jQuery("#selectedModuleName").val();AppConnector.request(f).then(function(g){a.progressIndicator({mode:"hide"});b.resolve(g)},function(g){a.progressIndicator({mode:"hide"});b.reject(g)});return b.promise()},registerFieldTypeChangeEvent:function(f){var e=this;var b=f.find('[name="fieldLength"]');var d=[{name:"DecimalMaxLength"}];var a=[{name:"MaxLength"}];var c=[{name:"FloatingDigits"}];b.data("validator",a);f.find('[name="fieldType"]').on("change",function(o){var i=jQuery(o.currentTarget);var p=f.find('[name="fieldLength"]');var l=i.find("option:selected");f.find(".supportedType").addClass("hide");if(l.data("lengthsupported")){f.find(".lengthsupported").removeClass("hide");p.data("validator",a)}if(l.data("decimalsupported")){var k=f.find(".decimalsupported");k.removeClass("hide");var g=k.find('[name="decimal"]');var j=l.data("maxfloatingdigits");if(typeof j!="undefined"){g.data("validator",c);p.data("validator",d)}if(l.data("decimalreadonly")){g.val(j).attr("readonly",true)}else{g.removeAttr("readonly").val("")}}if(l.data("predefinedvalueexists")){var h=f.find(".preDefinedValueExists");h.removeClass("hide")}if(l.data("picklistoption")){var n=f.find(".picklistOption");n.removeClass("hide")}if(l.data("predefinedmodulelist")){var m=f.find(".preDefinedModuleList");m.removeClass("hide")}if(l.data("predefinedtreelist")){var q=f.find(".preDefinedTreeList");q.removeClass("hide")}})},showCustomField:function(l){var j=this;var d=jQuery("#layoutEditorContainer").find(".contents");var i=d.find(".block_"+l.blockid);var k=d.find(".newCustomFieldCopy").clone(true,true);var h=k.find("div.marginLeftZero.border1px");h.addClass("opacity editFields").attr("data-field-id",l.id).attr("data-block-id",l.blockid);h.find(".deleteCustomField, .saveFieldDetails").attr("data-field-id",l.id);h.find(".fieldLabel").html(l.label);if(!l.customField){h.find(".deleteCustomField").remove()}if(jQuery.inArray(l.type,["string","phone","currency","url","integer","double"])==-1){h.find(".maskField").remove()}var f=i.find(".blockFieldsList");var g=f.find("ul[name=sortable1]");var c=g.children().length;var e=f.find("ul[name=sortable2]");var b=e.children().length;if(c>b){e.append(k.removeClass("hide newCustomFieldCopy"))}else{g.append(k.removeClass("hide newCustomFieldCopy"))}var a=k.find("form.fieldDetailsForm");j.setFieldDetails(l,a);j.makeFieldsListSortable()},setFieldDetails:function(a,f){var e=this;f.find(".modal-header").html(jQuery(""+a.label+''));var g=f.find(".defaultValueUi");if(a.mandatory){f.find('[name="mandatory"]').filter(":checkbox").attr("checked",true)}if(a.presence){f.find('[name="presence"]').filter(":checkbox").attr("checked",true)}if(a.quickcreate){f.find('[name="quickcreate"]').filter(":checkbox").attr("checked",true)}if(a.isQuickCreateDisabled){f.find('[name="quickcreate"]').filter(":checkbox").attr("readonly","readonly").addClass("optionDisabled")}if(a.isSummaryField){f.find('[name="summaryfield"]').filter(":checkbox").attr("checked",true)}if(a.isSummaryFieldDisabled){f.find('[name="summaryfield"]').filter(":checkbox").attr("readonly","readonly").addClass("optionDisabled")}if(a.masseditable){f.find('[name="masseditable"]').filter(":checkbox").attr("checked",true)}if(a.isMassEditDisabled){f.find('[name="masseditable"]').filter(":checkbox").attr("readonly","readonly").addClass("optionDisabled")}if(a.isDefaultValueDisabled){f.find('[name="defaultvalue"]').filter(":checkbox").attr("readonly","readonly").addClass("optionDisabled")}if(a.defaultvalue){f.find('[name="defaultvalue"]').filter(":checkbox").attr("checked",true);g.removeClass("zeroOpacity")}else{g.addClass("zeroOpacity")}var b=Vtiger_Field_Js.getInstance(a);var h=b.getUiTypeSpecificHtml();g.html(h);g.find(".chzn-select").removeClass("chzn-select");var d=g.find(".timepicker-default");d.removeClass("timePicker timepicker-default");d.attr("data-toregister","time");var c=g.find(".dateField");c.removeClass("dateField");c.attr("data-toregister","date");g.find("[data-validation-engine]").attr("data-validation-engine","validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]");g.find("[name*="+a.name+"]").attr("name","fieldDefaultValue");g.find('[name="fieldDefaultValue"]').attr("disabled","disabled");g.find("input").addClass("input-medium");g.find(".select2").addClass("row")},registerAddCustomBlockEvent:function(){var b=this;var a=jQuery("#layoutEditorContainer").find(".contents");a.find(".addCustomBlock").click(function(f){var d=a.find(".addBlockModal").clone(true,true);var c=function(h){h.find(".addBlockModal").removeClass("hide").show();app.showSelect2ElementView(h.find("select"));var g=h.find(".addCustomBlockForm");b.setBlocksListArray(g);var e=g.find('[name="label"]');var i=app.validationEngineOptions;i.onValidationComplete=function(l,k){if(k){var m=l.serializeFormData();if(jQuery.inArray(m.label,b.blockNamesList)==-1){b.saveBlockDetails(l).then(function(o){var p={};if(o.success){var n=o.result;b.displayNewCustomBlock(n);b.updateNewSequenceForBlocks(n.sequenceList);b.appendNewBlockToBlocksList(n,l);b.makeFieldsListSortable();p.text=app.vtranslate("JS_CUSTOM_BLOCK_ADDED")}else{p.text=o.error["message"];p.type="error"}Settings_Vtiger_Index_Js.showMessage(p)});app.hideModalWindow();return k}else{var j=app.vtranslate("JS_BLOCK_NAME_EXISTS");e.validationEngine("showPrompt",j,"error","topLeft",true);f.preventDefault();return}}};g.validationEngine(i);g.submit(function(j){j.preventDefault()})};app.showModalWindow(d,function(e){if(typeof c=="function"){c(e)}},{width:"1000px"})})},saveBlockDetails:function(c){var b=this;var a=jQuery.Deferred();var d=jQuery.progressIndicator({position:"html",blockInfo:{enabled:true}});var e=c.serializeFormData();e.module=app.getModuleName();e.parent=app.getParentModuleName();e.sourceModule=jQuery("#selectedModuleName").val();e.action="Block";e.mode="save";AppConnector.request(e).then(function(f){d.progressIndicator({mode:"hide"});a.resolve(f)},function(f){d.progressIndicator({mode:"hide"});a.reject(f)});return a.promise()},displayNewCustomBlock:function(a){var e=this;var d=jQuery("#layoutEditorContainer").find(".contents");var b=a.beforeBlockId;var f=d.find(".block_"+b);var c=d.find(".newCustomBlockCopy").clone(true,true);c.data("blockId",a.id).find(".blockLabel").append(jQuery(""+a.label+""));c.find(".blockVisibility").data("blockId",a.id);if(a.isAddCustomFieldEnabled){c.find(".addCustomField").removeClass("hide")}f.after(c.removeClass("hide newCustomBlockCopy").addClass("editFieldsTable block_"+a.id));c.find(".blockFieldsList").sortable({connectWith:".blockFieldsList"})},updateNewSequenceForBlocks:function(a){var b=jQuery("#layoutEditorContainer").find(".contents");jQuery.each(a,function(c,d){b.find(".block_"+c).data("sequence",d)})},appendNewBlockToBlocksList:function(a,e){var d=jQuery("#layoutEditorContainer").find(".contents");var f=d.find(".addBlockModal");var b=f.find('[name="beforeBlockId"]');var c=jQuery("

    +
    + +
    +
    + get('listrelatedrecord')} checked="" {/if} name="listRelatedRecord" class="alignTop"/> +
    +
    +
    +
    +
    + +
    +
    + get('previewrelatedrecord')} checked="" {/if} name="previewRelatedRecord" class="alignTop"/> +
    +
    +
    +
    diff --git a/modules/Accounts/models/Module.php b/modules/Accounts/models/Module.php index b14662f7d137..60b518131630 100644 --- a/modules/Accounts/models/Module.php +++ b/modules/Accounts/models/Module.php @@ -1,5 +1,5 @@ $listQuery * @return Listview Query */ - public function getQueryByModuleField($sourceModule, $field, $record, $listQuery) { - if (($sourceModule == 'Accounts' && $field == 'account_id' && $record) - || in_array($sourceModule, array('Campaigns', 'Products', 'Services', 'Emails','Potentials'))) { + public function getQueryByModuleField($sourceModule, $field, $record, $listQuery) + { + if (($sourceModule == 'Accounts' && $field == 'account_id' && $record) || in_array($sourceModule, array('Campaigns', 'Products', 'Services', 'Emails', 'Potentials'))) { if ($sourceModule === 'Campaigns') { $condition = " vtiger_account.accountid NOT IN (SELECT accountid FROM vtiger_campaignaccountrel WHERE campaignid = '$record')"; @@ -31,13 +32,12 @@ public function getQueryByModuleField($sourceModule, $field, $record, $listQuery $condition = " vtiger_account.accountid NOT IN (SELECT relcrmid FROM vtiger_crmentityrel WHERE crmid = '$record' UNION SELECT crmid FROM vtiger_crmentityrel WHERE relcrmid = '$record') "; } elseif ($sourceModule === 'Emails') { $condition = ' vtiger_account.emailoptout = 0'; - - }elseif ($sourceModule === 'Potentials') { + } elseif ($sourceModule === 'Potentials') { $config = Settings_SalesProcesses_Module_Model::getConfig('potential'); $currentUser = Users_Record_Model::getCurrentUserModel(); $accessibleGroups = $currentUser->getAccessibleGroupForModule('Accounts'); - if($config['add_potential'] && $accessibleGroups){ - $condition = " vtiger_crmentity.smownerid NOT IN (". implode(',',array_keys($accessibleGroups)).")"; + if ($config['add_potential'] && $accessibleGroups) { + $condition = " vtiger_crmentity.smownerid NOT IN (" . implode(',', array_keys($accessibleGroups)) . ")"; } else { return $listQuery; } @@ -46,10 +46,10 @@ public function getQueryByModuleField($sourceModule, $field, $record, $listQuery } $position = stripos($listQuery, 'where'); - if($position) { - $overRideQuery = $listQuery. ' AND ' . $condition; + if ($position) { + $overRideQuery = $listQuery . ' AND ' . $condition; } else { - $overRideQuery = $listQuery. ' WHERE ' . $condition; + $overRideQuery = $listQuery . ' WHERE ' . $condition; } return $overRideQuery; } @@ -62,7 +62,8 @@ public function getQueryByModuleField($sourceModule, $field, $record, $listQuery * @param Vtiger_Module_Model $relatedModule * @return */ - public function getRelationQuery($recordId, $functionName, $relatedModule, $relationModel = false) { + public function getRelationQuery($recordId, $functionName, $relatedModule, $relationModel = false) + { if ($functionName === 'get_activities') { $focus = CRMEntity::getInstance($this->getName()); $focus->id = $recordId; @@ -79,20 +80,20 @@ public function getRelationQuery($recordId, $functionName, $relatedModule, $rela INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_activity.activityid LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid - WHERE vtiger_crmentity.deleted = 0 AND vtiger_activity.link IN (".$entityIds.')'; + WHERE vtiger_crmentity.deleted = 0 AND vtiger_activity.link IN (" . $entityIds . ')'; $time = vtlib_purify($_REQUEST['time']); - if($time == 'current') { + if ($time == 'current') { $query .= " AND ((vtiger_activity.activitytype='Task' and vtiger_activity.status not in ('Completed','Deferred')) OR (vtiger_activity.activitytype not in ('Emails','Task') and vtiger_activity.eventstatus not in ('','Held')))"; } - if($time == 'history') { + if ($time == 'history') { $query .= " AND ((vtiger_activity.activitytype='Task' and vtiger_activity.status in ('Completed','Deferred')) OR (vtiger_activity.activitytype not in ('Emails','Task') and vtiger_activity.eventstatus in ('','Held')))"; } $relatedModuleName = $relatedModule->getName(); $query .= $this->getSpecificRelationQuery($relatedModuleName); $instance = CRMEntity::getInstance($relatedModuleName); - $securityParameter = $instance->getUserAccessConditionsQuerySR($relatedModuleName); + $securityParameter = $instance->getUserAccessConditionsQuerySR($relatedModuleName, false, $recordId); if ($securityParameter != '') $query .= $securityParameter; @@ -106,10 +107,10 @@ public function getRelationQuery($recordId, $functionName, $relatedModule, $rela } else { $query = parent::getRelationQuery($recordId, $functionName, $relatedModule, $relationModel); } - + return $query; } - + /** * Function searches the records in the module, if parentId & parentModule * is given then searches only those records related to them. diff --git a/modules/ModComments/models/Record.php b/modules/ModComments/models/Record.php index b3b08537bb7b..e22f6cc24cb0 100644 --- a/modules/ModComments/models/Record.php +++ b/modules/ModComments/models/Record.php @@ -167,7 +167,7 @@ public static function getRecentComments($parentRecordId, $pagingModel){ $queryGenerator = $listView->get('query_generator'); $queryGenerator->setFields(array('parent_comments', 'createdtime', 'modifiedtime', 'related_to', 'assigned_user_id', 'commentcontent', 'creator', 'id', 'customer', 'reasontoedit', 'userid', 'from_mailconverter')); - + $queryGenerator->addSourceRecord($parentRecordId); $query = $queryGenerator->getQuery(); $query = $query ." AND related_to = ? ORDER BY vtiger_crmentity.createdtime DESC LIMIT $startIndex, $limit"; @@ -196,6 +196,7 @@ public static function getAllParentComments($parentId) { $queryGenerator = $listView->get('query_generator'); $queryGenerator->setFields(array('parent_comments', 'createdtime', 'modifiedtime', 'related_to', 'id', 'assigned_user_id', 'commentcontent', 'creator', 'customer', 'reasontoedit', 'userid')); + $queryGenerator->addSourceRecord($parentId); $query = $queryGenerator->getQuery(); //Condition are directly added as query_generator transforms the diff --git a/modules/Settings/Roles/actions/Save.php b/modules/Settings/Roles/actions/Save.php index 9b118d01e2f2..7e4f9051e4ed 100644 --- a/modules/Settings/Roles/actions/Save.php +++ b/modules/Settings/Roles/actions/Save.php @@ -65,6 +65,8 @@ public function process(Vtiger_Request $request) $parentRole = Settings_Roles_Record_Model::getInstanceById($parentRoleId); $recordModel->set('change_owner', $request->get('change_owner')) ->set('searchunpriv', $request->get('searchunpriv')) + ->set('listrelatedrecord', $request->get('listrelatedrecord')) + ->set('previewrelatedrecord', $request->get('previewRelatedRecord')) ->set('clendarallorecords', $request->get('clendarallorecords')); if (!empty($allowassignedrecordsto)) $recordModel->set('allowassignedrecordsto', $allowassignedrecordsto); // set the value of assigned records to diff --git a/modules/Settings/Roles/models/Record.php b/modules/Settings/Roles/models/Record.php index 186300377f3e..0b4f9846dcb2 100644 --- a/modules/Settings/Roles/models/Record.php +++ b/modules/Settings/Roles/models/Record.php @@ -320,13 +320,23 @@ public function save() $searchunpriv = implode(',', $this->get('searchunpriv')); if ($mode == 'edit') { - $sql = 'UPDATE vtiger_role SET rolename=?, parentrole=?, depth=?, allowassignedrecordsto=?, changeowner=?, searchunpriv=?, clendarallorecords=? WHERE roleid=?'; - $params = array($this->getName(), $this->getParentRoleString(), $this->getDepth(), $this->get('allowassignedrecordsto'), $this->get('change_owner'), $searchunpriv,$this->get('clendarallorecords'), $roleId); + $sql = 'UPDATE vtiger_role SET rolename=?, parentrole=?, depth=?, allowassignedrecordsto=?, changeowner=?, searchunpriv=?, clendarallorecords=?, listrelatedrecord=?, previewrelatedrecord=? WHERE roleid=?'; + $params = [$this->getName(), $this->getParentRoleString(), $this->getDepth(), $this->get('allowassignedrecordsto'), $this->get('change_owner'), $searchunpriv, $this->get('clendarallorecords'), $this->get('listrelatedrecord'), $this->get('previewrelatedrecord'), $roleId]; $db->pquery($sql, $params); } else { - $sql = 'INSERT INTO vtiger_role(roleid, rolename, parentrole, depth, allowassignedrecordsto, changeowner, searchunpriv, clendarallorecords) VALUES (?,?,?,?,?,?,?,?)'; - $params = array($roleId, $this->getName(), $this->getParentRoleString(), $this->getDepth(), $this->get('allowassignedrecordsto'), $this->get('change_owner'), $searchunpriv, $this->get('clendarallorecords')); - $db->pquery($sql, $params); + $db->insert('vtiger_role', [ + 'roleid' => $roleId, + 'rolename' => $this->getName(), + 'parentrole' => $this->getParentRoleString(), + 'depth' => $this->getDepth(), + 'allowassignedrecordsto' => $this->get('allowassignedrecordsto'), + 'changeowner' => $this->get('change_owner'), + 'searchunpriv' => $searchunpriv, + 'clendarallorecords' => $this->get('clendarallorecords'), + 'listrelatedrecord' => $this->get('listrelatedrecord'), + 'previewrelatedrecord' => $this->get('previewrelatedrecord'), + ]); + $picklist2RoleSQL = "INSERT INTO vtiger_role2picklist SELECT '" . $roleId . "',picklistvalueid,picklistid,sortid FROM vtiger_role2picklist WHERE roleid = ?"; $db->pquery($picklist2RoleSQL, array($parentRole->getId())); diff --git a/modules/Users/CreateUserPrivilegeFile.php b/modules/Users/CreateUserPrivilegeFile.php index a449afc7743c..1ab6e7131aa2 100644 --- a/modules/Users/CreateUserPrivilegeFile.php +++ b/modules/Users/CreateUserPrivilegeFile.php @@ -64,7 +64,7 @@ function createUserPrivilegesfile($userid) $actionPermissionArr=getCombinedUserActionPermissions($userid); $user_role=fetchUserRole($userid); $user_role_info=getRoleInformation($user_role); - $user_role_parent=$user_role_info[$user_role][1]; + $user_role_parent = $user_role_info['parentrole']; $userGroupFocus=new GetUserGroups(); $userGroupFocus->getAllUserGroups($userid); $subRoles=getRoleSubordinates($user_role); diff --git a/modules/Vtiger/models/Module.php b/modules/Vtiger/models/Module.php index dfd14c2dba0d..21e5a87f7205 100644 --- a/modules/Vtiger/models/Module.php +++ b/modules/Vtiger/models/Module.php @@ -1141,7 +1141,7 @@ function getCalendarActivities($mode, $pagingModel, $user, $recordId = false) } $moduleName = 'Calendar'; $instance = CRMEntity::getInstance($moduleName); - $securityParameter = $instance->getUserAccessConditionsQuerySR($moduleName, $currentUser); + $securityParameter = $instance->getUserAccessConditionsQuerySR($moduleName, $currentUser, $recordId); if ($securityParameter != '') $query .= $securityParameter; $query .= " ORDER BY date_start, time_start LIMIT " . $pagingModel->getStartIndex() . ", " . ($pagingModel->getPageLimit() + 1); @@ -1479,7 +1479,7 @@ public function getRelationQuery($recordId, $functionName, $relatedModule, $rela $focus = CRMEntity::getInstance($this->getName()); $focus->id = $recordId; - + $result = $focus->$functionName($recordId, $this->getId(), $relatedModule->getId()); $query = $result['query'] . ' ' . $this->getSpecificRelationQuery($relatedModuleName); @@ -1503,8 +1503,9 @@ public function getRelationQuery($recordId, $functionName, $relatedModule, $rela $selectColumnSql = 'SELECT DISTINCT vtiger_crmentity.crmid,' . $selectColumnSql; $query = $selectColumnSql . ' FROM ' . $newQuery[1]; } + $instance = CRMEntity::getInstance($relatedModuleName); - $securityParameter = $instance->getUserAccessConditionsQuerySR($relatedModuleName); + $securityParameter = $instance->getUserAccessConditionsQuerySR($relatedModuleName, false, $recordId); if ($securityParameter != '') $query .= $securityParameter; From ca9c0d8e43e6136d17ec9429694e1aabf7b20688 Mon Sep 17 00:00:00 2001 From: Paula W Date: Tue, 8 Sep 2015 14:52:44 +0200 Subject: [PATCH 155/489] Update Currency.php --- modules/Vtiger/inventoryfields/Currency.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/Vtiger/inventoryfields/Currency.php b/modules/Vtiger/inventoryfields/Currency.php index 5120f7bf4225..8d370598cd3e 100644 --- a/modules/Vtiger/inventoryfields/Currency.php +++ b/modules/Vtiger/inventoryfields/Currency.php @@ -19,7 +19,7 @@ class Vtiger_Currency_InventoryField extends Vtiger_Basic_InventoryField protected $params = ['type']; /** - * Geting value to display + * Getting value to display * @param int $value * @return string */ @@ -41,7 +41,7 @@ public function getCurrencyParam($currencies, $param = false) } /** - * Geting value to display + * Getting value to display * @return array */ public function typeValues() From 1a8a91377ccd3bbfa8f020a1214e2d151533c4f3 Mon Sep 17 00:00:00 2001 From: Paula W Date: Tue, 8 Sep 2015 14:53:11 +0200 Subject: [PATCH 156/489] Update Discount.php --- modules/Vtiger/inventoryfields/Discount.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Vtiger/inventoryfields/Discount.php b/modules/Vtiger/inventoryfields/Discount.php index 330fed1ce35c..5fc3c3523aef 100644 --- a/modules/Vtiger/inventoryfields/Discount.php +++ b/modules/Vtiger/inventoryfields/Discount.php @@ -20,7 +20,7 @@ class Vtiger_Discount_InventoryField extends Vtiger_Basic_InventoryField protected $summationValue = true; /** - * Geting value to display + * Getting value to display * @param type $value * @return type */ From 8b730143b74fd7c9036084372aa1d6adab813f1f Mon Sep 17 00:00:00 2001 From: Paula W Date: Tue, 8 Sep 2015 14:53:51 +0200 Subject: [PATCH 157/489] Update DiscountMode.php --- modules/Vtiger/inventoryfields/DiscountMode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Vtiger/inventoryfields/DiscountMode.php b/modules/Vtiger/inventoryfields/DiscountMode.php index 57cce98c9096..7a282892e659 100644 --- a/modules/Vtiger/inventoryfields/DiscountMode.php +++ b/modules/Vtiger/inventoryfields/DiscountMode.php @@ -17,7 +17,7 @@ class Vtiger_DiscountMode_InventoryField extends Vtiger_Basic_InventoryField protected $values = [0 => 'group', 1 => 'individual']; /** - * Geting value to display + * Getting value to display * @param int $value * @return string */ From 2ba06144cb6547a73c539321394d402c511ac916 Mon Sep 17 00:00:00 2001 From: Paula W Date: Tue, 8 Sep 2015 14:54:22 +0200 Subject: [PATCH 158/489] Update GrossPrice.php --- modules/Vtiger/inventoryfields/GrossPrice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Vtiger/inventoryfields/GrossPrice.php b/modules/Vtiger/inventoryfields/GrossPrice.php index 56d653143f07..f13a6f891546 100644 --- a/modules/Vtiger/inventoryfields/GrossPrice.php +++ b/modules/Vtiger/inventoryfields/GrossPrice.php @@ -17,7 +17,7 @@ class Vtiger_GrossPrice_InventoryField extends Vtiger_Basic_InventoryField protected $summationValue = true; /** - * Geting value to display + * Getting value to display * @param type $value * @return type */ From d2f838e02b796c4f89a5a740ae9ab700041752bb Mon Sep 17 00:00:00 2001 From: Paula W Date: Tue, 8 Sep 2015 15:01:58 +0200 Subject: [PATCH 159/489] Update Margin.php --- modules/Vtiger/inventoryfields/Margin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Vtiger/inventoryfields/Margin.php b/modules/Vtiger/inventoryfields/Margin.php index cf30223df902..3bb52b32ce55 100644 --- a/modules/Vtiger/inventoryfields/Margin.php +++ b/modules/Vtiger/inventoryfields/Margin.php @@ -16,7 +16,7 @@ class Vtiger_Margin_InventoryField extends Vtiger_Basic_InventoryField protected $dbType = 'decimal(27,8) DEFAULT 0'; /** - * Geting value to display + * Getting value to display * @param type $value * @return type */ From abed0c36659e2ea8d84e04afdbd6cdee508e5569 Mon Sep 17 00:00:00 2001 From: Paula W Date: Tue, 8 Sep 2015 15:03:37 +0200 Subject: [PATCH 160/489] Update MarginP.php --- modules/Vtiger/inventoryfields/MarginP.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/Vtiger/inventoryfields/MarginP.php b/modules/Vtiger/inventoryfields/MarginP.php index 047478e812f4..896602b73df0 100644 --- a/modules/Vtiger/inventoryfields/MarginP.php +++ b/modules/Vtiger/inventoryfields/MarginP.php @@ -10,13 +10,13 @@ class Vtiger_MarginP_InventoryField extends Vtiger_Basic_InventoryField { protected $name = 'MarginP'; - protected $defaultLabel = 'LBL_MARGIN_PRECENT'; + protected $defaultLabel = 'LBL_MARGIN_PERCENT'; protected $defaultValue = 0; protected $columnName = 'marginp'; protected $dbType = 'decimal(27,8) DEFAULT 0'; /** - * Geting value to display + * Getting value to display * @param type $value * @return type */ From 3fdce5ed426dfccee6a5eeccfcc28bdae3130083 Mon Sep 17 00:00:00 2001 From: Paula W Date: Tue, 8 Sep 2015 15:09:10 +0200 Subject: [PATCH 161/489] Update Name.php --- modules/Vtiger/inventoryfields/Name.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Vtiger/inventoryfields/Name.php b/modules/Vtiger/inventoryfields/Name.php index 8d6b7fea6d35..d1c101a78aa5 100644 --- a/modules/Vtiger/inventoryfields/Name.php +++ b/modules/Vtiger/inventoryfields/Name.php @@ -16,7 +16,7 @@ class Vtiger_Name_InventoryField extends Vtiger_Basic_InventoryField protected $params = ['modules', 'limit']; /** - * Geting value to display + * Getting value to display * @param type $value * @return type */ @@ -28,7 +28,7 @@ public function getDisplayValue($value) } /** - * Geting value to display + * Getting value to display * @return array */ public function modulesValues() @@ -41,7 +41,7 @@ public function modulesValues() } /** - * Geting value to display + * Getting value to display * @return array */ public function limitValues() From 1148f130713227221e95611b0467b848f982e9b7 Mon Sep 17 00:00:00 2001 From: Paula W Date: Tue, 8 Sep 2015 15:10:23 +0200 Subject: [PATCH 162/489] Update NetPrice.php --- modules/Vtiger/inventoryfields/NetPrice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Vtiger/inventoryfields/NetPrice.php b/modules/Vtiger/inventoryfields/NetPrice.php index f0d45b73273c..3d3f31abf998 100644 --- a/modules/Vtiger/inventoryfields/NetPrice.php +++ b/modules/Vtiger/inventoryfields/NetPrice.php @@ -17,7 +17,7 @@ class Vtiger_NetPrice_InventoryField extends Vtiger_Basic_InventoryField protected $summationValue = true; /** - * Geting value to display + * Getting value to display * @param type $value * @return type */ From 097152312e1357a63893e410bc4bbc6a61392a33 Mon Sep 17 00:00:00 2001 From: Paula W Date: Tue, 8 Sep 2015 15:11:10 +0200 Subject: [PATCH 163/489] Update Purchase.php --- modules/Vtiger/inventoryfields/Purchase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Vtiger/inventoryfields/Purchase.php b/modules/Vtiger/inventoryfields/Purchase.php index b752f3eb07a9..3d1a95e11f97 100644 --- a/modules/Vtiger/inventoryfields/Purchase.php +++ b/modules/Vtiger/inventoryfields/Purchase.php @@ -16,7 +16,7 @@ class Vtiger_Purchase_InventoryField extends Vtiger_Basic_InventoryField protected $dbType = 'decimal(27,8) NOT NULL DEFAULT 0'; /** - * Geting value to display + * Getting value to display * @param type $value * @return type */ From d091753a13acc620ba022305c66ae2c840c6c392 Mon Sep 17 00:00:00 2001 From: Paula W Date: Tue, 8 Sep 2015 15:11:41 +0200 Subject: [PATCH 164/489] Update Quantity.php --- modules/Vtiger/inventoryfields/Quantity.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Vtiger/inventoryfields/Quantity.php b/modules/Vtiger/inventoryfields/Quantity.php index cebc490e1f84..2e92984d96ab 100644 --- a/modules/Vtiger/inventoryfields/Quantity.php +++ b/modules/Vtiger/inventoryfields/Quantity.php @@ -16,7 +16,7 @@ class Vtiger_Quantity_InventoryField extends Vtiger_Basic_InventoryField protected $dbType = 'decimal(25,3) NOT NULL DEFAULT 0'; /** - * Geting value to display + * Getting value to display * @param type $value * @return type */ From 23d8ea6f46fe20d370e12f1eb60e4acef909dd87 Mon Sep 17 00:00:00 2001 From: Paula W Date: Tue, 8 Sep 2015 15:15:08 +0200 Subject: [PATCH 165/489] Update Reference.php --- modules/Vtiger/inventoryfields/Reference.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Vtiger/inventoryfields/Reference.php b/modules/Vtiger/inventoryfields/Reference.php index 8cd3a0c49a4b..a71cdccecddd 100644 --- a/modules/Vtiger/inventoryfields/Reference.php +++ b/modules/Vtiger/inventoryfields/Reference.php @@ -15,7 +15,7 @@ class Vtiger_Reference_InventoryField extends Vtiger_Basic_InventoryField protected $dbType = 'int(19)'; /** - * Geting value to display + * Getting value to display * @param type $value * @return type */ From 7ff3d2e90bfb794a50b5a236764c75350079e463 Mon Sep 17 00:00:00 2001 From: Paula W Date: Tue, 8 Sep 2015 15:15:53 +0200 Subject: [PATCH 166/489] Update Tax.php --- modules/Vtiger/inventoryfields/Tax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Vtiger/inventoryfields/Tax.php b/modules/Vtiger/inventoryfields/Tax.php index 14a46f294cbd..777a80c62db9 100644 --- a/modules/Vtiger/inventoryfields/Tax.php +++ b/modules/Vtiger/inventoryfields/Tax.php @@ -20,7 +20,7 @@ class Vtiger_Tax_InventoryField extends Vtiger_Basic_InventoryField protected $summationValue = true; /** - * Geting value to display + * Getting value to display * @param type $value * @return type */ From 1b8585cb0c20beafc7dc35da2d3cc9dfffcbe5f8 Mon Sep 17 00:00:00 2001 From: Paula W Date: Tue, 8 Sep 2015 15:16:40 +0200 Subject: [PATCH 167/489] Update TaxMode.php --- modules/Vtiger/inventoryfields/TaxMode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Vtiger/inventoryfields/TaxMode.php b/modules/Vtiger/inventoryfields/TaxMode.php index a5172bc46e91..27d35e1698f6 100644 --- a/modules/Vtiger/inventoryfields/TaxMode.php +++ b/modules/Vtiger/inventoryfields/TaxMode.php @@ -17,7 +17,7 @@ class Vtiger_TaxMode_InventoryField extends Vtiger_Basic_InventoryField protected $values = [0 => 'group', 1 => 'individual']; /** - * Geting value to display + * Getting value to display * @param int $value * @return string */ From b407eaa96b33de3d7dda207049938d9803ad865b Mon Sep 17 00:00:00 2001 From: Paula W Date: Tue, 8 Sep 2015 15:17:07 +0200 Subject: [PATCH 168/489] Update TotalPrice.php --- modules/Vtiger/inventoryfields/TotalPrice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Vtiger/inventoryfields/TotalPrice.php b/modules/Vtiger/inventoryfields/TotalPrice.php index 0908e612abc2..ecaba8bcf340 100644 --- a/modules/Vtiger/inventoryfields/TotalPrice.php +++ b/modules/Vtiger/inventoryfields/TotalPrice.php @@ -17,7 +17,7 @@ class Vtiger_TotalPrice_InventoryField extends Vtiger_Basic_InventoryField protected $summationValue = true; /** - * Geting value to display + * Getting value to display * @param type $value * @return type */ From f5b07e27480c2f149c1b2ee3244034c7c02dadf6 Mon Sep 17 00:00:00 2001 From: Paula W Date: Tue, 8 Sep 2015 15:17:44 +0200 Subject: [PATCH 169/489] Update UnitPrice.php --- modules/Vtiger/inventoryfields/UnitPrice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Vtiger/inventoryfields/UnitPrice.php b/modules/Vtiger/inventoryfields/UnitPrice.php index c04662d79cc5..f89495dc4d0e 100644 --- a/modules/Vtiger/inventoryfields/UnitPrice.php +++ b/modules/Vtiger/inventoryfields/UnitPrice.php @@ -17,7 +17,7 @@ class Vtiger_UnitPrice_InventoryField extends Vtiger_Basic_InventoryField protected $summationValue = true; /** - * Geting value to display + * Getting value to display * @param type $value * @return type */ From 7aa1400ee17d8327b352429b76a0a12afe63787f Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Tue, 8 Sep 2015 15:47:55 +0200 Subject: [PATCH 170/489] Expanded the permissions for viewing related records list --- config/version.php | 2 +- include/CRMEntity.php | 16 ++++++++++------ include/utils/utils.php | 20 +++++--------------- modules/Settings/Roles/actions/Save.php | 2 +- 4 files changed, 17 insertions(+), 23 deletions(-) diff --git a/config/version.php b/config/version.php index 2d216d0c88ec..34129c7197a4 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150908'; -$YetiForce_current_version = '2.2.69'; +$YetiForce_current_version = '2.2.70'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/include/CRMEntity.php b/include/CRMEntity.php index db5af2a524fe..0469f16066a2 100644 --- a/include/CRMEntity.php +++ b/include/CRMEntity.php @@ -2412,12 +2412,16 @@ function getUserAccessConditionsQuerySR($module, $current_user = false, $related $tabId = getTabid($module); if ($relatedRecord) { - //getInstanceById - //getRoleInformation($roleId) - - $recordMetadata = Vtiger_Functions::getCRMRecordMetadata($relatedRecord); - if ($recordMetadata['smownerid'] == $current_user->id) { - return ''; + $role = getRoleInformation($current_user->roleid); + if ($role['listrelatedrecord'] == 1) { + $recordMetaData = Vtiger_Functions::getCRMRecordMetadata($relatedRecord); + $recordPermission = Users_Privileges_Model::isPermitted($recordMetaData['setype'], 'DetailView', $relatedRecord); + if (!$recordPermission) { + throw new AppException('LBL_PERMISSION_DENIED'); + } + if ($recordMetaData['smownerid'] == $current_user->id) { + return ''; + } } } diff --git a/include/utils/utils.php b/include/utils/utils.php index f06953307222..876021eb9e97 100644 --- a/include/utils/utils.php +++ b/include/utils/utils.php @@ -589,22 +589,12 @@ function getRecordOwnerId($record) $log = vglobal('log'); $log->debug("Entering getRecordOwnerId(" . $record . ") method ..."); $adb = PearDatabase::getInstance(); - $ownerArr = Array(); + $ownerArr = []; - // Look at cache first for information - $ownerId = VTCacheUtils::lookupRecordOwner($record); - - if ($ownerId === false) { - $query = "select smownerid from vtiger_crmentity where crmid = ?"; - $result = $adb->pquery($query, array($record)); - if ($adb->num_rows($result) > 0) { - $ownerId = $adb->query_result($result, 0, 'smownerid'); - // Update cache for re-use - VTCacheUtils::updateRecordOwner($record, $ownerId); - } - } - - if ($ownerId) { + $recordMetaData = Vtiger_Functions::getCRMRecordMetadata($record); + + if ($recordMetaData) { + $ownerId = $recordMetaData['smownerid']; // Look at cache first for information $count = VTCacheUtils::lookupOwnerType($ownerId); diff --git a/modules/Settings/Roles/actions/Save.php b/modules/Settings/Roles/actions/Save.php index 7e4f9051e4ed..4b6703ef0749 100644 --- a/modules/Settings/Roles/actions/Save.php +++ b/modules/Settings/Roles/actions/Save.php @@ -65,7 +65,7 @@ public function process(Vtiger_Request $request) $parentRole = Settings_Roles_Record_Model::getInstanceById($parentRoleId); $recordModel->set('change_owner', $request->get('change_owner')) ->set('searchunpriv', $request->get('searchunpriv')) - ->set('listrelatedrecord', $request->get('listrelatedrecord')) + ->set('listrelatedrecord', $request->get('listRelatedRecord')) ->set('previewrelatedrecord', $request->get('previewRelatedRecord')) ->set('clendarallorecords', $request->get('clendarallorecords')); if (!empty($allowassignedrecordsto)) From 86b951c000a92378ec1ba76572bbaec8c4ab093e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Ko=C5=84?= Date: Wed, 9 Sep 2015 08:13:22 +0200 Subject: [PATCH 171/489] Fix #1894 Added translations --- config/version.php | 4 ++-- languages/de_de/OSSMailView.php | 1 + languages/en_us/OSSMailView.php | 1 + languages/nl_nl/OSSMailView.php | 3 ++- languages/pt_br/OSSMailView.php | 1 + languages/ru_ru/OSSMailView.php | 1 + 6 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config/version.php b/config/version.php index 34129c7197a4..b59ce6ca136a 100644 --- a/config/version.php +++ b/config/version.php @@ -8,6 +8,6 @@ * All Rights Reserved. * Contributor(s): YetiForce.com * ****************************************************************************** */ -$patch_version = '20150908'; -$YetiForce_current_version = '2.2.70'; +$patch_version = '20150909'; +$YetiForce_current_version = '2.2.71'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/languages/de_de/OSSMailView.php b/languages/de_de/OSSMailView.php index 73a1cb4e46ba..a7266c886ede 100644 --- a/languages/de_de/OSSMailView.php +++ b/languages/de_de/OSSMailView.php @@ -71,6 +71,7 @@ 'Alert_ChangeType_desc' => 'Alle Arten der ausgewählten E-Mails werden geändert, ohne die Möglichkeit die Änderungen rückgängig zu machen.', 'LBL_ChangeTypeOK' => 'E-Mail-Typ geändert', 'Configuration' => 'Konfiguration', + 'LBL_NO_MAILS' => 'No emails', //dashboards 'Graf' => 'Unternehmens-E-Mails nach Typ', diff --git a/languages/en_us/OSSMailView.php b/languages/en_us/OSSMailView.php index c228c2a14553..0099ebfae542 100644 --- a/languages/en_us/OSSMailView.php +++ b/languages/en_us/OSSMailView.php @@ -73,6 +73,7 @@ 'Alert_ChangeType_desc' => 'All types of selected e-mail will be changed, without the possibility to undo the changes.', 'LBL_ChangeTypeOK' => 'Changed message type', 'Configuration' => 'Configuration', + 'LBL_NO_MAILS' => 'No emails', //dashboards 'Graf' => 'Corporate emails by Type', diff --git a/languages/nl_nl/OSSMailView.php b/languages/nl_nl/OSSMailView.php index b0cb5f5b1483..edc53440e62a 100644 --- a/languages/nl_nl/OSSMailView.php +++ b/languages/nl_nl/OSSMailView.php @@ -74,6 +74,7 @@ 'Alert_ChangeType_desc' => 'All types of selected e-mail will be changed, without the possibility to undo the changes.', 'LBL_ChangeTypeOK' => 'Changed message type', 'Configuration' => 'Configuration', + 'LBL_NO_MAILS' => 'No emails', //dashboards 'Graf' => 'Corporate emails by Type', @@ -93,4 +94,4 @@ 'Subject'=>'Subject', 'Content'=>'Content', 'JS_BIND_CONFIRM'=>'Are you sure you want to bind the selected messages?', -]; \ No newline at end of file +]; diff --git a/languages/pt_br/OSSMailView.php b/languages/pt_br/OSSMailView.php index a523ce1d5f32..fae1eda23c4d 100644 --- a/languages/pt_br/OSSMailView.php +++ b/languages/pt_br/OSSMailView.php @@ -73,6 +73,7 @@ 'Alert_ChangeType_desc' => 'Todo tipo de e-mail selecionado será mudado, sem a possibilidade de desfazer as altereções.', 'LBL_ChangeTypeOK' => 'Mudar tipo de mensagem', 'Configuration' => 'Configuração', + 'LBL_NO_MAILS' => 'No emails', //dashboards 'Graf' => 'E-mails Corporativos por Tipo', diff --git a/languages/ru_ru/OSSMailView.php b/languages/ru_ru/OSSMailView.php index dc294ba10702..51c69911870f 100644 --- a/languages/ru_ru/OSSMailView.php +++ b/languages/ru_ru/OSSMailView.php @@ -81,6 +81,7 @@ 'LBL_ChangeTypeOK' => 'Изменен статус сообщения', 'Configuration' => 'Настройка просмотра почты', 'Date of receipt' => 'Дата поступления', + 'LBL_NO_MAILS' => 'No emails', //dashboards 'Graf' => 'Письма по статусу', From 5743f3b8eaad61dfe1f3636b0ffc4297a214c99e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Ko=C5=84?= Date: Wed, 9 Sep 2015 08:14:31 +0200 Subject: [PATCH 172/489] Improved code formating --- config/version.php | 2 +- languages/ru_ru/OSSMailView.php | 123 ++++++++++++++++---------------- 2 files changed, 62 insertions(+), 63 deletions(-) diff --git a/config/version.php b/config/version.php index b59ce6ca136a..aebed0f90d3b 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150909'; -$YetiForce_current_version = '2.2.71'; +$YetiForce_current_version = '2.2.72'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/languages/ru_ru/OSSMailView.php b/languages/ru_ru/OSSMailView.php index 51c69911870f..40f85326550b 100644 --- a/languages/ru_ru/OSSMailView.php +++ b/languages/ru_ru/OSSMailView.php @@ -1,5 +1,5 @@ 'Пользователь', 'ToID' => 'ID получателя', @@ -26,73 +26,72 @@ // Basic Strings 'OSSMailView' => 'Просмотр Почты', 'SINGLE_OSSMailView' => 'Просмотр Почты', - 'LBL_ADD_RECORD' => 'Написать Письмо', - 'LBL_RECORDS_LIST' => 'Список Писем', + 'LBL_ADD_RECORD' => 'Написать Письмо', + 'LBL_RECORDS_LIST' => 'Список Писем', // Blocks - 'LBL_INFORMATION' => 'Информация', + 'LBL_INFORMATION' => 'Информация', 'LBL_ORIGN_MESSAGE' => 'Оригинал сообщения', //Field Labels - 'relatedid' => 'Связан с', - 'number' => '№', - 'yes' => 'Да', - 'no' => 'Нет', - 'From' => 'От', - 'To' => 'Для', - 'CC' => 'Копия', - 'BCC' => 'Скрытая копия', - 'Date' => 'Дата', - 'Subject' => 'Тема', - 'Content' => 'Содержание', - 'SendType' => 'Статус', - 'Sent' => 'Отправлено', - 'Received' => 'Получено', - 'Internal' => 'Внутренний', - 'Sent' => 'Отправлено', - 'Spam' => 'Спам', - 'Trash' => 'В корзине', - 'Fromaddress' => 'С адреса', - 'Toaddress' => 'На адрес', - 'messageid' => 'ID сообщения', - 'Reply_to_email' => 'Ответить', - 'Reply_toaddress' => 'Переслать на адрес', - 'Attachments_Exist' => 'Вложение', - 'Email_list' => 'Просмотр почты', - 'Widget list limit' => 'Количество сообщений', - '_self' => 'Открывать в этом же окне', - '_blank' => 'Открывать в новом окне', - 'List open email' => 'Выберите, как открывать письмо', - 'emailPreviewHeader' => 'Предварительный просмотр', - 'Email_list' => 'Просмотр почты', - 'LBL_CREATEMAIL' => 'Написать Письмо', - 'LBL_OUTCOMING' => 'Исходящие', - 'LBL_INCOMING' => 'Входящие', - 'Internal' => 'Внутренний', - 'LBL_REPLYALLL' => 'Ответить всем', - 'LBL_PRINT' => 'Печатать', + 'relatedid' => 'Связан с', + 'number' => '№', + 'yes' => 'Да', + 'no' => 'Нет', + 'From' => 'От', + 'To' => 'Для', + 'CC' => 'Копия', + 'BCC' => 'Скрытая копия', + 'Date' => 'Дата', + 'Subject' => 'Тема', + 'Content' => 'Содержание', + 'SendType' => 'Статус', + 'Sent' => 'Отправлено', + 'Received' => 'Получено', + 'Internal' => 'Внутренний', + 'Sent' => 'Отправлено', + 'Spam' => 'Спам', + 'Trash' => 'В корзине', + 'Fromaddress' => 'С адреса', + 'Toaddress' => 'На адрес', + 'messageid' => 'ID сообщения', + 'Reply_to_email' => 'Ответить', + 'Reply_toaddress' => 'Переслать на адрес', + 'Attachments_Exist' => 'Вложение', + 'Email_list' => 'Просмотр почты', + 'Widget list limit' => 'Количество сообщений', + '_self' => 'Открывать в этом же окне', + '_blank' => 'Открывать в новом окне', + 'List open email' => 'Выберите, как открывать письмо', + 'emailPreviewHeader' => 'Предварительный просмотр', + 'Email_list' => 'Просмотр почты', + 'LBL_CREATEMAIL' => 'Написать Письмо', + 'LBL_OUTCOMING' => 'Исходящие', + 'LBL_INCOMING' => 'Входящие', + 'Internal' => 'Внутренний', + 'LBL_REPLYALLL' => 'Ответить всем', + 'LBL_PRINT' => 'Печатать', 'LBL_FORWARD' => 'Переслать', - 'LBL_VERIFY' => 'Контроллер', - 'LBL_REL_MOD' => 'Связанный модуль', - 'LBL_BindMailsOK' => 'Помеченные письма на связываются, при следующем запуске обработчика сообщение будет связано с записью', - 'LBL_BindMails' => 'Связать письма', - 'LBL_ChangeType' => 'Изменить статус', - 'LBL_SELECT_TYPE' => 'Выберите статус', - 'ChangeType' => 'Изменение статуса сообщения', - 'Alert_ChangeType_desc' => 'Все виды выбранный адрес электронной почты будет изменен, без возможности отменить изменения.', - 'LBL_ChangeTypeOK' => 'Изменен статус сообщения', - 'Configuration' => 'Настройка просмотра почты', + 'LBL_VERIFY' => 'Контроллер', + 'LBL_REL_MOD' => 'Связанный модуль', + 'LBL_BindMailsOK' => 'Помеченные письма на связываются, при следующем запуске обработчика сообщение будет связано с записью', + 'LBL_BindMails' => 'Связать письма', + 'LBL_ChangeType' => 'Изменить статус', + 'LBL_SELECT_TYPE' => 'Выберите статус', + 'ChangeType' => 'Изменение статуса сообщения', + 'Alert_ChangeType_desc' => 'Все виды выбранный адрес электронной почты будет изменен, без возможности отменить изменения.', + 'LBL_ChangeTypeOK' => 'Изменен статус сообщения', + 'Configuration' => 'Настройка просмотра почты', 'Date of receipt' => 'Дата поступления', 'LBL_NO_MAILS' => 'No emails', - //dashboards - 'Graf' => 'Письма по статусу', + 'Graf' => 'Письма по статусу', ]; $jsLanguageStrings = [ - 'From' => 'От', - 'To' => 'Для', - 'CC' => 'Копия', - 'BCC' => 'Скрытая копия', - 'Date' => 'Дата', - 'Subject' => 'Тема', - 'Content' => 'Содержание', - 'JS_BIND_CONFIRM' => 'Вы уверены, что хотите связать выбранные сообщения?', + 'From' => 'От', + 'To' => 'Для', + 'CC' => 'Копия', + 'BCC' => 'Скрытая копия', + 'Date' => 'Дата', + 'Subject' => 'Тема', + 'Content' => 'Содержание', + 'JS_BIND_CONFIRM' => 'Вы уверены, что хотите связать выбранные сообщения?', ]; From 2a0f0b837229cf6d1b6ce04fb347bdd105e7f4d5 Mon Sep 17 00:00:00 2001 From: MaciejStencel Date: Wed, 9 Sep 2015 08:20:55 +0200 Subject: [PATCH 173/489] Fixed display of avaible phone fields to be used for sending SMS. Now shows only active fields. --- config/version.php | 2 +- layouts/vlayout/modules/Vtiger/SendSMSForm.tpl | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/version.php b/config/version.php index aebed0f90d3b..364982ab3fb3 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150909'; -$YetiForce_current_version = '2.2.72'; +$YetiForce_current_version = '2.2.73'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/layouts/vlayout/modules/Vtiger/SendSMSForm.tpl b/layouts/vlayout/modules/Vtiger/SendSMSForm.tpl index ee7396b0caa4..07856e7516cd 100644 --- a/layouts/vlayout/modules/Vtiger/SendSMSForm.tpl +++ b/layouts/vlayout/modules/Vtiger/SendSMSForm.tpl @@ -38,6 +38,7 @@ get('allowassignedrecordsto')} checked=""{/if} {if $RECORD_MODEL->get('allowassignedrecordsto') eq '1'} checked="" {/if} name="allowassignedrecordsto" data-handler="new" class="alignTop"/>  - {vtranslate('LBL_ALL_USERS',$QUALIFIED_MODULE)} - -
    -
    - -
    -
    - -
    -
    - -
    +

    -
    - -
    -
    - -
    +

    @@ -97,18 +73,22 @@
    -
    - get('listrelatedrecord')} checked="" {/if} name="listRelatedRecord" class="alignTop"/> -
    +

    -
    - get('previewrelatedrecord')} checked="" {/if} name="previewRelatedRecord" class="alignTop"/> -
    +

    @@ -127,24 +107,11 @@
    -
    - -
    -
    - -
    -
    - -
    +

    From 41e5223933359a71432a67d3d0b16ee5f0e92db8 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Wed, 9 Sep 2015 12:17:19 +0200 Subject: [PATCH 178/489] Rebuilt roles configuration --- .../vlayout/modules/Settings/Roles/EditView.tpl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/layouts/vlayout/modules/Settings/Roles/EditView.tpl b/layouts/vlayout/modules/Settings/Roles/EditView.tpl index 63e778d3fc64..d1f116d564a3 100644 --- a/layouts/vlayout/modules/Settings/Roles/EditView.tpl +++ b/layouts/vlayout/modules/Settings/Roles/EditView.tpl @@ -54,10 +54,16 @@
    - +
    + +
    +
    + +

    From 80a1e2528f379e9988f8427fc006e0c1a760bf14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Ko=C5=84?= Date: Wed, 9 Sep 2015 15:52:15 +0200 Subject: [PATCH 179/489] Fix #1924 Added pagination to recycle bin --- config/version.php | 2 +- modules/RecycleBin/views/List.php | 30 ++++--- modules/RecycleBin/views/Pagination.php | 115 ++++++++++++++++++++++++ 3 files changed, 134 insertions(+), 13 deletions(-) create mode 100644 modules/RecycleBin/views/Pagination.php diff --git a/config/version.php b/config/version.php index 754ef05cb65c..b26e5a080482 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150909'; -$YetiForce_current_version = '2.2.74'; +$YetiForce_current_version = '2.2.75'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/modules/RecycleBin/views/List.php b/modules/RecycleBin/views/List.php index aec1c21fd3c3..122702c8c4ad 100644 --- a/modules/RecycleBin/views/List.php +++ b/modules/RecycleBin/views/List.php @@ -147,20 +147,26 @@ public function initializeListViewContents(Vtiger_Request $request, Vtiger_Viewe $viewer->assign('SOURCE_MODULE', $sourceModule); $viewer->assign('DELETED_RECORDS_TOTAL_COUNT', $moduleModel->getDeletedRecordsTotalCount()); - if (PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false)) { - if (!$this->listViewCount) { - $this->listViewCount = $listViewModel->getListViewCount(); - } - $totalCount = $this->listViewCount; - $pageLimit = $pagingModel->getPageLimit(); - $pageCount = ceil((int) $totalCount / (int) $pageLimit); + + if (!$this->listViewCount) { + $this->listViewCount = $listViewModel->getListViewCount(); + } + $totalCount = $this->listViewCount; + $pageLimit = $pagingModel->getPageLimit(); + $pageCount = ceil((int) $totalCount / (int) $pageLimit); - if ($pageCount == 0) { - $pageCount = 1; - } - $viewer->assign('PAGE_COUNT', $pageCount); - $viewer->assign('LISTVIEW_COUNT', $totalCount); + if ($pageCount == 0) { + $pageCount = 1; } + $startPaginFrom = $pageNumber - 2; + if($pageNumber == $totalCount && 1 != $pageNumber) + $startPaginFrom = $pageNumber - 4; + if($startPaginFrom <= 0 || 1 == $pageNumber) + $startPaginFrom = 1; + + $viewer->assign('PAGE_COUNT', $pageCount); + $viewer->assign('LISTVIEW_COUNT', $totalCount); + $viewer->assign('START_PAGIN_FROM', $startPaginFrom); $viewer->assign('IS_MODULE_DELETABLE', $listViewModel->getModule()->isPermitted('Delete')); } diff --git a/modules/RecycleBin/views/Pagination.php b/modules/RecycleBin/views/Pagination.php new file mode 100644 index 000000000000..e97e4723ec21 --- /dev/null +++ b/modules/RecycleBin/views/Pagination.php @@ -0,0 +1,115 @@ +exposeMethod('getPagination'); + } + + public function getPagination(Vtiger_Request $request) + { + $viewer = $this->getViewer($request); + $moduleName = $request->getModule(); + $sourceModule = $request->get('sourceModule'); + + $pageNumber = $request->get('page'); + $orderBy = $request->get('orderby'); + $sortOrder = $request->get('sortorder'); + if ($sortOrder == "ASC") { + $nextSortOrder = "DESC"; + $sortImage = "glyphicon glyphicon-chevron-down"; + } else { + $nextSortOrder = "ASC"; + $sortImage = "glyphicon glyphicon-chevron-up"; + } + + if (empty($pageNumber)) { + $pageNumber = '1'; + } + + $moduleModel = RecycleBin_Module_Model::getInstance($moduleName); + //If sourceModule is empty, pick the first module name from the list + if (empty($sourceModule)) { + foreach ($moduleModel->getAllModuleList() as $model) { + $sourceModule = $model->get('name'); + break; + } + } + $listViewModel = RecycleBin_ListView_Model::getInstance($moduleName, $sourceModule); + + $linkParams = array('MODULE' => $moduleName, 'ACTION' => $request->get('view')); + $linkModels = $moduleModel->getListViewMassActions($linkParams); + + $pagingModel = new Vtiger_Paging_Model(); + $pagingModel->set('page', $pageNumber); + if (empty($orderBy) && empty($sortOrder)) { + $moduleInstance = CRMEntity::getInstance($moduleName); + $orderBy = $moduleInstance->default_order_by; + $sortOrder = $moduleInstance->default_sort_order; + } + if (!empty($orderBy)) { + $listViewModel->set('orderby', $orderBy); + $listViewModel->set('sortorder', $sortOrder); + } + + if (!$this->listViewHeaders) { + $this->listViewHeaders = $listViewModel->getListViewHeaders(); + } + if (!$this->listViewEntries) { + $this->listViewEntries = $listViewModel->getListViewEntries($pagingModel); + } + $noOfEntries = count($this->listViewEntries); + + $viewer->assign('MODULE', $moduleName); + + $viewer->assign('LISTVIEW_LINKS', $moduleModel->getListViewLinks()); + $viewer->assign('LISTVIEW_MASSACTIONS', $linkModels); + + $viewer->assign('PAGING_MODEL', $pagingModel); + $viewer->assign('PAGE_NUMBER', $pageNumber); + + $viewer->assign('ORDER_BY', $orderBy); + $viewer->assign('SORT_ORDER', $sortOrder); + $viewer->assign('NEXT_SORT_ORDER', $nextSortOrder); + $viewer->assign('SORT_IMAGE', $sortImage); + $viewer->assign('COLUMN_NAME', $orderBy); + + $viewer->assign('LISTVIEW_ENTRIES_COUNT', $noOfEntries); + $viewer->assign('LISTVIEW_HEADERS', $this->listViewHeaders); + $viewer->assign('LISTVIEW_ENTRIES', $this->listViewEntries); + $viewer->assign('MODULE_LIST', $moduleModel->getAllModuleList()); + $viewer->assign('SOURCE_MODULE', $sourceModule); + $viewer->assign('DELETED_RECORDS_TOTAL_COUNT', $moduleModel->getDeletedRecordsTotalCount()); + + + if (!$this->listViewCount) { + $this->listViewCount = $listViewModel->getListViewCount(); + } + $totalCount = $this->listViewCount; + $pageLimit = $pagingModel->getPageLimit(); + $pageCount = ceil((int) $totalCount / (int) $pageLimit); + + if ($pageCount == 0) { + $pageCount = 1; + } + $startPaginFrom = $pageNumber - 2; + if($pageNumber == $totalCount && 1 != $pageNumber) + $startPaginFrom = $pageNumber - 4; + if($startPaginFrom <= 0 || 1 == $pageNumber) + $startPaginFrom = 1; + + $viewer->assign('PAGE_COUNT', $pageCount); + $viewer->assign('LISTVIEW_COUNT', $totalCount); + $viewer->assign('START_PAGIN_FROM', $startPaginFrom); + $viewer->assign('IS_MODULE_DELETABLE', $listViewModel->getModule()->isPermitted('Delete')); + echo $viewer->view('Pagination.tpl', $moduleName, true); + } + + public function transferListSearchParamsToFilterCondition($listSearchParams, $moduleModel) + { + return Vtiger_Util_Helper::transferListSearchParamsToFilterCondition($listSearchParams, $moduleModel); + } +} From b5d4ad06e009c925a5310b7183cda61bece0ca08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Ko=C5=84?= Date: Thu, 10 Sep 2015 09:43:44 +0200 Subject: [PATCH 180/489] Fix #1911 --- config/version.php | 4 ++-- modules/Vtiger/uitypes/Currency.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/version.php b/config/version.php index b26e5a080482..f3e0af7d437a 100644 --- a/config/version.php +++ b/config/version.php @@ -8,6 +8,6 @@ * All Rights Reserved. * Contributor(s): YetiForce.com * ****************************************************************************** */ -$patch_version = '20150909'; -$YetiForce_current_version = '2.2.75'; +$patch_version = '20150910'; +$YetiForce_current_version = '2.2.76'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/modules/Vtiger/uitypes/Currency.php b/modules/Vtiger/uitypes/Currency.php index 521851cc7983..5642f6b86342 100644 --- a/modules/Vtiger/uitypes/Currency.php +++ b/modules/Vtiger/uitypes/Currency.php @@ -122,6 +122,8 @@ public function getDetailViewDisplayValue($value, $recordId, $uiType) if ($uiType == '72' && $recordId) { $moduleName = $this->get('field')->getModuleName(); + if(!$moduleName) + $moduleName = Vtiger_Functions::getCRMRecordType($recordId); if ($this->get('field')->getName() == 'unit_price') { $currencyId = getProductBaseCurrency($recordId, $moduleName); $cursym_convrate = getCurrencySymbolandCRate($currencyId); From 370db8544d42184a8663ec83fcaffe3edf8e0a98 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Thu, 10 Sep 2015 09:54:47 +0200 Subject: [PATCH 181/489] Fix #1886 --- config/version.php | 2 +- webservice.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/version.php b/config/version.php index f3e0af7d437a..fcbd24c9c7b9 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150910'; -$YetiForce_current_version = '2.2.76'; +$YetiForce_current_version = '2.2.77'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/webservice.php b/webservice.php index 3f122c632f0e..b25ecfb8a0ca 100644 --- a/webservice.php +++ b/webservice.php @@ -35,6 +35,7 @@ global $seclog,$log; $seclog =& LoggerManager::getLogger('SECURITY'); $log =& LoggerManager::getLogger('webservice'); + $adb =& PearDatabase::getInstance(); function getRequestParamsArrayForOperation($operation){ global $operationInput; From 28a78e16689b7fb3b6941153612d7aae3f8f9c82 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Thu, 10 Sep 2015 10:26:57 +0200 Subject: [PATCH 182/489] Fix #1834 FIx #1921 --- config/version.php | 2 +- layouts/vlayout/modules/OSSMail/resources/Global.js | 4 ++-- layouts/vlayout/modules/OSSMail/resources/Global.min.js | 2 +- .../plugins/thunderbird_labels/thunderbird_labels.php | 8 +++++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/config/version.php b/config/version.php index fcbd24c9c7b9..281f0ad5b7d8 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150910'; -$YetiForce_current_version = '2.2.77'; +$YetiForce_current_version = '2.2.78'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/layouts/vlayout/modules/OSSMail/resources/Global.js b/layouts/vlayout/modules/OSSMail/resources/Global.js index bf68b864c2cd..296d69cc22ae 100644 --- a/layouts/vlayout/modules/OSSMail/resources/Global.js +++ b/layouts/vlayout/modules/OSSMail/resources/Global.js @@ -49,7 +49,7 @@ function load_all_widgets(inframe, crm_path) { params['from_email'] = fromEmail[1]; } params['from_name'] = inframe.find('.from .rcmContactAddress').text(); - params['title'] = inframe.find('.subject').text(); + params['title'] = inframe.find('.subject').text().replace("Subject: ", ""); params['body'] = inframe.find('#messagebody').text(); gcrm['uid'] = params['uid'] = inframe.find('#message-oss-parameters-uid').text(); gcrm['folder'] = params['folder'] = inframe.find('#message-oss-parameters-folder').text(); @@ -65,7 +65,7 @@ function load_all_widgets(inframe, crm_path) { params['from_email'] = fromEmail[1]; } params['from_name'] = inframe2.find('.from .rcmContactAddress').text(); - params['title'] = inframe2.find('.subject').text(); + params['title'] = inframe2.find('.subject').text().replace("Subject: ", ""); params['body'] = inframe2.find('#messagebody').text(); gcrm['uid'] = params['uid'] = inframe2.find('#message-oss-parameters-uid').text(); gcrm['folder'] = params['folder'] = inframe2.find('#message-oss-parameters-folder').text(); diff --git a/layouts/vlayout/modules/OSSMail/resources/Global.min.js b/layouts/vlayout/modules/OSSMail/resources/Global.min.js index f0131112a64a..59dbe01e7f77 100644 --- a/layouts/vlayout/modules/OSSMail/resources/Global.min.js +++ b/layouts/vlayout/modules/OSSMail/resources/Global.min.js @@ -1,2 +1,2 @@ -$("#roundcube_interface").load(function(){var b=$("#roundcube_interface").contents();var a=getAbsolutePath();load_all_widgets(b,a);load_ical_attachments(b,a)});function load_ical_attachments(b,a){$(b.find("#messagecontent .icalattachments a")).click(function(){var c={};c.data={module:"Calendar",action:"ImportICS",ics:$(this).attr("class")};c.async=true;c.dataType="json";$(this).closest(".icalattachments").remove();AppConnector.request(c).then(function(d){var e={text:d.result,type:"info",animation:"show"};Vtiger_Helper_Js.showPnotify(e)})})}function load_all_widgets(g,d){if(!g){var g=$("#roundcube_interface").contents()}if(!d){var d=getAbsolutePath()}var f={};var c={};if(!g.find(".oss-header").text()==""){var e="";var b=g.find(".from .rcmContactAddress").attr("href");if(!!b){var a=b.split(":");f.from_email=a[1]}f.from_name=g.find(".from .rcmContactAddress").text();f.title=g.find(".subject").text();f.body=g.find("#messagebody").text();c.uid=f.uid=g.find("#message-oss-parameters-uid").text();c.folder=f.folder=g.find("#message-oss-parameters-folder").text();c.username=f.username=g.find("#message-oss-parameters-username").text();load_connection(d,c,f,g,e)}$(g.find("#messagelist")).click(function(){$(g.find("#messagecontframe")).load(function(){var i=$(g.find("#messagecontframe")).contents();var j=i.find(".from .rcmContactAddress").attr("href");if(!!j){var h=j.split(":");f.from_email=h[1]}f.from_name=i.find(".from .rcmContactAddress").text();f.title=i.find(".subject").text();f.body=i.find("#messagebody").text();c.uid=f.uid=i.find("#message-oss-parameters-uid").text();c.folder=f.folder=i.find("#message-oss-parameters-folder").text();c.username=f.username=i.find("#message-oss-parameters-username").text();load_connection(d,c,f,i,e)})})}function load_connection(c,b,e,f,d){var a=jQuery.ajax({type:"GET",async:true,url:c+"index.php",data:{module:"OSSMail",action:"getConfig"}});jqxhr=get_crm_id(b);jqxhr.done(function(h){e.crmid=h.result;var g=find_crm_detail(c,"all",e);a.done(function(i){g.done(function(k){if(h.result!=="false"){var j=0;if(h.result.id!==undefined){j=h.result.id}if(h.result["0_created_Email"]!==undefined){j=h.result["0_created_Email"]["created_Email"]}if(j===0){load_oss_bar_no_mail(f,e)}else{e.crmid=j;load_oss_bar(f,e.crmid,i.result,k.result);load_action(f,e)}}})})})}function load_action(b,a){$(b.find("#message-oss-header a.link")).click(function(){var c=$(this).attr("href");window.location.href=c});$(b.find("#message-oss-header .oss-add-Vendors")).click(function(){loadQuickCreateForm("Vendors",a,b)});$(b.find("#message-oss-header .oss-add-Accounts")).click(function(){loadQuickCreateForm("Accounts",a,b)});$(b.find("#message-oss-header .oss-add-Contacts")).click(function(){loadQuickCreateForm("Contacts",a,b)});$(b.find("#message-oss-header .oss-add-Leads")).click(function(){loadQuickCreateForm("Leads",a,b)});$(b.find("#message-oss-header .oss-add-Potentials")).click(function(){loadQuickCreateForm("Potentials",a,b)});$(b.find("#message-oss-header .oss-add-Project")).click(function(){loadQuickCreateForm("Project",a,b)});$(b.find("#message-oss-header .oss-add-ServiceContracts")).click(function(){loadQuickCreateForm("ServiceContracts",a,b)});$(b.find("#message-oss-header .oss-add-HelpDesk")).click(function(){if($(this).attr("data-module")&&$(this).attr("data-module")!="HelpDesk"){a.sourceModule=$(this).attr("data-module");a.crmid=$(this).attr("data-crmid")}loadQuickCreateForm("HelpDesk",a,b)});$(b.find("#message-oss-header .oss-remove-relation")).click(function(){var c={mailId:a.crmid,crmid:$(this).attr("data-crmid")};executeActions("removeRelated",c);load_all_widgets()});$(b.find("#message-oss-header .oss-Related")).click(function(){var f={mailId:a.crmid};if($(this).attr("data-crmid")){f.crmid=$(this).attr("data-crmid")}var c=$(this).attr("data-module");var d=jQuery('input[name="temp_field"]');var e={module:c,src_module:c,src_field:d.attr("name"),src_record:"",url:getAbsolutePath()+"/index.php?"};showPopup(e,d,f,b,true)});$(b.find("#message-oss-header .oss-add-modcomments")).click(function(){a.rcrmid=$(this).attr("data-crmid");a.no_rel=true;loadQuickCreateForm("ModComments",a,b)});$(b.find("#message-oss-header .oss-add-events")).click(function(){a.sourceModule=$(this).attr("data-module");a.crmid=$(this).attr("data-crmid");loadQuickCreateForm("Calendar",a,b)});$(b.find("#message-oss-header .oss-add-task")).click(function(){a.sourceModule=$(this).attr("data-module");a.crmid=$(this).attr("data-crmid");a.mode="task";loadQuickCreateForm("Calendar",a,b)});$(b.find("#message-oss-header .oss-add-products")).click(function(){var c="Products";var f={mailId:a.crmid,newModule:"Products",mod:$(this).attr("data-module"),crmid:$(this).attr("data-crmid"),};var d=jQuery('input[name="temp_field"]');var e={module:c,src_module:c,src_field:d.attr("name"),src_record:"",url:getAbsolutePath()+"/index.php?"};showPopup(e,d,f,b,true)});$(b.find("#message-oss-header .oss-add-services")).click(function(){var c="Services";var f={mailId:a.crmid,newModule:"Products",mod:$(this).attr("data-module"),crmid:$(this).attr("data-crmid"),};var d=jQuery('input[name="temp_field"]');var e={module:c,src_module:c,src_field:d.attr("name"),src_record:"",url:getAbsolutePath()+"/index.php?"};showPopup(e,d,f,b,true)});$(b.find("#moreheaderstoggle .oss-reload-bar")).click(function(){load_all_widgets()});$(b.find("#moreheaderstoggle .oss-close-bar")).click(function(){var e=b.find("#message-oss-header");var d=b.find("#messageheader");var c=d.height();if(e.data("show")==true){e.show().data("show",false);b.find("#messagecontent").css("top",(c+80)+"px");b.find("#moreheaderstoggle .oss-close-bar").html('')}else{e.hide().data("show",true);b.find("#messagecontent").css("top",(c)+"px");b.find("#moreheaderstoggle .oss-close-bar").html('')}});$(b.find("#moreheaderstoggle .oss-email-link")).click(function(){if(a.crmid){window.location.href=getAbsolutePath()+"index.php?module=OSSMailView&view=Detail&record="+a.crmid}else{alert(app.vtranslate("NoCrmRecord"))}})}function executeActions(a,c){var b={};var d={};d.data={module:"OSSMail",action:"executeActions",action_name:a,params:c};d.async=false;d.dataType="json";AppConnector.request(d).then(function(g){var e=g.result;if(e.success){var f={text:e.data,type:"info",animation:"show"}}else{var f={text:e.data,animation:"show"}}Vtiger_Helper_Js.showPnotify(f)})}function load_oss_bar_no_mail(b,a){b.find("#message-oss-header").html('
    '+app.vtranslate("JS_MAIL_NOT_FOUND_IN_DB")+' '+app.vtranslate("JS_MANUAL_IMPORT")+"
    ");b.find("#messagecontent").css("top",(b.find(".oss-header").outerHeight()+b.find("#messageheader").outerHeight()+1)+"px");$(b.find("#message-oss-header .import_mail")).click(function(){Vtiger_Helper_Js.showPnotify({text:app.vtranslate("StartedDownloadingEmail"),type:"info"});import_mail(a).then(function(c){load_all_widgets(b);Vtiger_Helper_Js.showPnotify({text:app.vtranslate("AddFindEmailInRecord"),type:"success"})})})}function import_mail(c){var a=jQuery.Deferred();var b={};b.data={module:"OSSMailScanner",action:"ImportMail",params:c};AppConnector.request(b).then(function(d){a.resolve(d)},function(d){a.reject()});return a.promise()}function load_oss_bar(y,F,D,a){var t=getAbsolutePath();var c=y.find("#messageheader");var B={};var A=c.find(".from .rcmContactAddress").attr("href");if(!!A){var m=A.split(":");B.from_email=m[1]}B.from_name=c.find(".from .rcmContactAddress").text();B.title=c.find(".subject").text();B.body=y.find("#messagebody").text();B.uid=y.find("#message-oss-parameters-uid").text();B.folder=y.find("#message-oss-parameters-folder").text();B.username=y.find("#message-oss-parameters-username").text();var v=get_module_permissions(t);var H=false;var r=false;var s=false;var n=false;var e=false;var E="";var p="";var o="";var C="";var f="";var z="";var q="";var G="";var b=t+"layouts/vlayout/skins/images/";window.images_path=b;var l="";var w="";var u={};var k="";var j="";var h="";var g="";if(a){if(a.Accounts){for(var x=0;x'+d.label+''+app.vtranslate('+app.vtranslate('+app.vtranslate(
    ';p+="
    "+load_icons("Accounts",d.crmid,v,b)+"
    "}}if(a.Contacts){for(var x=0;x'+d.label+''+app.vtranslate('+app.vtranslate('+app.vtranslate(
    ';p+="
    "+load_icons("Contacts",d.crmid,v,b)+"
    "}}if(a.Leads){for(var x=0;x'+d.label+''+app.vtranslate('+app.vtranslate('+app.vtranslate(
    ';p+="
    "+load_icons("Leads",d.crmid,v,b)+"
    "}}if(a.Vendors){for(var x=0;x'+d.label+''+app.vtranslate('+app.vtranslate('+app.vtranslate(
    '}}if(p==""){H=true}if(!a.Potentials){r=true}else{for(var x=0;x'+d.label+''+app.vtranslate('+app.vtranslate('+app.vtranslate(';o+="
    "+load_icons("Potentials",d.crmid,v,b)+"
    "}}if(a.Campaigns){for(var x=0;x'+d.label+""}}if(!a.Project){s=true}else{for(var x=0;x'+d.label+''+app.vtranslate('+app.vtranslate('+app.vtranslate(';f+="
    "+load_icons("Project",d.crmid,v,b)+"
    "}}if(!a.HelpDesk){n=true}else{for(var x=0;x'+d.label+''+app.vtranslate('+app.vtranslate('+app.vtranslate(';q+="
    "+load_icons("HelpDesk",d.crmid,v,b)+"
    "}}if(a.ServiceContracts){for(var x=0;x'+d.label+''+app.vtranslate('+app.vtranslate('+app.vtranslate('}}else{e=true}}else{var H=true;var r=true;var s=true;var n=true;var e=true}if(H){p+='
    '+app.vtranslate("Add or related to Leads")+''+app.vtranslate('+app.vtranslate(
    ';p+='
    '+app.vtranslate("Add or related to Contacts")+''+app.vtranslate('+app.vtranslate(
    ';p+='
    '+app.vtranslate("Add or related to Accounts")+''+app.vtranslate('+app.vtranslate(
    ';p+='
    '+app.vtranslate("Add or related to Vendors")+''+app.vtranslate('+app.vtranslate(
    '}if(r){o+=''+app.vtranslate("Add or related to Potentials")+''+app.vtranslate('+app.vtranslate('}if(s){f+=''+app.vtranslate("Add or related to Project")+''+app.vtranslate('+app.vtranslate('}if(n){q+='
    '+app.vtranslate("Add or related to HelpDesk")+''+app.vtranslate('+app.vtranslate(
    '}if(e){q+='
    '+app.vtranslate("Add or related to ServiceContracts")+''+app.vtranslate('+app.vtranslate(
    '}if(v.Accounts||v.Contacts||v.Leads||v.Vendors){k+=""+app.vtranslate("Marketing")+"";j+=''+p+""}if(v.Potentials||v.Campaigns){k+=""+app.vtranslate("MPotentials")+"";j+=''+o+""}if(v.Project){k+=""+app.vtranslate("MProject")+"";j+=''+f+""}if(v.HelpDesk){k+=""+app.vtranslate("MHelpDesk")+"";j+=''+q+""}y.find("#message-oss-header").html(''+k+''+j+"
    ");y.find("#moreheaderstoggle").html('');y.find("#messagecontent").css("top",(y.find(".oss-header").outerHeight()+y.find("#messageheader").outerHeight()+1)+"px")}function load_icons(a,e,c,b){var d="";if(c.Calendar){d+=''+app.vtranslate('+app.vtranslate('}if(c.ModComments){d+=''+app.vtranslate('}if(a=="Accounts"||a=="Contacts"||a=="Leads"||a=="Potentials"){if(c.Products){d+=''+app.vtranslate('}}if(a=="HelpDesk"||a=="Project"){if(c.HelpDesk){d+=''+app.vtranslate('}}if(a=="Accounts"||a=="Contacts"||a=="Leads"||a=="HelpDesk"||a=="Potentials"){if(c.Services){d+=''+app.vtranslate('}}return d}function get_module_permissions(a){var b;jQuery.ajax({type:"Post",async:false,dataType:"json",url:a+"index.php?module=OSSMail&action=GetPermissions",data:{View:"EditView"},success:function(c){b=c.result},failure:function(c){b=false}});return b}function getAbsolutePath(){return jQuery("#site_URL").val()}function oss_get_config(){var b={};var a={};b.data={module:"OSSMail",action:"getConfig"};b.async=false;b.dataType="json";AppConnector.request(b).then(function(c){a=c.result});return a}function find_crm_detail(c,a,b){var d=jQuery.ajax({type:"Post",async:true,dataType:"json",url:c+"index.php?module=OSSMail&action=findCrmDetail",data:{metod:a,params:b}});return d}function showPopup(g,e,f,h,a){var b=jQuery.Event(Vtiger_Edit_Js.preReferencePopUpOpenEvent);e.trigger(b);var d={};var c=Vtiger_Popup_Js.getInstance();show(g,function(j){var i=JSON.parse(j);for(var k in i){var j={name:i[k].name,id:k};e.val(j.id)}f.newModule=g.module;f.newCrmId=j.id;if(a){executeActions("addRelated",f);load_all_widgets()}})}function show(c,d,i,f,b){var h=Vtiger_Popup_Js.getInstance();if(typeof c=="undefined"){c={}}if(typeof c=="object"&&(typeof c.view=="undefined")){c.view="Popup"}if(typeof f=="undefined"){f="postSelection"+Math.floor(Math.random()*10000)}if(typeof i=="undefined"){i="test"}if(typeof c=="object"){c.triggerEventName=f}else{c+="&triggerEventName="+f}var e=(typeof c=="string")?c:jQuery.param(c);var a=c.url+e;var g=window.open(a,i,"width=800,height=650,resizable=0,scrollbars=1");if(typeof h.destroy=="function"){h.destroy()}jQuery.initWindowMsg();if(typeof d!="undefined"){h.retrieveSelectedRecords(d,f)}if(typeof b=="function"){jQuery.windowMsg("Vtiger.OnPopupWindowLoad.Event",function(j){b(j)})}return g}function get_crm_id(c){var a=getAbsolutePath();var b=jQuery.ajax({type:"GET",async:true,url:a+"index.php",data:{module:"OSSMail",action:"getCrmId",params:c}});return b}function loadQuickCreateForm(b,f,j){var e={};var g={};if(f.crmid){if(f.sourceModule){var h=f.sourceModule}else{var h="OSSMailView"}var m=function(p){var n,o,q;if(f.mode=="task"){p.find('a[data-tab-name="Task"]').trigger("click")}if(f.no_rel!="true"){jQuery('').appendTo(p);jQuery('').appendTo(p);jQuery('').appendTo(p)}};var l=["Leads","Contacts","Vendors","Accounts"];var d=["Campaigns","HelpDesk","Potentials","Project","ServiceContracts"];if($.inArray(f.sourceModule,l)>=0){g.link=f.crmid}if($.inArray(f.sourceModule,d)>=0){g.process=f.crmid}}var c=function(n){load_all_widgets()};var k="index.php?module="+b+"&view=QuickCreateAjax";g.email=f.from_email;g.potentialname=f.title;g.projectname=f.title;g.ticket_title=f.title;g.description=f.body;g.related_to=f.rcrmid;g.productname=f.title;g.servicename=f.title;e.callbackFunction=c;if(f.crmid){if(f.no_rel!="true"){g.sourceModule=h;g.sourceRecord=f.crmid;g.relationOperation=true;e.callbackPostShown=m}}e.data=g;e.noCache=true;var a=jQuery.progressIndicator();var i=new Vtiger_Header_Js();i.getQuickCreateForm(k,b,e).then(function(n){i.handleQuickCreateData(n,e);a.progressIndicator({mode:"hide"})})}function oss_add_task(a){Vtiger_Header_Js.getInstance().quickCreateModule("Calendar");$("#globalmodal").ready(function(){setTimeout(function(){jQuery('a[data-tab-name="Task"]').trigger("click");jQuery("#Calendar_editView_fieldName_subject").val(a.title);jQuery('').appendTo("#quickCreate");jQuery('').appendTo("#quickCreate");jQuery('').appendTo("#quickCreate");jQuery('').appendTo("#quickCreate")},1000)})}; \ No newline at end of file +$("#roundcube_interface").load(function(){var b=$("#roundcube_interface").contents();var a=getAbsolutePath();load_all_widgets(b,a);load_ical_attachments(b,a)});function load_ical_attachments(b,a){$(b.find("#messagecontent .icalattachments a")).click(function(){var c={};c.data={module:"Calendar",action:"ImportICS",ics:$(this).attr("class")};c.async=true;c.dataType="json";$(this).closest(".icalattachments").remove();AppConnector.request(c).then(function(d){var e={text:d.result,type:"info",animation:"show"};Vtiger_Helper_Js.showPnotify(e)})})}function load_all_widgets(g,d){if(!g){var g=$("#roundcube_interface").contents()}if(!d){var d=getAbsolutePath()}var f={};var c={};if(!g.find(".oss-header").text()==""){var e="";var b=g.find(".from .rcmContactAddress").attr("href");if(!!b){var a=b.split(":");f.from_email=a[1]}f.from_name=g.find(".from .rcmContactAddress").text();f.title=g.find(".subject").text().replace("Subject: ","");f.body=g.find("#messagebody").text();c.uid=f.uid=g.find("#message-oss-parameters-uid").text();c.folder=f.folder=g.find("#message-oss-parameters-folder").text();c.username=f.username=g.find("#message-oss-parameters-username").text();load_connection(d,c,f,g,e)}$(g.find("#messagelist")).click(function(){$(g.find("#messagecontframe")).load(function(){var i=$(g.find("#messagecontframe")).contents();var j=i.find(".from .rcmContactAddress").attr("href");if(!!j){var h=j.split(":");f.from_email=h[1]}f.from_name=i.find(".from .rcmContactAddress").text();f.title=i.find(".subject").text().replace("Subject: ","");f.body=i.find("#messagebody").text();c.uid=f.uid=i.find("#message-oss-parameters-uid").text();c.folder=f.folder=i.find("#message-oss-parameters-folder").text();c.username=f.username=i.find("#message-oss-parameters-username").text();load_connection(d,c,f,i,e)})})}function load_connection(c,b,e,f,d){var a=jQuery.ajax({type:"GET",async:true,url:c+"index.php",data:{module:"OSSMail",action:"getConfig"}});jqxhr=get_crm_id(b);jqxhr.done(function(h){e.crmid=h.result;var g=find_crm_detail(c,"all",e);a.done(function(i){g.done(function(k){if(h.result!=="false"){var j=0;if(h.result.id!==undefined){j=h.result.id}if(h.result["0_created_Email"]!==undefined){j=h.result["0_created_Email"]["created_Email"]}if(j===0){load_oss_bar_no_mail(f,e)}else{e.crmid=j;load_oss_bar(f,e.crmid,i.result,k.result);load_action(f,e)}}})})})}function load_action(b,a){$(b.find("#message-oss-header a.link")).click(function(){var c=$(this).attr("href");window.location.href=c});$(b.find("#message-oss-header .oss-add-Vendors")).click(function(){loadQuickCreateForm("Vendors",a,b)});$(b.find("#message-oss-header .oss-add-Accounts")).click(function(){loadQuickCreateForm("Accounts",a,b)});$(b.find("#message-oss-header .oss-add-Contacts")).click(function(){loadQuickCreateForm("Contacts",a,b)});$(b.find("#message-oss-header .oss-add-Leads")).click(function(){loadQuickCreateForm("Leads",a,b)});$(b.find("#message-oss-header .oss-add-Potentials")).click(function(){loadQuickCreateForm("Potentials",a,b)});$(b.find("#message-oss-header .oss-add-Project")).click(function(){loadQuickCreateForm("Project",a,b)});$(b.find("#message-oss-header .oss-add-ServiceContracts")).click(function(){loadQuickCreateForm("ServiceContracts",a,b)});$(b.find("#message-oss-header .oss-add-HelpDesk")).click(function(){if($(this).attr("data-module")&&$(this).attr("data-module")!="HelpDesk"){a.sourceModule=$(this).attr("data-module");a.crmid=$(this).attr("data-crmid")}loadQuickCreateForm("HelpDesk",a,b)});$(b.find("#message-oss-header .oss-remove-relation")).click(function(){var c={mailId:a.crmid,crmid:$(this).attr("data-crmid")};executeActions("removeRelated",c);load_all_widgets()});$(b.find("#message-oss-header .oss-Related")).click(function(){var f={mailId:a.crmid};if($(this).attr("data-crmid")){f.crmid=$(this).attr("data-crmid")}var c=$(this).attr("data-module");var d=jQuery('input[name="temp_field"]');var e={module:c,src_module:c,src_field:d.attr("name"),src_record:"",url:getAbsolutePath()+"/index.php?"};showPopup(e,d,f,b,true)});$(b.find("#message-oss-header .oss-add-modcomments")).click(function(){a.rcrmid=$(this).attr("data-crmid");a.no_rel=true;loadQuickCreateForm("ModComments",a,b)});$(b.find("#message-oss-header .oss-add-events")).click(function(){a.sourceModule=$(this).attr("data-module");a.crmid=$(this).attr("data-crmid");loadQuickCreateForm("Calendar",a,b)});$(b.find("#message-oss-header .oss-add-task")).click(function(){a.sourceModule=$(this).attr("data-module");a.crmid=$(this).attr("data-crmid");a.mode="task";loadQuickCreateForm("Calendar",a,b)});$(b.find("#message-oss-header .oss-add-products")).click(function(){var c="Products";var f={mailId:a.crmid,newModule:"Products",mod:$(this).attr("data-module"),crmid:$(this).attr("data-crmid"),};var d=jQuery('input[name="temp_field"]');var e={module:c,src_module:c,src_field:d.attr("name"),src_record:"",url:getAbsolutePath()+"/index.php?"};showPopup(e,d,f,b,true)});$(b.find("#message-oss-header .oss-add-services")).click(function(){var c="Services";var f={mailId:a.crmid,newModule:"Products",mod:$(this).attr("data-module"),crmid:$(this).attr("data-crmid"),};var d=jQuery('input[name="temp_field"]');var e={module:c,src_module:c,src_field:d.attr("name"),src_record:"",url:getAbsolutePath()+"/index.php?"};showPopup(e,d,f,b,true)});$(b.find("#moreheaderstoggle .oss-reload-bar")).click(function(){load_all_widgets()});$(b.find("#moreheaderstoggle .oss-close-bar")).click(function(){var e=b.find("#message-oss-header");var d=b.find("#messageheader");var c=d.height();if(e.data("show")==true){e.show().data("show",false);b.find("#messagecontent").css("top",(c+80)+"px");b.find("#moreheaderstoggle .oss-close-bar").html('')}else{e.hide().data("show",true);b.find("#messagecontent").css("top",(c)+"px");b.find("#moreheaderstoggle .oss-close-bar").html('')}});$(b.find("#moreheaderstoggle .oss-email-link")).click(function(){if(a.crmid){window.location.href=getAbsolutePath()+"index.php?module=OSSMailView&view=Detail&record="+a.crmid}else{alert(app.vtranslate("NoCrmRecord"))}})}function executeActions(a,c){var b={};var d={};d.data={module:"OSSMail",action:"executeActions",action_name:a,params:c};d.async=false;d.dataType="json";AppConnector.request(d).then(function(g){var e=g.result;if(e.success){var f={text:e.data,type:"info",animation:"show"}}else{var f={text:e.data,animation:"show"}}Vtiger_Helper_Js.showPnotify(f)})}function load_oss_bar_no_mail(b,a){b.find("#message-oss-header").html('
    '+app.vtranslate("JS_MAIL_NOT_FOUND_IN_DB")+' '+app.vtranslate("JS_MANUAL_IMPORT")+"
    ");b.find("#messagecontent").css("top",(b.find(".oss-header").outerHeight()+b.find("#messageheader").outerHeight()+1)+"px");$(b.find("#message-oss-header .import_mail")).click(function(){Vtiger_Helper_Js.showPnotify({text:app.vtranslate("StartedDownloadingEmail"),type:"info"});import_mail(a).then(function(c){load_all_widgets(b);Vtiger_Helper_Js.showPnotify({text:app.vtranslate("AddFindEmailInRecord"),type:"success"})})})}function import_mail(c){var a=jQuery.Deferred();var b={};b.data={module:"OSSMailScanner",action:"ImportMail",params:c};AppConnector.request(b).then(function(d){a.resolve(d)},function(d){a.reject()});return a.promise()}function load_oss_bar(y,F,D,a){var t=getAbsolutePath();var c=y.find("#messageheader");var B={};var A=c.find(".from .rcmContactAddress").attr("href");if(!!A){var m=A.split(":");B.from_email=m[1]}B.from_name=c.find(".from .rcmContactAddress").text();B.title=c.find(".subject").text();B.body=y.find("#messagebody").text();B.uid=y.find("#message-oss-parameters-uid").text();B.folder=y.find("#message-oss-parameters-folder").text();B.username=y.find("#message-oss-parameters-username").text();var v=get_module_permissions(t);var H=false;var r=false;var s=false;var n=false;var e=false;var E="";var p="";var o="";var C="";var f="";var z="";var q="";var G="";var b=t+"layouts/vlayout/skins/images/";window.images_path=b;var l="";var w="";var u={};var k="";var j="";var h="";var g="";if(a){if(a.Accounts){for(var x=0;x'+d.label+''+app.vtranslate('+app.vtranslate('+app.vtranslate(
    ';p+="
    "+load_icons("Accounts",d.crmid,v,b)+"
    "}}if(a.Contacts){for(var x=0;x'+d.label+''+app.vtranslate('+app.vtranslate('+app.vtranslate(
    ';p+="
    "+load_icons("Contacts",d.crmid,v,b)+"
    "}}if(a.Leads){for(var x=0;x'+d.label+''+app.vtranslate('+app.vtranslate('+app.vtranslate(';p+="
    "+load_icons("Leads",d.crmid,v,b)+"
    "}}if(a.Vendors){for(var x=0;x'+d.label+''+app.vtranslate('+app.vtranslate('+app.vtranslate('}}if(p==""){H=true}if(!a.Potentials){r=true}else{for(var x=0;x'+d.label+''+app.vtranslate('+app.vtranslate('+app.vtranslate(';o+="
    "+load_icons("Potentials",d.crmid,v,b)+"
    "}}if(a.Campaigns){for(var x=0;x'+d.label+""}}if(!a.Project){s=true}else{for(var x=0;x'+d.label+''+app.vtranslate('+app.vtranslate('+app.vtranslate(';f+="
    "+load_icons("Project",d.crmid,v,b)+"
    "}}if(!a.HelpDesk){n=true}else{for(var x=0;x'+d.label+''+app.vtranslate('+app.vtranslate('+app.vtranslate(';q+="
    "+load_icons("HelpDesk",d.crmid,v,b)+"
    "}}if(a.ServiceContracts){for(var x=0;x'+d.label+''+app.vtranslate('+app.vtranslate('+app.vtranslate('}}else{e=true}}else{var H=true;var r=true;var s=true;var n=true;var e=true}if(H){p+='
    '+app.vtranslate("Add or related to Leads")+''+app.vtranslate('+app.vtranslate(
    ';p+='
    '+app.vtranslate("Add or related to Contacts")+''+app.vtranslate('+app.vtranslate(
    ';p+='
    '+app.vtranslate("Add or related to Accounts")+''+app.vtranslate('+app.vtranslate(
    ';p+='
    '+app.vtranslate("Add or related to Vendors")+''+app.vtranslate('+app.vtranslate(
    '}if(r){o+=''+app.vtranslate("Add or related to Potentials")+''+app.vtranslate('+app.vtranslate('}if(s){f+=''+app.vtranslate("Add or related to Project")+''+app.vtranslate('+app.vtranslate('}if(n){q+='
    '+app.vtranslate("Add or related to HelpDesk")+''+app.vtranslate('+app.vtranslate(
    '}if(e){q+='
    '+app.vtranslate("Add or related to ServiceContracts")+''+app.vtranslate('+app.vtranslate(
    '}if(v.Accounts||v.Contacts||v.Leads||v.Vendors){k+=""+app.vtranslate("Marketing")+"";j+=''+p+""}if(v.Potentials||v.Campaigns){k+=""+app.vtranslate("MPotentials")+"";j+=''+o+""}if(v.Project){k+=""+app.vtranslate("MProject")+"";j+=''+f+""}if(v.HelpDesk){k+=""+app.vtranslate("MHelpDesk")+"";j+=''+q+""}y.find("#message-oss-header").html(''+k+''+j+"
    ");y.find("#moreheaderstoggle").html('');y.find("#messagecontent").css("top",(y.find(".oss-header").outerHeight()+y.find("#messageheader").outerHeight()+1)+"px")}function load_icons(a,e,c,b){var d="";if(c.Calendar){d+=''+app.vtranslate('+app.vtranslate('}if(c.ModComments){d+=''+app.vtranslate('}if(a=="Accounts"||a=="Contacts"||a=="Leads"||a=="Potentials"){if(c.Products){d+=''+app.vtranslate('}}if(a=="HelpDesk"||a=="Project"){if(c.HelpDesk){d+=''+app.vtranslate('}}if(a=="Accounts"||a=="Contacts"||a=="Leads"||a=="HelpDesk"||a=="Potentials"){if(c.Services){d+=''+app.vtranslate('}}return d}function get_module_permissions(a){var b;jQuery.ajax({type:"Post",async:false,dataType:"json",url:a+"index.php?module=OSSMail&action=GetPermissions",data:{View:"EditView"},success:function(c){b=c.result},failure:function(c){b=false}});return b}function getAbsolutePath(){return jQuery("#site_URL").val()}function oss_get_config(){var b={};var a={};b.data={module:"OSSMail",action:"getConfig"};b.async=false;b.dataType="json";AppConnector.request(b).then(function(c){a=c.result});return a}function find_crm_detail(c,a,b){var d=jQuery.ajax({type:"Post",async:true,dataType:"json",url:c+"index.php?module=OSSMail&action=findCrmDetail",data:{metod:a,params:b}});return d}function showPopup(g,e,f,h,a){var b=jQuery.Event(Vtiger_Edit_Js.preReferencePopUpOpenEvent);e.trigger(b);var d={};var c=Vtiger_Popup_Js.getInstance();show(g,function(j){var i=JSON.parse(j);for(var k in i){var j={name:i[k].name,id:k};e.val(j.id)}f.newModule=g.module;f.newCrmId=j.id;if(a){executeActions("addRelated",f);load_all_widgets()}})}function show(c,d,i,f,b){var h=Vtiger_Popup_Js.getInstance();if(typeof c=="undefined"){c={}}if(typeof c=="object"&&(typeof c.view=="undefined")){c.view="Popup"}if(typeof f=="undefined"){f="postSelection"+Math.floor(Math.random()*10000)}if(typeof i=="undefined"){i="test"}if(typeof c=="object"){c.triggerEventName=f}else{c+="&triggerEventName="+f}var e=(typeof c=="string")?c:jQuery.param(c);var a=c.url+e;var g=window.open(a,i,"width=800,height=650,resizable=0,scrollbars=1");if(typeof h.destroy=="function"){h.destroy()}jQuery.initWindowMsg();if(typeof d!="undefined"){h.retrieveSelectedRecords(d,f)}if(typeof b=="function"){jQuery.windowMsg("Vtiger.OnPopupWindowLoad.Event",function(j){b(j)})}return g}function get_crm_id(c){var a=getAbsolutePath();var b=jQuery.ajax({type:"GET",async:true,url:a+"index.php",data:{module:"OSSMail",action:"getCrmId",params:c}});return b}function loadQuickCreateForm(b,f,j){var e={};var g={};if(f.crmid){if(f.sourceModule){var h=f.sourceModule}else{var h="OSSMailView"}var m=function(p){var n,o,q;if(f.mode=="task"){p.find('a[data-tab-name="Task"]').trigger("click")}if(f.no_rel!="true"){jQuery('').appendTo(p);jQuery('').appendTo(p);jQuery('').appendTo(p)}};var l=["Leads","Contacts","Vendors","Accounts"];var d=["Campaigns","HelpDesk","Potentials","Project","ServiceContracts"];if($.inArray(f.sourceModule,l)>=0){g.link=f.crmid}if($.inArray(f.sourceModule,d)>=0){g.process=f.crmid}}var c=function(n){load_all_widgets()};var k="index.php?module="+b+"&view=QuickCreateAjax";g.email=f.from_email;g.potentialname=f.title;g.projectname=f.title;g.ticket_title=f.title;g.description=f.body;g.related_to=f.rcrmid;g.productname=f.title;g.servicename=f.title;e.callbackFunction=c;if(f.crmid){if(f.no_rel!="true"){g.sourceModule=h;g.sourceRecord=f.crmid;g.relationOperation=true;e.callbackPostShown=m}}e.data=g;e.noCache=true;var a=jQuery.progressIndicator();var i=new Vtiger_Header_Js();i.getQuickCreateForm(k,b,e).then(function(n){i.handleQuickCreateData(n,e);a.progressIndicator({mode:"hide"})})}function oss_add_task(a){Vtiger_Header_Js.getInstance().quickCreateModule("Calendar");$("#globalmodal").ready(function(){setTimeout(function(){jQuery('a[data-tab-name="Task"]').trigger("click");jQuery("#Calendar_editView_fieldName_subject").val(a.title);jQuery('').appendTo("#quickCreate");jQuery('').appendTo("#quickCreate");jQuery('').appendTo("#quickCreate");jQuery('').appendTo("#quickCreate")},1000)})}; \ No newline at end of file diff --git a/modules/OSSMail/roundcube/plugins/thunderbird_labels/thunderbird_labels.php b/modules/OSSMail/roundcube/plugins/thunderbird_labels/thunderbird_labels.php index cc414ded28bb..1ade296cee47 100644 --- a/modules/OSSMail/roundcube/plugins/thunderbird_labels/thunderbird_labels.php +++ b/modules/OSSMail/roundcube/plugins/thunderbird_labels/thunderbird_labels.php @@ -297,9 +297,11 @@ public function color_headers($p) { #write_log($this->name, print_r($p, true)); # -- always write array, even when empty - $p['content'] .= ''; + if($p['class'] == 'headers-table'){ + $p['content'] .= ''; + } return $p; } From 0b0021c04580231d959c011c0ee8ccb1b5c31b41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Skrzypczak?= Date: Thu, 10 Sep 2015 11:02:49 +0200 Subject: [PATCH 183/489] Improved save inventory fields in administration. --- config/version.php | 2 +- .../LayoutEditor/resources/LayoutEditor.js | 24 +++++++++++++------ .../resources/LayoutEditor.min.js | 2 +- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/config/version.php b/config/version.php index 281f0ad5b7d8..62ee2699ded3 100644 --- a/config/version.php +++ b/config/version.php @@ -9,5 +9,5 @@ * Contributor(s): YetiForce.com * ****************************************************************************** */ $patch_version = '20150910'; -$YetiForce_current_version = '2.2.78'; +$YetiForce_current_version = '2.2.79'; $_SESSION['yetiforce_version'] = $YetiForce_current_version; diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.js b/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.js index e0c7fa9e61e0..84ca52f0373b 100644 --- a/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.js +++ b/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.js @@ -1811,19 +1811,21 @@ jQuery.Class('Settings_LayoutEditor_Js', { form.validationEngine(app.validationEngineOptions); form.on('submit',function (e) { var formData = form.serializeFormData(); - var paramsName = JSON.parse(app.getMainParams('params')); - var params = {}; - for( var i in formData){ - if(jQuery.inArray(i, paramsName) != -1){ - params[i] = formData[i]; - delete formData[i]; + var paramsName = thisInstance.getParamsInventory(); + if(paramsName){ + var params = {}; + for( var i in formData){ + if(jQuery.inArray(i, paramsName) != -1){ + params[i] = formData[i]; + delete formData[i]; + } } + formData.params = JSON.stringify(params); } var errorExists = form.validationEngine('validate'); if(errorExists != false){ formData.block = blockId; formData.module = selectedModule; - formData.params = JSON.stringify(params); app.saveAjax('saveInventoryField', formData).then(function (data) { var result = data.result; if(result && result.edit){ @@ -1845,6 +1847,14 @@ jQuery.Class('Settings_LayoutEditor_Js', { event.preventDefault(); }); }, + /** + * get inventory params + */ + getParamsInventory: function(){ + if(typeof app.getMainParams('params') != 'undefined'){ + return JSON.parse(app.getMainParams('params')); + } + }, /** * register events for layout editor */ diff --git a/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.min.js b/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.min.js index 1637d2fd1ae6..3aada4011143 100644 --- a/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.min.js +++ b/layouts/vlayout/modules/Settings/LayoutEditor/resources/LayoutEditor.min.js @@ -1,2 +1,2 @@ -jQuery.Class("Settings_LayoutEditor_Js",{},{updatedBlockSequence:{},reactiveFieldsList:[],inActiveFieldsList:false,updatedBlockFieldsList:[],updatedBlocksList:[],blockNamesList:[],setInactiveFieldsList:function(){var c=this;var b=jQuery("#layoutEditorContainer").find(".contents");var a=b.find(".inActiveFieldsArray");if(0c.children().length+1){var d=a.children(":last");c.append(d)}}},createUpdatedBlockFieldsList:function(){var h=this;var b=jQuery("#layoutEditorContainer").find(".contents");for(var e in h.updatedBlocksList){var d=h.updatedBlocksList[e];var k=b.find(".block_"+d);var g=k.find("ul[name=sortable1]");var c=g.find(".editFields");var f=1;c.each(function(n,o){var m=jQuery(o);var l=m.data("fieldId");h.updatedBlockFieldsList.push({fieldid:l,sequence:f,block:d});f=f+2});var a=k.find("ul[name=sortable2]");var i=a.find(".editFields");var j=2;i.each(function(n,o){var m=jQuery(o);var l=m.data("fieldId");h.updatedBlockFieldsList.push({fieldid:l,sequence:j,block:d});j=j+2})}},registerFieldSequenceSaveClick:function(){var b=this;var a=jQuery("#detailViewLayout");a.on("click",".saveFieldSequence",function(){b.hideSaveFieldSequenceButton();b.createUpdatedBlockFieldsList();b.updateFieldSequence()})},updateFieldSequence:function(){var a=this;var b=jQuery.progressIndicator({position:"html",blockInfo:{enabled:true}});var c={};c.module=app.getModuleName();c.parent=app.getParentModuleName();c.action="Field";c.mode="move";c.updatedFields=a.updatedBlockFieldsList;AppConnector.request(c).then(function(d){b.progressIndicator({mode:"hide"});window.location.reload();var e={};e.text=app.vtranslate("JS_FIELD_SEQUENCE_UPDATED");Settings_Vtiger_Index_Js.showMessage(e)},function(d){b.progressIndicator({mode:"hide"})})},registerAddCustomFieldEvent:function(){var b=this;var a=jQuery("#layoutEditorContainer").find(".contents");a.find(".addCustomField").click(function(f){var c=jQuery(f.currentTarget).closest(".editFieldsTable").data("blockId");var g=a.find(".createFieldModal").clone(true,true);g.removeClass("hide").show();var d=function(h){app.showSelect2ElementView(h.find("select"),{width:"100%"});var e=h.find(".createCustomFieldForm");e.attr("id","createFieldForm");var j={tags:[],tokenSeparators:[","]};app.showSelect2ElementView(e.find('[name="pickListValues"]'),j);b.registerFieldTypeChangeEvent(e);var i=app.getvalidationEngineOptions(true);i.onValidationComplete=function(m,l){if(l){var p=jQuery('[name="fieldType"]',m).val();var o=jQuery('[name="fieldName"]',m).val();if(p=="Picklist"||p=="MultiSelectCombo"){var r=jQuery("#picklistUi",m);var t=r.val();var z=t.length;var n=/["]/;if(o.toLowerCase()==="status"){var A=app.vtranslate("JS_RESERVED_PICKLIST_NAME");jQuery('[name="fieldName"]',m).validationEngine("showPrompt",A,"error","bottomLeft",true);return false}for(var s=0;s0){var v=app.getSelect2ElementFromSelect(r);var A=app.vtranslate("JS_DUPLICATES_VALUES_FOUND");v.validationEngine("showPrompt",A,"error","bottomLeft",true);return false}}if(p=="Tree"){var k=m.find("select.TreeList");if(k.val()=="-"){var A=app.vtranslate("JS_FIELD_CAN_NOT_BE_EMPTY");m.find(".select2-container.TreeList").validationEngine("showPrompt",A,"error","bottomLeft",true);return false}}var u=m.find(":submit");u.attr("disabled","disabled");b.addCustomField(c,m).then(function(E){var B=E.result;var F={};if(E.success){app.hideModalWindow();F.text=app.vtranslate("JS_CUSTOM_FIELD_ADDED");Settings_Vtiger_Index_Js.showMessage(F);b.showCustomField(B)}else{var D=E.error["message"];if(E.error["code"]!=513){var C=m.find('[name="fieldName"]')}else{var C=m.find('[name="fieldLabel"]')}C.validationEngine("showPrompt",D,"error","topLeft",true);u.removeAttr("disabled")}})}return false};e.validationEngine(i)};app.showModalWindow(g,function(e){if(typeof d=="function"){d(e)}},{width:"1000px"})})},setBlocksListArray:function(c){var b=this;b.blockNamesList=[];var a=c.find('[name="beforeBlockId"]');a.find("option").each(function(e,g){var f=jQuery(g);var d=f.data("label");b.blockNamesList.push(d)})},addCustomField:function(c,e){var d=this;var a=e.closest("#globalmodal").find(".modal-header h3");var b=jQuery.Deferred();a.progressIndicator({smallLoadingImage:true,imageContainerCss:{display:"inline","margin-left":"18%",position:"absolute"}});var f=e.serializeFormData();f.module=app.getModuleName();f.parent=app.getParentModuleName();f.action="Field";f.mode="add";f.blockid=c;f.sourceModule=jQuery("#selectedModuleName").val();AppConnector.request(f).then(function(g){a.progressIndicator({mode:"hide"});b.resolve(g)},function(g){a.progressIndicator({mode:"hide"});b.reject(g)});return b.promise()},registerFieldTypeChangeEvent:function(f){var e=this;var b=f.find('[name="fieldLength"]');var d=[{name:"DecimalMaxLength"}];var a=[{name:"MaxLength"}];var c=[{name:"FloatingDigits"}];b.data("validator",a);f.find('[name="fieldType"]').on("change",function(o){var i=jQuery(o.currentTarget);var p=f.find('[name="fieldLength"]');var l=i.find("option:selected");f.find(".supportedType").addClass("hide");if(l.data("lengthsupported")){f.find(".lengthsupported").removeClass("hide");p.data("validator",a)}if(l.data("decimalsupported")){var k=f.find(".decimalsupported");k.removeClass("hide");var g=k.find('[name="decimal"]');var j=l.data("maxfloatingdigits");if(typeof j!="undefined"){g.data("validator",c);p.data("validator",d)}if(l.data("decimalreadonly")){g.val(j).attr("readonly",true)}else{g.removeAttr("readonly").val("")}}if(l.data("predefinedvalueexists")){var h=f.find(".preDefinedValueExists");h.removeClass("hide")}if(l.data("picklistoption")){var n=f.find(".picklistOption");n.removeClass("hide")}if(l.data("predefinedmodulelist")){var m=f.find(".preDefinedModuleList");m.removeClass("hide")}if(l.data("predefinedtreelist")){var q=f.find(".preDefinedTreeList");q.removeClass("hide")}})},showCustomField:function(l){var j=this;var d=jQuery("#layoutEditorContainer").find(".contents");var i=d.find(".block_"+l.blockid);var k=d.find(".newCustomFieldCopy").clone(true,true);var h=k.find("div.marginLeftZero.border1px");h.addClass("opacity editFields").attr("data-field-id",l.id).attr("data-block-id",l.blockid);h.find(".deleteCustomField, .saveFieldDetails").attr("data-field-id",l.id);h.find(".fieldLabel").html(l.label);if(!l.customField){h.find(".deleteCustomField").remove()}if(jQuery.inArray(l.type,["string","phone","currency","url","integer","double"])==-1){h.find(".maskField").remove()}var f=i.find(".blockFieldsList");var g=f.find("ul[name=sortable1]");var c=g.children().length;var e=f.find("ul[name=sortable2]");var b=e.children().length;if(c>b){e.append(k.removeClass("hide newCustomFieldCopy"))}else{g.append(k.removeClass("hide newCustomFieldCopy"))}var a=k.find("form.fieldDetailsForm");j.setFieldDetails(l,a);j.makeFieldsListSortable()},setFieldDetails:function(a,f){var e=this;f.find(".modal-header").html(jQuery(""+a.label+''));var g=f.find(".defaultValueUi");if(a.mandatory){f.find('[name="mandatory"]').filter(":checkbox").attr("checked",true)}if(a.presence){f.find('[name="presence"]').filter(":checkbox").attr("checked",true)}if(a.quickcreate){f.find('[name="quickcreate"]').filter(":checkbox").attr("checked",true)}if(a.isQuickCreateDisabled){f.find('[name="quickcreate"]').filter(":checkbox").attr("readonly","readonly").addClass("optionDisabled")}if(a.isSummaryField){f.find('[name="summaryfield"]').filter(":checkbox").attr("checked",true)}if(a.isSummaryFieldDisabled){f.find('[name="summaryfield"]').filter(":checkbox").attr("readonly","readonly").addClass("optionDisabled")}if(a.masseditable){f.find('[name="masseditable"]').filter(":checkbox").attr("checked",true)}if(a.isMassEditDisabled){f.find('[name="masseditable"]').filter(":checkbox").attr("readonly","readonly").addClass("optionDisabled")}if(a.isDefaultValueDisabled){f.find('[name="defaultvalue"]').filter(":checkbox").attr("readonly","readonly").addClass("optionDisabled")}if(a.defaultvalue){f.find('[name="defaultvalue"]').filter(":checkbox").attr("checked",true);g.removeClass("zeroOpacity")}else{g.addClass("zeroOpacity")}var b=Vtiger_Field_Js.getInstance(a);var h=b.getUiTypeSpecificHtml();g.html(h);g.find(".chzn-select").removeClass("chzn-select");var d=g.find(".timepicker-default");d.removeClass("timePicker timepicker-default");d.attr("data-toregister","time");var c=g.find(".dateField");c.removeClass("dateField");c.attr("data-toregister","date");g.find("[data-validation-engine]").attr("data-validation-engine","validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]");g.find("[name*="+a.name+"]").attr("name","fieldDefaultValue");g.find('[name="fieldDefaultValue"]').attr("disabled","disabled");g.find("input").addClass("input-medium");g.find(".select2").addClass("row")},registerAddCustomBlockEvent:function(){var b=this;var a=jQuery("#layoutEditorContainer").find(".contents");a.find(".addCustomBlock").click(function(f){var d=a.find(".addBlockModal").clone(true,true);var c=function(h){h.find(".addBlockModal").removeClass("hide").show();app.showSelect2ElementView(h.find("select"));var g=h.find(".addCustomBlockForm");b.setBlocksListArray(g);var e=g.find('[name="label"]');var i=app.validationEngineOptions;i.onValidationComplete=function(l,k){if(k){var m=l.serializeFormData();if(jQuery.inArray(m.label,b.blockNamesList)==-1){b.saveBlockDetails(l).then(function(o){var p={};if(o.success){var n=o.result;b.displayNewCustomBlock(n);b.updateNewSequenceForBlocks(n.sequenceList);b.appendNewBlockToBlocksList(n,l);b.makeFieldsListSortable();p.text=app.vtranslate("JS_CUSTOM_BLOCK_ADDED")}else{p.text=o.error["message"];p.type="error"}Settings_Vtiger_Index_Js.showMessage(p)});app.hideModalWindow();return k}else{var j=app.vtranslate("JS_BLOCK_NAME_EXISTS");e.validationEngine("showPrompt",j,"error","topLeft",true);f.preventDefault();return}}};g.validationEngine(i);g.submit(function(j){j.preventDefault()})};app.showModalWindow(d,function(e){if(typeof c=="function"){c(e)}},{width:"1000px"})})},saveBlockDetails:function(c){var b=this;var a=jQuery.Deferred();var d=jQuery.progressIndicator({position:"html",blockInfo:{enabled:true}});var e=c.serializeFormData();e.module=app.getModuleName();e.parent=app.getParentModuleName();e.sourceModule=jQuery("#selectedModuleName").val();e.action="Block";e.mode="save";AppConnector.request(e).then(function(f){d.progressIndicator({mode:"hide"});a.resolve(f)},function(f){d.progressIndicator({mode:"hide"});a.reject(f)});return a.promise()},displayNewCustomBlock:function(a){var e=this;var d=jQuery("#layoutEditorContainer").find(".contents");var b=a.beforeBlockId;var f=d.find(".block_"+b);var c=d.find(".newCustomBlockCopy").clone(true,true);c.data("blockId",a.id).find(".blockLabel").append(jQuery(""+a.label+""));c.find(".blockVisibility").data("blockId",a.id);if(a.isAddCustomFieldEnabled){c.find(".addCustomField").removeClass("hide")}f.after(c.removeClass("hide newCustomBlockCopy").addClass("editFieldsTable block_"+a.id));c.find(".blockFieldsList").sortable({connectWith:".blockFieldsList"})},updateNewSequenceForBlocks:function(a){var b=jQuery("#layoutEditorContainer").find(".contents");jQuery.each(a,function(c,d){b.find(".block_"+c).data("sequence",d)})},appendNewBlockToBlocksList:function(a,e){var d=jQuery("#layoutEditorContainer").find(".contents");var f=d.find(".addBlockModal");var b=f.find('[name="beforeBlockId"]');var c=jQuery("