1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Tab');
7 Pman.Tab.AdminContacts = new Roo.XComponent({
10 '99b344c8ae43e3e7213862b8f35c4e51' :"Select Company",
11 '1c76cbfe21c6f44c1d1e59d54f3e4420' :"Company",
12 'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email",
13 '8444e81d652b084d70c71cd7d19ac0cf' :"Displaying Person{0} - {1} of {2}",
14 '13348442cc6a27032d2b4aa28b75a5d3' :"Search",
15 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
16 '9e727fdd3aec8274f46685441900280d' :"Project",
17 '7dce122004969d56ae2e0245cb754d35' :"Edit",
18 '4110db87ce3ac86d603d03d691616b1e' :"Drag person to add or remove from group",
19 'b47a519aebda8fdb4b59bdae6eb2bff0' :"Show No Company",
20 '1243daf593fa297e07ab03bf06d925af' :"Searching...",
21 'bcc254b55c4a1babdf1dcb82c207506b' :"Phone",
22 '9675747b5ab12d05f18518761e68a533' :"Select Companies",
23 '40bed7cf9b3d4bb3a3d7a7e3eb18c5eb' :"Person",
24 'f1174ecbbc232f948717979daf04cf08' :"No Person found",
25 'ec3249f16ee5880d4c1acb752e5c925f' :"Switch to Selected User",
26 'a93806efd0cc7a149f0f03e2b9a0f862' :"Bulk Add",
27 'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
28 'a1fa27779242b4902f7ae3bdd5c6d508' :"Type",
29 '49ee3087348e8d44e1feda1917443987' :"Name",
30 'bbbabdbe1b262f75d99d62880b953be1' :"Role",
31 '4d3d769b812b6faa6b76e1a8abaece2d' :"Active",
32 'd4d25ad0a12e8d30e9d8d35230f6d1d3' :"Show Removed",
33 '9810aa2b9f44401be4bf73188ef2b67d' :"Fax"
36 part : ["Admin", "Contacts" ],
37 order : '001-Pman.Tab.AdminContacts',
39 parent : 'Pman.Tab.AdminContactsManager',
40 name : "Pman.Tab.AdminContacts",
42 permname : 'Core.Person',
53 url : baseURL + '/Roo/Person.php',
113 'name': 'no_reset_sent',
117 'name': 'action_type',
121 'name': 'project_id',
125 'name': 'office_id_id',
129 'name': 'office_id_company_id',
133 'name': 'office_id_name',
137 'name': 'office_id_address',
141 'name': 'office_id_phone',
145 'name': 'office_id_fax',
149 'name': 'office_id_email',
153 'name': 'office_id_role',
157 'name': 'company_id_code',
161 'name': 'company_id_name',
165 'name': 'company_id_remarks',
169 'name': 'company_id_owner_id',
173 'name': 'company_id_address',
177 'name': 'company_id_tel',
181 'name': 'company_id_fax',
185 'name': 'company_id_email',
189 'name': 'company_id_id',
193 'name': 'company_id_isOwner',
197 'name': 'company_id_logo_id',
201 'name': 'company_id_background_color',
205 'name': 'company_id_comptype',
209 'name': 'company_id_url',
213 'name': 'company_id_main_office_id',
217 'name': 'company_id_created_by',
221 'name': 'company_id_created_dt',
225 'name': 'company_id_updated_by',
229 'name': 'company_id_updated_dt',
233 'name': 'company_id_passwd',
237 'name': 'project_id_id',
241 'name': 'project_id_name',
245 'name': 'project_id_remarks',
249 'name': 'project_id_owner_id',
253 'name': 'project_id_code',
257 'name': 'project_id_active',
261 'name': 'project_id_type',
265 'name': 'project_id_client_id',
269 'name': 'project_id_team_id',
273 'name': 'project_id_file_location',
277 'name': 'project_id_open_date',
281 'name': 'project_id_open_by',
285 'name': 'project_id_close_date',
289 'name': 'project_id_countries',
293 'name': 'project_id_languages',
297 'name': 'project_id_agency_id',
301 'name': 'owner_id_id',
305 'name': 'owner_id_office_id',
309 'name': 'owner_id_name',
313 'name': 'owner_id_phone',
317 'name': 'owner_id_fax',
321 'name': 'owner_id_email',
325 'name': 'owner_id_company_id',
329 'name': 'owner_id_role',
333 'name': 'owner_id_active',
337 'name': 'owner_id_remarks',
341 'name': 'owner_id_passwd',
345 'name': 'owner_id_owner_id',
349 'name': 'owner_id_lang',
353 'name': 'owner_id_no_reset_sent',
357 'name': 'owner_id_action_type',
361 'name': 'owner_id_project_id',
367 totalProperty : 'total',
373 sortInfo : { field : 'name', direction: 'ASC' },
377 beforeload : function (_self, o)
379 if(!_this.active_company_button.pressed){
380 o.params['!company_id_comptype'] = 'OWNER';
383 o.params['query[search]'] = _this.searchBox.getValue();
385 if (!_this.activeButton) {return; false;}
387 if (_this.companyCombo && _this.companyCombo.getValue()) {
388 o.params.company_id = _this.companyCombo.getValue();
392 o.params.active = _this.activeButton.pressed ? 0 : 1;
394 if(_this.active_company_button.pressed){
395 o.params.company_id = 0;
398 var c = Pman.Tab.AdminContactsManager.layout.getRegion('west').getActivePanel();
404 var tms = c.grid.getSelectionModel().getSelected();
410 if(c.tableName == 'Groups'){
411 o.params['query[in_group]'] = tms.data.id;
412 o.params['query[type]'] = 2; // group type..
414 o.params['query[in_country]'] = (tms.data.country*1 == -1) ? '' : tms.data.country;
415 o.params['query[in_group]'] = 0;
416 o.params['query[type]'] = 2;
419 if (Pman.Tab.AdminContactsGroup && Pman.Tab.AdminContactsGroup.grid) {
425 if(Pman.Tab.AdminCountries && Pman.Tab.AdminCountries.grid){
426 var tms = Pman.Tab.AdminCountries.grid.getSelectionModel().getSelected();
434 //o.params['query[name]'] = _this.searchBox.getValue();
437 update : function (_self, record, operation)
439 if (operation != 'commit') {
442 // only used to change active status.
445 url : baseURL + '/Roo/Person.php',
449 active: record.data.active
452 success : function() {
455 _this.grid.ds.remove(record);
460 Roo.MessageBox.alert("Error", "saving failed", function() {
461 _this.grid.footer.onClick('first');
475 displayMsg : _this._strings['8444e81d652b084d70c71cd7d19ac0cf'],
476 emptyMsg : _this._strings['f1174ecbbc232f948717979daf04cf08'],
479 xtype : 'PagingToolbar',
482 '|xns' : 'Roo.Toolbar',
483 text : _this._strings['4110db87ce3ac86d603d03d691616b1e'],
496 '|xns' : 'Roo.Toolbar',
497 text : _this._strings['13348442cc6a27032d2b4aa28b75a5d3'],
506 render : function (_self)
508 _this.searchBox = _self;
510 show : function (_self,e)
512 if (e.getCharCode() != 13) {
515 _this.grid.footer.onClick('first');
517 specialkey : function (_self, e)
519 if (e.getKey() == 13) {
520 _this.grid.footer.onClick('first');
530 url : baseURL + '/Roo/Companies.php',
536 fields : [{"name":"id","type":"int"},{"name":"code","type":"string"}],
539 totalProperty : 'total',
545 sortInfo : { direction : 'ASC', field: 'name' },
549 beforeload : function (_self, o){
550 o.params = o.params || {};
560 displayField : 'name',
562 emptyText : _this._strings['99b344c8ae43e3e7213862b8f35c4e51'],
563 forceSelection : true,
564 hiddenName : 'company_id',
566 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'],
568 name : 'company_name',
570 qtip : _this._strings['9675747b5ab12d05f18518761e68a533'],
571 queryParam : 'query[name]',
572 selectOnFocus : true,
573 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>',
574 triggerAction : 'all',
581 render : function (_self)
583 _this.companyCombo = _self;
585 select : function (combo, record, index)
587 _this.grid.footer.onClick.defer(300,_this.grid.footer,[ 'first'] );
596 '|xns' : 'Roo.Toolbar',
598 icon : rootURL + '/Pman/templates/images/search.gif',
602 click : function (_self, e)
604 _this.grid.footer.onClick('first');
609 '|xns' : 'Roo.Toolbar',
611 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
615 click : function (_self, e)
617 _this.searchBox.setValue('');
618 _this.grid.footer.onClick('first');
623 '|xns' : 'Roo.Toolbar',
625 text : _this._strings['d4d25ad0a12e8d30e9d8d35230f6d1d3'],
629 render : function (_self)
631 _this.activeButton = _self;
633 toggle : function (_self, pressed)
635 _this.grid.footer.onClick('first');
636 this.setText(pressed ? "Show Active" : "Show Removed");
643 '|xns' : 'Roo.Toolbar',
645 text : _this._strings['b47a519aebda8fdb4b59bdae6eb2bff0'],
649 render : function (_self)
651 _this.active_company_button = _self;
653 toggle : function (_self, pressed)
655 _this.grid.footer.onClick('first');
656 this.setText(pressed ? "Show Company" : "Show No Company");
663 '|xns' : 'Roo.Toolbar',
664 text : _this._strings['ec3249f16ee5880d4c1acb752e5c925f'],
668 click : function (_self, e)
670 var s = _this.grid.getSelectionModel().getSelections();
672 Roo.MessageBox.alert("Error", "Select a Person");
677 url : baseURL + '/Login.php',
680 'switch' : s[0].data.id
682 success : function (){
683 document.location = baseURL + '?ts=' + Math.random();
685 failure : function (d){
687 Roo.MessageBox.alert("Error", d);
694 '|xns' : 'Roo.Toolbar',
699 '|xns' : 'Roo.Toolbar',
700 cls : 'x-btn-text-icon',
701 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
702 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'],
709 _this.dialog.show( { id : 0 } , function() {
710 _this.grid.footer.onClick('first');
716 '|xns' : 'Roo.Toolbar',
717 cls : 'x-btn-text-icon',
718 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
719 text : _this._strings['a93806efd0cc7a149f0f03e2b9a0f862'],
726 Pman.Dialog.PersonBulkAdd.show( { id : 0 } , function() {
727 _this.grid.footer.onClick('first');
733 '|xns' : 'Roo.Toolbar',
734 cls : 'x-btn-text-icon',
735 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
736 text : _this._strings['7dce122004969d56ae2e0245cb754d35'],
742 var s = _this.grid.getSelectionModel().getSelections();
743 if (!s.length || (s.length > 1)) {
744 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
748 _this.dialog.show(s[0].data, function() {
749 _this.grid.footer.onClick('first');
756 '|xns' : 'Roo.Toolbar',
757 cls : 'x-btn-text-icon',
758 icon : rootURL + '/Pman/templates/images/trash.gif',
759 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'],
765 Pman.genericDelete(_this, 'Person');
773 autoExpandColumn : 'name',
782 dataIndex : 'project_id_code',
783 header : _this._strings['9e727fdd3aec8274f46685441900280d'],
785 renderer : function(v,x,r) {
786 return String.format('<span qtip="{0}">{1}</span>',
787 r.data.project_id_name,
793 xtype : 'ColumnModel'
797 dataIndex : 'company_id_comptype',
798 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'],
799 renderer : function(v,x,r) {
800 if (r.data.office_id) {
801 return String.format('{0} - {1}', v, r.data.office_id_name);
803 return String.format('{0}', v);
808 xtype : 'ColumnModel'
812 dataIndex : 'company_id_name',
813 header : _this._strings['1c76cbfe21c6f44c1d1e59d54f3e4420'],
814 renderer : function(v,x,r) {
815 if (r.data.office_id) {
816 return String.format('{0} - {1}', v, r.data.office_id_name);
818 return String.format('{0}', v);
823 xtype : 'ColumnModel'
828 header : _this._strings['49ee3087348e8d44e1feda1917443987'],
829 renderer : function(v) { return String.format('{0}', v); },
833 xtype : 'ColumnModel'
838 header : _this._strings['bbbabdbe1b262f75d99d62880b953be1'],
839 renderer : function(v) { return String.format('{0}', v); },
842 xtype : 'ColumnModel'
847 header : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'],
848 renderer : function(v) { return String.format('{0}', v); },
851 xtype : 'ColumnModel'
856 header : _this._strings['9810aa2b9f44401be4bf73188ef2b67d'],
857 renderer : function(v) { return String.format('{0}', v); },
860 xtype : 'ColumnModel'
865 header : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'],
866 renderer : function(v) {
867 return (v.length && v.indexOf('@') > 0 ) ?
868 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
873 xtype : 'ColumnModel'
877 dataIndex : 'active',
878 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'],
879 renderer : function(v) {
880 var state = v> 0 ? '-checked' : '';
882 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
887 xtype : 'ColumnModel'
891 cellclick : function (_self, rowIndex, columnIndex, e)
894 var di = this.colModel.getDataIndex(columnIndex);
895 if (di != 'active') {
899 var rec = _this.grid.ds.getAt(rowIndex);
901 rec.set('active', rec.data.active ? 0 : 1);
910 _this.dialog = Pman.Dialog.PersonEdit;
913 //_this.dialog = Pman.Dialog.FILL_IN
914 if (_this.panel.active) {
915 this.footer.onClick('first');
918 rowdblclick : function (_self, rowIndex, e)
920 if (!_this.dialog) return;
921 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
922 _this.grid.footer.onClick('first');
937 tableName : 'Person',
938 title : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'],
942 activate : function() {
945 _this.grid.footer.onClick('first');