Proyectos de Subversion LeadersLinked - Backend

Rev

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