Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 1388 | Rev 1390 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1384 efrain 1
<?php
2
$acl = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser = $this->currentUserHelper();
4
 
5
$roleName = $currentUser->getUserTypeId();
6
 
7
$routeAdd = $this->url('recruitment-and-selection/forms/add');
8
$routeDatatable = $this->url('recruitment-and-selection/forms');
9
$routeDashboard = $this->url('dashboard');
10
 
11
$allowAdd = $acl->isAllowed($roleName, 'recruitment-and-selection/forms/add') ? 1 : 0;
12
$allowEdit = $acl->isAllowed($roleName, 'recruitment-and-selection/forms/edit') ? 1 : 0;
13
$allowDelete = $acl->isAllowed($roleName, 'recruitment-and-selection/forms/delete') ? 1 : 0;
14
 
15
 
16
$this->inlineScript()->appendFile('https://maps.googleapis.com/maps/api/js?key=' . $google_map_key . '&libraries=places');
17
 
18
 
19
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
20
 
21
 
22
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
23
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
24
 
25
 
26
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
27
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
28
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
29
 
30
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
31
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
32
 
33
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
34
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
35
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
36
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
37
 
38
 
39
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.min.css'));
40
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css'));
41
 
42
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.full.min.js'));
43
 
44
$this->inlineScript()->appendFile($this->basePath('plugins/moment/moment-with-locales.min.js'));
45
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css'));
46
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'));
47
 
48
 
49
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
50
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
51
 
52
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
53
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
54
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-input-number/input-number-format.jquery.js'));
55
 
56
// bootbox Alert //
57
$this->inlineScript()->appendFile($this->basePath('plugins/bootbox/bootbox.min.js'));
58
 
59
// JsRender //
60
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
61
 
62
 
63
// Page Styles
64
$this->headLink()->appendStylesheet($this->basePath('css/pages/self-evaluation.css'));
65
 
66
 
1388 eleazar 67
$status_active = \LeadersLinked\Model\RecruitmentSelectionVacancy::STATUS_ACTIVE;
68
$status_inactive = \LeadersLinked\Model\RecruitmentSelectionVacancy::STATUS_INACTIVE;
1384 efrain 69
 
70
$this->inlineScript()->captureStart();
71
echo <<<JS
72
jQuery(document).ready(function($) {
73
    var allowEdit = $allowEdit;
74
    var allowDelete = $allowDelete;
75
    var sections = [];
76
    var competencies_type = [];
77
    /**
78
     * Get rows and set data table
79
     */
80
    var tableForm = $('#gridTable').dataTable({
81
        'processing': true,
82
        'serverSide': true,
83
        'searching': true,
84
        'order': [
85
            [0, 'asc']
86
        ],
87
        'ordering': true,
88
        'ordenable': true,
89
        'responsive': true,
90
        'select': false,
91
        'paging': true,
92
        'pagingType': 'simple_numbers',
93
        'ajax': {
94
            'url': '$routeDatatable',
95
            'type': 'get',
96
            'beforeSend': function(request) {
97
                NProgress.start();
98
            },
99
            'dataFilter': function(response) {
100
                var response = jQuery.parseJSON(response);
101
                var json = {};
102
                json.recordsTotal = 0;
103
                json.recordsFiltered = 0;
104
                json.data = [];
105
                if (response.success) {
106
                    json.recordsTotal = response.data.total;
107
                    json.recordsFiltered = response.data.total;
108
                    json.data = response.data.items;
109
                } else {
110
                    $.fn.showError(response.data)
111
                }
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
                            tableForm.fnDraw();
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
            });
169
        },
170
        'aoColumns': [{
171
                'mDataProp': 'name'
172
            },
173
            {
174
                'mDataProp': 'job_description'
175
            },
176
            {
177
                'mDataProp': 'status'
178
            },
179
            {
180
                'mDataProp': 'actions'
181
            },
182
        ],
183
        'columnDefs': [{
184
                'targets': 0,
185
                'className': 'text-vertical-middle',
186
            },
187
            {
188
                'targets': 1,
189
                'className': 'text-vertical-middle',
190
            },
191
            {
192
                'targets': -2,
193
                'orderable': false,
194
                'className': 'text-center',
195
                'render': function(data, type, row) {
196
                    checked = data == 'a' ? ' checked="checked" ' : '';
197
                    return '<div class="checkbox checkbox-success">' +
198
                        '<input class="styled" type="checkbox" ' + checked + ' disabled="disabled">' +
199
                        '<label ></label></div>';
200
                }
201
            },
202
            {
203
                'targets': -1,
204
                'orderable': false,
205
                'render': function(data, type, row) {
206
                    s = '';
207
                    if (allowEdit) {
208
                        s = s + '<button class="btn btn-primary btn-edit-form" data-href="' + data['link_edit'] + '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pencil"></i> LABEL_EDIT </button>&nbsp;';
209
                    }
210
                    if (allowDelete) {
211
                        s = s + '<button class="btn btn-danger btn-delete" data-href="' + data['link_delete'] + '" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> LABEL_DELETE </button>&nbsp;';
212
                    }
213
                    if (allowReport) {
214
                        s = s + '<a class="btn btn-default btn-pdf" href="' + data['link_report'] + '" target="_blank" data-toggle="tooltip" title="LABEL_PDF"><i class="fa fa-file-o"></i> LABEL_PDF </button>&nbsp;';
215
                    }
216
                    return s;
217
                }
218
            }
219
        ],
220
    });
221
 
222
 
223
 
224
    /**
225
     * Clicked on edit form
226
     */
227
    $('body').on('click', 'button.btn-edit-form', function(e) {
228
        e.preventDefault();
229
        renderCompetenciesData([]);
230
        form_id = $(this).data('id')
231
        var action = $(this).data('href');
232
        $.ajax({
233
            'dataType': 'json',
234
            'accept': 'application/json',
235
            'method': 'get',
236
            'url': action,
237
        }).done(function(response) {
238
            if (response['success']) {
239
                $("#rows").html('');
240
                sections = [];
241
                $('#form-main').attr('action', action);
242
                $('#form-main #form-name').val(response['data']['name']);
243
                $('#form-main #form-location').val(response['data']['location']);
244
                $('#form-main #job_description_id').val(response['data']['job_description_id']).trigger('change');
245
                $('#form-main #job_category_id').val(response['data']['job_category_id']).trigger('change');
246
                $('#form-main #industry_id').val(response['data']['industry_id']).trigger('change');
247
                $('#form-main #form-status').val(response['data']['status']);
248
                CKEDITOR.instances['form-description'].setData(response['data']['description']);
249
 
1389 eleazar 250
 
1384 efrain 251
            } else {
252
                $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
253
            }
254
        }).fail(function(jqXHR, textStatus, errorThrown) {
255
            $.fn.showError(textStatus);
256
        });
257
    });
1389 eleazar 258
 
259
 
1384 efrain 260
    /**
261
     * Clicked new Form
262
     */
263
    $('button.btn-add-form').click(function(e) {
264
        $("#rows").html('');
265
        sections = [];
266
        $('#form-main').attr('action', '$routeAdd');
267
        $('#form-main #form-name').val('');
268
        $('#form-main #form-location').val('');
269
        $('#form-main #job_description_id').val('').trigger('change');
270
        $('#form-main #job_category_id').val('').trigger('change');
271
        $('#form-main #industry_id').val('').trigger('change');
272
        $('#form-main #form-status').val('$status_active');
273
        CKEDITOR.instances['form-description'].setData('');
274
        renderCompetenciesData([]);
275
        $('#row-lists').hide();
276
        $('#row-form').show();
277
        $('#form-main #form-name').focus();
278
        return;
279
    });
280
 
281
 
282
    $.validator.addMethod('checkLocation', function (value, element, param) {
283
        var otherElement = $(param);
284
 
285
        return $.trim(otherElement.val()).length > 0;
286
    }, 'ERROR_PLACED_AUTOCOMPLETE_DOES_NOT_CONTAIN_GEOMETRY');
287
 
288
    var autocompleteLocation = new google.maps.places.Autocomplete(
289
        (document.getElementById('location_search')),
290
        {types: ['(cities)']}
291
    );
292
 
293
    /**
294
     * Clicked cancel new/edit Form
295
     */
296
    $('button.btn-edit-cancel').click(function(e) {
297
        $('#row-form').hide();
298
        $('#row-lists').show();
299
        return;
300
    });
301
    /**
302
     * Clicked save and continue new Form
303
     */
304
    $('button.btn-form-save-continue').click(function(e) {
305
        for (var instanceName in CKEDITOR.instances) {
306
            CKEDITOR.instances[instanceName].updateElement();
307
        }
308
        saveData(1);
309
    });
310
    /**
311
     * Clicked save and close new/edit Form
312
     */
313
    $('button.btn-form-save-close').click(function(e) {
314
        for (var instanceName in CKEDITOR.instances) {
315
            CKEDITOR.instances[instanceName].updateElement();
316
        }
317
        saveData(0);
318
    });
319
    /**
320
     * Save Form Data
321
     */
322
    const saveData = (action) => {
323
        if ($('#form-name').val() == '') {
324
            $.fn.showError('ERROR_ENTER_NAME');
325
        } else if ($('#form-description').val() == '') {
326
            $.fn.showError('ERROR_ENTER_DESCRIPTION');
327
        } else if ($('#form-category').val() == '') {
328
            $.fn.showError('ERROR_ENTER_CATEGORY');
329
        } else if ($('#form-industry').val() == '') {
330
            $.fn.showError('ERROR_ENTER_INDUSTRY');
331
        } else if ($('#form-text').val() == '') {
332
            $.fn.showError('ERROR_ENTER_TEXT');
333
        } else if ($('#form-status').val() == '') {
334
            $.fn.showError('ERROR_SELECT_STATUS');
335
        } else if ($('#job_description_id').val() == '') {
336
            $.fn.showError('ERROR_SELECT_JOB_DESCRIPTION');
337
        } else if (sections.length == 0) {
338
            $.fn.showError('ERROR_NOT_SECTIONS');
339
        } else {
340
            $.ajax({
341
                'dataType': 'json',
342
                'method': 'post',
343
                'url': $('#form-main').attr('action'),
344
                'data': {
345
                    'name': $('#form-main #form-name').val(),
346
                    'job_description_id': $('#form-main #job_description_id').val(),
347
                    'location' :$('#form-main #form-location').val(),
348
                    'job_category_id' :$('#form-main #job_category_id').val(),
349
                    'industry_id' :$('#form-main #industry_id').val(),
350
                    'status': $('#form-main #form-status').val(),
351
                    'description': $('#form-main #form-description').val(),
352
                    'content': JSON.stringify(sections)
353
                },
354
            }).done(function(response) {
355
                if (response['success']) {
356
                    $.fn.showSuccess(response['data']);
357
                    if (action == 1) {
358
                        $('#form-main').attr('action', response['action_edit']);
359
                    } else {
360
                        $('#row-form').hide();
361
                        $('#row-lists').show();
362
                        /*---------- Reset Form -------- */
363
                        $('#form-main')[0].reset();
364
                        /*--------Reset Sections ----------*/
365
                        sections = [];
366
                        tableForm.fnDraw();
367
                    }
368
                    return;
369
                } else {
370
                    $.fn.showError(response['message'] || 'ERROR_UNKNOWN');
371
                    return;
372
                }
373
            });
374
        }
375
    }
376
    /**
377
     * Remove Html Tags
378
     */
379
    const removeTags = (str) => str.toString().replace(/(<([^>]+)>)/ig, '')
1389 eleazar 380
 
381
 
1384 efrain 382
    /**
383
     * Remove Option
384
     */
385
    const removeOption = (id_section, id) => {
386
        sections.map((item) => {
387
            if (item.id_section == id_section) {
388
                item.options = item.options.filter((opt) => opt.id_option != id) || []
389
            }
390
        });
391
        return renderData(sections);
392
    }
393
    /**
394
     * Clicked refresh button
395
     */
396
    $('button.btn-refresh').click(function(e) {
397
        tableForm.fnDraw();
398
        return;
399
    });
400
    /**
401
     * Initialize select Jobdescription
402
     */
403
    $('#job_description_id').select2({
404
        theme: 'bootstrap4',
405
        width: '100%',
406
    });
407
 
408
    /**
409
     * On change selecte JobDescription
410
     */
411
    $('#job_description_id').on('change', function() {
412
        if ($("#job_description_id").val() != '') {
413
            $.getJSON("/settings/jobs-description/edit/" + $("#job_description_id").val(), function(response) {
414
                if (response['success']) {
415
                    competencies_type = response['data']['competency_types'];
416
                    renderCompetenciesData(response['data']['competencies_selected']);
417
                }
418
            });
419
        }
420
    });
421
 
422
     /**
423
     * Initialize select Jobcategory
424
     */
425
    $('#job_category_id').select2({
426
        theme: 'bootstrap4',
427
        width: '100%',
428
    });
429
     /**
430
     * On change selecte Jobcategory
431
     */
432
    $('#job_category_id').on('change', function() {
433
        if ($("#job_category_id").val() != '') {
434
            $.getJSON("/settings/job-categories/edit/" + $("#job_category_id").val(), function(response) {
435
                if (response['success']) {
436
                    competencies_type = response['data']['competency_types'];
437
                    renderCompetenciesData(response['data']['competencies_selected']);
438
                }
439
            });
440
        }
441
    });
442
 
443
     /**
444
     * Initialize select industry
445
     */
446
    $('#industry_id').select2({
447
        theme: 'bootstrap4',
448
        width: '100%',
449
    });
450
      /**
451
     * On change selecte industry
452
     */
453
    $('#industry_id').on('change', function() {
454
        if ($("#industry_id").val() != '') {
455
            $.getJSON("/settings/industries/edit/" + $("#industry_id").val(), function(response) {
456
                if (response['success']) {
457
                    competencies_type = response['data']['competency_types'];
458
                    renderCompetenciesData(response['data']['competencies_selected']);
459
                }
460
            });
461
        }
462
    });
463
     /**
464
     * Initialize select Location
465
     */
466
 
467
    var validatorLocation = $('#form-location').validate({
468
        debug: true,
469
        onclick: false,
470
        onkeyup: false,
471
        onfocusout: false,
472
        ignore: [],
473
        rules: {
474
            'location_search': {
475
                required: true,
476
                checkLocation: '#form-location #latitude'
477
            }
478
        },
479
        submitHandler: function(form)
480
        {
481
            NProgress.start();
482
            $.ajax({
483
                'dataType'  : 'json',
484
                'accept'    : 'application/json',
485
                'method'    : 'post',
486
                'url'       :  route_location,
487
                'data'      :  $('#form-location').serialize(),
488
            }).done(function(response) {
489
 
490
 
491
 
492
                if(response['success']) {
493
                    $('#overview-location').html(response.data);
494
                    $("#location-box").modal('hide');
495
                } else {
496
                    validatorLocation.resetForm();
497
                    $.fn.showError(response['data']);
498
                }
499
            }).fail(function( jqXHR, textStatus, errorThrown) {
500
                $.fn.showError(textStatus);
501
            }).always(function() {
502
                NProgress.done();
503
            });
504
            return false;
505
        },
506
        invalidHandler: function(form, validator) {
507
 
508
        }
509
    });
510
 
511
    $('body').on('click', 'a.btn-location-edit', function(e) {
512
        e.preventDefault();
513
 
514
        $('#form-location #location_search').val('');
515
        $('#form-location #formatted_address').val('');
516
        $('#form-location #address1').val('');
517
        $('#form-location #address2').val('');
518
        $('#form-location #country').val('');
519
        $('#form-location #state').val('');
520
        $('#form-location #city1').val('');
521
        $('#form-location #city2').val('');
522
        $('#form-location #postal_code').val('');
523
        $('#form-location #latitude').val('');
524
        $('#form-location #longitude').val('');
525
        validatorLocation.resetForm();
526
 
527
        $("#location-box").modal('show');
528
    });
529
 
530
    $('.btn-location-close').on("click", function(e){
531
        e.preventDefault();
532
 
533
        $("#location-box").modal('hide');
534
        return false;
535
    });
1389 eleazar 536
 
1384 efrain 537
JS;
538
 
539
$this->inlineScript()->captureEnd();
540
?>
541
<!-- Content Header (Page header) -->
542
<section class="content-header">
543
   <div class="container-fluid">
544
      <div class="row mb-2">
545
         <div class="col-sm-12">
546
            <h1>LABEL_RECRUITMENT_AND_SELECTION</h1>
547
         </div>
548
      </div>
549
   </div>
550
   <!-- /.container-fluid -->
551
</section>
552
<section class="content">
553
<div class="container-fluid" id="row-lists">
554
   <div class="row">
555
      <div class="col-12">
556
         <div class="card">
557
            <div class="card-body">
558
               <table id="gridTable" class="table   table-hover">
559
                  <thead>
560
                     <tr>
561
                        <th style="width:25%">LABEL_NAME</th>
562
                        <th style="width:20%">LABEL_JOB_DESCRIPTION</th>
563
                        <th style="width:10%">LABEL_ACTIVE</th>
564
                        <th style="width:25%">LABEL_ACTIONS</th>
565
                     </tr>
566
                  </thead>
567
                  <tbody></tbody>
568
               </table>
569
            </div>
570
            <div class="card-footer clearfix">
571
               <div style="float:right;">
572
                  <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
573
                  <?php if ($allowAdd) : ?>
574
                  <button type="button" class="btn btn-primary btn-add-form"><i class="fa fa-plus"></i> LABEL_ADD </button>
575
                  <?php endif; ?>
576
               </div>
577
            </div>
578
         </div>
579
      </div>
580
   </div>
581
</div>
582
<!-- Create/Edit Form -->
583
<div class="row" id="row-form" style="display: none; padding: 16px;">
584
   <div class="col-xs-12 col-md-12">
585
      <form action="#" name="form-main" id="form-main">
586
         <div class="form-group">
587
            <label for="form-name">LABEL_FIRST_NAME</label>
588
            <input type="text" name="form-name" id="form-name" class="form-control" maxlength="50" />
589
         </div>
590
         <div class="form-group">
591
            <label for="job_description_id">LABEL_POSITION_EVALUATED</label>
592
            <select name="job_description_id" id="job_description_id" class="form-control">
593
               <option value="">LABEL_SELECT</option>
594
               <?php foreach ($jobsDescription as $rs): ?>
595
               <option value="<?php echo $rs->uuid;?>"><?php echo $rs->name;?></option>
596
               <?php endforeach; ?>
597
            </select>
598
         </div>
599
         <div class="form-group">
600
            <label for="form-location">LABEL_LOCATION</label>
601
            <input type="text" name="form-location" id="location_search" class="form-control" maxlength="50" />
602
         </div>
603
         <div class="form-group">
604
            <label for="job_category_id">LABEL_JOB_CATEGORY</label>
605
            <select name="job_category_id" id="job_category_id" class="form-control">
606
               <option value="">LABEL_SELECT</option>
607
               <?php foreach ($jobCategory as $rs): ?>
608
               <option value="<?php echo $rs->uuid;?>"><?php echo $rs->name;?></option>
609
               <?php endforeach; ?>
610
            </select>
611
         </div>
612
         <div class="form-group">
613
            <label for="job_description_id">LABEL_INDUSTRY</label>
614
            <select name="job_description_id" id="job_description_id" class="form-control">
615
               <option value="">LABEL_SELECT</option>
616
               <?php foreach ($industry as $rs): ?>
617
               <option value="<?php echo $rs->uuid;?>"><?php echo $rs->name;?></option>
618
               <?php endforeach; ?>
619
            </select>
620
         </div>
621
            <label for="form-description">LABEL_DESCRIPTION</label>
622
            <!--  ckeditor -->
623
            <textarea  name="form-description" id="form-description" rows="5" class="ckeditor form-control"></textarea>
624
         </div>
625
         <div class="form-group">
626
            <label for="form-status">LABEL_STATUS</label>
627
            <select name="form-status" id="form-status" class="form-control">
628
               <option value="<?php echo $status_inactive; ?>">LABEL_INACTIVE</option>
629
               <option value="<?php echo $status_active; ?>">LABEL_ACTIVE</option>
630
            </select>
631
         </div>
632
         <div class="row">
633
            <div class="col-xs-12 col-md-12 text-right">
634
               <button type="button" class="btn btn-primary" id="btn-add-section" data-toggle="tooltip" title="LABEL_ADD LABEL_SECTION"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_ADD LABEL_SECTION</button>
635
            </div>
636
         </div>
637
         <br />
638
         <div class="row">
639
            <div class="col-xs-12 col-md-12">
640
               <div class="panel-group" id="rows"></div>
641
            </div>
642
         </div>
1389 eleazar 643
 
1384 efrain 644
         <div class="form-group">
645
            <button type="button" form="form-main" class="btn btn-info btn-form-save-continue">LABEL_SAVE & LABEL_CONTINUE</button>
646
            <button type="button" class="btn btn-primary btn-form-save-close">LABEL_SAVE & LABEL_CLOSE</button>
647
            <button type="button" class="btn btn-secondary btn-edit-cancel">LABEL_CANCEL</button>
648
         </div>
649
      </form>
650
   </div>
651
</div>
652
<!-- Create/Edit Form-->
653
<!-- section Modal -->
654
<div  id="modal-section" class="modal" tabindex="-1" role="dialog">
655
   <div class="modal-dialog modal-lg" role="document">
656
      <form action="#" name="form-section" id="form-section">
657
         <input type="hidden" name="id-section" id="id-section" />
658
         <div class="modal-content">
659
            <div class="modal-header">
660
               <h4 class="modal-title">LABEL_ADD LABEL_SECTION</h4>
661
               <button type="button" class="close" data-dismiss="modal" aria-label="Close">
662
               <span aria-hidden="true">&times;</span>
663
               </button>
664
            </div>
665
            <div class="modal-body">
666
               <div class="form-group">
667
                  <label for="title-section">LABEL_FIRST_NAME</label>
668
                  <input type="text" name="title-section" id="title-section" class="form-control" maxlength="50" value="" />
669
               </div>
670
               <div class="form-group">
671
                  <label for="text-section">LABEL_TEXT</label>
672
                  <textarea  name="text-section" id="text-section" rows="5" class="form-control"></textarea>
673
               </div>
674
               <div class="form-group">
675
                  <label for="type-section">LABEL_TYPE</label>
676
                  <select name="type-section" id="type-section" class="form-control">
677
                     <option value="simple">Simple</option>
678
                     <option value="multiple">Multiple</option>
679
                  </select>
680
               </div>
681
            </div>
682
            <div class="modal-footer">
683
               <button type="button" id="btn-save-section" class="btn btn-primary">LABEL_SAVE</button>
684
               <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
685
            </div>
686
         </div>
687
      </form>
688
   </div>
689
</div>
690
<!-- End Modal section -->
691
<!-- Modal Options -->
692
<div  id="modal-option" class="modal" tabindex="-1" role="dialog">
693
   <div class="modal-dialog modal-lg" role="document">
694
      <form action="#" name="form-option" id="form-option">
695
         <input type="hidden" name="section-option" id="section-option" value="" />
696
         <input type="hidden" name="id-option" id="id-option" value="" />
697
         <div class="modal-content">
698
            <div class="modal-header">
699
               <h4 class="modal-title">LABEL_OPTION</h4>
700
               <button type="button" class="close" data-dismiss="modal" aria-label="Close">
701
               <span aria-hidden="true">&times;</span>
702
               </button>
703
            </div>
704
            <div class="modal-body">
705
               <div class="form-group">
706
                  <label for="text-option">LABEL_TEXT</label>
707
                  <!--  ckeditor -->
708
                  <textarea  name="text-option" id="text-option" rows="5" class="form-control"></textarea>
709
               </div>
710
            </div>
711
            <div class="modal-footer">
712
               <button type="button" class="btn btn-primary" id="btn-save-option">LABEL_SAVE</button>
713
               <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
714
            </div>
715
         </div>
716
      </form>
717
   </div>
718
</div>
719
 
720
   <!-- End Modal Options -->
721
   <!---Template Sections --->
722
   <script id="sectionTemplate" type="text/x-jsrender">
723
   <div class="panel panel-default" id="panel-{{:id_section}}">
724
   <div class="panel-heading">
725
   <h4 class="panel-title" style="font-size: 18px;">
726
         <a class="accordion-toggle" data-toggle="collapse" aria-expanded="true" data-parent="#panel-{{:id_section}}" href="#collapse-{{:id_section}}">
727
         <span class="section-name{{:id_section}}">
728
         {{:title}}
729
         </span>
730
         </a>
731
      </h4>
732
   </div>
733
   <div id="collapse-{{:id_section}}" class="panel-collapse in collapse show">
734
      <div class="panel-body">
735
         <div class="table-responsive">
736
            <table class="table table-bordered">
737
               <thead>
738
                  <tr>
739
                     <th style="width: 10%;">LABEL_ELEMENT</th>
740
                     <th style="width: 30%;">LABEL_TEXT</th>
741
                     <th style="width: 10%;">LABEL_TYPE</th>
742
                     <th style="width: 50%;">LABEL_ACTIONS</th>
743
                  </tr>
744
               </thead>
745
               <tbody>
746
                  <tr>
747
                     <td class="text-left">LABEL_SECTION</td>
748
                     <td class="text-left">{{:title}}</td>
749
                     <td>
750
                        {{if type == 'simple'}} Simple {{/if}}
751
                        {{if type == 'multiple'}} Multiple {{/if}}
752
                     </td>
753
                     <td>
754
                        <button  type="button" class="btn btn-default btn-edit-section" data-section="{{:id_section}}" data-toggle="tooltip"  data-original-title="LABEL_EDIT LABEL_SECTION"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_SECTION </button>
755
                        <button  type="button" class="btn btn-default btn-delete-section" data-section="{{:id_section}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE LABEL_SECTION"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_SECTION </button>
756
                        {{if type == 'multiple'}}
757
                        <button type="button" class="btn btn-default btn-add-option" data-section="{{:id_section}}" data-toggle="tooltip"  data-original-title="LABEL_ADD  LABEL_OPTION"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_ADD  LABEL_OPTION </button>
758
                        {{/if}}
759
                     </td>
760
                  </tr>
761
                  {{for options}}
762
                  <tr >
763
                     <td class="text-left">--LABEL_OPTION</td>
764
                     <td class="text-left">
765
                        {{:title}}
766
                     </td>
767
                     <td></td>
768
                     <td>
769
                        <button type="button"  class="btn btn-default btn-edit-option" data-section="{{:id_section}}" data-option="{{:id_option}}" data-toggle="tooltip"  data-original-title="LABEL_EDIT LABEL_OPTION"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_OPTION</button>
770
                        <button type="button" class="btn btn-default btn-delete-option" data-section="{{:id_section}}" data-option="{{:id_option}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE LABEL_OPTION"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_OPTION</button>
771
                     </td>
772
                  </tr>
773
                  {{/for}}
774
               </tbody>
775
            </table>
776
         </div>
777
      </div>
778
   </div>
779
</div>
780
   </script>
781
   <!-- End Template Sections-->
782
 
783
  <!---Template Competencies --->
784
   <script id="sectionCompetencies" type="text/x-jsrender">
785
   <div class="panel panel-default" id="panel-{{:competency_id}}">
786
   <div class="panel-heading">
787
      <h4 class="panel-title" style="font-size: 18px;">
788
         <a class="accordion-toggle" data-toggle="collapse" aria-expanded="true" data-parent="#panel-{{:competency_id}}" href="#collapse-{{:competency_id}}">
789
         <span class="competency-name{{:competency_id}}">
790
         {{:~getType(competency_type_id).name}} - {{:name}}
791
         </span>
792
         </a>
793
      </h4>
794
   </div>
795
   <div id="collapse-{{:competency_id}}" class="panel-collapse in collapse show">
796
      <div class="panel-body">
797
         <div class="table-responsive">
798
            <table class="table table-bordered">
799
               <thead>
800
                  <tr>
801
                     <th style="width: 80%;">LABEL_CONDUCT</th>
802
                     <th style="width: 20%;">LABEL_LEVEL</th>
803
                  </tr>
804
               </thead>
805
               <tbody>
806
                  {{for behaviors}}
807
                  <tr >
808
                     <td class="text-left">
809
                        {{:description}}
810
                     </td>
811
                     <td>
812
                        {{if level == '0'}} LABEL_NA {{/if}}
813
                        {{if level == '1' }} LABEL_LEVEL_ONE {{/if}}
814
                        {{if level == '2' }} LABEL_LEVEL_TWO {{/if}}
815
                        {{if level == '3' }} LABEL_LEVEL_THREE {{/if}}
816
                        {{if level == '4' }} LABEL_LEVEL_FOUR {{/if}}
817
                     </td>
818
 
819
 
820
                  </tr>
821
                  {{/for}}
822
               </tbody>
823
            </table>
824
         </div>
825
      </div>
826
   </div>
827
</div>
828
   </script>
829
    <!-- End Template Competencies-->
830
 
831
</section>