Proyectos de Subversion LeadersLinked - Backend

Rev

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