Proyectos de Subversion LeadersLinked - Backend

Rev

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