File size: 1,501 Bytes
07c3cdd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
var synchronizeDepartmentsLDAPADV = function() {
  iGrid = Ext.getCmp('infoGrid');
  rowSelected = iGrid.getSelectionModel().getSelected();
  if (rowSelected) {
    location.href = 'authSourcesSynchronize?authUid=' + rowSelected.data.AUTH_SOURCE_UID + '&tab=synchronizeDepartments';
  }
};

var synchronizeGroupsLDAPADV = function() {
  iGrid = Ext.getCmp('infoGrid');
  rowSelected = iGrid.getSelectionModel().getSelected();
  if (rowSelected) {
    location.href = 'authSourcesSynchronize?authUid=' + rowSelected.data.AUTH_SOURCE_UID + '&tab=synchronizeGroups';
  }
};

var synchronizeDepartmentsButtonLDAPADV = new Ext.Action({
  text: 'Synchronize Departments',
  iconCls: 'ICON_DEPARTAMENTS',
  disabled: true,
  handler: synchronizeDepartmentsLDAPADV
});

var synchronizeGroupsButtonLDAPADV = new Ext.Action({
  text: 'Synchronize Groups',
  iconCls: 'ICON_GROUPS',
  disabled: true,
  handler: synchronizeGroupsLDAPADV
});

var _rowselectLDAPADV = function(sm, index, record) {
  if (record.get('AUTH_SOURCE_PROVIDER') == 'ldapAdvanced') {
    synchronizeDepartmentsButtonLDAPADV.enable();
    synchronizeGroupsButtonLDAPADV.enable();
  }
};

var _rowdeselectLDAPADV = function(sm, index, record) {
  synchronizeDepartmentsButtonLDAPADV.disable();
  synchronizeGroupsButtonLDAPADV.disable();
};

_rowselect.push(_rowselectLDAPADV);
_rowdeselect.push(_rowdeselectLDAPADV);
_pluginActionButtons.push(synchronizeDepartmentsButtonLDAPADV);
_pluginActionButtons.push(synchronizeGroupsButtonLDAPADV);