YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/Users/resources/Detail.min.js.map

Summary

Maintainability
Test Coverage
{"version":3,"file":"Detail.min.js","sources":["Detail.js"],"sourcesContent":["/*+***********************************************************************************\n * The contents of this file are subject to the vtiger CRM Public License Version 1.0\n * (\"License\"); You may not use this file except in compliance with the License\n * The Original Code is:  vtiger CRM Open Source\n * The Initial Developer of the Original Code is vtiger.\n * Portions created by vtiger are Copyright (C) vtiger.\n * All Rights Reserved.\n * Contributor(s): YetiForce S.A.\n *************************************************************************************/\n'use strict';\n\nVtiger_Detail_Js(\n\t'Users_Detail_Js',\n\t{\n\t\t/*\n\t\t * function to trigger delete record action\n\t\t * @params: delete record url.\n\t\t */\n\t\ttriggerDeleteUser: function (deleteUserUrl) {\n\t\t\tapp.showConfirmModal({\n\t\t\t\ttitle: app.vtranslate('JS_DELETE_USER_CONFIRMATION'),\n\t\t\t\tconfirmedCallback: () => {\n\t\t\t\t\tAppConnector.request(deleteUserUrl).done(function (data) {\n\t\t\t\t\t\tif (data) {\n\t\t\t\t\t\t\tvar callback = function (data) {\n\t\t\t\t\t\t\t\tvar params = app.validationEngineOptions;\n\t\t\t\t\t\t\t\tparams.onValidationComplete = function (form, valid) {\n\t\t\t\t\t\t\t\t\tif (valid) {\n\t\t\t\t\t\t\t\t\t\tUsers_Detail_Js.deleteUser(form);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t$('#deleteUser').validationEngine(app.validationEngineOptions);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tapp.showModalWindow(data, function (data) {\n\t\t\t\t\t\t\t\tif (typeof callback == 'function') {\n\t\t\t\t\t\t\t\t\tcallback(data);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tdeleteUser: function (form) {\n\t\t\tvar userid = form.find('[name=\"userid\"]').val();\n\t\t\tvar transferUserId = form.find('[name=\"tranfer_owner_id\"]').val();\n\n\t\t\tvar params = {\n\t\t\t\tmodule: app.getModuleName(),\n\t\t\t\taction: 'DeleteAjax',\n\t\t\t\tmode: 'deleteUser',\n\t\t\t\ttransfer_user_id: transferUserId,\n\t\t\t\tuserid: userid,\n\t\t\t\tpermanent: form.find('[name=\"deleteUserPermanent\"]:checked').val()\n\t\t\t};\n\t\t\tAppConnector.request(params).done(function (data) {\n\t\t\t\tif (data.success) {\n\t\t\t\t\tapp.hideModalWindow();\n\t\t\t\t\tapp.showNotify({\n\t\t\t\t\t\ttext: app.vtranslate(data.result.message),\n\t\t\t\t\t\ttype: 'success'\n\t\t\t\t\t});\n\t\t\t\t\tvar url = data.result.listViewUrl;\n\t\t\t\t\twindow.location.href = url;\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\ttriggerChangeAccessKey: function (url) {\n\t\t\tapp.showConfirmModal({\n\t\t\t\ttitle: app.vtranslate('JS_NEW_ACCESS_KEY_REQUESTED'),\n\t\t\t\ttext: app.vtranslate('JS_CHANGE_ACCESS_KEY_CONFIRMATION'),\n\t\t\t\tconfirmedCallback: () => {\n\t\t\t\t\tAppConnector.request(url).done(function (data) {\n\t\t\t\t\t\tlet params = {},\n\t\t\t\t\t\t\tmessage;\n\t\t\t\t\t\tif (data['success']) {\n\t\t\t\t\t\t\tdata = data.result;\n\t\t\t\t\t\t\tparams['type'] = 'success';\n\t\t\t\t\t\t\tmessage = app.vtranslate(data.message);\n\t\t\t\t\t\t\tlet accessKeyEle = $('#Users_detailView_fieldValue_accesskey');\n\t\t\t\t\t\t\tif (accessKeyEle.length) {\n\t\t\t\t\t\t\t\taccessKeyEle.find('.value').html(data.accessKey);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmessage = app.vtranslate(data['error']['message']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparams['text'] = message;\n\t\t\t\t\t\tapp.showNotify(params);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t},\n\t{\n\t\tusersEditInstance: false,\n\t\tupdateStartHourElement: function (form) {\n\t\t\tthis.usersEditInstance.triggerHourFormatChangeEvent(form);\n\t\t\tthis.updateStartHourElementValue();\n\t\t},\n\t\thourFormatUpdateEvent: function () {\n\t\t\tvar thisInstance = this;\n\t\t\tthis.getForm().on(this.fieldUpdatedEvent, '[name=\"hour_format\"]', function (e, params) {\n\t\t\t\tthisInstance.updateStartHourElementValue();\n\t\t\t});\n\t\t},\n\t\tupdateStartHourElementValue: function () {\n\t\t\tvar form = this.getForm();\n\t\t\tvar startHourSelectElement = $('select[name=\"start_hour\"]', form);\n\t\t\tvar selectedElementValue = startHourSelectElement.find('option:selected').text();\n\t\t\tstartHourSelectElement.closest('.fieldValue').find('span.value').text(selectedElementValue);\n\t\t\tvar endHourSelectElement = $('select[name=\"end_hour\"]', form);\n\t\t\tendHourSelectElement\n\t\t\t\t.closest('.fieldValue')\n\t\t\t\t.find('span.value')\n\t\t\t\t.text(endHourSelectElement.find('option:selected').text());\n\t\t},\n\t\tstartHourUpdateEvent: function (form) {\n\t\t\tvar thisInstance = this;\n\t\t\tform.on(this.fieldUpdatedEvent, '[name=\"start_hour\"]', function (e, params) {\n\t\t\t\tthisInstance.updateStartHourElement(form);\n\t\t\t});\n\t\t},\n\t\tsaveFieldValues: function (fieldDetailList) {\n\t\t\tvar aDeferred = $.Deferred();\n\t\t\tvar thisInstance = this;\n\t\t\tvar lock = false;\n\t\t\tvar recordId = this.getRecordId();\n\t\t\tvar data = {};\n\t\t\tif (typeof fieldDetailList !== 'undefined') {\n\t\t\t\tdata = fieldDetailList;\n\t\t\t\tif (data['field'] == 'email1') {\n\t\t\t\t\tthisInstance.usersEditInstance.checkEmail(data['value']).done(\n\t\t\t\t\t\tfunction (data) {},\n\t\t\t\t\t\tfunction (data, error) {\n\t\t\t\t\t\t\tlock = true;\n\t\t\t\t\t\t\taDeferred.reject();\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (lock !== true) {\n\t\t\t\tdata['record'] = recordId;\n\t\t\t\tdata['module'] = app.getModuleName();\n\t\t\t\tdata['action'] = 'SaveAjax';\n\n\t\t\t\tvar params = {};\n\t\t\t\tparams.data = data;\n\t\t\t\tparams.async = false;\n\t\t\t\tparams.dataType = 'json';\n\t\t\t\tAppConnector.request(params).done(function (reponseData) {\n\t\t\t\t\taDeferred.resolve(reponseData);\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn aDeferred.promise();\n\t\t},\n\t\tregisterEvents: function () {\n\t\t\tthis._super();\n\t\t\tvar form = this.getForm();\n\t\t\tthis.usersEditInstance = Vtiger_Edit_Js.getInstance();\n\t\t\tthis.updateStartHourElement(form);\n\t\t\tthis.hourFormatUpdateEvent();\n\t\t\tthis.startHourUpdateEvent(form);\n\t\t\tUsers_Edit_Js.registerChangeEventForCurrencySeparator();\n\t\t}\n\t}\n);\n"],"names":["Vtiger_Detail_Js","triggerDeleteUser","deleteUserUrl","app","showConfirmModal","title","vtranslate","confirmedCallback","AppConnector","request","done","data","callback","params","validationEngineOptions","onValidationComplete","form","valid","Users_Detail_Js","deleteUser","$","validationEngine","showModalWindow","userid","find","val","transferUserId","module","getModuleName","action","mode","transfer_user_id","permanent","success","hideModalWindow","showNotify","text","result","message","type","url","listViewUrl","window","location","href","triggerChangeAccessKey","accessKeyEle","length","html","accessKey","error","usersEditInstance","updateStartHourElement","triggerHourFormatChangeEvent","updateStartHourElementValue","hourFormatUpdateEvent","thisInstance","getForm","on","fieldUpdatedEvent","startHourSelectElement","selectedElementValue","closest","endHourSelectElement","startHourUpdateEvent","saveFieldValues","fieldDetailList","aDeferred","Deferred","lock","recordId","getRecordId","field","checkEmail","value","reject","record","async","dataType","reponseData","resolve","promise","registerEvents","_super","Vtiger_Edit_Js","getInstance","Users_Edit_Js","regist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