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.AdminPermMembers = new Roo.XComponent({
10 '1c76cbfe21c6f44c1d1e59d54f3e4420' :"Company",
11 'ce8ae9da5b7cd6c3df2929543a9af92d' :"Email",
12 '8444e81d652b084d70c71cd7d19ac0cf' :"Displaying Person{0} - {1} of {2}",
13 'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
14 '13348442cc6a27032d2b4aa28b75a5d3' :"Search",
15 '9e727fdd3aec8274f46685441900280d' :"Project",
16 '7dce122004969d56ae2e0245cb754d35' :"Edit",
17 '4110db87ce3ac86d603d03d691616b1e' :"Drag person to add or remove from group",
18 'bcc254b55c4a1babdf1dcb82c207506b' :"Phone",
19 '40bed7cf9b3d4bb3a3d7a7e3eb18c5eb' :"Person",
20 'f1174ecbbc232f948717979daf04cf08' :"No Person found",
21 'a93806efd0cc7a149f0f03e2b9a0f862' :"Bulk Add",
22 'a1fa27779242b4902f7ae3bdd5c6d508' :"Type",
23 '49ee3087348e8d44e1feda1917443987' :"Name",
24 'bbbabdbe1b262f75d99d62880b953be1' :"Role",
25 '4d3d769b812b6faa6b76e1a8abaece2d' :"Active",
26 'd4d25ad0a12e8d30e9d8d35230f6d1d3' :"Show Removed",
27 '9810aa2b9f44401be4bf73188ef2b67d' :"Fax"
30 part : ["old", "AdminPermMembers" ],
31 order : '001-Pman.Tab.AdminPermMembers',
33 parent : 'Pman.Tab.AdminPermManager',
34 name : "Pman.Tab.AdminPermMembers",
37 _tree : function(_data)
49 title : _this._strings['40bed7cf9b3d4bb3a3d7a7e3eb18c5eb'] /* Person */,
51 activate : function() {
54 _this.grid.footer.onClick('first');
62 autoExpandColumn : 'name',
67 cellclick : function (_self, rowIndex, columnIndex, e)
70 var di = this.colModel.getDataIndex(columnIndex);
75 var rec = _this.grid.ds.getAt(rowIndex);
77 rec.set('active', rec.data.active ? 0 : 1);
79 Roo.select('.x-grid-row-selected').item(1).addClass('fadeout');
81 _this.grid.footer.onClick('first');
89 _this.dialog = Pman.Dialog.PersonEdit;
92 //_this.dialog = Pman.Dialog.FILL_IN
93 if (_this.panel.active) {
94 this.footer.onClick('first');
97 rowdblclick : function (_self, rowIndex, e)
99 if (!_this.dialog) return;
100 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
101 _this.grid.footer.onClick('first');
108 xtype : 'PagingToolbar',
110 displayMsg : _this._strings['8444e81d652b084d70c71cd7d19ac0cf'] /* Displaying Person{0} - {1} of {2} */,
111 emptyMsg : _this._strings['f1174ecbbc232f948717979daf04cf08'] /* No Person found */,
118 text : _this._strings['4110db87ce3ac86d603d03d691616b1e'] /* Drag person to add or remove from group */,
120 '|xns' : 'Roo.Toolbar'
131 cls : 'x-btn-text-icon',
132 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
133 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
138 _this.dialog.show( { id : 0 } , function() {
139 _this.grid.footer.onClick('first');
144 '|xns' : 'Roo.Toolbar'
148 cls : 'x-btn-text-icon',
149 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
150 text : _this._strings['a93806efd0cc7a149f0f03e2b9a0f862'] /* Bulk Add */,
155 Pman.Dialog.PersonBulkAdd.show( { id : 0 } , function() {
156 _this.grid.footer.onClick('first');
161 '|xns' : 'Roo.Toolbar'
165 cls : 'x-btn-text-icon',
166 icon : Roo.rootURL + 'images/default/tree/leaf.gif',
167 text : _this._strings['7dce122004969d56ae2e0245cb754d35'] /* Edit */,
171 var s = _this.grid.getSelectionModel().getSelections();
172 if (!s.length || (s.length > 1)) {
173 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
177 _this.dialog.show(s[0].data, function() {
178 _this.grid.footer.onClick('first');
184 '|xns' : 'Roo.Toolbar'
189 '|xns' : 'Roo.Toolbar'
193 text : _this._strings['13348442cc6a27032d2b4aa28b75a5d3'] /* Search */,
195 '|xns' : 'Roo.Toolbar'
200 render : function (_self)
202 _this.searchBox = _self;
204 show : function (_self,e)
206 if (e.getCharCode() != 13) {
209 _this.grid.footer.onClick('first');
211 specialkey : function (_self, e)
213 if (e.getKey() == 13) {
214 _this.grid.footer.onClick('first');
224 icon : rootURL + '/Pman/templates/images/search.gif',
226 click : function (_self, e)
228 _this.grid.footer.onClick('first');
232 '|xns' : 'Roo.Toolbar'
237 icon : rootURL + '/Pman/templates/images/edit-clear.gif',
239 click : function (_self, e)
241 _this.searchBox.setValue('');
242 _this.grid.footer.onClick('first');
246 '|xns' : 'Roo.Toolbar'
251 '|xns' : 'Roo.Toolbar'
256 text : _this._strings['d4d25ad0a12e8d30e9d8d35230f6d1d3'] /* Show Removed */,
258 render : function (_self)
260 _this.activeButton = _self;
262 toggle : function (_self, pressed)
264 _this.grid.footer.onClick('first');
265 this.setText(pressed ? "Show Active" : "Show Removed");
271 '|xns' : 'Roo.Toolbar'
278 sortInfo : { field : 'name', direction: 'ASC' },
280 beforeload : function (_self, o)
283 // technically we may allow non-owner's to be in the group..
284 // need to work out how that will work...
287 //o.params['company_id_comptype'] = 'OWNER';
288 o.params['query[search]'] = _this.searchBox.getValue();
290 if (!_this.activeButton) {return; false;}
293 o.params.active = _this.activeButton.pressed ? 0 : 1;
294 if (!Pman.Tab.AdminPermManager) {
299 if (Pman.Tab.AdminPermManager && Pman.Tab.AdminPermManager.grid) {
300 var tms = Pman.Tab.AdminPermManager.grid.getSelectionModel().getSelected();
305 o.params['query[in_group]'] = tms.data.id;
306 o.params['query[type]'] = 0; // group type..
309 //o.params['query[name]'] = _this.searchBox.getValue();
313 update : function (_self, record, operation)
315 if (operation != 'commit') {
318 // only used to change active status.
321 url : baseURL + '/Roo/core_person',
325 active: record.data.active
328 success : function() {
331 _this.grid.ds.remove(record);
336 Roo.MessageBox.alert("Error", "saving failed", function() {
337 _this.grid.footer.onClick('first');
348 url : baseURL + '/Roo/core_person',
353 xtype : 'JsonReader',
380 'name': 'company_id',
408 'name': 'no_reset_sent',
412 'name': 'action_type',
416 'name': 'project_id',
420 'name': 'office_id_id',
424 'name': 'office_id_company_id',
428 'name': 'office_id_name',
432 'name': 'office_id_address',
436 'name': 'office_id_phone',
440 'name': 'office_id_fax',
444 'name': 'office_id_email',
448 'name': 'office_id_role',
452 'name': 'company_id_code',
456 'name': 'company_id_name',
460 'name': 'company_id_remarks',
464 'name': 'company_id_owner_id',
468 'name': 'company_id_address',
472 'name': 'company_id_tel',
476 'name': 'company_id_fax',
480 'name': 'company_id_email',
484 'name': 'company_id_id',
488 'name': 'company_id_isOwner',
492 'name': 'company_id_logo_id',
496 'name': 'company_id_background_color',
500 'name': 'company_id_comptype',
504 'name': 'company_id_url',
508 'name': 'company_id_main_office_id',
512 'name': 'company_id_created_by',
516 'name': 'company_id_created_dt',
520 'name': 'company_id_updated_by',
524 'name': 'company_id_updated_dt',
528 'name': 'company_id_passwd',
532 'name': 'project_id_id',
536 'name': 'project_id_name',
540 'name': 'project_id_remarks',
544 'name': 'project_id_owner_id',
548 'name': 'project_id_code',
552 'name': 'project_id_active',
556 'name': 'project_id_type',
560 'name': 'project_id_client_id',
564 'name': 'project_id_team_id',
568 'name': 'project_id_file_location',
572 'name': 'project_id_open_date',
576 'name': 'project_id_open_by',
580 'name': 'project_id_close_date',
584 'name': 'project_id_countries',
588 'name': 'project_id_languages',
592 'name': 'project_id_agency_id',
596 'name': 'owner_id_id',
600 'name': 'owner_id_office_id',
604 'name': 'owner_id_name',
608 'name': 'owner_id_phone',
612 'name': 'owner_id_fax',
616 'name': 'owner_id_email',
620 'name': 'owner_id_company_id',
624 'name': 'owner_id_role',
628 'name': 'owner_id_active',
632 'name': 'owner_id_remarks',
636 'name': 'owner_id_passwd',
640 'name': 'owner_id_owner_id',
644 'name': 'owner_id_lang',
648 'name': 'owner_id_no_reset_sent',
652 'name': 'owner_id_action_type',
656 'name': 'owner_id_project_id',
662 totalProperty : 'total',
669 xtype : 'ColumnModel',
670 dataIndex : 'project_id_code',
671 header : _this._strings['9e727fdd3aec8274f46685441900280d'] /* Project */,
673 renderer : function(v,x,r) {
674 return String.format('<span qtip="{0}">{1}</span>',
675 r.data.project_id_name,
684 xtype : 'ColumnModel',
685 dataIndex : 'company_id_comptype',
686 header : _this._strings['a1fa27779242b4902f7ae3bdd5c6d508'] /* Type */,
687 renderer : function(v,x,r) {
688 if (r.data.office_id) {
689 return String.format('{0} - {1}', v, r.data.office_id_name);
691 return String.format('{0}', v);
699 xtype : 'ColumnModel',
700 dataIndex : 'company_id_name',
701 header : _this._strings['1c76cbfe21c6f44c1d1e59d54f3e4420'] /* Company */,
702 renderer : function(v,x,r) {
703 if (r.data.office_id) {
704 return String.format('{0} - {1}', v, r.data.office_id_name);
706 return String.format('{0}', v);
714 xtype : 'ColumnModel',
716 header : _this._strings['49ee3087348e8d44e1feda1917443987'] /* Name */,
717 renderer : function(v,p,r) {
718 if(r.data.active != 1){
719 return String.format('<div style="text-decoration:line-through">{0}</div>', v);
721 return String.format('{0}', v);
729 xtype : 'ColumnModel',
731 header : _this._strings['bbbabdbe1b262f75d99d62880b953be1'] /* Role */,
732 renderer : function(v) { return String.format('{0}', v); },
738 xtype : 'ColumnModel',
740 header : _this._strings['bcc254b55c4a1babdf1dcb82c207506b'] /* Phone */,
741 renderer : function(v) { return String.format('{0}', v); },
747 xtype : 'ColumnModel',
749 header : _this._strings['9810aa2b9f44401be4bf73188ef2b67d'] /* Fax */,
750 renderer : function(v) { return String.format('{0}', v); },
756 xtype : 'ColumnModel',
758 header : _this._strings['ce8ae9da5b7cd6c3df2929543a9af92d'] /* Email */,
759 renderer : function(v) {
760 return (v.length && v.indexOf('@') > 0 ) ?
761 String.format('<a href="mailto:{0}">{0}</a>',v) : v;
769 xtype : 'ColumnModel',
770 dataIndex : 'active',
771 header : _this._strings['4d3d769b812b6faa6b76e1a8abaece2d'] /* Active */,
772 renderer : function(v) {
773 var state = v> 0 ? '-checked' : '';
775 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';