Proyectos de Subversion LeadersLinked - Backend

Rev

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