Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 3835 | Rev 3852 | 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']);
3840 eleazar 476
                $('#form-add #first_name').prop("disabled", true);
477
                $('#form-add #last_name').prop('disabled', true);
3829 eleazar 478
                $('#form-add #step').show();
1648 eleazar 479
            } else {
1646 eleazar 480
                $.fn.showError(response['data']);
481
            }
482
        }).fail(function (jqXHR, textStatus, errorThrown) {
483
            $.fn.showError(textStatus);
484
        }).always(function () {
485
            NProgress.done();
486
        });
1648 eleazar 487
    })
1655 eleazar 488
 
489
    CKEDITOR.replace('coment');
1481 eleazar 490
});
491
JS;
492
$this->inlineScript()->captureEnd();
493
?>
494
 
495
 
496
<!-- Content Header (Page header) -->
497
<section class="content-header">
1631 eleazar 498
    <div class="container-fluid">
499
        <div class="row mb-2">
500
            <div class="col-sm-12">
501
                <h1>LABEL_CANDIDATES</h1>
502
            </div>
503
        </div>
504
    </div><!-- /.container-fluid -->
1481 eleazar 505
</section>
506
 
507
<section class="content">
1631 eleazar 508
    <div class="container-fluid">
509
        <div class="row">
510
            <div class="col-12">
511
                <div class="card">
512
                    <div class="card-header">
513
                        <?php
1486 eleazar 514
                        // $form = $this->form;
1631 eleazar 515
                        $form->setAttributes([
516
                            'name' => 'form-filter',
517
                            'id' => 'form-filter',
1481 eleazar 518
                        ]);
1631 eleazar 519
 
1481 eleazar 520
                        $form->prepare();
521
                        echo $this->form()->openTag($form);
1631 eleazar 522
                        ?>
1481 eleazar 523
                        <div class="row">
524
                            <div class="col-md-6 col-sm-12">
525
                                <div class="form-group">
526
                                    <?php
527
                                    $element = $form->get('form_uuid');
1631 eleazar 528
 
1484 eleazar 529
                                    $element->setOptions(['label' => 'LABEL_VACANCIES']);
1631 eleazar 530
 
1481 eleazar 531
                                    $element->setAttributes(['class' => 'form-control']);
532
                                    echo $this->formLabel($element);
533
                                    echo $this->formSelect($element);
534
                                    ?>
1631 eleazar 535
                                </div>
1481 eleazar 536
                            </div>
537
 
538
                        </div>
1631 eleazar 539
                        <?php echo $this->form()->closeTag($form); ?>
540
                    </div>
541
                    <div class="card-body">
542
                        <table id="gridTable" class="table   table-hover">
543
                            <thead>
544
                            <tr>
545
                                <th>LABEL_FIRST_NAME</th>
546
                                <th>LABEL_LAST_NAME</th>
547
                                <th>LABEL_EMAIL</th>
548
                                <th>LABEL_ACTIONS</th>
549
                            </tr>
550
                            </thead>
551
                            <tbody>
552
                            </tbody>
553
                        </table>
554
                    </div>
555
                    <div class="card-footer clearfix">
556
                        <div style="float:right;">
557
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i>
558
                                LABEL_REFRESH
559
                            </button>
560
                            <?php if ($allowAdd) : ?>
561
                                <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i>
562
                                    LABEL_ADD
563
                                </button>
564
                            <?php endif; ?>
565
                        </div>
566
                    </div>
567
                </div>
568
            </div>
569
        </div>
570
    </div>
571
</section>
1616 eleazar 572
 
573
<!-- The Add Modal -->
574
<div class="modal" tabindex="-1" role="dialog" id="add-candidate-box">
1631 eleazar 575
    <div class="modal-dialog" role="document">
576
        <?php
2121 eleazar 577
        //$form = $this->formAdd;
1631 eleazar 578
        $form->setAttributes([
579
            'method' => 'post',
580
            'name' => 'form-add',
581
            'action' => $routeAdd,
582
            'email' => $routeEmail,
583
            'id' => 'form-add'
584
        ]);
585
        $form->prepare();
586
        echo $this->form()->openTag($form);
587
 
1660 eleazar 588
        $fields = ['user_id'];
589
 
590
        foreach($fields as $field)
591
        {
592
            $element = $form->get($field);
593
            echo $this->formHidden($element);
594
        }
595
 
1631 eleazar 596
        ?>
597
        <div class="modal-content">
598
            <div class="modal-header">
599
                <h3 class="modal-title">LABEL_NEW_CANDIDATE</h3>
600
            </div>
601
            <div class="modal-body">
602
                <div class="form-group">
603
                    <?php
3821 eleazar 604
                    $element = $form->get('email');
605
                    $element->setOptions(['label' => 'LABEL_EMAIL']);
1631 eleazar 606
                    $element->setAttributes(['class' => 'form-control']);
607
                    echo $this->formLabel($element);
608
                    echo $this->formText($element);
1485 eleazar 609
                    ?>
1631 eleazar 610
                </div>
3821 eleazar 611
                <button id="check-email" type="button" class="btn btn-primary">LABEL_CHECK_EMAIL</button>
1631 eleazar 612
                <div class="form-group">
613
                    <?php
3821 eleazar 614
                    $element = $form->get('first_name');
615
                    $element->setOptions(['label' => 'LABEL_FIRST_NAME']);
1631 eleazar 616
                    $element->setAttributes(['class' => 'form-control']);
617
                    echo $this->formLabel($element);
618
                    echo $this->formText($element);
1485 eleazar 619
                    ?>
1631 eleazar 620
                </div>
621
                <div class="form-group">
622
                    <?php
3821 eleazar 623
                    $element = $form->get('last_name');
624
                    $element->setOptions(['label' => 'LABEL_LAST_NAME']);
1631 eleazar 625
                    $element->setAttributes(['class' => 'form-control']);
626
                    echo $this->formLabel($element);
627
                    echo $this->formText($element);
1485 eleazar 628
                    ?>
1631 eleazar 629
                </div>
3828 eleazar 630
                <div id="step" style="display: none;">
3821 eleazar 631
                    <div class="form-group">
632
              	       <?php
633
                         $element = $form->get('coment');
634
                         $element->setAttributes(['class' => 'form-control']);
635
                         $element->setOptions(['label' => 'LABEL_COMMENT']);
636
                         echo $this->formLabel($element);
637
                         echo $this->formTextArea($element);
638
                        ?>
639
      	            </div>
640
                      <div class="form-group">
641
                        <?php
642
                        $element = $form->get('evaluation');
643
                        $element->setAttributes(['class' => 'form-control']);
644
                        $element->setOptions(['label' => 'LABEL_EVALUATION']);
645
                        echo $this->formLabel($element);
646
                        echo $this->formSelect($element);
647
                        ?>
648
                    </div>
649
                    <div class="form-group">
650
                        <?php
651
                        $element = $form->get('file');
1631 eleazar 652
 
3821 eleazar 653
                        $element->setAttributes(['class' => 'form-control', 'accept' => 'pdf/docx']);
654
                        $element->setOptions(['label' => 'LABEL_CURRICULUM']);
655
                        echo $this->formLabel($element);
656
                        ?>
657
                        <div class="file-loading">
658
                            <?php echo $this->formFile($element); ?>
659
                        </div>
1493 eleazar 660
                    </div>
3821 eleazar 661
                    <div class="form-group">
662
                        <?php
663
                        $element = $form->get('status');
664
                        $element->setAttributes(['class' => 'form-control']);
665
                        $element->setOptions(['label' => 'LABEL_STATUS']);
666
                        echo $this->formLabel($element);
667
                        echo $this->formSelect($element);
668
                        ?>
669
                    </div>
1631 eleazar 670
                </div>
671
            </div>
672
            <div class="modal-footer">
673
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
674
                <button type="button" class="btn btn-default btn-add-cancel">LABEL_CANCEL</button>
675
            </div>
676
            <?php echo $this->form()->closeTag($form); ?>
677
        </div>
678
    </div>
1616 eleazar 679
</div>
680
 
681
<!-- The Edit Modal -->
682
<div class="modal" tabindex="-1" role="dialog" id="edit-candidate-box">
1631 eleazar 683
    <div class="modal-dialog" role="document">
684
        <?php
685
        $form->setAttributes([
686
            'method' => 'post',
687
            'name' => 'form-edit',
688
            'id' => 'form-edit'
689
        ]);
690
        $form->prepare();
691
        echo $this->form()->openTag($form);
692
 
1660 eleazar 693
        $fields = ['user_id'];
694
 
695
        foreach($fields as $field)
696
        {
697
            $element = $form->get($field);
698
            echo $this->formHidden($element);
699
        }
700
 
1631 eleazar 701
        ?>
702
        <div class="modal-content">
703
            <div class="modal-header">
704
                <h3 class="modal-title">LABEL_CANDIDATE</h3>
705
            </div>
706
            <div class="modal-body">
707
                <div class="form-group">
708
                    <?php
709
                    $element = $form->get('first_name');
710
                    $element->setOptions(['label' => 'LABEL_FIRST_NAME']);
711
                    $element->setAttributes(['class' => 'form-control']);
712
                    echo $this->formLabel($element);
713
                    echo $this->formText($element);
1616 eleazar 714
                    ?>
1631 eleazar 715
                </div>
716
                <div class="form-group">
717
                    <?php
718
                    $element = $form->get('last_name');
719
                    $element->setOptions(['label' => 'LABEL_LAST_NAME']);
720
                    $element->setAttributes(['class' => 'form-control']);
721
                    echo $this->formLabel($element);
722
                    echo $this->formText($element);
1616 eleazar 723
                    ?>
1631 eleazar 724
                </div>
725
                <div class="form-group">
726
                    <?php
727
                    $element = $form->get('email');
728
                    $element->setOptions(['label' => 'LABEL_EMAIL']);
729
                    $element->setAttributes(['class' => 'form-control']);
730
                    echo $this->formLabel($element);
731
                    echo $this->formText($element);
1616 eleazar 732
                    ?>
1631 eleazar 733
                </div>
734
                <div class="form-group">
1649 eleazar 735
              	   <?php
1652 eleazar 736
                     $element = $form->get('coment');
1649 eleazar 737
                     $element->setAttributes(['class' => 'form-control']);
1657 eleazar 738
                     $element->setOptions(['label' => 'LABEL_COMMENT']);
1649 eleazar 739
                     echo $this->formLabel($element);
740
                     echo $this->formTextArea($element);
741
                    ?>
742
      	        </div>
743
                  <div class="form-group">
1631 eleazar 744
                    <?php
1658 eleazar 745
                    $element = $form->get('evaluation');
1649 eleazar 746
                    $element->setAttributes(['class' => 'form-control']);
1658 eleazar 747
                    $element->setOptions(['label' => 'LABEL_EVALUATION']);
1649 eleazar 748
                    echo $this->formLabel($element);
749
                    echo $this->formSelect($element);
750
                    ?>
751
                </div>
752
                <div class="form-group">
753
                    <?php
1616 eleazar 754
                    $element = $form->get('file');
1631 eleazar 755
 
756
                    $element->setAttributes(['class' => 'form-control', 'accept' => 'pdf/docx']);
1616 eleazar 757
                    $element->setOptions(['label' => 'LABEL_CURRICULUM']);
758
                    echo $this->formLabel($element);
759
                    ?>
760
                    <div class="file-loading">
1631 eleazar 761
                        <?php echo $this->formFile($element); ?>
1616 eleazar 762
                    </div>
1631 eleazar 763
                </div>
1619 eleazar 764
 
1631 eleazar 765
                <div class="form-group">
766
                    <?php
767
                    $element = $form->get('status');
768
                    $element->setAttributes(['class' => 'form-control']);
769
                    $element->setOptions(['label' => 'LABEL_STATUS']);
770
                    echo $this->formLabel($element);
771
                    echo $this->formSelect($element);
1619 eleazar 772
                    ?>
1631 eleazar 773
                </div>
774
            </div>
775
            <div class="modal-footer">
776
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
777
                <button type="button" class="btn btn-default btn-add-cancel">LABEL_CANCEL</button>
778
            </div>
779
            <?php echo $this->form()->closeTag($form); ?>
780
        </div>
781
    </div>
1485 eleazar 782
</div>