Proyectos de Subversion LeadersLinked - Backend

Rev

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