Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 7768 | Rev 7771 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3766 stevensc 1
<?php
1 www 2
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser    = $this->currentUserHelper();
4
$roleName       = $currentUser->getUserTypeId();
5
 
6
$routeAdd           = $this->url('jobs/add');
7
 
8
$routeDatatable   = $this->url('jobs');
9
 
10
$allowAdd = $acl->isAllowed($roleName, 'jobs/add') ? 1 : 0;
11
$allowDelete = $acl->isAllowed($roleName, 'jobs/delete') ? 1 : 0;
12
$allowEdit = $acl->isAllowed($roleName, 'jobs/edit') ? 1 : 0;
13
$allowUsersWhoApplied = $acl->isAllowed($roleName, 'jobs/users-who-applied') ? 1 : 0;
14
 
15
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
16
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
17
 
18
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
19
 
20
 
21
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/css/fileinput.min.css'));
22
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.css'));
23
 
24
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/piexif.js'));
25
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/sortable.js'));
26
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/fileinput.js'));
27
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/locales/es.js'));
28
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/fas/theme.js'));
29
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.js'));
30
 
31
 
32
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
33
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
34
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
35
 
36
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
37
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
38
 
39
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
40
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
41
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
42
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
43
 
44
 
45
 
46
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.min.css'));
47
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css'));
48
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.min.js'));
49
 
50
 
51
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-input-number/input-number-format.jquery.min.js'));
52
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
53
 
54
 
55
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
56
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
57
 
58
$this->inlineScript()->appendFile($this->basePath('plugins/moment/moment-with-locales.min.js'));
59
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
60
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
61
 
62
 
63
$this->headStyle()->captureStart();
64
echo <<<CSS
65
 
66
 
67
#gridTableUsersWhoApplied {
68
    display: flex;
69
    flex-flow: column;
70
    width: 100%;
71
}
72
 
73
#gridTableUsersWhoApplied thead {
74
    flex: 0 0 auto;
75
}
76
 
77
#gridTableUsersWhoApplied tbody {
78
    flex: 1 1 auto;
79
    display: block;
80
    overflow-y: auto;
81
    overflow-x: hidden;
82
}
83
 
84
#gridTableUsersWhoApplied tr {
85
    width: 100%;
86
    display: table;
87
    table-layout: fixed;
88
}
89
CSS;
90
$this->headStyle()->captureEnd();
91
 
92
$this->inlineScript()->captureStart();
93
echo <<<JS
94
jQuery( document ).ready(function( $ ) {
95
       var route_status = '';
96
       var route_title =  '';
97
       var route_extended =  '';
98
       var route_location =  '';
99
       var route_job_category =  '';
100
       var route_employment_type =  '';
101
       var route_salary =  '';
102
       var route_experience = '';
103
       var route_languages =  '';
104
       var route_degrees = '';
105
       var route_skills =  '';
106
       var route_last_date_of_application =  '';
107
 
108
 
109
 
110
        var allowDelete = $allowDelete;
111
        var allowEdit = $allowEdit;
112
        var allowUsersWhoApplied = $allowUsersWhoApplied;
113
 
114
        var gridTable = $('#gridTable').dataTable( {
115
            'processing': true,
116
            'serverSide': true,
117
            'searching': true,
118
            'order': [[ 0, 'desc' ]],
119
            'ordering':  true,
120
            'ordenable' : true,
121
            'responsive': true,
122
            'select' : false,
123
        	'paging': true,
124
            'pagingType': 'simple_numbers',
125
 
126
    		'ajax': {
127
    			'url' : '$routeDatatable',
128
    			'type' : 'get',
129
                'beforeSend': function (request) {
130
                  NProgress.start();
131
                },
132
                'dataFilter': function(response) {
133
                    var response = jQuery.parseJSON( response );
134
 
135
                    var json                = {};
136
                    json.recordsTotal       = 0;
137
                    json.recordsFiltered    = 0;
138
                    json.data               = [];
139
 
140
                    if(response.success) {
141
                        json.recordsTotal       = response.data.total;
142
                        json.recordsFiltered    = response.data.total;
143
                        json.data               = response.data.items;
144
                    } else {
145
                        $.fn.showError(response.data)
146
                    }
147
 
148
                    return JSON.stringify( json );
149
                }
150
    		},
151
            'language' : {
152
                'sProcessing':     'LABEL_DATATABLE_SPROCESSING',
153
                'sLengthMenu':     'LABEL_DATATABLE_SLENGTHMENU',
154
                'sZeroRecords':    'LABEL_DATATABLE_SZERORECORDS',
155
                'sEmptyTable':     'LABEL_DATATABLE_SEMPTYTABLE',
156
                'sInfo':           'LABEL_DATATABLE_SINFO',
157
                'sInfoEmpty':      'LABEL_DATATABLE_SINFOEMPTY',
158
                'sInfoFiltered':   'LABEL_DATATABLE_SINFOFILTERED',
159
                'sInfoPostFix':    '',
160
                'sSearch':         'LABEL_DATATABLE_SSEARCH',
161
                'sUrl':            '',
162
                'sInfoThousands':  ',',
163
                'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
164
                'oPaginate': {
165
                    'sFirst':    'LABEL_DATATABLE_SFIRST',
166
                    'sLast':     'LABEL_DATATABLE_SLAST',
167
                    'sNext':     'LABEL_DATATABLE_SNEXT',
168
                    'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
169
                },
170
                'oAria': {
171
                    'sSortAscending':  ': LABEL_DATATABLE_SSORTASCENDING',
172
                    'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
173
                },
174
            },
175
            'drawCallback': function( settings ) {
176
                NProgress.done();
177
                $('button.btn-delete').confirmation({
178
                    rootSelector: 'button.btn-delete',
179
                    title : 'LABEL_ARE_YOU_SURE',
180
                    singleton : true,
181
                    btnOkLabel: 'LABEL_YES',
182
                    btnCancelLabel: 'LABEL_NO',
183
                    onConfirm: function(value) {
184
                        action = $(this).data('href');
185
                        NProgress.start();
186
                        $.ajax({
187
                            'dataType'  : 'json',
188
                            'accept'    : 'application/json',
189
                            'method'    : 'post',
190
                            'url'       :  action,
191
                        }).done(function(response) {
192
                            if(response['success']) {
193
                                $.fn.showSuccess(response['data']);
194
                                gridTable.api().ajax.reload(null, false);
195
                            } else {
196
                                $.fn.showError(response['data']);
197
                            }
198
                        }).fail(function( jqXHR, textStatus, errorThrown) {
199
                            $.fn.showError(textStatus);
200
                        }).always(function() {
201
                            NProgress.done();
202
                        });
203
                    },
204
                });
205
            },
206
            'aoColumns': [
207
                { 'mDataProp': 'last_date_of_application' },
208
                { 'mDataProp': 'title' },
209
                { 'mDataProp': 'details' },
210
                { 'mDataProp': 'actions' },
211
    	    ],
212
            'columnDefs': [
213
 
214
                {
215
                    'targets': -2,
216
                    'orderable': false,
217
                    'render' : function ( data, type, row ) {
218
                        var s = 'LABEL_STATUS : ' + row['details']['status'] + '<br>';
219
                        s = s + 'LABEL_EMPLOYMENT_TYPE : <br>' + row['details']['employment_type'] + '<br>';
220
                        s = s +  'LABEL_QTY_USERS_WHO_APPLIED : ' + row['details']['users_who_applied'] + '<br>';
221
 
222
                        return s;
223
                    }
224
                },
225
 
226
                {
227
                    'targets': -1,
228
                    'orderable': false,
229
                    'render' : function ( data, type, row ) {
230
                        s = '';
231
 
232
                        if(allowEdit && data['link_edit']  ) {
233
                            s = s + '<button class="btn btn-info btn-sm btn-edit" style="margin-top: 5px" data-href="' + data['link_edit']+ '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pencil"></i> LABEL_EDIT </button><br>';
234
                        }
235
                        if(allowDelete && data['link_delete']  ) {
236
                            s = s + '<button class="btn btn-danger btn-sm btn-delete" style="margin-top: 5px" data-href="' + data['link_delete']+ '" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> LABEL_DELETE </button><br>';
237
                        }
238
                        if(allowUsersWhoApplied && data['link_users_who_applied']  ) {
239
                            s = s + '<button class="btn btn-primary btn-sm btn-users-who-applied" style="margin-top: 5px" data-href="' + data['link_users_who_applied']+ '" data-toggle="tooltip" title="LABEL_USERS_WHO_APPLIED"><i class="fa fa-users"></i> LABEL_USERS_WHO_APPLIED </button><br>';
240
                        }
241
 
242
                        return s;
243
                    }
244
                }
245
              ],
246
        });
247
 
248
    $.validator.addMethod('greaterThanFloat', function (value, element, param) {
249
        var otherElement = $(param);
250
        return parseFloat(value) > parseFloat(otherElement.val());
251
    }, 'ERROR_INVALID_MINIMUM');
252
 
253
 
254
 
255
    $.validator.addMethod('greaterThan', function (value, element, param) {
256
        var otherElement = $(param);
257
        return parseInt(value, 10) > parseInt(otherElement.val(), 10);
258
    }, 'ERROR_INVALID_MINIMUM');
259
 
260
 
261
    $.validator.addMethod('checkLocation', function (value, element, param) {
262
        var otherElement = $(param);
263
 
264
        return $.trim(otherElement.val()).length > 0;
265
    }, 'ERROR_PLACED_AUTOCOMPLETE_DOES_NOT_CONTAIN_GEOMETRY');
266
 
267
    var autocompleteLocation = new google.maps.places.Autocomplete(
268
        (document.getElementById('location_search')),
269
        {types: ['(cities)']}
270
    );
271
 
272
    $.fn.fillInAddressLocation = function() {
273
 
274
        var place = autocompleteLocation.getPlace();
275
        if (!place.geometry) {
276
            $.fn.showError('ERROR_PLACED_AUTOCOMPLETE_DOES_NOT_CONTAIN_GEOMETRY')
277
            return;
278
        } else {
279
            address1 = '';
280
            address2 = '';
281
            city1 = '';
282
            city2 = '';
283
            state = '';
284
            country = '';
285
            postal_code = '';
286
 
287
            formatted_address = place.formatted_address;
288
            latitude = place.geometry.location.lat();
289
            longitude = place.geometry.location.lng();
290
            var arrAddress = place.address_components;
291
 
292
            $.each(arrAddress, function(i, address_component) {
293
                if (address_component.types[0] == "route") {
294
                    address1 = address_component.long_name;
295
                }
296
                if (address_component.types[0] == "sublocality") {
297
                    address2 = address_component.long_name;
298
                }
299
                if (address_component.types[0] == "locality") {
300
                    city1 = address_component.long_name;
301
                }
302
                if (address_component.types[0] == "administrative_area_level_2") {
303
                    city2 = address_component.long_name;
304
                }
305
                if (address_component.types[0] == "administrative_area_level_1") {
306
                    state = address_component.long_name;
307
                }
308
                if (address_component.types[0] == "country") {
309
                    country = address_component.long_name;
310
                }
311
                if (address_component.types[0] == "postal_code") {
312
                    postal_code = address_component.long_name;
313
                }
314
            });
315
 
316
            $('#form-location #formatted_address').val(formatted_address);
317
            $('#form-location #address1').val(address1);
318
            $('#form-location #address2').val(address2);
319
            $('#form-location #city1').val(city1);
320
            $('#form-location #city2').val(city2);
321
            $('#form-location #state').val(state);
322
            $('#form-location #country').val(country);
323
            $('#form-location #postal_code').val(postal_code);
324
            $('#form-location #latitude').val(latitude);
325
            $('#form-location #longitude').val(longitude);
326
        }
327
    }
328
 
329
 
330
    var autocompleteLocationNew = new google.maps.places.Autocomplete(
331
        (document.getElementById('add_location_search')),
332
        {types: ['(cities)']}
333
    );
334
 
335
    $.fn.fillInAddressNewLocation = function() {
336
 
337
 
338
        var place = autocompleteLocationNew.getPlace();
339
        if (!place.geometry) {
340
            $.fn.showError('ERROR_PLACED_AUTOCOMPLETE_DOES_NOT_CONTAIN_GEOMETRY')
341
            return;
342
        } else {
343
            address1 = '';
344
            address2 = '';
345
            city1 = '';
346
            city2 = '';
347
            state = '';
348
            country = '';
349
            postal_code = '';
350
 
351
            formatted_address = place.formatted_address;
352
            latitude = place.geometry.location.lat();
353
            longitude = place.geometry.location.lng();
354
            var arrAddress = place.address_components;
355
 
356
            $.each(arrAddress, function(i, address_component) {
357
                if (address_component.types[0] == "route") {
358
                    address1 = address_component.long_name;
359
                }
360
                if (address_component.types[0] == "sublocality") {
361
                    address2 = address_component.long_name;
362
                }
363
                if (address_component.types[0] == "locality") {
364
                    city1 = address_component.long_name;
365
                }
366
                if (address_component.types[0] == "administrative_area_level_2") {
367
                    city2 = address_component.long_name;
368
                }
369
                if (address_component.types[0] == "administrative_area_level_1") {
370
                    state = address_component.long_name;
371
                }
372
                if (address_component.types[0] == "country") {
373
                    country = address_component.long_name;
374
                }
375
                if (address_component.types[0] == "postal_code") {
376
                    postal_code = address_component.long_name;
377
                }
378
            });
379
 
380
            $('#form-add #formatted_address').val(formatted_address);
381
            $('#form-add #address1').val(address1);
382
            $('#form-add #address2').val(address2);
383
            $('#form-add #city1').val(city1);
384
            $('#form-add #city2').val(city2);
385
            $('#form-add #state').val(state);
386
            $('#form-add #country').val(country);
387
            $('#form-add #postal_code').val(postal_code);
388
            $('#form-add #latitude').val(latitude);
389
            $('#form-add #longitude').val(longitude);
390
        }
391
    }
392
 
393
 
394
    $.validator.setDefaults({
395
        debug: true,
396
        highlight: function(element) {
397
            $(element).addClass('is-invalid');
398
        },
399
        unhighlight: function(element) {
400
            $(element).removeClass('is-invalid');
401
        },
402
        errorElement: 'span',
403
        errorClass: 'error invalid-feedback',
404
        errorPlacement: function(error, element) {
405
            if(element.parent('.form-group').length) {
406
                error.insertAfter(element);
407
            } else if(element.parent('.toggle').length) {
408
                error.insertAfter(element.parent().parent());
409
            } else {
410
                error.insertAfter(element.parent());
411
            }
412
        }
413
    });
414
 
415
 
416
 
417
    $.fn.showFormErrorValidator = function(fieldname, errors) {
418
        var field = $(fieldname);
419
        if(field) {
420
            $(field).addClass('form-group-has-error');
421
 
422
            var error = $('<div id="' + fieldname +'-error" class="form-group-invalid-feedback">' + errors + '</div>');
423
            if(field.parent('.form-group').length) {
424
                error.insertAfter(field.parent());
425
            } else {
426
                error.insertAfter(field);
427
            }
428
        }
429
    };
430
 
431
    var validatorAdd = $('#form-add').validate({
432
        debug: true,
433
        onclick: false,
434
        onkeyup: false,
435
        onfocusout: false,
436
        ignore: [],
437
        rules: {
438
            'name': {
439
                required: true,
440
                maxlength: 128,
441
            },
442
            'title': {
443
                required: true,
444
            },
445
            'last_date_of_application': {
446
                required: true,
447
            },
448
            'job_category_id' :  {
449
                required: true,
450
            },
451
            'employment_type' : {
452
                required: true,
453
            },
454
            'add_location_search': {
455
                required: true,
456
                checkLocation: '#form-add #latitude'
457
            }
458
        },
459
        submitHandler: function(form)
460
        {
461
            NProgress.start();
462
            $.ajax({
463
                'dataType'  : 'json',
464
                'accept'    : 'application/json',
465
                'method'    : 'post',
466
                'url'       :  '$routeAdd',
467
                'data'      :  $('#form-add').serialize(),
468
            }).done(function(response) {
469
                if(response['success']) {
470
                    $('#add-job-box').modal('hide');
471
                    gridTable.api().ajax.reload(null, false);
472
 
473
                    $('#overview-title').html(response['data']['title']);
474
                    $('#overview-job-category').html(response['data']['job_category']);
475
					$('#overview-last-date-of-application').html(response['data']['last_date_of_application']);
476
					$('#overview-employment-type').html(response['data']['employment_type']);
477
                    $('#overview-location').html(response['data']['location']);
478
 
479
                    $('#overview-status').html(response['data']['status']);
480
                    $('#overview-description').html(response['data']['description']);
481
 
482
                    $('#overview-salary').html(response['data']['salary']);
483
                    $('#overview-experience').html('')
484
 
485
 
486
 
487
 
488
 
489
                    $('list-skills').empty();
490
                    $('list-languages').empty();
491
                    $('list-degrees').empty();
492
 
493
 
494
                    route_status = response['data']['route_status'];
495
                    route_title =  response['data']['route_title'];
496
                    route_extended =  response['data']['route_extended'];
497
                    route_location =  response['data']['route_location'];
498
                    route_job_category =  response['data']['route_job_category'];
499
                    route_employment_type =  response['data']['route_employment_type'];
500
                    route_salary =  response['data']['route_salary'];
501
                    route_experience = response['data']['route_experience'];
502
                    route_languages =  response['data']['route_languages'];
503
                    route_degrees = response['data']['route_degrees'];
504
                    route_skills =  response['data']['route_skills'];
505
                    route_last_date_of_application =  response['data']['route_last_date_of_application'];
506
 
507
                    $('#divListing').hide();
508
                    $('#divEdit').show();
509
 
510
                } else {
511
                    validatorAdd.resetForm();
512
                    if(jQuery.type(response['data']) == 'string') {
513
                        $.fn.showError(response['data']);
514
                    } else  {
515
                        $.each(response['data'], function( fieldname, errors ) {
516
                            $.fn.showFormErrorValidator('#form-add #' + fieldname, errors);
517
                        });
518
                    }
519
                }
520
            }).fail(function( jqXHR, textStatus, errorThrown) {
521
                $.fn.showError(textStatus);
522
            }).always(function() {
523
                NProgress.done();
524
            });
525
            return false;
526
        },
527
        invalidHandler: function(form, validator) {
528
 
529
        }
530
    });
531
 
532
    $('body').on('click', 'button.btn-edit', function(e) {
533
        e.preventDefault();
534
 
535
        var href = $(this).data('href');
536
 
537
        NProgress.start();
538
            $.ajax({
539
                'dataType'  : 'json',
540
                'accept'    : 'application/json',
541
                'method'    : 'get',
542
                'url'       :  href,
543
            }).done(function(response) {
544
                if(response['success']) {
545
                    $('#add-job-box').modal('hide');
546
                    gridTable.api().ajax.reload(null, false);
547
 
548
                    $('#overview-title').html(response['data']['title']);
549
                    $('#overview-job-category').html(response['data']['job_category']);
550
					$('#overview-last-date-of-application').html(response['data']['last_date_of_application']);
551
					$('#overview-employment-type').html(response['data']['employment_type']);
552
                    $('#overview-location').html(response['data']['location']);
553
 
554
                    $('#overview-status').html(response['data']['status']);
555
                    $('#overview-description').html(response['data']['description']);
556
 
557
 
558
                    if(response['data']['salary']) {
559
					   $('#overview-salary').html(response['data']['salary']);
560
                    } else {
561
                       $('#overview-salary').html('')
562
                    }
563
 
564
                    if(response['data']['experience']) {
565
					   $('#overview-experience').html(response['data']['experience'] + ' LABEL_YEARS');
566
                    } else {
567
                       $('#overview-experience').html('')
568
                    }
569
 
570
 
571
 
572
                    $('#list-skills').empty();
573
                    $.each(response['data']['skills'], function(i, name) {
574
                        $('#list-skills').append('<li>' + name + '</li>');
575
                    });
576
 
577
                    $('#list-languages').empty();
578
                    $.each(response['data']['languages'], function(i, name) {
579
                        $('#list-languages').append('<li>' + name + '</li>');
580
                    });
581
 
582
                    $('#list-degrees').empty();
583
                    $.each(response['data']['degrees'], function(i, name) {
584
                        $('#list-degrees').append('<li>' + name + '</li>');
585
                    });
586
 
587
 
588
                    route_status =  response['data']['route_status'];
589
                    route_title =   response['data']['route_title'];
590
                    route_extended =   response['data']['route_extended'];
591
                    route_location =   response['data']['route_location'];
592
                    route_job_category =   response['data']['route_job_category'];
593
                    route_employment_type =   response['data']['route_employment_type'];
594
                    route_salary =   response['data']['route_salary'];
595
                    route_experience =  response['data']['route_experience'];
596
                    route_languages =   response['data']['route_languages'];
597
                    route_degrees =  response['data']['route_degrees'];
598
                    route_skills =   response['data']['route_skills'];
599
                    route_last_date_of_application =   response['data']['route_last_date_of_application'];
600
 
601
 
602
                    $('#divListing').hide();
603
                    $('#divEdit').show();
604
 
605
                } else {
606
                    validatorAdd.resetForm();
607
                    if(jQuery.type(response['data']) == 'string') {
608
                        $.fn.showError(response['data']);
609
                    } else  {
610
                        $.each(response['data'], function( fieldname, errors ) {
611
                            $.fn.showFormErrorValidator('#form-add #' + fieldname, errors);
612
                        });
613
                    }
614
                }
615
            }).fail(function( jqXHR, textStatus, errorThrown) {
616
                $.fn.showError(textStatus);
617
            }).always(function() {
618
                NProgress.done();
619
            });
620
            return false;
621
    });
622
 
623
 
624
 
625
    $(".close-box, .btn-add-job-cancel").on("click", function(e){
626
        e.preventDefault();
627
        $('#add-job-box').modal('hide');
628
        return false;
629
    });
630
 
631
    $('body').on('click', 'button.btn-add', function(e) {
632
        e.preventDefault();
633
 
634
 
635
        $('#form-add #title').val('');
636
        $('#form-add #last_date_of_application').val('');
637
        $('#form-add #employment_type').val('').trigger('change');
638
        $('#form-add #job_category_id').val('').trigger('change');
639
        $('#form-add #formatted_address').val('');
640
        $('#form-add #address1').val('');
641
        $('#form-add #address2').val('');
642
        $('#form-add #country').val('');
643
        $('#form-add #state').val('');
644
        $('#form-add #city1').val('');
645
        $('#form-add #city2').val('');
646
        $('#form-add #postal_code').val('');
647
        $('#form-add #latitude').val('');
648
        $('#form-add #longitude').val('');
649
        $('#form-add #add_location_search').val('');
650
        validatorAdd.resetForm();
651
 
652
        $('#add-job-box').modal('show');
653
        return false;
654
    });
655
 
656
    $('#form-add #last_date_of_application').datetimepicker({
657
        //viewMode: 'years',
658
        locale: 'es',
659
        format: 'DD/MM/YYYY'
660
    });
661
 
662
 
663
    $('body').on('click', 'button.btn-view-profile', function(e) {
664
        e.preventDefault();
665
 
666
        var href = $(this).data('href');
667
        window.open(href, '_blank');
668
 
669
    });
670
 
671
    $('body').on('click', 'button.btn-users-who-applied', function(e) {
672
        e.preventDefault();
673
 
674
        var href = $(this).data('href');
675
        NProgress.start();
676
        $.ajax({
677
            'dataType'  : 'json',
678
            'accept'    : 'application/json',
679
            'method'    : 'get',
680
            'url'       :  href
681
        }).done(function(response) {
682
            if(response['success']) {
683
                $('#gridTableUsersWhoApplied tbody').empty();
684
                $.each(response['data'], function(i, record) {
685
                    var s = '<tr>';
686
                    s = s + '<td>' + record['first_name'] + '</td>';
687
                    s = s + '<td>' + record['last_name'] + '</td>';
688
                    s = s + '<td>' + record['email'] + '</td>';
689
                    s = s + '<td><button class="btn btn-default btn-view-profile" data-href="' + record['link_view']+ '"><i class="fa fa-external-link"></i></button></td>';
690
                    s = s + '<tr>';
691
 
692
                    $('#gridTableUsersWhoApplied tbody').append(s);
693
 
694
                });
695
 
696
 
697
                $('#modalUsersWhoApplied').modal('show');
698
            } else {
699
                $.fn.showError(response['data']);
700
 
701
            }
702
        }).fail(function( jqXHR, textStatus, errorThrown) {
703
            $.fn.showError(textStatus);
704
        }).always(function() {
705
            NProgress.done();
706
        });
707
        return false;
708
 
709
    });
710
 
711
 var validatorLocation = $('#form-location').validate({
712
        debug: true,
713
        onclick: false,
714
        onkeyup: false,
715
        onfocusout: false,
716
        ignore: [],
717
        rules: {
718
            'location_search': {
719
                required: true,
720
                checkLocation: '#form-location #latitude'
721
            }
722
        },
723
        submitHandler: function(form)
724
        {
725
            NProgress.start();
726
            $.ajax({
727
                'dataType'  : 'json',
728
                'accept'    : 'application/json',
729
                'method'    : 'post',
730
                'url'       :  route_location,
731
                'data'      :  $('#form-location').serialize(),
732
            }).done(function(response) {
733
 
734
 
735
 
736
                if(response['success']) {
737
                    $('#overview-location').html(response.data);
738
                    $("#location-box").modal('hide');
739
                } else {
740
                    validatorLocation.resetForm();
741
                    $.fn.showError(response['data']);
742
                }
743
            }).fail(function( jqXHR, textStatus, errorThrown) {
744
                $.fn.showError(textStatus);
745
            }).always(function() {
746
                NProgress.done();
747
            });
748
            return false;
749
        },
750
        invalidHandler: function(form, validator) {
751
 
752
        }
753
    });
754
 
755
 
756
    $('body').on('click', 'a.btn-location-edit', function(e) {
757
        e.preventDefault();
758
 
759
        $('#form-location #location_search').val('');
760
        $('#form-location #formatted_address').val('');
761
        $('#form-location #address1').val('');
762
        $('#form-location #address2').val('');
763
        $('#form-location #country').val('');
764
        $('#form-location #state').val('');
765
        $('#form-location #city1').val('');
766
        $('#form-location #city2').val('');
767
        $('#form-location #postal_code').val('');
768
        $('#form-location #latitude').val('');
769
        $('#form-location #longitude').val('');
770
        validatorLocation.resetForm();
771
 
772
        $("#location-box").modal('show');
773
    });
774
 
775
    $('.btn-location-close').on("click", function(e){
776
        e.preventDefault();
777
 
778
        $("#location-box").modal('hide');
779
        return false;
780
    });
781
 
782
 
783
 
784
 
785
    var validatorLastDateOfApplication = $('#form-last-date-of-application').validate({
786
        debug: true,
787
        onclick: false,
788
        onkeyup: false,
789
        onfocusout: false,
790
        ignore: [],
791
        rules: {
792
            'last_date_of_application': {
793
                required: true,
794
            },
795
        },
796
 
797
        submitHandler: function(form)
798
        {
799
            NProgress.start();
800
            $.ajax({
801
                'dataType'  : 'json',
802
                'accept'    : 'application/json',
803
                'method'    : 'post',
804
                'url'       :  route_last_date_of_application,
805
                'data'      :  $('#form-last-date-of-application').serialize()
806
            }).done(function(response) {
807
                if(response['success']) {
808
 
809
                    $('#overview-last-date-of-application').html(response['data']);
810
                    $("#last-date-of-application-box").modal('hide');
811
                } else {
812
                    validatorLastDateOfApplication.resetForm();
813
                    if(jQuery.type(response['data']) == 'string') {
814
                        $.fn.showError(response['data']);
815
                    } else  {
816
                        $.each(response['data'], function( fieldname, errors ) {
817
                            $.fn.showFormErrorValidator('#form-last-date-of-application #' + fieldname, errors);
818
                        });
819
                    }
820
                }
821
            }).fail(function( jqXHR, textStatus, errorThrown) {
822
                $.fn.showError(textStatus);
823
            }).always(function() {
824
                NProgress.done();
825
            });
826
            return false;
827
        },
828
        invalidHandler: function(form, validator) {
829
 
830
        }
831
    });
832
 
833
 
834
    $('.btn-last-date-of-application-edit').on("click", function(e){
835
        e.preventDefault();
836
 
837
        NProgress.start();
838
        $.ajax({
839
            'dataType'  : 'json',
840
            'accept'    : 'application/json',
841
            'method'    : 'get',
842
            'url'       : route_last_date_of_application,
843
        }).done(function(response) {
844
           if(response['success']) {
845
                $('#form-last-date-of-application #last_date_of_application').val(response['data']);
846
                validatorLastDateOfApplication.resetForm();
847
 
848
                $("#last-date-of-application-box").modal('show');
849
            } else {
850
                $.fn.showError(response['data']);
851
            }
852
        }).fail(function( jqXHR, textStatus, errorThrown) {
853
            $.fn.showError(textStatus);
854
        }).always(function() {
855
            NProgress.done();
856
        });
857
        return false;
858
 
859
    });
860
 
861
    $('.btn-last-date-of-application-close').on("click", function(e){
862
        e.preventDefault();
863
 
864
        $("#last-date-of-application-box").modal('hide');
865
        return false;
866
    });
867
 
868
 
869
    var validatorExtended = $('#form-extended').validate({
870
        debug: true,
871
        onclick: false,
872
        onkeyup: false,
873
        onfocusout: false,
874
        ignore: [],
875
        rules: {
876
            'description': {
877
                updateCkeditor:function() {
878
                        CKEDITOR.instances.description.updateElement();
879
                },
880
                required: false,
881
            },
882
        },
883
 
884
        submitHandler: function(form)
885
        {
886
            NProgress.start();
887
            $.ajax({
888
                'dataType'  : 'json',
889
                'accept'    : 'application/json',
890
                'method'    : 'post',
891
                'url'       :  route_extended,
892
                'data'      :  $('#form-extended').serialize()
893
            }).done(function(response) {
894
                if(response['success']) {
895
 
896
                    $('#overview-description').html(response['data']['description']);
897
                    $("#extended-box").modal('hide');
898
                } else {
899
                    validatorExtended.resetForm();
900
                    if(jQuery.type(response['data']) == 'string') {
901
                        $.fn.showError(response['data']);
902
                    } else  {
903
                        $.each(response['data'], function( fieldname, errors ) {
904
                            $.fn.showFormErrorValidator('#form-extended #' + fieldname, errors);
905
                        });
906
                    }
907
                }
908
            }).fail(function( jqXHR, textStatus, errorThrown) {
909
                $.fn.showError(textStatus);
910
            }).always(function() {
911
                NProgress.done();
912
            });
913
            return false;
914
        },
915
        invalidHandler: function(form, validator) {
916
 
917
        }
918
    });
919
 
920
 
921
    $('.btn-extended-edit').on("click", function(e){
922
        e.preventDefault();
923
 
924
        NProgress.start();
925
        $.ajax({
926
            'dataType'  : 'json',
927
            'accept'    : 'application/json',
928
            'method'    : 'get',
929
            'url'       : route_extended,
930
        }).done(function(response) {
931
           if(response['success']) {
932
                CKEDITOR.instances.description.setData(response['data']['description']);
933
                validatorExtended.resetForm();
934
 
935
                $("#extended-box").modal('show');
936
            } else {
937
                $.fn.showError(response['data']);
938
            }
939
        }).fail(function( jqXHR, textStatus, errorThrown) {
940
            $.fn.showError(textStatus);
941
        }).always(function() {
942
            NProgress.done();
943
        });
944
        return false;
945
 
946
    });
947
 
948
    $('.btn-extended-close').on("click", function(e){
949
        e.preventDefault();
950
 
951
        $("#extended-box").modal('hide');
952
        return false;
953
    });
954
 
955
 
956
    var validatorJobCategory = $('#form-job-category').validate({
957
        debug: true,
958
        onclick: false,
959
        onkeyup: false,
960
        ignore: [],
961
        rules: {
962
            'job-category_id': {
963
                required: false,
964
                digits: true
965
            },
966
        },
967
        submitHandler: function(form)
968
        {
969
            NProgress.start();
970
            $.ajax({
971
                'dataType'  : 'json',
972
                'accept'    : 'application/json',
973
                'method'    : 'post',
974
                'url'       :  route_job_category,
975
                'data'      :  $('#form-job-category').serialize()
976
            }).done(function(response) {
977
                if(response['success']) {
978
					$('#overview-job-category').html(response['data']);
979
                    $("#job-category-box").modal('hide');
980
                } else {
981
                    validatorJobCategory.resetForm();
982
                    if(jQuery.type(response['data']) == 'string') {
983
                        $.fn.showError(response['data']);
984
                    } else  {
985
                        $.each(response['data'], function( fieldname, errors ) {
986
                            $.fn.showFormErrorValidator('#form-job-category #' + fieldname, errors);
987
                        });
988
                    }
989
                }
990
            }).fail(function( jqXHR, textStatus, errorThrown) {
991
                $.fn.showError(textStatus);
992
            }).always(function() {
993
                NProgress.done();
994
            });
995
            return false;
996
        },
997
        invalidHandler: function(form, validator) {
998
 
999
        }
1000
    });
1001
 
1002
    $('.btn-job-category-edit').on("click", function(e){
1003
        e.preventDefault();
1004
 
1005
        NProgress.start();
1006
        $.ajax({
1007
            'dataType'  : 'json',
1008
            'accept'    : 'application/json',
1009
            'method'    : 'get',
1010
            'url'       : route_job_category,
1011
        }).done(function(response) {
1012
           if(response['success']) {
1013
                $('#form-job-category #job_category_id').val(response['data']).trigger('change');
1014
                validatorJobCategory.resetForm();
1015
                $("#job-category-box").modal('show');
1016
            } else {
1017
                $.fn.showError(response['data']);
1018
            }
1019
        }).fail(function( jqXHR, textStatus, errorThrown) {
1020
            $.fn.showError(textStatus);
1021
        }).always(function() {
1022
            NProgress.done();
1023
        });
1024
        return false;
1025
 
1026
    });
1027
 
1028
    $('.btn-job-category-close').on("click", function(e){
1029
        e.preventDefault();
1030
 
1031
        $("#job-category-box").modal('hide');
1032
        return false;
1033
    });
1034
 
1035
 
1036
 
1037
    var validatorEmploymentType = $('#form-employment-type').validate({
1038
        debug: true,
1039
        onclick: false,
1040
        onkeyup: false,
1041
        ignore: [],
1042
        rules: {
1043
            'employment_type': {
1044
                required: false,
1045
            },
1046
        },
1047
        submitHandler: function(form)
1048
        {
1049
            NProgress.start();
1050
            $.ajax({
1051
                'dataType'  : 'json',
1052
                'accept'    : 'application/json',
1053
                'method'    : 'post',
1054
                'url'       :  route_employment_type,
1055
                'data'      :  $('#form-employment-type').serialize()
1056
            }).done(function(response) {
1057
                if(response['success']) {
1058
					$('#overview-employment-type').html(response['data']);
1059
                    $("#employment-type-box").modal('hide');
1060
                } else {
1061
                    validatorEmploymentType.resetForm();
1062
                    if(jQuery.type(response['data']) == 'string') {
1063
                        $.fn.showError(response['data']);
1064
                    } else  {
1065
                        $.each(response['data'], function( fieldname, errors ) {
1066
                            $.fn.showFormErrorValidator('#form-employment-type #' + fieldname, errors);
1067
                        });
1068
                    }
1069
                }
1070
            }).fail(function( jqXHR, textStatus, errorThrown) {
1071
                $.fn.showError(textStatus);
1072
            }).always(function() {
1073
                NProgress.done();
1074
            });
1075
            return false;
1076
        },
1077
        invalidHandler: function(form, validator) {
1078
 
1079
        }
1080
    });
1081
 
1082
    $('.btn-employment-type-edit').on("click", function(e){
1083
        e.preventDefault();
1084
 
1085
        NProgress.start();
1086
        $.ajax({
1087
            'dataType'  : 'json',
1088
            'accept'    : 'application/json',
1089
            'method'    : 'get',
1090
            'url'       : route_employment_type,
1091
        }).done(function(response) {
1092
           if(response['success']) {
1093
                $('#form-employment-type #employment_type').val(response['data']).trigger('change');
1094
                validatorEmploymentType.resetForm();
1095
                $("#employment-type-box").modal('show');
1096
            } else {
1097
                $.fn.showError(response['data']);
1098
            }
1099
        }).fail(function( jqXHR, textStatus, errorThrown) {
1100
            $.fn.showError(textStatus);
1101
        }).always(function() {
1102
            NProgress.done();
1103
        });
1104
        return false;
1105
 
1106
    });
1107
 
1108
    $('.btn-employment-type-close').on("click", function(e){
1109
        e.preventDefault();
1110
 
1111
        $("#employment-type-box").modal('hide');
1112
        return false;
1113
    });
1114
 
1115
    var validatorSalary = $('#form-salary').validate({
1116
        debug: true,
1117
        onclick: false,
1118
        onkeyup: false,
1119
        ignore: [],
1120
        rules: {
1121
            'salary_visible': {
1122
                required: false,
1123
            },
1124
            'salary_min': {
1125
                required:  '#form-salary #salary_visible:checked',
1126
                number: true,
1127
                maxlength: 10,
1128
            },
1129
            'salary currency': {
1130
                required:  '#form-salary #salary_visible:checked',
1131
                maxlength: 5,
1132
            },
1133
            'salary_max': {
1134
                required:  '#form-salary #salary_visible:checked',
1135
                number: true,
1136
                maxlength: 10,
1137
                greaterThanFloat : '#form-salary #salary_min',
1138
            },
1139
        },
1140
        submitHandler: function(form)
1141
        {
1142
            NProgress.start();
1143
            $.ajax({
1144
                'dataType'  : 'json',
1145
                'accept'    : 'application/json',
1146
                'method'    : 'post',
1147
                'url'       :  route_salary,
1148
                'data'      :  $('#form-salary').serialize()
1149
            }).done(function(response) {
1150
                if(response['success']) {
1151
					$('#overview-salary').html(response['data']);
1152
                    $("#salary-box").modal('hide');
1153
                } else {
1154
                    validatorSalary.resetForm();
1155
                    if(jQuery.type(response['data']) == 'string') {
1156
                        $.fn.showError(response['data']);
1157
                    } else  {
1158
                        $.each(response['data'], function( fieldname, errors ) {
1159
                            $.fn.showFormErrorValidator('#form-salary #' + fieldname, errors);
1160
                        });
1161
                    }
1162
                }
1163
            }).fail(function( jqXHR, textStatus, errorThrown) {
1164
                $.fn.showError(textStatus);
1165
            }).always(function() {
1166
                NProgress.done();
1167
            });
1168
            return false;
1169
        },
1170
        invalidHandler: function(form, validator) {
1171
 
1172
        }
1173
    });
1174
 
1175
    $('.btn-salary-edit').on("click", function(e){
1176
        e.preventDefault();
1177
 
1178
        NProgress.start();
1179
        $.ajax({
1180
            'dataType'  : 'json',
1181
            'accept'    : 'application/json',
1182
            'method'    : 'get',
1183
            'url'       : route_salary,
1184
        }).done(function(response) {
1185
           if(response['success']) {
1186
                if(response['data']['salary_visible'] == 'y') {
1187
                    $('#form-salary #salary_visible').bootstrapToggle('on')
1188
                    $('#form-salary #salary_min').val(response['data']['salary_min']);
1189
                    $('#form-salary #salary_min').prop('readonly', false);
1190
                    $('#form-salary #salary_max').val(response['data']['salary_max']);
1191
                    $('#form-salary #salary_max').prop('readonly', false);
1192
                    $('#form-salary #salary_currency').val(response['data']['salary_currency']);
1193
                    $('#form-salary #salary_currency').prop('disable',false);
1194
                } else {
1195
                    $('#form-salary #salary_visible').bootstrapToggle('off')
1196
                    $('#form-salary #salary_min').val('1');
1197
                    $('#form-salary #salary_min').prop('readonly', true);
1198
                    $('#form-salary #salary_max').val('99');
1199
                    $('#form-salary #salary_max').prop('readonly', true);
1200
                    $('#form-salary #salary_currency').val('USD');
1201
                    $('#form-salary #salary_currency').prop('disable',true);
1202
                }
1203
                validatorSalary.resetForm();
1204
                $("#salary-box").modal('show');
1205
            } else {
1206
                $.fn.showError(response['data']);
1207
            }
1208
        }).fail(function( jqXHR, textStatus, errorThrown) {
1209
            $.fn.showError(textStatus);
1210
        }).always(function() {
1211
            NProgress.done();
1212
        });
1213
        return false;
1214
 
1215
    });
1216
 
1217
    $('.btn-salary-close').on("click", function(e){
1218
        e.preventDefault();
1219
 
1220
        $("#salary-box").modal('hide');
1221
        return false;
1222
    });
1223
 
1224
    var validatorExperience = $('#form-experience').validate({
1225
        debug: true,
1226
        onclick: false,
1227
        onkeyup: false,
1228
        ignore: [],
1229
        rules: {
1230
            'experience_visible': {
1231
                required: false,
1232
            },
1233
            'experience_min': {
1234
                required:  '#form-experience #experience_visible:checked',
1235
                digits: true,
1236
                maxlength: 2,
1237
            },
1238
            'experience_max': {
1239
                required:  '#form-experience #experience_visible:checked',
1240
                digits: true,
1241
                maxlength: 4,
1242
                greaterThan : '#form-experience #experience_min',
1243
            },
1244
        },
1245
        submitHandler: function(form)
1246
        {
1247
            NProgress.start();
1248
            $.ajax({
1249
                'dataType'  : 'json',
1250
                'accept'    : 'application/json',
1251
                'method'    : 'post',
1252
                'url'       :  route_experience,
1253
                'data'      :  $('#form-experience').serialize()
1254
            }).done(function(response) {
1255
                if(response['success']) {
1256
					$('#overview-experience').html(response['data']);
1257
                    $("#experience-box").modal('hide');
1258
                } else {
1259
                    validatorExperience.resetForm();
1260
                    if(jQuery.type(response['data']) == 'string') {
1261
                        $.fn.showError(response['data']);
1262
                    } else  {
1263
                        $.each(response['data'], function( fieldname, errors ) {
1264
                            $.fn.showFormErrorValidator('#form-experience #' + fieldname, errors);
1265
                        });
1266
                    }
1267
                }
1268
            }).fail(function( jqXHR, textStatus, errorThrown) {
1269
                $.fn.showError(textStatus);
1270
            }).always(function() {
1271
                NProgress.done();
1272
            });
1273
            return false;
1274
        },
1275
        invalidHandler: function(form, validator) {
1276
 
1277
        }
1278
    });
1279
 
1280
    $('.btn-experience-edit').on("click", function(e){
1281
        e.preventDefault();
1282
 
1283
        NProgress.start();
1284
        $.ajax({
1285
            'dataType'  : 'json',
1286
            'accept'    : 'application/json',
1287
            'method'    : 'get',
1288
            'url'       : route_experience,
1289
        }).done(function(response) {
1290
           if(response['success']) {
1291
                if(response['data']['experience_visible'] == 'y') {
1292
                    $('#form-experience #experience_visible').bootstrapToggle('on')
1293
                    $('#form-experience #experience_min').val(response['data']['experience_min']);
1294
                    $('#form-experience #experience_min').prop('readonly', false);
1295
                    $('#form-experience #experience_max').val(response['data']['experience_max']);
1296
                    $('#form-experience #experience_max').prop('readonly', false);
1297
                } else {
1298
                    $('#form-experience #experience_visible').bootstrapToggle('off')
1299
                    $('#form-experience #experience_min').val('1');
1300
                    $('#form-experience #experience_min').prop('readonly', true);
1301
                    $('#form-experience #experience_max').val('5');
1302
                    $('#form-experience #experience_max').prop('readonly', true);
1303
                }
1304
 
1305
                validatorExperience.resetForm();
1306
                $("#experience-box").modal('show');
1307
            } else {
1308
                $.fn.showError(response['data']);
1309
            }
1310
        }).fail(function( jqXHR, textStatus, errorThrown) {
1311
            $.fn.showError(textStatus);
1312
        }).always(function() {
1313
            NProgress.done();
1314
        });
1315
        return false;
1316
 
1317
    });
1318
 
1319
    $('.btn-experience-close').on("click", function(e){
1320
        e.preventDefault();
1321
 
1322
        $("#experience-box").modal('hide');
1323
        return false;
1324
    });
1325
 
1326
 
1327
    $('.btn-skills-edit').on("click", function(e){
1328
        e.preventDefault();
1329
 
1330
        NProgress.start();
1331
        $.ajax({
1332
            'dataType'  : 'json',
1333
            'accept'    : 'application/json',
1334
            'method'    : 'get',
1335
            'url'       : route_skills,
1336
        }).done(function(response) {
1337
           if(response['success']) {
1338
                $('#form-skill #skills').val(response['data']).trigger('change');
1339
                validatorSkills.resetForm();
1340
 
1341
                $('#skills-box').modal('show');
1342
            } else {
1343
                $.fn.showError(response['data']);
1344
            }
1345
        }).fail(function( jqXHR, textStatus, errorThrown) {
1346
            $.fn.showError(textStatus);
1347
        }).always(function() {
1348
            NProgress.done();
1349
        });
1350
        return false;
1351
 
1352
    });
1353
 
1354
    $('.btn-skills-close').on("click", function(e){
1355
        e.preventDefault();
1356
 
1357
        $('#skills-box').modal('hide');
1358
        return false;
1359
    });
1360
 
1361
    var validatorSkills = $('#form-skill').validate({
1362
        debug: true,
1363
        onclick: false,
1364
        onkeyup: false,
1365
         onfocusout: false,
1366
        ignore: [],
1367
        rules: {
1368
            'skills[]': {
1369
                required: true,
1370
            }
1371
        },
1372
        submitHandler: function(form)
1373
        {
1374
            NProgress.start();
1375
            $.ajax({
1376
                'dataType'  : 'json',
1377
                'accept'    : 'application/json',
1378
                'method'    : 'post',
1379
                'url'       :  route_skills,
1380
                'data'      :  {
1381
                    'skills[]' : $('#form-skill #skills').val()
1382
                },
1383
            }).done(function(response) {
1384
                if(response['success']) {
1385
 
1386
					$('#list-skills').empty();
1387
                    $.each(response['data'], function(index, item) {
1388
                        $('#list-skills').append('<li><a href="#" title="">' + item.label + '</a></li>');
1389
                    });
1390
 
1391
                    $("#skills-box").modal('hide');
1392
                } else {
1393
                    validatorSkills.resetForm();
1394
                    if(jQuery.type(response['data']) == 'string') {
1395
                        $.fn.showError(response['data']);
1396
                    } else  {
1397
                        $.each(response['data'], function( fieldname, errors ) {
1398
                            $.fn.showFormErrorValidator('#form-skill #' + fieldname, errors);
1399
                        });
1400
                    }
1401
                }
1402
            }).fail(function( jqXHR, textStatus, errorThrown) {
1403
                $.fn.showError(textStatus);
1404
            }).always(function() {
1405
                NProgress.done();
1406
            });
1407
            return false;
1408
        },
1409
        invalidHandler: function(form, validator) {
1410
 
1411
        }
1412
    });
1413
 
1414
 
1415
 
1416
    var validatorLanguages = $('#form-language').validate({
1417
        debug: true,
1418
        onclick: false,
1419
        onkeyup: false,
1420
         onfocusout: false,
1421
        ignore: [],
1422
        rules: {
1423
            'languages[]': {
1424
                required: true,
1425
            }
1426
        },
1427
        submitHandler: function(form)
1428
        {
1429
            NProgress.start();
1430
            $.ajax({
1431
                'dataType'  : 'json',
1432
                'accept'    : 'application/json',
1433
                'method'    : 'post',
1434
                'url'       :  route_languages,
1435
                'data'      :  {
1436
                    'languages[]' : $('#form-language #languages').val()
1437
                },
1438
            }).done(function(response) {
1439
                if(response['success']) {
1440
 
1441
					$('#list-languages').empty();
1442
                    $.each(response['data'], function(index, item) {
1443
                        $('#list-languages').append('<li><a href="#" title="">' + item.label + '</a></li>');
1444
                    });
1445
 
1446
                    $("#languages-box").modal('hide');
1447
                } else {
1448
                    validatorLanguages.resetForm();
1449
                    if(jQuery.type(response['data']) == 'string') {
1450
                        $.fn.showError(response['data']);
1451
                    } else  {
1452
                        $.each(response['data'], function( fieldname, errors ) {
1453
                            $.fn.showFormErrorValidator('#form-language #' + fieldname, errors);
1454
                        });
1455
                    }
1456
                }
1457
            }).fail(function( jqXHR, textStatus, errorThrown) {
1458
                $.fn.showError(textStatus);
1459
            }).always(function() {
1460
                NProgress.done();
1461
            });
1462
            return false;
1463
        },
1464
        invalidHandler: function(form, validator) {
1465
 
1466
        }
1467
    });
1468
 
1469
    $('.btn-languages-edit').on("click", function(e){
1470
        e.preventDefault();
1471
 
1472
        NProgress.start();
1473
        $.ajax({
1474
            'dataType'  : 'json',
1475
            'accept'    : 'application/json',
1476
            'method'    : 'get',
1477
            'url'       : route_languages,
1478
        }).done(function(response) {
1479
           if(response['success']) {
1480
                $('#form-language #languages').val(response['data']).trigger('change');
1481
                validatorLanguages.resetForm();
1482
 
1483
                $("#languages-box").modal('show');
1484
            } else {
1485
                $.fn.showError(response['data']);
1486
            }
1487
        }).fail(function( jqXHR, textStatus, errorThrown) {
1488
            $.fn.showError(textStatus);
1489
        }).always(function() {
1490
            NProgress.done();
1491
        });
1492
        return false;
1493
 
1494
    });
1495
 
1496
    $('.btn-languages-close').on("click", function(e){
1497
        e.preventDefault();
1498
 
1499
        $("#languages-box").modal('hide');
1500
        return false;
1501
    });
1502
 
1503
 
1504
    var validatorDegrees = $('#form-degree').validate({
1505
        debug: true,
1506
        onclick: false,
1507
        onkeyup: false,
1508
         onfocusout: false,
1509
        ignore: [],
1510
        rules: {
1511
            'degrees[]': {
1512
                required: true,
1513
            }
1514
        },
1515
        submitHandler: function(form)
1516
        {
1517
            NProgress.start();
1518
            $.ajax({
1519
                'dataType'  : 'json',
1520
                'accept'    : 'application/json',
1521
                'method'    : 'post',
1522
                'url'       :  route_degrees,
1523
                'data'      :  {
1524
                    'degrees[]' : $('#form-degree #degrees').val()
1525
                },
1526
            }).done(function(response) {
1527
                if(response['success']) {
1528
 
1529
					$('#list-degrees').empty();
1530
                    $.each(response['data'], function(index, item) {
1531
                        $('#list-degrees').append('<li><a href="#" title="">' + item.label + '</a></li>');
1532
                    });
1533
 
1534
                    $("#degrees-box").modal('hide');
1535
                } else {
1536
                    validatorDegrees.resetForm();
1537
                    if(jQuery.type(response['data']) == 'string') {
1538
                        $.fn.showError(response['data']);
1539
                    } else  {
1540
                        $.each(response['data'], function( fieldname, errors ) {
1541
                            $.fn.showFormErrorValidator('#form-degree #' + fieldname, errors);
1542
                        });
1543
                    }
1544
                }
1545
            }).fail(function( jqXHR, textStatus, errorThrown) {
1546
                $.fn.showError(textStatus);
1547
            }).always(function() {
1548
                NProgress.done();
1549
            });
1550
            return false;
1551
        },
1552
        invalidHandler: function(form, validator) {
1553
 
1554
        }
1555
    });
1556
 
1557
    $('.btn-degrees-edit').on("click", function(e){
1558
        e.preventDefault();
1559
 
1560
        NProgress.start();
1561
        $.ajax({
1562
            'dataType'  : 'json',
1563
            'accept'    : 'application/json',
1564
            'method'    : 'get',
1565
            'url'       : route_degrees,
1566
        }).done(function(response) {
1567
           if(response['success']) {
1568
                $('#form-degree #degrees').val(response['data']).trigger('change');
1569
                validatorDegrees.resetForm();
1570
 
1571
                $("#degrees-box").modal('show');
1572
            } else {
1573
                $.fn.showError(response['data']);
1574
            }
1575
        }).fail(function( jqXHR, textStatus, errorThrown) {
1576
            $.fn.showError(textStatus);
1577
        }).always(function() {
1578
            NProgress.done();
1579
        });
1580
        return false;
1581
 
1582
    });
1583
 
1584
    $('.btn-degrees-close').on("click", function(e){
1585
        e.preventDefault();
1586
 
1587
        $("#degrees-box").modal('hide');
1588
        return false;
1589
    });
1590
 
1591
 
1592
    $('#form-degree #degrees').select2({
1593
        theme: 'bootstrap4',
1594
        width: '100%',
1595
        placeholder: 'LABEL_SELECT_DEGREE'
1596
    });
1597
 
1598
    $('#form-skill #skills').select2({
1599
        theme: 'bootstrap4',
1600
        width: '100%',
1601
        placeholder: 'LABEL_SELECT_ONE_SKILLS'
1602
    });
1603
 
1604
    $('#form-language #languages').select2({
1605
        theme: 'bootstrap4',
1606
        width: '100%',
1607
        placeholder: 'LABEL_SELECT_ONE_LANGUAGE'
1608
    });
1609
 
1610
 
1611
 
1612
    $('#form-last-date-of-application #last_date_of_application').datetimepicker({
1613
        locale: 'es',
1614
        format: 'DD/MM/YYYY'
1615
    });
1616
 
1617
    $('#form-salary #salary_visible').bootstrapToggle({'on' : 'LABEL_SHOW',  'off' : 'LABEL_NO_SHOW', 'width' : '160px', 'height' : '40px'});
1618
    $('#form-salary #salary_min').inputNumberFormat({ 'decimal': 2 });
1619
    $('#form-salary #salary_max').inputNumberFormat({ 'decimal': 2 });
1620
 
1621
    $('#form-salary #salary_visible').change(function(e) {
1622
        e.preventDefault();
1623
 
1624
        if($(this).prop('checked')) {
1625
            $('#form-salary #salary_min').prop('readonly', false);
1626
            $('#form-salary #salary_max').prop('readonly', false);
1627
            $('#form-salary #salary_currency').prop('disabled', false);
1628
        } else {
1629
            $('#form-salary #salary_min').val('1');
1630
            $('#form-salary #salary_max').val('99');
1631
            $('#form-salary #salary_min').prop('readonly', true);
1632
            $('#form-salary #salary_max').prop('readonly', true);
1633
            $('#form-salary #salary_currency').prop('disabled', true);
1634
        }
1635
    });
1636
 
1637
    $('#form-experience #experience_visible').bootstrapToggle({'on' : 'LABEL_SHOW',  'off' : 'LABEL_NO_SHOW', 'width' : '160px', 'height' : '40px'});
1638
    $('#form-experience #experience_min').inputNumberFormat({ 'decimal': 0 });
1639
    $('#form-experience #experience_max').inputNumberFormat({ 'decimal': 0 });
1640
 
1641
    $('#form-experience #experience_visible').change(function(e) {
1642
        e.preventDefault();
1643
 
1644
        if($(this).prop('checked')) {
1645
            $('#form-experience #experience_min').prop('readonly', false);
1646
            $('#form-experience #experience_max').prop('readonly', false);
1647
        } else {
1648
            $('#form-experience #experience_min').val('1');
1649
            $('#form-experience #experience_max').val('5');
1650
            $('#form-experience #experience_min').prop('readonly', true);
1651
            $('#form-experience #experience_max').prop('readonly', true);
1652
       }
1653
    });
1654
 
1655
 
1656
    var validatorStatus = $('#form-status').validate({
1657
        debug: true,
1658
        onclick: false,
1659
        onkeyup: false,
1660
        ignore: [],
1661
        rules: {
1662
            'status': {
1663
                required: false,
1664
            },
1665
        },
1666
        submitHandler: function(form)
1667
        {
1668
            NProgress.start();
1669
            $.ajax({
1670
                'dataType'  : 'json',
1671
                'accept'    : 'application/json',
1672
                'method'    : 'post',
1673
                'url'       :  route_status,
1674
                'data'      :  $('#form-status').serialize()
1675
            }).done(function(response) {
1676
                if(response['success']) {
1677
					$('#overview-status').html(response['data']['status']);
1678
                    $("#status-box").modal('hide');
1679
                } else {
1680
                    validatorStatus.resetForm();
1681
                    if(jQuery.type(response['data']) == 'string') {
1682
                        $.fn.showError(response['data']);
1683
                    } else  {
1684
                        $.each(response['data'], function( fieldname, errors ) {
1685
                            $.fn.showFormErrorValidator('#form-status #' + fieldname, errors);
1686
                        });
1687
                    }
1688
                }
1689
            }).fail(function( jqXHR, textStatus, errorThrown) {
1690
                $.fn.showError(textStatus);
1691
            }).always(function() {
1692
                NProgress.done();
1693
            });
1694
            return false;
1695
        },
1696
        invalidHandler: function(form, validator) {
1697
 
1698
        }
1699
    });
1700
 
1701
    $('.btn-status-edit').on("click", function(e){
1702
        e.preventDefault();
1703
 
1704
        NProgress.start();
1705
        $.ajax({
1706
            'dataType'  : 'json',
1707
            'accept'    : 'application/json',
1708
            'method'    : 'get',
1709
            'url'       : route_status,
1710
        }).done(function(response) {
1711
           if(response['success']) {
1712
                $('#form-status #status').val(response['data']['status']);
1713
                validatorStatus.resetForm();
1714
                $("#status-box").modal('show');
1715
            } else {
1716
                $.fn.showError(response['data']);
1717
            }
1718
        }).fail(function( jqXHR, textStatus, errorThrown) {
1719
            $.fn.showError(textStatus);
1720
        }).always(function() {
1721
            NProgress.done();
1722
        });
1723
        return false;
1724
 
1725
    });
1726
 
1727
    $('.btn-status-close').on("click", function(e){
1728
        e.preventDefault();
1729
 
1730
        $("#status-box").modal('hide');
1731
        return false;
1732
    });
1733
 
1734
 
1735
    var validatorTitle = $('#form-title').validate({
1736
        debug: true,
1737
        onclick: false,
1738
        onkeyup: false,
1739
        ignore: [],
1740
        rules: {
1741
            'title': {
1742
                required: true,
1743
                maxlength: 128,
1744
            },
1745
        },
1746
        submitHandler: function(form)
1747
        {
1748
            NProgress.start();
1749
            $.ajax({
1750
                'dataType'  : 'json',
1751
                'accept'    : 'application/json',
1752
                'method'    : 'post',
1753
                'url'       :  route_title,
1754
                'data'      :  $('#form-title').serialize()
1755
            }).done(function(response) {
1756
                if(response['success']) {
1757
					$('#overview-title').html(response['data']['title']);
1758
                    $("#title-box").modal('hide');
1759
                } else {
1760
                    validatorTitle.resetForm();
1761
                    if(jQuery.type(response['data']) == 'string') {
1762
                        $.fn.showError(response['data']);
1763
                    } else  {
1764
                        $.each(response['data'], function( fieldname, errors ) {
1765
                            $.fn.showFormErrorValidator('#form-title #' + fieldname, errors);
1766
                        });
1767
                    }
1768
                }
1769
            }).fail(function( jqXHR, textTitle, errorThrown) {
1770
                $.fn.showError(textTitle);
1771
            }).always(function() {
1772
                NProgress.done();
1773
            });
1774
            return false;
1775
        },
1776
        invalidHandler: function(form, validator) {
1777
 
1778
        }
1779
    });
1780
 
1781
    $('.btn-title-edit').on("click", function(e){
1782
        e.preventDefault();
1783
 
1784
        NProgress.start();
1785
        $.ajax({
1786
            'dataType'  : 'json',
1787
            'accept'    : 'application/json',
1788
            'method'    : 'get',
1789
            'url'       : route_title,
1790
        }).done(function(response) {
1791
           if(response['success']) {
1792
                $('#form-title #title').val(response['data']['title'] );
1793
                validatorTitle.resetForm();
1794
                $("#title-box").modal('show');
1795
            } else {
1796
                $.fn.showError(response['data']);
1797
            }
1798
        }).fail(function( jqXHR, textTitle, errorThrown) {
1799
            $.fn.showError(textTitle);
1800
        }).always(function() {
1801
            NProgress.done();
1802
        });
1803
        return false;
1804
 
1805
    });
1806
 
1807
    $('.btn-title-close').on("click", function(e){
1808
        e.preventDefault();
1809
 
1810
        $("#title-box").modal('hide');
1811
        return false;
1812
    });
1813
 
1814
    $('h1.btn-edit-back').on("click", function(e){
1815
        e.preventDefault();
1816
 
1817
 
1818
 
1819
        $('#divEdit').hide();
1820
        $('#divListing').show();
1821
        return false;
1822
    });
1823
 
1824
 
3766 stevensc 1825
    CKEDITOR.replace('description', {
1826
        toolbar: [
1827
            { name: 'editing', items: [ 'Scayt' ] },
1828
            { name: 'links', items: [ 'Link', 'Unlink'] },
1829
            { name: 'paragraph', items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote' ] },
1830
            { name: 'basicstyles', items: [ 'Bold', 'Italic', 'Strike', 'RemoveFormat' ] },
1831
            '/',
1832
            { name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'SpecialChar' ] },
1833
            { name: 'styles', items: [ 'Styles', 'Format' ] },
1834
            { name: 'tools', items: [ 'Maximize' ] }
1835
        ],
3928 stevensc 1836
        removePlugins: 'elementspath,Anchor',
3766 stevensc 1837
        height: 100
1838
    });
1 www 1839
 
1840
    autocompleteLocation.addListener('place_changed', $.fn.fillInAddressLocation);
1841
    autocompleteLocationNew.addListener('place_changed', $.fn.fillInAddressNewLocation);
1842
});
1843
JS;
1844
$this->inlineScript()->captureEnd();
6628 stevensc 1845
 
1846
$js = <<<JS
6629 stevensc 1847
const linksVars = {
6680 stevensc 1848
    link_add:"$routeAdd",
1849
    link_table: "$routeDatatable",
1850
    allowAdd: "$allowAdd",
1851
    allowDelete: "$allowDelete",
1852
    allowEdit: "$allowEdit",
7768 stevensc 1853
    allowUsersWhoApplied: "$allowUsersWhoApplied",
1854
    googleApi: "$google_map_key"
6628 stevensc 1855
}
1856
JS;
1857
 
1858
$this->inlineScript()->appendScript($js);
7124 stevensc 1859
$this->headLink()->appendStylesheet('/react-bundles/jobs/main.css');
6628 stevensc 1860
$this->inlineScript()->appendFile('/react-bundles/jobs/jobsBundle.js');
1 www 1861
?>
3766 stevensc 1862
 
1 www 1863
<!-- Content Header (Page header) -->
6628 stevensc 1864
<div id="jobs"></div>
1 www 1865
<div id="divListing">
1866
 
1867
    <section class="content-header">
3766 stevensc 1868
        <div class="container-fluid">
1869
            <div class="row mb-2">
1870
                <div class="col-sm-12">
1871
                    <h1>LABEL_JOBS</h1>
1872
                </div>
1873
            </div>
1874
        </div><!-- /.container-fluid -->
1 www 1875
    </section>
3766 stevensc 1876
 
1 www 1877
    <section class="content">
3766 stevensc 1878
        <div class="container-fluid">
1879
            <div class="row">
1880
                <div class="col-12">
1881
                    <div class="card">
1882
                        <div class="card-body">
1883
                            <table id="gridTable" class="table   table-hover">
1884
                                <thead>
1885
                                    <tr>
1886
 
1887
                                        <th>LABEL_LAST_DATE_OF_APPLICATION</th>
1888
                                        <th>LABEL_TITLE</th>
1889
                                        <th>LABEL_DETAILS</th>
1890
                                        <th>LABEL_ACTIONS</th>
1 www 1891
                                    </tr>
3766 stevensc 1892
                                </thead>
1893
                                <tbody>
1894
                                </tbody>
1895
                            </table>
1896
                        </div>
1897
                        <div class="card-footer clearfix">
1898
                            <div style="float:right;">
1899
                                <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
1900
                                <?php if ($allowAdd) : ?>
1901
                                    <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
1902
                                <?php endif; ?>
1903
                            </div>
1904
                        </div>
1905
                    </div>
1906
                </div>
1 www 1907
            </div>
3766 stevensc 1908
        </div>
1909
    </section>
1910
</div>
1 www 1911
 
1912
<div id="divEdit" style="display: none">
1913
 
1914
    <section class="content-header">
3766 stevensc 1915
        <div class="container-fluid">
1916
            <div class="row mb-2">
1917
                <div class="col-sm-12">
1918
                    <h1 class="btn-edit-back"><i class="fa fa-chevron-left" aria-hidden="true"></i> LABEL_EDIT_JOB</h1>
1 www 1919
 
3766 stevensc 1920
                </div>
1921
            </div>
1922
        </div><!-- /.container-fluid -->
1 www 1923
    </section>
3766 stevensc 1924
 
1 www 1925
    <section class="content">
3766 stevensc 1926
        <div class="container-fluid">
1 www 1927
 
3766 stevensc 1928
            <div class="row">
1929
                <div class="col-lg-3">
1930
                </div>
1931
                <div class="col-lg-6">
1932
                    <div class="main-ws-sec">
1 www 1933
 
3766 stevensc 1934
                        <!--user-profile-ov end -->
1935
                        <div class="user-profile-ov">
1936
                            <h3>
1937
                                LABEL_STATUS <a href="#" title="" class="btn-status-edit"> <i class="fa fa-pencil"></i></a>
1938
                            </h3>
1939
                            <p id="overview-status"></p>
1940
                        </div>
1 www 1941
 
3766 stevensc 1942
                        <div class="user-profile-ov">
1943
                            <h3>LABEL_TITLE
1944
                                <a href="#" title="" class="btn-title-edit"><i class="fa fa-pencil"></i></a>
1945
                            </h3>
1946
                            <p id="overview-title"></p>
1947
                        </div>
1948
                        <div class="user-profile-ov">
1949
                            <h3>LABEL_OVERVIEW
1950
                                <a href="#" title="" class="btn-extended-edit"><i class="fa fa-pencil"></i></a>
1951
                            </h3>
1952
                            <p id="overview-description"></p>
1953
                        </div>
1954
                        <!--user-profile-ov end-->
1955
                        <div class="user-profile-ov st2">
1956
                            <h3>LABEL_LAST_DATE_OF_APPLICATION
1957
                                <a href="#" title="" class="btn-last-date-of-application-edit"><i class="fa fa-pencil"></i></a> <a href="#" title="" class="esp-bx-open"></a>
1958
                            </h3>
1959
                            <span id="overview-last-date-of-application"></span>
1960
                        </div>
1961
                        <!--user-profile-ov end-->
1962
                        <div class="user-profile-ov">
1963
                            <h3>LABEL_EMPLOYMENT_TYPE
1964
                                <a href="#" title="" class="btn-employment-type-edit"><i class="fa fa-pencil"></i></a>
1965
                            </h3>
1966
                            <span id="overview-employment-type"></span>
1967
                        </div>
1968
                        <!--user-profile-ov end-->
1969
                        <div class="user-profile-ov">
1970
                            <h3>
1971
                                <a href="#" title="">LABEL_LOCATION</a>
1972
                                <a href="#" title="" class="btn-location-edit"><i class="fa fa-pencil"></i></a>
1973
                            </h3>
1974
                            <span id="overview-location"></span>
1975
                        </div>
1976
                        <!--user-profile-ov end-->
1977
                        <div class="user-profile-ov">
1978
                            <h3>
1979
                                LABEL_EXPERIENCE
1980
                                <a href="#" title="" class="btn-experience-edit"><i class="fa fa-pencil"></i></a>
1981
                            </h3>
1982
                            <span id="overview-experience"> </span>
1983
                        </div>
1984
                        <!--user-profile-ov end-->
1985
                        <div class="user-profile-ov">
1986
                            <h3>
1987
                                LABEL_SALARY
1988
                                <a href="#" title="" class="btn-salary-edit"><i class="fa fa-pencil"></i></a>
1989
                            </h3>
1990
                            <span id="overview-salary"></span>
1991
                        </div>
1992
                        <!--user-profile-ov end-->
1993
                        <div class="user-profile-ov">
1994
                            <h3>
1995
                                LABEL_CATEGORIE
1996
                                <a href="#" title="" class="btn-job-category-edit"><i class="fa fa-pencil"></i></a>
1997
                            </h3>
1998
                            <span id="overview-job-category"></span>
1999
                        </div>
2000
                        <!--user-profile-ov end-->
2001
                        <div class="user-profile-ov">
2002
                            <h3>
2003
                                LABEL_SKILLS <a href="#" title="" class="btn-skills-edit"> <i class="fa fa-pencil"></i></a>
2004
                            </h3>
2005
                            <ul id="list-skills">
1 www 2006
 
2007
 
3766 stevensc 2008
                            </ul>
2009
                        </div>
2010
                        <!--user-profile-ov end -->
2011
                        <div class="user-profile-ov">
2012
                            <h3>
2013
                                LABEL_LANGUAGES <a href="#" title="" class="btn-languages-edit"> <i class="fa fa-pencil"></i></a>
2014
                            </h3>
2015
                            <ul id="list-languages">
1 www 2016
 
3766 stevensc 2017
 
2018
                            </ul>
2019
                        </div>
2020
                        <!--user-profile-ov end -->
2021
                        <div class="user-profile-ov">
2022
                            <h3>
2023
                                LABEL_DEGREES <a href="#" title="" class="btn-degrees-edit"> <i class="fa fa-pencil"></i></a>
2024
                            </h3>
2025
                            <ul id="list-degrees">
2026
 
2027
 
2028
                            </ul>
2029
                        </div>
2030
 
2031
 
2032
 
2033
                    </div>
2034
                </div>
2035
                <div class="col-lg-3">
2036
                </div>
2037
            </div>
2038
        </div>
2039
    </section>
1 www 2040
</div>
2041
 
2042
<div class="modal" tabindex="-1" role="dialog" id="add-job-box">
3766 stevensc 2043
    <div class="modal-dialog" role="document">
2044
        <?php
2045
        $form = $this->formAdd;
2046
        $form->setAttributes([
2047
            'method'    => 'post',
2048
            'name'      => 'form-add',
2049
            'id'        => 'form-add'
2050
        ]);
2051
        $form->prepare();
2052
        echo $this->form()->openTag($form);
2053
 
2054
        $fieldnames = [
2055
            'formatted_address',
2056
            'address1',
2057
            'address2',
2058
            'country',
2059
            'state',
2060
            'city1',
2061
            'city2',
2062
            'postal_code',
2063
            'latitude',
2064
            'longitude',
2065
        ];
2066
 
2067
        foreach ($fieldnames as $fieldname) {
2068
 
2069
            $element = $form->get($fieldname);
2070
            echo $this->formHidden($element);
2071
        }
2072
        ?>
2073
        <div class="modal-content">
2074
            <div class="modal-header">
2075
                <h3 class="modal-title">LABEL_NEW_JOB</h3>
2076
            </div>
2077
            <div class="modal-body">
2078
                <div class="form-group">
2079
                    <?php
2080
                    $element = $form->get('title');
2081
                    $element->setOptions(['label' => 'LABEL_TITLE']);
2082
                    $element->setAttributes(['class' => 'form-control']);
2083
                    echo $this->formLabel($element);
2084
                    echo $this->formText($element);
1 www 2085
                    ?>
3766 stevensc 2086
                </div>
2087
                <div class="form-group">
2088
                    <?php
2089
                    $element = $form->get('employment_type');
2090
                    $element->setAttributes(['class' => 'form-control']);
2091
                    $element->setOptions(['empty_option' => 'LABEL_SELECT_EMPLOYMENT_TYPE', 'label' => 'LABEL_EMPLOYMENT_TYPE']);
2092
                    echo $this->formLabel($element);
2093
                    echo $this->formSelect($element);
1 www 2094
                    ?>
3766 stevensc 2095
                </div>
2096
                <div class="form-group">
2097
                    <?php
2098
                    $element = $form->get('last_date_of_application');
2099
                    $element->setAttributes(['class' => 'form-control']);
2100
                    $element->setOptions(['label' => 'LABEL_LAST_DATE_OF_APPLICATION']);
2101
                    echo $this->formLabel($element);
2102
                    echo $this->formText($element);
1 www 2103
                    ?>
3766 stevensc 2104
                </div>
2105
 
2106
                <div class="form-group">
2107
                    <?php
2108
                    $element = $form->get('job_category_id');
2109
                    $element->setOptions(['empty_option' => 'LABEL_SELECT_JOB_CATEGORY', 'label' => 'LABEL_JOB_CATEGORY']);
2110
                    $element->setAttributes(['class' => 'form-control']);
2111
                    echo $this->formLabel($element);
2112
                    echo $this->formSelect($element);
1 www 2113
                    ?>
3766 stevensc 2114
                </div>
2115
                <div class="form-group">
2116
                    <?php
2117
                    $element = $form->get('location_search');
2118
                    $element->setAttributes(['name' => 'add_location_search',  'id' => 'add_location_search', 'class' => 'form-control']);
2119
                    $element->setOptions(['label' => 'LABEL_LOCATION']);
2120
                    echo $this->formLabel($element);
2121
                    echo $this->formText($element);
1 www 2122
                    ?>
3766 stevensc 2123
                </div>
2124
            </div>
2125
 
2126
            <div class="modal-footer">
2127
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2128
                <button type="button" class="btn btn-default btn-add-job-cancel">LABEL_CANCEL</button>
2129
            </div>
2130
            <?php echo $this->form()->closeTag($form); ?>
2131
        </div>
2132
    </div>
1 www 2133
</div>
3766 stevensc 2134
 
2135
 
1 www 2136
<!-- The Modal -->
2137
<div class="modal" id="modalUsersWhoApplied">
3766 stevensc 2138
    <div class="modal-dialog modal-xl">
2139
        <div class="modal-content">
1 www 2140
 
2141
            <!-- Modal Header -->
3766 stevensc 2142
            <div class="modal-header">
2143
                <h4 class="modal-title">LABEL_USERS_WHO_APPLIED</h4>
2144
                <button type="button" class="close" data-dismiss="modal">&times;</button>
2145
            </div>
1 www 2146
 
2147
            <!-- Modal body -->
3766 stevensc 2148
            <div class="modal-body">
2149
                <div style="height: 300px;overflow: scroll;">
2150
                    <table id="gridTableUsersWhoApplied" style="width: 100%" class="table table-bordered table-hover">
2151
                        <thead>
2152
                            <tr>
2153
                                <th>LABEL_FIRST_NAME</th>
2154
                                <th>LABEL_LAST_NAME</th>
2155
                                <th>LABEL_EMAIL</th>
2156
                                <th>LABEL_ACTIONS</th>
2157
                            </tr>
2158
                        </thead>
2159
                        <tbody>
2160
                        </tbody>
2161
                    </table>
2162
                </div>
1 www 2163
 
3766 stevensc 2164
            </div>
2165
 
1 www 2166
            <!-- Modal footer -->
3766 stevensc 2167
            <div class="modal-footer">
2168
                <button type="button" class="btn btn-danger" data-dismiss="modal">LABEL_CLOSE</button>
2169
            </div>
1 www 2170
 
3766 stevensc 2171
        </div>
2172
    </div>
2173
</div>
1 www 2174
 
2175
<div class="modal" tabindex="-1" role="dialog" id="extended-box">
3766 stevensc 2176
    <div class="modal-dialog" role="document">
2177
        <?php
1 www 2178
        $form = $this->formExtended;
2179
        $form->setAttributes([
2180
            'method' => 'post',
2181
            'name' => 'form-extended',
2182
            'id' => 'form-extended'
2183
        ]);
2184
        $form->prepare();
2185
        echo $this->form()->openTag($form);
3766 stevensc 2186
        ?>
2187
        <div class="modal-content">
2188
            <div class="modal-header">
2189
                <h3 class="modal-title">LABEL_OVERVIEW</h3>
2190
            </div>
2191
            <div class="modal-body">
1 www 2192
                <div class="form-group">
3766 stevensc 2193
                    <?php
2194
                    $element = $form->get('description');
2195
                    $element->setOptions(['label' => 'LABEL_OVERVIEW']);
2196
                    $element->setAttributes(['class' => 'form-control']);
2197
                    echo $this->formLabel($element);
2198
                    echo $this->formTextArea($element);
2199
                    ?>
1 www 2200
                </div>
3766 stevensc 2201
            </div>
2202
            <div class="modal-footer">
2203
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2204
                <button type="button" class="btn btn-default btn-extended-close">LABEL_CANCEL</button>
2205
            </div>
2206
            <?php echo $this->form()->closeTag($form); ?>
2207
        </div>
2208
    </div>
1 www 2209
</div>
2210
 
2211
<div class="modal" tabindex="-1" role="dialog" id="location-box">
3766 stevensc 2212
    <div class="modal-dialog" role="document">
2213
        <?php
1 www 2214
        $form = $this->formLocation;
2215
        $form->setAttributes([
2216
            'method' => 'post',
2217
            'name' => 'form-location',
2218
            'id' => 'form-location'
2219
        ]);
2220
        $form->prepare();
2221
        echo $this->form()->openTag($form);
3766 stevensc 2222
 
1 www 2223
        $fieldnames = [
2224
            'formatted_address',
2225
            'address1',
2226
            'address2',
2227
            'country',
2228
            'state',
2229
            'city1',
2230
            'city2',
2231
            'postal_code',
2232
            'latitude',
2233
            'longitude',
2234
        ];
3766 stevensc 2235
 
2236
        foreach ($fieldnames as $fieldname) {
2237
 
1 www 2238
            $element = $form->get($fieldname);
2239
            echo $this->formHidden($element);
2240
        }
2241
        ?>
3766 stevensc 2242
        <div class="modal-content">
2243
            <div class="modal-header">
2244
                <h3 class="modal-title">LABEL_LOCATION</h3>
2245
            </div>
2246
            <div class="modal-body">
2247
                <div class="form-group datefm">
2248
                    <?php
2249
                    $element = $form->get('location_search');
2250
                    $element->setOptions(['label' => 'LABEL_LOCATION']);
2251
                    $element->setAttributes(['class' => 'form-control']);
2252
                    echo $this->formLabel($element);
2253
                    echo $this->formText($element);
1 www 2254
                    ?>
3766 stevensc 2255
                    <i class="fa fa-map-marker"></i>
2256
                </div>
2257
            </div>
2258
            <div class="modal-footer">
2259
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2260
                <button type="button" class="btn btn-default btn-location-close">LABEL_CANCEL</button>
2261
            </div>
2262
            <?php echo $this->form()->closeTag($form); ?>
2263
        </div>
2264
    </div>
2265
</div>
1 www 2266
 
2267
<div class="modal" tabindex="-1" role="dialog" id="employment-type-box">
3766 stevensc 2268
    <div class="modal-dialog" role="document">
2269
        <?php
1 www 2270
        $form = $this->formEmploymentType;
2271
        $form->setAttributes([
2272
            'method' => 'post',
2273
            'name' => 'form-employment-type',
2274
            'id' => 'form-employment-type'
2275
        ]);
2276
        $form->prepare();
2277
        echo $this->form()->openTag($form);
3766 stevensc 2278
        ?>
2279
        <div class="modal-content">
2280
            <div class="modal-header">
2281
                <h3 class="modal-title">LABEL_EMPLOYMENT_TYPE</h3>
2282
            </div>
2283
            <div class="modal-body">
1 www 2284
                <div class="form-group">
3766 stevensc 2285
                    <?php
2286
                    $element = $form->get('employment_type');
2287
                    $element->setOptions(['label' => 'LABEL_EMPLOYMENT_TYPE']);
2288
                    $element->setAttributes(['class' => 'form-control']);
2289
                    echo $this->formLabel($element);
2290
                    echo $this->formSelect($element);
2291
                    ?>
1 www 2292
                </div>
3766 stevensc 2293
            </div>
2294
            <div class="modal-footer">
2295
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2296
                <button type="button" class="btn btn-default btn-employment-type-close">LABEL_CANCEL</button>
2297
            </div>
2298
            <?php echo $this->form()->closeTag($form); ?>
2299
        </div>
2300
    </div>
2301
</div>
1 www 2302
 
2303
<div class="modal" tabindex="-1" role="dialog" id="job-category-box">
3766 stevensc 2304
    <div class="modal-dialog" role="document">
2305
        <?php
1 www 2306
        $form = $this->formJobCategory;
2307
        $form->setAttributes([
2308
            'method' => 'post',
2309
            'name' => 'form-job-category',
2310
            'id' => 'form-job-category'
2311
        ]);
2312
        $form->prepare();
2313
        echo $this->form()->openTag($form);
3766 stevensc 2314
        ?>
2315
        <div class="modal-content">
2316
            <div class="modal-header">
2317
                <h3 class="modal-title">LABEL_JOB_CATEGORY</h3>
2318
            </div>
2319
            <div class="modal-body">
1 www 2320
                <div class="form-group">
3766 stevensc 2321
                    <?php
2322
                    $element = $form->get('job_category_id');
2323
                    $element->setOptions(['label' => 'LABEL_JOB_CATEGORY']);
2324
                    $element->setAttributes(['class' => 'form-control']);
2325
                    echo $this->formLabel($element);
2326
                    echo $this->formSelect($element);
2327
                    ?>
1 www 2328
                </div>
3766 stevensc 2329
            </div>
2330
            <div class="modal-footer">
2331
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2332
                <button type="button" class="btn btn-default btn-job-category-close">LABEL_CANCEL</button>
2333
            </div>
2334
            <?php echo $this->form()->closeTag($form); ?>
2335
        </div>
2336
    </div>
2337
</div>
1 www 2338
 
2339
<div class="modal" tabindex="-1" role="dialog" id="salary-box">
3766 stevensc 2340
    <div class="modal-dialog" role="document">
2341
        <?php
1 www 2342
        $form = $this->formSalary;
2343
        $form->setAttributes([
2344
            'method' => 'post',
2345
            'name' => 'form-salary',
2346
            'id' => 'form-salary'
2347
        ]);
2348
        $form->prepare();
2349
        echo $this->form()->openTag($form);
3766 stevensc 2350
        ?>
2351
        <div class="modal-content">
2352
            <div class="modal-header">
2353
                <h3 class="modal-title">LABEL_SALARY</h3>
2354
            </div>
2355
            <div class="modal-body">
1 www 2356
                <div class="form-group">
3766 stevensc 2357
                    <?php
2358
                    $element = $form->get('salary_visible');
2359
                    echo $this->formCheckbox($element);
2360
                    ?>
1 www 2361
                </div>
2362
                <div class="form-group">
3766 stevensc 2363
                    <?php
2364
                    $element = $form->get('salary_currency');
2365
                    $element->setAttributes(['class' => 'form-control']);
2366
                    $element->setOptions(['label' => 'LABEL_CURRENCY']);
2367
                    echo $this->formLabel($element);
2368
                    echo $this->formSelect($element);
2369
                    ?>
1 www 2370
                </div>
3766 stevensc 2371
                <div class="form-group">
2372
                    <?php
2373
                    $element = $form->get('salary_min');
2374
                    $element->setOptions(['label' => 'LABEL_MINIMUM']);
2375
                    $element->setAttributes(['class' => 'form-control']);
2376
                    echo $this->formLabel($element);
2377
                    echo $this->formText($element);
2378
                    ?>
1 www 2379
                </div>
2380
                <div class="form-group">
3766 stevensc 2381
                    <?php
2382
                    $element = $form->get('salary_max');
2383
                    $element->setOptions(['label' => 'LABEL_MAXIMUM']);
2384
                    $element->setAttributes(['class' => 'form-control']);
2385
                    echo $this->formLabel($element);
2386
                    echo $this->formText($element);
2387
                    ?>
1 www 2388
                </div>
3766 stevensc 2389
            </div>
2390
            <div class="modal-footer">
2391
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2392
                <button type="button" class="btn btn-default btn-salary-close">LABEL_CANCEL</button>
2393
            </div>
2394
            <?php echo $this->form()->closeTag($form); ?>
2395
        </div>
2396
    </div>
2397
</div>
1 www 2398
 
2399
<div class="modal" tabindex="-1" role="dialog" id="experience-box">
3766 stevensc 2400
    <div class="modal-dialog" role="document">
2401
        <?php
1 www 2402
        $form = $this->formExperience;
2403
        $form->setAttributes([
2404
            'method' => 'post',
2405
            'name' => 'form-experience',
2406
            'id' => 'form-experience'
2407
        ]);
2408
        $form->prepare();
2409
        echo $this->form()->openTag($form);
3766 stevensc 2410
        ?>
2411
        <div class="modal-content">
2412
            <div class="modal-header">
2413
                <h3 class="modal-title">LABEL_EXPERIENCE</h3>
2414
            </div>
2415
            <div class="modal-body">
1 www 2416
                <div class="form-group">
3766 stevensc 2417
                    <?php
2418
                    $element = $form->get('experience_visible');
2419
 
2420
                    echo $this->formCheckbox($element);
2421
                    ?>
1 www 2422
                </div>
3766 stevensc 2423
                <div class="form-group">
2424
                    <?php
2425
                    $element = $form->get('experience_min');
2426
                    $element->setOptions(['label' => 'LABEL_MINIMUM']);
2427
                    $element->setAttributes(['class' => 'form-control']);
2428
                    echo $this->formLabel($element);
2429
                    echo $this->formText($element);
2430
                    ?>
1 www 2431
                </div>
2432
                <div class="form-group">
3766 stevensc 2433
                    <?php
2434
                    $element = $form->get('experience_max');
2435
                    $element->setOptions(['label' => 'LABEL_MAXIMUM']);
2436
                    $element->setAttributes(['class' => 'form-control']);
2437
                    echo $this->formLabel($element);
2438
                    echo $this->formText($element);
2439
                    ?>
1 www 2440
                </div>
3766 stevensc 2441
            </div>
2442
            <div class="modal-footer">
2443
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2444
                <button type="button" class="btn btn-default btn-experience-close">LABEL_CANCEL</button>
2445
            </div>
2446
            <?php echo $this->form()->closeTag($form); ?>
2447
        </div>
2448
    </div>
2449
</div>
1 www 2450
 
2451
 
2452
<div class="modal" tabindex="-1" role="dialog" id="skills-box">
3766 stevensc 2453
    <div class="modal-dialog" role="document">
2454
        <?php
2455
        $form = $this->formSkill;
2456
        $form->setAttributes([
2457
            'method' => 'post',
2458
            'name' => 'form-skill',
2459
            'id' => 'form-skill'
2460
        ]);
2461
        $form->prepare();
2462
        echo $this->form()->openTag($form);
2463
        ?>
2464
        <div class="modal-content">
2465
            <div class="modal-header">
2466
                <h3 class="modal-title">LABEL_SKILLS</h3>
2467
            </div>
2468
            <div class="modal-body">
1 www 2469
                <div class="form-group">
3766 stevensc 2470
                    <?php
1 www 2471
                    $element = $form->get('skills');
2472
                    $element->setOptions(['label' => 'LABEL_SKILLS']);
2473
                    $element->setAttributes(['class' => 'form-control']);
2474
                    echo $this->formLabel($element);
2475
                    echo $this->formSelect($element);
3766 stevensc 2476
                    ?>
1 www 2477
                </div>
3766 stevensc 2478
            </div>
2479
 
2480
 
2481
            <div class="modal-footer">
2482
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2483
                <button type="button" class="btn btn-default btn-skills-close">LABEL_CANCEL</button>
2484
            </div>
2485
            <?php echo $this->form()->closeTag($form); ?>
2486
        </div>
2487
    </div>
1 www 2488
</div>
2489
 
2490
<div class="modal" tabindex="-1" role="dialog" id="languages-box">
3766 stevensc 2491
    <div class="modal-dialog" role="document">
2492
        <?php
1 www 2493
        $form = $this->formLanguage;
2494
        $form->setAttributes([
2495
            'method' => 'post',
2496
            'name' => 'form-language',
2497
            'id' => 'form-language'
2498
        ]);
2499
        $form->prepare();
2500
        echo $this->form()->openTag($form);
3766 stevensc 2501
        ?>
2502
        <div class="modal-content">
2503
            <div class="modal-header">
2504
                <h3 class="modal-title">LABEL_LANGUAGES</h3>
2505
            </div>
2506
            <div class="modal-body">
1 www 2507
                <div class="form-group">
3766 stevensc 2508
                    <?php
1 www 2509
                    $element = $form->get('languages');
2510
                    $element->setOptions(['label' => 'LABEL_LANGUAGES']);
2511
                    $element->setAttributes(['class' => 'form-control']);
2512
                    echo $this->formLabel($element);
2513
                    echo $this->formSelect($element);
3766 stevensc 2514
                    ?>
1 www 2515
                </div>
3766 stevensc 2516
            </div>
2517
            <div class="modal-footer">
2518
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2519
                <button type="button" class="btn btn-default btn-languages-close">LABEL_CANCEL</button>
2520
            </div>
2521
            <?php echo $this->form()->closeTag($form); ?>
2522
        </div>
2523
    </div>
1 www 2524
</div>
2525
 
2526
<div class="modal" tabindex="-1" role="dialog" id="last-date-of-application-box">
3766 stevensc 2527
    <div class="modal-dialog" role="document">
2528
        <?php
2529
        $form = $this->fromLastDateOfApplication;
1 www 2530
        $form->setAttributes([
2531
            'method' => 'post',
2532
            'name' => 'form-last-date-of-application',
2533
            'id' => 'form-last-date-of-application'
2534
        ]);
2535
        $form->prepare();
2536
        echo $this->form()->openTag($form);
3766 stevensc 2537
        ?>
2538
        <div class="modal-content">
2539
            <div class="modal-header">
2540
                <h3 class="modal-title">LABEL_LAST_DATE_OF_APPLICATION</h3>
2541
            </div>
2542
            <div class="modal-body">
1 www 2543
                <div class="form-group">
3766 stevensc 2544
                    <?php
1 www 2545
                    $element = $form->get('last_date_of_application');
2546
                    $element->setOptions(['label' => 'LABEL_LAST_DATE_OF_APPLICATION']);
2547
                    $element->setAttributes(['class' => 'form-control']);
2548
                    echo $this->formLabel($element);
2549
                    echo $this->formText($element);
3766 stevensc 2550
                    ?>
1 www 2551
                </div>
3766 stevensc 2552
            </div>
2553
            <div class="modal-footer">
2554
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2555
                <button type="button" class="btn btn-default btn-last-date-of-application-close">LABEL_CANCEL</button>
2556
            </div>
2557
            <?php echo $this->form()->closeTag($form); ?>
2558
        </div>
2559
    </div>
1 www 2560
</div>
2561
 
2562
<div class="modal" tabindex="-1" role="dialog" id="degrees-box">
3766 stevensc 2563
    <div class="modal-dialog" role="document">
2564
        <?php
1 www 2565
        $form = $this->formDegree;
2566
        $form->setAttributes([
2567
            'method' => 'post',
2568
            'name' => 'form-degree',
2569
            'id' => 'form-degree'
2570
        ]);
2571
        $form->prepare();
2572
        echo $this->form()->openTag($form);
3766 stevensc 2573
        ?>
2574
        <div class="modal-content">
2575
            <div class="modal-header">
2576
                <h3 class="modal-title">LABEL_DEGREES</h3>
2577
            </div>
2578
            <div class="modal-body">
1 www 2579
                <div class="form-group">
3766 stevensc 2580
                    <?php
1 www 2581
                    $element = $form->get('degrees');
2582
                    $element->setOptions(['label' => 'LABEL_DEGREES']);
2583
                    $element->setAttributes(['class' => 'form-control']);
2584
                    echo $this->formLabel($element);
2585
                    echo $this->formSelect($element);
3766 stevensc 2586
                    ?>
1 www 2587
                </div>
3766 stevensc 2588
            </div>
2589
            <div class="modal-footer">
2590
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2591
                <button type="button" class="btn btn-default btn-degrees-close">LABEL_CANCEL</button>
2592
            </div>
2593
            <?php echo $this->form()->closeTag($form); ?>
2594
        </div>
2595
    </div>
1 www 2596
</div>
2597
 
2598
<div class="modal" tabindex="-1" role="dialog" id="status-box">
3766 stevensc 2599
    <div class="modal-dialog" role="document">
2600
        <?php
2601
        $form = $this->formStatus;
2602
        $form->setAttributes([
2603
            'method' => 'post',
2604
            'name' => 'form-status',
2605
            'id' => 'form-status'
2606
        ]);
2607
        $form->prepare();
2608
        echo $this->form()->openTag($form);
2609
        ?>
2610
        <div class="modal-content">
2611
            <div class="modal-header">
2612
                <h3 class="modal-title">LABEL_STATUS</h3>
2613
            </div>
2614
            <div class="modal-body">
1 www 2615
                <div class="form-group">
3766 stevensc 2616
                    <?php
1 www 2617
                    $element = $form->get('status');
2618
                    $element->setOptions(['label' => 'LABEL_STATUS']);
2619
                    $element->setAttributes(['class' => 'form-control']);
2620
                    echo $this->formLabel($element);
2621
                    echo $this->formSelect($element);
3766 stevensc 2622
                    ?>
1 www 2623
                </div>
3766 stevensc 2624
            </div>
2625
 
2626
 
2627
            <div class="modal-footer">
2628
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2629
                <button type="button" class="btn btn-default btn-status-close">LABEL_CANCEL</button>
2630
            </div>
2631
            <?php echo $this->form()->closeTag($form); ?>
2632
        </div>
2633
    </div>
1 www 2634
</div>
2635
 
2636
<div class="modal" tabindex="-1" role="dialog" id="title-box">
3766 stevensc 2637
    <div class="modal-dialog" role="document">
2638
        <?php
2639
        $form = $this->formTitle;
2640
        $form->setAttributes([
2641
            'method' => 'post',
2642
            'name' => 'form-title',
2643
            'id' => 'form-title'
2644
        ]);
2645
        $form->prepare();
2646
        echo $this->form()->openTag($form);
2647
        ?>
2648
        <div class="modal-content">
2649
            <div class="modal-header">
2650
                <h3 class="modal-title">LABEL_TITLE</h3>
2651
            </div>
2652
            <div class="modal-body">
1 www 2653
                <div class="form-group">
3766 stevensc 2654
                    <?php
1 www 2655
                    $element = $form->get('title');
2656
                    $element->setOptions(['label' => 'LABEL_TITLE']);
2657
                    $element->setAttributes(['class' => 'form-control']);
2658
                    echo $this->formLabel($element);
2659
                    echo $this->formText($element);
3766 stevensc 2660
                    ?>
1 www 2661
                </div>
3766 stevensc 2662
            </div>
2663
 
2664
 
2665
            <div class="modal-footer">
2666
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
2667
                <button type="button" class="btn btn-default btn-title-close">LABEL_CANCEL</button>
2668
            </div>
2669
            <?php echo $this->form()->closeTag($form); ?>
2670
        </div>
2671
    </div>
1 www 2672
</div>