ultimix

- Main Page
- Data Structures
- Files
- Examples

- File List
- Globals

permit_view.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
30 ultimix.permit.success_function = function( Data , Waiting )
31 {
32 return(
33 function( Result )
34 {
35 if( Result == ultimix.std_dialogs.MB_YES )
36 {
37 ultimix.data_form.AddDataToForm( Data );
38 document.getElementById( 'data_form' ).submit();
39 if( Waiting )
40 {
41 ultimix.std_dialogs.MessageBox(
42 ultimix.get_string( 'wait_please' ) , ultimix.get_string( 'Info' ) ,
43 ultimix.std_dialogs.MB_ICONLOADING | ultimix.std_dialogs.MB_MODAL
44 );
45 }
46 }
47 }
48 );
49 }
50
66 ultimix.permit.submit_permit_button = function( Permit , MasterId , MasterType , Checkboxes , Action )
67 {
68 ultimix.data_form.CreateForm();
69
70 if( Checkboxes != '' )
71 {
72 if( !ultimix.grids.record_selected( Checkboxes , 'at_least_one_record_must_be_selected' ) )
73 {
74 return;
75 }
76 var ids = ultimix.grids.get_identificators( Checkboxes );
77 var Data = { 'permit' : Permit , 'master_id' : MasterId , 'master_type' : MasterType , 'ids' : ids };
78 }
79 else
80 {
81 var Data = { 'permit' : Permit , 'master_id' : MasterId , 'master_type' : MasterType };
82 }
83 Data[ Action ] = 1;
84
85 var Success = ultimix.permit.success_function( Data , true );
86 ultimix.std_dialogs.QuestionMessageBox( ultimix.get_string( 'are_you_shure' ) , Success )
87 }
88
102 ultimix.permit.set_permit_button = function( Permit , MasterId , MasterType , Checkboxes )
103 {
104 ultimix.permit.submit_permit_button( Permit , MasterId , MasterType , Checkboxes , 'set_permit' );
105 }
106
120 ultimix.permit.toggle_permit_button = function( Permit , MasterId , MasterType , Checkboxes )
121 {
122 ultimix.permit.submit_permit_button( Permit , MasterId , MasterType , Checkboxes , 'toggle_permit' );
123 }
124
138 ultimix.permit.delete_permit_button = function( Permit , MasterId , MasterType , Checkboxes )
139 {
140 ultimix.permit.submit_permit_button( Permit , MasterId , MasterType , Checkboxes , 'delete_permit' );
141 }
142
148 ultimix.permit.add_permit = function( PermitName )
149 {
150 if( PermitName != '' )
151 {
152 document.getElementById( 'permit_list' ).removeChild( document.getElementById( PermitName + '_div_id_rest' ) );
153 document.getElementById( 'all_permits_div_id' ).innerHTML +=
154 "<div class='double_panel_row no_selection_text' id='" + PermitName + "_div_id'></div>";
155 document.getElementById( PermitName + '_div_id' ).innerHTML += "<input type='hidden' id='" + PermitName +
156 "_field_id' name='permits[]' value='" + PermitName +
157 "'><a href=\"javascript:ultimix.permit.delete_permit( '" +
158 PermitName + "' );\">" + PermitName + "</a><br>";
159 }
160 }
161
167 ultimix.permit.delete_permit = function( PermitName )
168 {
169 if( PermitName != '' )
170 {
171 document.getElementById( 'all_permits_div_id' ).removeChild(
172 document.getElementById( PermitName + '_div_id' )
173 );
174 document.getElementById( 'permit_list' ).innerHTML += "<div class='double_panel_row no_selection_text' id='" +
175 PermitName + "_div_id_rest'></div>";
176 document.getElementById( PermitName + '_div_id_rest' ).innerHTML +=
177 " <a href=\"javascript:ultimix.permit.add_permit( '" + PermitName + "' );\">" + PermitName + "</a><br>";
178 }
179 }
180
190 ultimix.permit.set_default_options = function( ViewOptions )
191 {
192 if( !ViewOptions )
193 {
194 ViewOptions = {};
195 }
196
197 ViewOptions.meta = ViewOptions.meta ? ViewOptions.meta : 'meta_permit_list';
198 ViewOptions.package_name = ViewOptions.package_name ? ViewOptions.package_name : 'permit::permit_view';
199 ViewOptions.paging_require_form = ViewOptions.paging_require_form ? ViewOptions.paging_require_form : '0';
200 ViewOptions.add_hidden_fields = ViewOptions.add_hidden_fields ? ViewOptions.add_hidden_fields : '0';
201
202 return( ViewOptions );
203 }
204
214 ultimix.permit.get_list_form = function( Fuctions , ViewOptions )
215 {
216 if( !Fuctions )
217 {
218 Fuctions = {};
219 }
220
221 ViewOptions = ultimix.permit.set_default_options( ViewOptions );
222
223 ultimix.ajax_gate.direct_view( ViewOptions , Fuctions );
224 }
225
241 ultimix.permit.get_custom_list_form = function( Fuctions , Header , Item , Footer , ViewOptions )
242 {
243 ultimix.auto.get_custom_list_form( Fuctions , Header , Item , Footer , false , ViewOptions , 'ad_banner' );
244 }
245
255 ultimix.permit.delete = function( Id , DataSelector )
256 {
257 ultimix.auto.delete(
258 Id , DataSelector ,
259 {
260 'package_name' : 'permit::permit_controller' ,
261 'permit_context_action' : 'delete_record' ,
262 'permit_action' : 'delete_record' , 'permit_record_id' : Id ,
263 'meta' : 'meta_delete_permit'
264 }
265 );
266 }
267
279 ultimix.permit.record_view_form = function( Id , DataSelector )
280 {
281 ultimix.auto.record_view_form(
282 Id , DataSelector ,
283 {
284 'package_name' : 'permit::permit_view' , 'permit_context_action' : 'record_view_form' ,
285 'permit_action' : 'record_view_form' , 'permit_record_id' : Id ,
286 'meta' : 'meta_record_view_permit_form'
287 }
288 );
289 }