Proyectos de Subversion LeadersLinked - Backend

Rev

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