Proyectos de Subversion LeadersLinked - Backend

Rev

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