Proyectos de Subversion LeadersLinked - Backend

Rev

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