Proyectos de Subversion LeadersLinked - Backend

Rev

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