X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=Pman.Dialog.CoreCompanies.js;h=e44744a9efd4f9171c7ff785a46617cc789b3eba;hp=878669466115ba888a1f9c62a98857e73a654032;hb=586e4eb470252d837ba18b67e4c3c1702131fd1d;hpb=adad80ec59b409b5e4cdefd848562adff10c624d diff --git a/Pman.Dialog.CoreCompanies.js b/Pman.Dialog.CoreCompanies.js index 87866946..e44744a9 100644 --- a/Pman.Dialog.CoreCompanies.js +++ b/Pman.Dialog.CoreCompanies.js @@ -34,6 +34,30 @@ Pman.Dialog.CoreCompanies = { '35cb9e66ff801a819684ee0fbeabaeeb' :"Background Colour", 'bc87ef2144ae15ef4f78211e73948051' :"Logo Image" }, + _named_strings : { + 'name_qtip' : '4ef6052d74436756f08e95fd63949653' /* Enter Company Name */ , + 'tel_fieldLabel' : 'bcc254b55c4a1babdf1dcb82c207506b' /* Phone */ , + 'address_qtip' : '32c4e9483403d60115b21519178e5384' /* Enter Address */ , + 'background_color_fieldLabel' : '35cb9e66ff801a819684ee0fbeabaeeb' /* Background Colour */ , + 'comptype_id_display_name_emptyText' : '023a5dfa857c4aa0156e6685231a1dbd' /* Select Type */ , + 'comptype_id_display_name_fieldLabel' : 'a1fa27779242b4902f7ae3bdd5c6d508' /* Type */ , + 'comptype_id_display_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ , + 'code_fieldLabel' : 'b33457e7e1cd5dbf1db34a0c60fcb75f' /* Company ID (for filing Ref.) */ , + 'fax_fieldLabel' : '9810aa2b9f44401be4bf73188ef2b67d' /* Fax */ , + 'name_fieldLabel' : 'e7b47c58815acf1d3afa59a84b5db7fb' /* Company Name */ , + 'fax_qtip' : 'cf3a5d25d39613ad5bbc2f5eb0f9b675' /* Enter Fax Number */ , + 'url_qtip' : '8c04eb09879a05470fae436ba76e3bb9' /* Enter Url */ , + 'remarks_fieldLabel' : '231bc72756b5e6de492aaaa1577f61b1' /* Remarks */ , + 'code_qtip' : '733640ec0c9367df1b4d85eb286ed9ae' /* Enter code */ , + 'tel_qtip' : 'bc3a4c40d007b8d610a16312970e5cb3' /* Enter Phone Number */ , + 'email_qtip' : '9f86c00615b1a210935ac28ff8ebbb22' /* Enter Email Address */ , + 'url_fieldLabel' : '02a3a357710cc2a5dfdfb74ed012fb59' /* Url */ , + 'remarks_qtip' : 'c54b90756cfbeff9217293b567cb2eb0' /* Enter remarks */ , + 'comptype_id_display_name_qtip' : '8535bcc0f05358a583bb432bbadf7e0d' /* Select type */ , + 'email_fieldLabel' : 'ce8ae9da5b7cd6c3df2929543a9af92d' /* Email */ , + 'address_fieldLabel' : 'dd7bf230fde8d4836917806aff6a6b27' /* Address */ , + 'logo_id_fieldLabel' : 'bc87ef2144ae15ef4f78211e73948051' /* Logo Image */ + }, dialog : false, callback: false, @@ -106,7 +130,7 @@ Pman.Dialog.CoreCompanies = { } new Pman.Request({ - url : baseURL + '/Roo/Core_enum.php', + url : baseURL + '/Roo/Core_company.php', method : 'POST', params : { id : _this.form.findField('id').getValue() * 1, @@ -114,13 +138,27 @@ Pman.Dialog.CoreCompanies = { _check_name : 1 }, success : function(res) { - + _this.dialog.el.mask("Saving"); + _this.form.doAction("submit"); + }, + failure : function(res) { + Roo.MessageBox.confirm( + "Confirm", + "The company name has been used. Save it anyway?", + function(res) { + if(res != 'yes') { + return; + } + + _this.dialog.el.mask("Saving"); + _this.form.doAction("submit"); + } + ); } }); - _this.dialog.el.mask("Saving"); - _this.form.doAction("submit"); - + return; + } }, xns : Roo, @@ -140,7 +178,7 @@ Pman.Dialog.CoreCompanies = { xtype : 'Form', fileUpload : true, labelWidth : 160, - url : baseURL + '/Roo/Companies.php', + url : baseURL + '/Roo/core_company.php', listeners : { actioncomplete : function(f, act) { _this.dialog.el.unmask(); @@ -213,11 +251,11 @@ Pman.Dialog.CoreCompanies = { emptyText : _this._strings['023a5dfa857c4aa0156e6685231a1dbd'] /* Select Type */, fieldLabel : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */, forceSelection : true, - hiddenName : 'comptype', + hiddenName : 'comptype_id', listWidth : 250, loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */, minChars : 2, - name : 'comptype_display_name', + name : 'comptype_id_display_name', pageSize : 20, qtip : _this._strings['8535bcc0f05358a583bb432bbadf7e0d'] /* Select type */, queryParam : 'query[name]', @@ -225,7 +263,7 @@ Pman.Dialog.CoreCompanies = { tpl : '
{name} : {display_name}
', triggerAction : 'all', typeAhead : false, - valueField : 'name', + valueField : 'id', width : 200, listeners : { render : function (_self) @@ -385,7 +423,7 @@ Pman.Dialog.CoreCompanies = { Pman.Dialog.Image.show({ onid :_this.data.id, - ontable : 'Companies', + ontable : 'core_company', imgtype : 'LOGO' }, function(data) { if (data) {