Proyectos de Subversion LeadersLinked - Backend

Rev

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