ultimix

- Main Page
- Data Structures
- Files
- Examples

- File List
- Globals

groups.js
Go to the documentation of this file.
1
6 if( !ultimix )
7 {
8 ultimix = {};
9 }
10
16 if( !ultimix.permit )
17 {
18 ultimix.permit = {};
19 }
20
36 ultimix.permit.SubmitGroupButton = function( Group , MasterId , MasterType , Checkboxes , Action )
37 {
38 ultimix.data_form.CreateForm();
39
40 if( Checkboxes != '' )
41 {
42 if( !ultimix.grids.record_selected( Checkboxes , 'at_least_one_record_must_be_selected' ) )
43 {
44 return;
45 }
46
47 var ids = ultimix.grids.get_identificators( Checkboxes );
48 var Data = { 'group' : Group , 'master_id' : MasterId , 'master_type' : MasterType , 'ids' : ids };
49 }
50 else
51 {
52 var Data = { 'group' : Group , 'master_id' : MasterId , 'master_type' : MasterType };
53 }
54
55 Data[ Action ] = 1;
56
57 var Success = ultimix.permit.SuccessFunction( Data , true );
58
59 ultimix.std_dialogs.MessageBox( ultimix.get_string( 'are_you_shure' ) , ultimix.get_string( 'Question' ) ,
60 ultimix.std_dialogs.MB_YESNO | ultimix.std_dialogs.MB_ICONQUESTION | ultimix.std_dialogs.MB_MODAL , Success );
61 return;
62
63 Success( ultimix.std_dialogs.MB_YES );
64 }
65
79 ultimix.permit.SetGroupButton = function( Group , MasterId , MasterType , Checkboxes )
80 {
81 ultimix.permit.SubmitGroupButton( Group , MasterId , MasterType , Checkboxes , 'set_group' );
82 }
83
97 ultimix.permit.ToggleGroupButton = function( Group , MasterId , MasterType , Checkboxes )
98 {
99 ultimix.permit.SubmitGroupButton( Group , MasterId , MasterType , Checkboxes , 'toggle_group' );
100 }
101
115 ultimix.permit.DeleteGroupButton = function( Group , MasterId , MasterType , Checkboxes )
116 {
117 ultimix.permit.SubmitGroupButton( Group , MasterId , MasterType , Checkboxes , 'delete_group' );
118 }
119
125 function AddGroup( GroupName )
126 {
127 if( GroupName != '' )
128 {
129 document.getElementById( 'group_list' ).removeChild( document.getElementById( GroupName + '_div_id_rest' ) );
130 document.getElementById( 'all_groups_div_id' ).innerHTML +=
131 "<div class='double_panel_row no_selection_text' id='" + GroupName + "_div_id'></div>";
132 document.getElementById( GroupName + '_div_id' ).innerHTML += "<input type='hidden' id='" + GroupName +
133 "_field_id' name='groups[]' value='" + GroupName + "'><a href=\"javascript:DeleteGroup( '" + GroupName +
134 "' );\">" + GroupName + "</a><br>";
135 }
136 }
137
143 function DeleteGroup( GroupName )
144 {
145 if( GroupName != '' )
146 {
147 document.getElementById( 'all_groups_div_id' ).removeChild( document.getElementById( GroupName + '_div_id' ) );
148 document.getElementById( 'group_list' ).innerHTML += "<div class='double_panel_row no_selection_text' id='" +
149 GroupName + "_div_id_rest'></div>";
150 document.getElementById( GroupName + '_div_id_rest' ).innerHTML += " <a href=\"javascript:AddGroup( '" +
151 GroupName + "' );\">" + GroupName + "</a><br>";
152 }
153 }