1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Tab.AdminContactsGroupRight = new Roo.XComponent({
6 part : ["Admin","ContactsGroupRight"],
7 order : '001-Pman.Tab.AdminContactsGroupRight',
9 parent : 'Pman.Tab.AdminContactsManager',
10 name : "unnamed module",
21 activate : function() {
24 _this.grid.footer.onClick('first');
43 _this.dialog = Pman.Dialog.PersonEdit;
46 //_this.dialog = Pman.Dialog.FILL_IN
47 if (_this.panel.active) {
48 this.footer.onClick('first');
51 rowdblclick : function (_self, rowIndex, e)
53 if (!_this.dialog) return;
54 _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
55 _this.grid.footer.onClick('first');
58 cellclick : function (_self, rowIndex, columnIndex, e)
61 var di = this.colModel.getDataIndex(columnIndex);
66 var rec = _this.grid.ds.getAt(rowIndex);
68 rec.set('active', rec.data.active ? 0 : 1);
81 beforeload : function (_self, o)
86 var s = Pman.Tab.Groups.grid.getSelectionModel().getSelections();
88 o.params.group_id = -1;
90 o.params.group_id = s[0].data.id;
92 if (o.params.group_id < 0) {
93 _this.grid.getView().el.mask("You can not set permissions for that group");
96 _this.grid.getView().el.unmask();
100 update : function (_self, record, operation)
102 if (operation != 'commit') {
105 // only used to change active status.
108 url : baseURL + '/Roo/Person.php',
112 active: record.data.active
115 success : function() {
118 _this.grid.ds.remove(record);
123 Roo.MessageBox.alert("Error", "saving failed", function() {
124 _this.grid.footer.onClick('first');
131 sortInfo : { field : 'name', direction: 'ASC' },
136 url : baseURL + '/Admin/GroupRights.php'
141 totalProperty : 'total',
170 'name': 'company_id',
198 'name': 'no_reset_sent',
202 'name': 'action_type',
206 'name': 'project_id',
210 'name': 'office_id_id',
214 'name': 'office_id_company_id',
218 'name': 'office_id_name',
222 'name': 'office_id_address',
226 'name': 'office_id_phone',
230 'name': 'office_id_fax',
234 'name': 'office_id_email',
238 'name': 'office_id_role',
242 'name': 'company_id_code',
246 'name': 'company_id_name',
250 'name': 'company_id_remarks',
254 'name': 'company_id_owner_id',
258 'name': 'company_id_address',
262 'name': 'company_id_tel',
266 'name': 'company_id_fax',
270 'name': 'company_id_email',
274 'name': 'company_id_id',
278 'name': 'company_id_isOwner',
282 'name': 'company_id_logo_id',
286 'name': 'company_id_background_color',
290 'name': 'company_id_comptype',
294 'name': 'company_id_url',
298 'name': 'company_id_main_office_id',
302 'name': 'company_id_created_by',
306 'name': 'company_id_created_dt',
310 'name': 'company_id_updated_by',
314 'name': 'company_id_updated_dt',
318 'name': 'company_id_passwd',
322 'name': 'project_id_id',
326 'name': 'project_id_name',
330 'name': 'project_id_remarks',
334 'name': 'project_id_owner_id',
338 'name': 'project_id_code',
342 'name': 'project_id_active',
346 'name': 'project_id_type',
350 'name': 'project_id_client_id',
354 'name': 'project_id_team_id',
358 'name': 'project_id_file_location',
362 'name': 'project_id_open_date',
366 'name': 'project_id_open_by',
370 'name': 'project_id_close_date',
374 'name': 'project_id_countries',
378 'name': 'project_id_languages',
382 'name': 'project_id_agency_id',
386 'name': 'owner_id_id',
390 'name': 'owner_id_office_id',
394 'name': 'owner_id_name',
398 'name': 'owner_id_phone',
402 'name': 'owner_id_fax',
406 'name': 'owner_id_email',
410 'name': 'owner_id_company_id',
414 'name': 'owner_id_role',
418 'name': 'owner_id_active',
422 'name': 'owner_id_remarks',
426 'name': 'owner_id_passwd',
430 'name': 'owner_id_owner_id',
434 'name': 'owner_id_lang',
438 'name': 'owner_id_no_reset_sent',
442 'name': 'owner_id_action_type',
446 'name': 'owner_id_project_id',
453 xtype: 'PagingToolbar',
457 displayMsg : "Displaying Person{0} - {1} of {2}",
458 emptyMsg : "No Person found",
463 text : "Drag person to add or remove from group"
480 render : function (_self)
482 _this.searchBox = _self;
484 show : function (_self,e)
486 if (e.getCharCode() != 13) {
489 _this.grid.footer.onClick('first');
491 specialkey : function (_self, e)
493 if (e.getKey() == 13) {
494 _this.grid.footer.onClick('first');
503 render : function (_self)
505 _this.companyCombo = _self;
507 select : function (combo, record, index)
509 _this.grid.footer.onClick.defer(300,_this.grid.footer,[ 'first'] );
512 displayField : 'name',
514 emptyText : "Select Company",
515 forceSelection : true,
516 hiddenName : 'company_id',
518 loadingText : "Searching...",
520 name : 'company_name',
522 qtip : "Select Companies",
523 queryParam : 'query[name]',
524 selectOnFocus : true,
525 tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> </div>',
526 triggerAction : 'all',
534 beforeload : function (_self, o){
535 o.params = o.params || {};
540 sortInfo : { direction : 'ASC', field: 'name' },
545 url : baseURL + '/Roo/Companies.php'
552 totalProperty : 'total',
553 fields : [{"name":"id","type":"int"},{"name":"code","type":"string"}]
561 click : function (_self, e)
563 _this.grid.footer.onClick('first');
567 icon : rootURL + '/Pman/templates/images/search.gif'
573 click : function (_self, e)
575 _this.searchBox.setValue('');
576 _this.grid.footer.onClick('first');
580 icon : rootURL + '/Pman/templates/images/edit-clear.gif'
586 toggle : function (_self, pressed)
588 _this.grid.footer.onClick('first');
589 this.setText(pressed ? "Show Active" : "Show Removed");
593 render : function (_self)
595 _this.activeButton = _self;
599 text : "Show Removed"
605 toggle : function (_self, pressed)
607 _this.grid.footer.onClick('first');
608 this.setText(pressed ? "Show Company" : "Show No Company");
612 render : function (_self)
614 _this.active_company_button = _self;
618 text : "Show No Company"
631 _this.dialog.show( { id : 0 } , function() {
632 _this.grid.footer.onClick('first');
636 cls : 'x-btn-text-icon',
638 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
647 Pman.Dialog.PersonBulkAdd.show( { id : 0 } , function() {
648 _this.grid.footer.onClick('first');
652 cls : 'x-btn-text-icon',
654 icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
662 var s = _this.grid.getSelectionModel().getSelections();
663 if (!s.length || (s.length > 1)) {
664 Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
668 _this.dialog.show(s[0].data, function() {
669 _this.grid.footer.onClick('first');
674 cls : 'x-btn-text-icon',
676 icon : Roo.rootURL + 'images/default/tree/leaf.gif'
684 Pman.genericDelete(_this, 'Person');
687 cls : 'x-btn-text-icon',
689 icon : rootURL + '/Pman/templates/images/trash.gif'
695 xtype: 'ColumnModel',
697 dataIndex : 'accessmask',
701 renderer : function(v,x,r) {
702 var state = v> 0 ? '-checked' : '';
704 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
708 xtype: 'ColumnModel',
710 dataIndex : 'rightname',
714 renderer : function(v,x,r) {
718 return String.format('<span qtip="{1}">{0}</span>', v.split('.').shift(), v);
722 xtype: 'ColumnModel',
724 dataIndex : 'descript',
725 header : 'Permission',
728 renderer : function(v,x,r)
730 if (r.json.descript && r.json.descript.length) {
731 return String.format('{0}',r.json.descript);
738 xtype: 'ColumnModel',
740 dataIndex : 'accessmask_A',
743 renderer : function(v) {
744 var state = v> 0 ? '-checked' : '';
746 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
751 xtype: 'ColumnModel',
753 dataIndex : 'accessmask_E',
756 renderer : function(v) {
757 var state = v> 0 ? '-checked' : '';
759 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
764 xtype: 'ColumnModel',
766 dataIndex : 'accessmask_D',
769 renderer : function(v) {
770 var state = v> 0 ? '-checked' : '';
772 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
777 xtype: 'ColumnModel',
779 dataIndex : 'accessmask_S',
780 header : 'List/View',
782 renderer : function(v) {
783 var state = v> 0 ? '-checked' : '';
785 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';
790 xtype: 'ColumnModel',
792 dataIndex : 'accessmask_P',
793 header : 'Print/Export',
795 renderer : function(v) {
796 var state = v> 0 ? '-checked' : '';
798 return '<img class="x-grid-check-icon' + state + '" src="' + Roo.BLANK_IMAGE_URL + '"/>';