Proyectos de Subversion LeadersLinked - Backend

Rev

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