Proyectos de Subversion LeadersLinked - Backend

Rev

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