Proyectos de Subversion LeadersLinked - Backend

Rev

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