Proyectos de Subversion LeadersLinked - Backend

Rev

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