Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev Autor Línea Nro. Línea
1631 eleazar 1
<?php
2
$acl = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser = $this->currentUserHelper();
4
$roleName = $currentUser->getUserTypeId();
1481 eleazar 5
 
1482 eleazar 6
$routeDatatable = $this->url('recruitment-and-selection/candidates');
1637 eleazar 7
$routeEmail = $this->url('recruitment-and-selection/user-by-email');
1506 eleazar 8
$routeAdd = $this->url('recruitment-and-selection/candidates/add', ['vacancy_uuid' => 'UUID_PLACEHOLDER']);
1481 eleazar 9
 
1482 eleazar 10
$allowAdd = $acl->isAllowed($roleName, 'recruitment-and-selection/candidates/add') ? 1 : 0;
11
$allowDelete = $acl->isAllowed($roleName, 'recruitment-and-selection/candidates/delete') ? 1 : 0;
1613 eleazar 12
$allowEdit = $acl->isAllowed($roleName, 'recruitment-and-selection/candidates/edit') ? 1 : 0;
1636 eleazar 13
$allowEmail = $acl->isAllowed($roleName, 'recruitment-and-selection/user-by-email') ? 1 : 0;
1481 eleazar 14
 
15
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
16
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
17
 
1649 eleazar 18
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
1481 eleazar 19
 
20
$this->inlineScript()->appendFile($this->basePath('plugins/bootbox/bootbox.min.js'));
21
 
1490 eleazar 22
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/css/fileinput.min.css'));
23
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.css'));
1481 eleazar 24
 
1490 eleazar 25
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/piexif.js'));
26
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/sortable.js'));
27
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/fileinput.js'));
28
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/locales/es.js'));
29
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/fas/theme.js'));
30
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.js'));
31
 
32
 
1481 eleazar 33
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
34
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
35
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
36
 
37
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
38
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
39
 
40
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
41
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
42
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
43
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
44
 
45
 
46
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
47
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
48
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
49
 
50
 
51
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
52
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
53
 
1886 eleazar 54
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.js'));
55
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/i18n/es.js'));
56
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.css'));
57
 
58
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.css'));
59
 
1481 eleazar 60
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
61
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
62
 
63
 
3880 eleazar 64
$status_active = \LeadersLinked\Model\RecruitmentSelectionCandidate::STATUS_ACEPTED;
3878 eleazar 65
$status_inactive = \LeadersLinked\Model\RecruitmentSelectionCandidate::STATUS_REJECTED;
1649 eleazar 66
 
1658 eleazar 67
$evaluation_0 = \LeadersLinked\Model\RecruitmentSelectionCandidate::EVALUATION_0;
68
$evaluation_1 = \LeadersLinked\Model\RecruitmentSelectionCandidate::EVALUATION_1;
69
$evaluation_2 = \LeadersLinked\Model\RecruitmentSelectionCandidate::EVALUATION_2;
70
$evaluation_3 = \LeadersLinked\Model\RecruitmentSelectionCandidate::EVALUATION_3;
71
$evaluation_4 = \LeadersLinked\Model\RecruitmentSelectionCandidate::EVALUATION_4;
1649 eleazar 72
 
1481 eleazar 73
$this->inlineScript()->captureStart();
74
echo <<<JS
1631 eleazar 75
jQuery(document).ready(function ($) {
1481 eleazar 76
    var allowAdd = $allowAdd;
1613 eleazar 77
    var allowDelete = $allowDelete;
78
    var allowEdit = $allowEdit;
1630 eleazar 79
    var allowEmail = $allowEmail;
1481 eleazar 80
 
1631 eleazar 81
    var gridTable = $('#gridTable').dataTable({
82
        'processing': true,
83
        'serverSide': true,
84
        'searching': true,
85
        'order': [[1, 'asc']],
86
        'ordering': true,
87
        'ordenable': true,
88
        'responsive': true,
89
        'select': false,
90
        'paging': true,
91
        'pagingType': 'simple_numbers',
92
        'lengthMenu': [[10, 25, 50, -1], [10, 25, 50, 'All']],
1481 eleazar 93
 
1631 eleazar 94
        'ajax': {
95
            'url': '$routeDatatable',
96
            'type': 'get',
97
            'data': function (d) {
1481 eleazar 98
            },
1631 eleazar 99
            'beforeSend': function (request) {
100
                NProgress.start();
101
            },
102
            'dataFilter': function (response) {
103
                var response = jQuery.parseJSON(response);
1481 eleazar 104
 
1631 eleazar 105
                var json = {};
106
                json.recordsTotal = 0;
107
                json.recordsFiltered = 0;
108
                json.data = [];
1481 eleazar 109
 
1631 eleazar 110
                if (response.success) {
111
                    json.recordsTotal = response.data.total;
112
                    json.recordsFiltered = response.data.total;
113
                    json.data = response.data.items;
114
                } else {
115
                    $.fn.showError(response.data)
116
                }
1484 eleazar 117
 
1631 eleazar 118
                return JSON.stringify(json);
119
            }
120
        },
121
        'language': {
122
            'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
123
            'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
124
            'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
125
            'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
126
            'sInfo': 'LABEL_DATATABLE_SINFO',
127
            'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
128
            'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
129
            'sInfoPostFix': '',
130
            'sSearch': 'LABEL_DATATABLE_SSEARCH',
131
            'sUrl': '',
132
            'sInfoThousands': ',',
133
            'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
134
            'oPaginate': {
135
                'sFirst': 'LABEL_DATATABLE_SFIRST',
136
                'sLast': 'LABEL_DATATABLE_SLAST',
137
                'sNext': 'LABEL_DATATABLE_SNEXT',
138
                'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
139
            },
140
            'oAria': {
141
                'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
142
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
143
            },
144
        },
145
        'drawCallback': function (settings) {
146
            NProgress.done();
147
            $('button.btn-delete').confirmation({
148
                rootSelector: 'button.btn-delete',
149
                title: 'LABEL_ARE_YOU_SURE',
150
                singleton: true,
151
                btnOkLabel: 'LABEL_YES',
152
                btnCancelLabel: 'LABEL_NO',
153
                onConfirm: function (value) {
154
                    action = $(this).data('href');
155
                    NProgress.start();
156
                    $.ajax({
157
                        'dataType': 'json',
158
                        'accept': 'application/json',
159
                        'method': 'post',
160
                        'url': action,
161
                    }).done(function (response) {
162
                        if (response['success']) {
163
                            $.fn.showSuccess(response['data']);
164
                            gridTable.api().ajax.reload(null, false);
165
                        } else {
166
                            $.fn.showError(response['data']);
167
                        }
168
                    }).fail(function (jqXHR, textStatus, errorThrown) {
169
                        $.fn.showError(textStatus);
170
                    }).always(function () {
171
                        NProgress.done();
172
                    });
173
                },
174
            });
1484 eleazar 175
 
1631 eleazar 176
            $('#form-add #file').fileinput({
177
                theme: 'fas',
178
                language: 'es',
179
                showUpload: false,
180
                dropZoneEnabled: false,
181
                maxFileCount: 1,
182
                allowedFileExtensions: ['pdf', 'docx'],
183
            });
1484 eleazar 184
 
1631 eleazar 185
            $('body').on('click', 'button.btn-add', function (e) {
186
                e.preventDefault();
1484 eleazar 187
 
1660 eleazar 188
                $('#form-add #user_id').val('');
1631 eleazar 189
                $('#form-add #first_name').val('');
190
                $('#form-add #last_name').val('');
191
                $('#form-add #email').val('');
192
                $('#form-add #file').fileinput('reset');
193
                $('#form-add #file').val('');
1649 eleazar 194
                $('#form-add #status').val('$status_active');
1659 eleazar 195
                $('#form-add #evaluation').val('$evaluation_0');
3866 eleazar 196
                $('#first-step').show();
3877 eleazar 197
                $('#second-step').hide();
1653 eleazar 198
                CKEDITOR.instances.coment.setData('');
1631 eleazar 199
                validatorAdd.resetForm();
1616 eleazar 200
 
1631 eleazar 201
                $('#add-candidate-box').modal('show');
202
                return false;
203
            });
1616 eleazar 204
 
1631 eleazar 205
            $(".close-box, .btn-add-cancel").on("click", function (e) {
206
                e.preventDefault();
3852 eleazar 207
                $('#form-add #first_name').prop("disabled", false);
208
                $('#form-add #last_name').prop('disabled', false);
3866 eleazar 209
                $('#secon-step').hide();
1631 eleazar 210
                $('#add-candidate-box').modal('hide');
211
                $('#edit-candidate-box').modal('hide');
212
                return false;
1616 eleazar 213
            });
214
 
1631 eleazar 215
            var validatorEdit = $('#form-edit').validate({
216
                debug: true,
217
                onclick: false,
218
                onkeyup: false,
219
                onfocusout: false,
220
                ignore: [],
221
                rules: {
1660 eleazar 222
                    'user_id': {
223
                        required: false,
224
                    },
1631 eleazar 225
                    'first_name': {
226
                        required: true,
227
                        maxlength: 128,
228
                    },
229
                    'file': {
230
                        required: false,
231
                        extension: 'pdf|docx',
232
                        accept: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/msword,application/pdf'
233
                    },
234
                    'last_name': {
235
                        required: true,
236
                    },
237
                    'email': {
238
                        required: true,
239
                    },
1658 eleazar 240
                    'evaluation':{
1649 eleazar 241
                        required: false,
242
                    },
1654 eleazar 243
                    'coment':{
244
                        updateCkeditor:function() {
1656 eleazar 245
                        CKEDITOR.instances.coment.updateElement();
1654 eleazar 246
                        },
1649 eleazar 247
                    },
1631 eleazar 248
                    'status': {
249
                        required: true,
250
                    }
251
                },
252
                submitHandler: function (form) {
253
                    var formdata = false;
254
                    if (window.FormData) {
255
                        formdata = new FormData(form); //form[0]);
256
                    }
1616 eleazar 257
 
1631 eleazar 258
                    $('input[type="submit"]').prop('disabled', true);
1616 eleazar 259
 
1631 eleazar 260
                    $.ajax({
261
                        'dataType': 'json',
262
                        'accept': 'application/json',
263
                        'method': 'post',
264
                        'url': $('#form-edit').attr('action'),
265
                        'data': formdata,
266
                        'processData': false,
267
                        'contentType': false,
268
                    }).done(function (response) {
269
                        if (response['success']) {
270
                            $.fn.showSuccess(response['data']);
271
 
272
                            $('#edit-candidate-box').modal('hide');
273
                            gridTable.api().ajax.reload(null, false);
274
                        } else {
275
                            validatorEdit.resetForm();
276
                            if (jQuery.type(response['data']) == 'string') {
277
                                $.fn.showError(response['data']);
278
                            } else {
279
                                $.each(response['data'], function (fieldname, errors) {
280
                                    $.fn.showFormErrorValidator('#form-edit #' + fieldname, errors);
281
                                });
282
                            }
283
                        }
284
                    }).fail(function (jqXHR, textStatus, errorThrown) {
285
                        $.fn.showError(textStatus);
286
                    }).always(function () {
287
                        NProgress.done();
288
                    });
289
                    return false;
290
                },
291
                invalidHandler: function (form, validator) {
292
 
1616 eleazar 293
                }
294
            });
295
 
1631 eleazar 296
            $('body').on('click', 'button.btn-edit', function (e) {
297
                e.preventDefault();
1486 eleazar 298
 
1631 eleazar 299
                var url = $(this).data('href');
300
                $.ajax({
301
                    'dataType': 'json',
302
                    'accept': 'application/json',
303
                    'method': 'get',
304
                    'url': url,
305
                }).done(function (response) {
306
                    if (response['success']) {
307
                        $('#form-edit')[0].reset();
1486 eleazar 308
 
1631 eleazar 309
                        $('#form-edit').attr('action', url);
1660 eleazar 310
 
311
                        $('#form-edit #first_name').val(response['data']['user_id']);
1631 eleazar 312
                        $('#form-edit #first_name').val(response['data']['first_name']);
313
                        $('#form-edit #last_name').val(response['data']['last_name']);
314
                        $('#form-edit #email').val(response['data']['email']);
1649 eleazar 315
                        $('#form-edit #status').val(response['data']['status']);
3420 eleazar 316
                        $('#form-edit #evaluation').val(response['data']['evaluation']);
317
                        $('#form-edit #coment').val(response['data']['coment']);
3821 eleazar 318
                        $('#form-edit #file').fileinput('reset');
319
                        $('#form-edit #file').val('');
1631 eleazar 320
 
321
 
322
                        $('#form-edit #status').val(response['data']['status']);
323
 
324
                        $('#edit-candidate-box').modal('show');
325
                    } else {
326
                        validatorEdit.resetForm();
327
                        if (jQuery.type(response['data']) == 'string') {
328
                            $.fn.showError(response['data']);
329
                        } else {
330
                            $.each(response['data'], function (fieldname, errors) {
331
                                $.fn.showFormErrorValidator('#form-edit #' + fieldname, errors);
332
                            });
333
                        }
1486 eleazar 334
                    }
1631 eleazar 335
                }).fail(function (jqXHR, textStatus, errorThrown) {
336
                    $.fn.showError(textStatus);
337
                }).always(function () {
338
                    NProgress.done();
339
                });
1486 eleazar 340
            });
341
 
1631 eleazar 342
            var validatorAdd = $('#form-add').validate({
343
                debug: true,
344
                onclick: false,
345
                onkeyup: false,
346
                onfocusout: false,
347
                ignore: [],
348
                rules: {
1660 eleazar 349
                    'user_id': {
350
                        required: false,
351
                    },
1631 eleazar 352
                    'first_name': {
353
                        required: true,
354
                        maxlength: 128,
355
                    },
356
                    'file': {
357
                        required: false,
358
                        extension: 'pdf|docx',
359
                        accept: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/msword,application/pdf'
360
                    },
361
                    'last_name': {
362
                        required: true,
363
                    },
364
                    'email': {
365
                        required: true,
366
                    },
1658 eleazar 367
                    'evaluation':{
1649 eleazar 368
                        required: false,
369
                    },
1654 eleazar 370
                    'coment':{
371
                        updateCkeditor:function() {
1656 eleazar 372
                            CKEDITOR.instances.coment.updateElement();
1654 eleazar 373
                        },
1649 eleazar 374
                    },
1631 eleazar 375
                    'status': {
376
                        required: true,
377
                    }
378
                },
379
                submitHandler: function (form) {
380
                    var formdata = false;
381
                    if (window.FormData) {
382
                        formdata = new FormData(form); //form[0]);
383
                    }
1630 eleazar 384
 
1631 eleazar 385
                    $('input[type="submit"]').prop('disabled', true);
1630 eleazar 386
 
1631 eleazar 387
                    $.ajax({
388
                        'dataType': 'json',
389
                        'accept': 'application/json',
390
                        'method': 'post',
391
                        'url': $('#form-add').attr('action'),
392
                        'data': formdata,
393
                        'processData': false,
394
                        'contentType': false,
395
                    }).done(function (response) {
396
                        if (response['success']) {
397
                            $.fn.showSuccess(response['data']);
398
 
399
                            $('#add-candidate-box').modal('hide');
400
                            gridTable.api().ajax.reload(null, false);
401
                        } else {
402
                            validatorAdd.resetForm();
403
                            if (jQuery.type(response['data']) == 'string') {
404
                                $.fn.showError(response['data']);
405
                            } else {
406
                                $.each(response['data'], function (fieldname, errors) {
407
                                    $.fn.showFormErrorValidator('#form-add #' + fieldname, errors);
408
                                });
409
                            }
410
                        }
411
                    }).fail(function (jqXHR, textStatus, errorThrown) {
412
                        $.fn.showError(textStatus);
413
                    }).always(function () {
414
                        NProgress.done();
415
                    });
416
                    return false;
417
                },
418
                invalidHandler: function (form, validator) {
419
 
1630 eleazar 420
                }
421
            });
422
        },
1631 eleazar 423
        'aoColumns': [
424
            { 'mDataProp': 'first_name' },
425
            { 'mDataProp': 'last_name' },
426
            { 'mDataProp': 'email' },
6237 eleazar 427
            { 'mDataProp': 'file' },
1631 eleazar 428
            { 'mDataProp': 'actions' },
429
        ],
430
        'columnDefs': [
431
            {
6237 eleazar 432
                    'targets': -2,
433
                    'orderable': false,
434
                    'render' : function ( data, type, row ) {
435
                        s = '&nbsp;';
436
 
437
                        if( data )  {
6244 eleazar 438
                            s = s + '&nbsp;<button class="btn btn-view-document" data-href="' + data['file'] + '" data-toggle="tooltip" title="LABEL_VIEW_DOCUMENT"><i class="fa fa-file"></i></button> <br>';
6237 eleazar 439
                        }  else {
440
                            s = s + '&nbsp;LABEL_IMAGE: <br>';
441
                        }
442
 
443
 
444
                        return s;
445
                    }
446
            },
447
            {
1631 eleazar 448
                'targets': -1,
449
                'orderable': false,
450
                'render': function (data, type, row) {
451
                    s = '';
1630 eleazar 452
 
1631 eleazar 453
                    if (allowEdit && data['link_edit']) {
454
                        s = s + '<button class="btn btn-info btn-sm btn-edit" data-href="' + data['link_edit'] + '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pencil"></i> LABEL_EDIT </button>&nbsp;';
455
                    }
1481 eleazar 456
 
1631 eleazar 457
                    if (allowDelete && data['link_delete']) {
458
                        s = s + '<button class="btn btn-danger btn-sm btn-delete" data-href="' + data['link_delete'] + '" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-times"></i> LABEL_DELETE </button>&nbsp;';
459
                    }
1614 eleazar 460
 
1631 eleazar 461
                    return s;
1481 eleazar 462
                }
1631 eleazar 463
            }
464
        ],
465
    });
1481 eleazar 466
 
1631 eleazar 467
    $('#form-filter #form_uuid').change(function (e) {
1481 eleazar 468
        e.preventDefault();
469
 
1503 eleazar 470
        var uuid = e.target.value;
471
 
1507 eleazar 472
        $('#form-add').attr('action', String("$routeAdd").replaceAll('UUID_PLACEHOLDER', uuid));
1503 eleazar 473
 
1599 eleazar 474
        gridTable.api().ajax.url("$routeDatatable" + "/" + uuid);
1481 eleazar 475
        gridTable.api().ajax.reload(null, false);
476
    })
477
 
478
 
1631 eleazar 479
    $('body').on('click', 'button.btn-refresh', function (e) {
1481 eleazar 480
        e.preventDefault();
481
        gridTable.api().ajax.reload(null, false);
482
    });
1507 eleazar 483
 
3875 eleazar 484
    $('body').on('click', '#btn-next', function () {
3869 eleazar 485
       $("#first-step").hide();
486
       $("#second-step").show();
487
    });
488
 
1507 eleazar 489
    $('#form-filter #form_uuid').change();
1642 eleazar 490
 
491
    $('body').on('click', '#check-email', function () {
492
        $.ajax("$routeEmail", {
493
            accepts: 'application/json',
494
            method: 'GET',
495
            data: {
496
                'email': $('#form-add #email').val(),
497
            }
1648 eleazar 498
        }).done(function (response) {
499
            if (response['success']) {
1662 eleazar 500
                $('#form-add #user_id').val(response['data']['user_id']);
1648 eleazar 501
                $('#form-add #first_name').val(response['data']['first_name']);
502
                $('#form-add #last_name').val(response['data']['last_name']);
3876 eleazar 503
               // $('#form-add #first_name').prop("disabled", true);
504
               // $('#form-add #last_name').prop('disabled', true);
1648 eleazar 505
            } else {
1646 eleazar 506
                $.fn.showError(response['data']);
507
            }
508
        }).fail(function (jqXHR, textStatus, errorThrown) {
509
            $.fn.showError(textStatus);
510
        }).always(function () {
511
            NProgress.done();
512
        });
1648 eleazar 513
    })
1655 eleazar 514
 
515
    CKEDITOR.replace('coment');
1481 eleazar 516
});
517
JS;
518
$this->inlineScript()->captureEnd();
519
?>
520
 
521
 
522
<!-- Content Header (Page header) -->
523
<section class="content-header">
1631 eleazar 524
    <div class="container-fluid">
525
        <div class="row mb-2">
526
            <div class="col-sm-12">
4241 eleazar 527
                <h1>LABEL_PRE_SELECTION</h1>
1631 eleazar 528
            </div>
529
        </div>
530
    </div><!-- /.container-fluid -->
1481 eleazar 531
</section>
532
 
533
<section class="content">
1631 eleazar 534
    <div class="container-fluid">
535
        <div class="row">
536
            <div class="col-12">
537
                <div class="card">
538
                    <div class="card-header">
539
                        <?php
1486 eleazar 540
                        // $form = $this->form;
1631 eleazar 541
                        $form->setAttributes([
542
                            'name' => 'form-filter',
543
                            'id' => 'form-filter',
1481 eleazar 544
                        ]);
1631 eleazar 545
 
1481 eleazar 546
                        $form->prepare();
547
                        echo $this->form()->openTag($form);
1631 eleazar 548
                        ?>
1481 eleazar 549
                        <div class="row">
550
                            <div class="col-md-6 col-sm-12">
551
                                <div class="form-group">
552
                                    <?php
553
                                    $element = $form->get('form_uuid');
1631 eleazar 554
 
1484 eleazar 555
                                    $element->setOptions(['label' => 'LABEL_VACANCIES']);
1631 eleazar 556
 
1481 eleazar 557
                                    $element->setAttributes(['class' => 'form-control']);
558
                                    echo $this->formLabel($element);
559
                                    echo $this->formSelect($element);
560
                                    ?>
1631 eleazar 561
                                </div>
1481 eleazar 562
                            </div>
563
 
564
                        </div>
1631 eleazar 565
                        <?php echo $this->form()->closeTag($form); ?>
566
                    </div>
567
                    <div class="card-body">
568
                        <table id="gridTable" class="table   table-hover">
569
                            <thead>
570
                            <tr>
571
                                <th>LABEL_FIRST_NAME</th>
572
                                <th>LABEL_LAST_NAME</th>
573
                                <th>LABEL_EMAIL</th>
6237 eleazar 574
                                <th>LABEL_DETAILS</th>
1631 eleazar 575
                                <th>LABEL_ACTIONS</th>
576
                            </tr>
577
                            </thead>
578
                            <tbody>
579
                            </tbody>
580
                        </table>
581
                    </div>
582
                    <div class="card-footer clearfix">
583
                        <div style="float:right;">
584
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i>
585
                                LABEL_REFRESH
586
                            </button>
587
                            <?php if ($allowAdd) : ?>
588
                                <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i>
589
                                    LABEL_ADD
590
                                </button>
591
                            <?php endif; ?>
592
                        </div>
593
                    </div>
594
                </div>
595
            </div>
596
        </div>
597
    </div>
598
</section>
1616 eleazar 599
 
600
<!-- The Add Modal -->
601
<div class="modal" tabindex="-1" role="dialog" id="add-candidate-box">
1631 eleazar 602
    <div class="modal-dialog" role="document">
603
        <?php
2121 eleazar 604
        //$form = $this->formAdd;
1631 eleazar 605
        $form->setAttributes([
606
            'method' => 'post',
607
            'name' => 'form-add',
608
            'action' => $routeAdd,
609
            'email' => $routeEmail,
610
            'id' => 'form-add'
611
        ]);
612
        $form->prepare();
613
        echo $this->form()->openTag($form);
614
 
1660 eleazar 615
        $fields = ['user_id'];
616
 
617
        foreach($fields as $field)
618
        {
619
            $element = $form->get($field);
620
            echo $this->formHidden($element);
621
        }
622
 
1631 eleazar 623
        ?>
624
        <div class="modal-content">
625
            <div class="modal-header">
626
                <h3 class="modal-title">LABEL_NEW_CANDIDATE</h3>
627
            </div>
628
            <div class="modal-body">
3863 eleazar 629
                <div id="first-step" style="display: none;">
630
                    <div class="form-group">
631
                        <?php
632
                        $element = $form->get('email');
633
                        $element->setOptions(['label' => 'LABEL_EMAIL']);
634
                        $element->setAttributes(['class' => 'form-control']);
635
                        echo $this->formLabel($element);
636
                        echo $this->formText($element);
637
                        ?>
638
                    </div>
639
                    <button id="check-email" type="button" class="btn btn-primary">LABEL_CHECK_EMAIL</button>
640
                    <div class="form-group">
641
                        <?php
642
                        $element = $form->get('first_name');
643
                        $element->setOptions(['label' => 'LABEL_FIRST_NAME']);
644
                        $element->setAttributes(['class' => 'form-control']);
645
                        echo $this->formLabel($element);
646
                        echo $this->formText($element);
647
                        ?>
648
                    </div>
649
                    <div class="form-group">
650
                        <?php
651
                        $element = $form->get('last_name');
652
                        $element->setOptions(['label' => 'LABEL_LAST_NAME']);
653
                        $element->setAttributes(['class' => 'form-control']);
654
                        echo $this->formLabel($element);
655
                        echo $this->formText($element);
656
                        ?>
657
                    </div>
658
                    <div class="modal-footer">
3871 eleazar 659
                        <button id="btn-next" type="button" class="btn btn-primary">LABEL_NEXT</button>
3863 eleazar 660
                    </div>
1631 eleazar 661
                </div>
3863 eleazar 662
                <div id="second-step" style="display: none;">
3821 eleazar 663
                    <div class="form-group">
664
              	       <?php
665
                         $element = $form->get('coment');
666
                         $element->setAttributes(['class' => 'form-control']);
667
                         $element->setOptions(['label' => 'LABEL_COMMENT']);
668
                         echo $this->formLabel($element);
669
                         echo $this->formTextArea($element);
670
                        ?>
671
      	            </div>
672
                      <div class="form-group">
673
                        <?php
674
                        $element = $form->get('evaluation');
675
                        $element->setAttributes(['class' => 'form-control']);
676
                        $element->setOptions(['label' => 'LABEL_EVALUATION']);
677
                        echo $this->formLabel($element);
678
                        echo $this->formSelect($element);
679
                        ?>
680
                    </div>
681
                    <div class="form-group">
682
                        <?php
683
                        $element = $form->get('file');
1631 eleazar 684
 
3821 eleazar 685
                        $element->setAttributes(['class' => 'form-control', 'accept' => 'pdf/docx']);
686
                        $element->setOptions(['label' => 'LABEL_CURRICULUM']);
687
                        echo $this->formLabel($element);
688
                        ?>
689
                        <div class="file-loading">
690
                            <?php echo $this->formFile($element); ?>
691
                        </div>
1493 eleazar 692
                    </div>
3821 eleazar 693
                    <div class="form-group">
694
                        <?php
695
                        $element = $form->get('status');
696
                        $element->setAttributes(['class' => 'form-control']);
697
                        $element->setOptions(['label' => 'LABEL_STATUS']);
698
                        echo $this->formLabel($element);
699
                        echo $this->formSelect($element);
700
                        ?>
701
                    </div>
3863 eleazar 702
                    <div class="modal-footer">
703
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
704
                        <button type="button" class="btn btn-default btn-add-cancel">LABEL_CANCEL</button>
705
                    </div>
1631 eleazar 706
                </div>
707
            </div>
3863 eleazar 708
 
1631 eleazar 709
            <?php echo $this->form()->closeTag($form); ?>
710
        </div>
711
    </div>
1616 eleazar 712
</div>
713
 
714
<!-- The Edit Modal -->
715
<div class="modal" tabindex="-1" role="dialog" id="edit-candidate-box">
1631 eleazar 716
    <div class="modal-dialog" role="document">
717
        <?php
718
        $form->setAttributes([
719
            'method' => 'post',
720
            'name' => 'form-edit',
721
            'id' => 'form-edit'
722
        ]);
723
        $form->prepare();
724
        echo $this->form()->openTag($form);
725
 
1660 eleazar 726
        $fields = ['user_id'];
727
 
728
        foreach($fields as $field)
729
        {
730
            $element = $form->get($field);
731
            echo $this->formHidden($element);
732
        }
733
 
1631 eleazar 734
        ?>
735
        <div class="modal-content">
736
            <div class="modal-header">
737
                <h3 class="modal-title">LABEL_CANDIDATE</h3>
738
            </div>
739
            <div class="modal-body">
740
                <div class="form-group">
741
                    <?php
742
                    $element = $form->get('first_name');
743
                    $element->setOptions(['label' => 'LABEL_FIRST_NAME']);
744
                    $element->setAttributes(['class' => 'form-control']);
745
                    echo $this->formLabel($element);
746
                    echo $this->formText($element);
1616 eleazar 747
                    ?>
1631 eleazar 748
                </div>
749
                <div class="form-group">
750
                    <?php
751
                    $element = $form->get('last_name');
752
                    $element->setOptions(['label' => 'LABEL_LAST_NAME']);
753
                    $element->setAttributes(['class' => 'form-control']);
754
                    echo $this->formLabel($element);
755
                    echo $this->formText($element);
1616 eleazar 756
                    ?>
1631 eleazar 757
                </div>
758
                <div class="form-group">
759
                    <?php
760
                    $element = $form->get('email');
761
                    $element->setOptions(['label' => 'LABEL_EMAIL']);
762
                    $element->setAttributes(['class' => 'form-control']);
763
                    echo $this->formLabel($element);
764
                    echo $this->formText($element);
1616 eleazar 765
                    ?>
1631 eleazar 766
                </div>
767
                <div class="form-group">
1649 eleazar 768
              	   <?php
1652 eleazar 769
                     $element = $form->get('coment');
1649 eleazar 770
                     $element->setAttributes(['class' => 'form-control']);
1657 eleazar 771
                     $element->setOptions(['label' => 'LABEL_COMMENT']);
1649 eleazar 772
                     echo $this->formLabel($element);
773
                     echo $this->formTextArea($element);
774
                    ?>
775
      	        </div>
776
                  <div class="form-group">
1631 eleazar 777
                    <?php
1658 eleazar 778
                    $element = $form->get('evaluation');
1649 eleazar 779
                    $element->setAttributes(['class' => 'form-control']);
1658 eleazar 780
                    $element->setOptions(['label' => 'LABEL_EVALUATION']);
1649 eleazar 781
                    echo $this->formLabel($element);
782
                    echo $this->formSelect($element);
783
                    ?>
784
                </div>
785
                <div class="form-group">
786
                    <?php
1616 eleazar 787
                    $element = $form->get('file');
1631 eleazar 788
 
789
                    $element->setAttributes(['class' => 'form-control', 'accept' => 'pdf/docx']);
1616 eleazar 790
                    $element->setOptions(['label' => 'LABEL_CURRICULUM']);
791
                    echo $this->formLabel($element);
792
                    ?>
793
                    <div class="file-loading">
1631 eleazar 794
                        <?php echo $this->formFile($element); ?>
1616 eleazar 795
                    </div>
1631 eleazar 796
                </div>
1619 eleazar 797
 
1631 eleazar 798
                <div class="form-group">
799
                    <?php
800
                    $element = $form->get('status');
801
                    $element->setAttributes(['class' => 'form-control']);
802
                    $element->setOptions(['label' => 'LABEL_STATUS']);
803
                    echo $this->formLabel($element);
804
                    echo $this->formSelect($element);
1619 eleazar 805
                    ?>
1631 eleazar 806
                </div>
807
            </div>
808
            <div class="modal-footer">
809
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
810
                <button type="button" class="btn btn-default btn-add-cancel">LABEL_CANCEL</button>
811
            </div>
812
            <?php echo $this->form()->closeTag($form); ?>
813
        </div>
814
    </div>
1485 eleazar 815
</div>