Proyectos de Subversion LeadersLinked - Backend

Rev

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