Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev Autor Línea Nro. Línea
3896 stevensc 1
<?php
1 www 2
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser    = $this->currentUserHelper();
4
 
5
$roleName = $currentUser->getUserTypeId();
6
 
7
 
15443 efrain 8
$routeAdd       = $this->url('jobs-description/competencies/add');
9
$routeDatatable = $this->url('jobs-description/competencies');
10
$routeImport    = $this->url('jobs-description/competencies/import');
1107 geraldo 11
 
15443 efrain 12
$allowAdd       = $acl->isAllowed($roleName, 'jobs-description/competencies/add') ? 1 : 0;
13
$allowEdit      = $acl->isAllowed($roleName, 'jobs-description/competencies/edit') ? 1 : 0;
14
$allowDelete    = $acl->isAllowed($roleName, 'jobs-description/competencies/delete') ? 1 : 0;
15
$allowImport    = $acl->isAllowed($roleName, 'jobs-description/competencies/import') ? 1 : 0;
1 www 16
 
17
 
16822 efrain 18
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
19
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
1 www 20
 
16842 efrain 21
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-maxlength/bootstrap-maxlength.min.js'));
1 www 22
 
23
 
24
 
16929 efrain 25
 
26
 
27
 
16822 efrain 28
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
29
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.css'));
1 www 30
 
16822 efrain 31
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
32
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
33
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/dataTables.responsive.min.js'));
34
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.min.js'));
1 www 35
 
36
 
16822 efrain 37
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
38
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
1 www 39
 
40
 
41
 
42
 
16822 efrain 43
$this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/select2.js'));
44
$this->inlineScript()->appendFile($this->basePath('assets/vendors/select2/js/i18n/es.js'));
45
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2/css/select2.css'));
46
 
16927 efrain 47
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/select2-bootstrap5-theme/select2-bootstrap-5-theme.css'));
16822 efrain 48
 
874 geraldo 49
// JsRender //
16822 efrain 50
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jsrender/jsrender.min.js'));
1 www 51
 
883 geraldo 52
// bootbox Alert //
1 www 53
 
883 geraldo 54
 
16822 efrain 55
 
1 www 56
$status_active = \LeadersLinked\Model\Competency::STATUS_ACTIVE;
57
 
58
$this->inlineScript()->captureStart();
59
echo <<<JS
877 geraldo 60
jQuery(document).ready(function($) {
14989 efrain 61
    var allowEdit = $allowEdit;
62
    var allowDelete = $allowDelete;
63
 
64
 
16929 efrain 65
 
14989 efrain 66
 
863 geraldo 67
    var gridTable = $('#gridTable').dataTable({
68
        'processing': true,
69
        'serverSide': true,
70
        'searching': true,
71
        'order': [
72
            [0, 'asc']
73
        ],
74
        'ordering': true,
75
        'ordenable': true,
76
        'responsive': true,
77
        'select': false,
78
        'paging': true,
79
        'pagingType': 'simple_numbers',
80
        'ajax': {
81
            'url': '$routeDatatable',
82
            'type': 'get',
83
            'beforeSend': function(request) {
84
                NProgress.start();
1 www 85
            },
863 geraldo 86
            'dataFilter': function(response) {
87
                var response = jQuery.parseJSON(response);
88
                var json = {};
89
                json.recordsTotal = 0;
90
                json.recordsFiltered = 0;
91
                json.data = [];
92
                if (response.success) {
93
                    json.recordsTotal = response.data.total;
94
                    json.recordsFiltered = response.data.total;
95
                    json.data = response.data.items;
1 www 96
                } else {
863 geraldo 97
                    $.fn.showError(response.data)
1 www 98
                }
863 geraldo 99
                return JSON.stringify(json);
1 www 100
            }
863 geraldo 101
        },
102
        'language': {
103
            'sProcessing': 'LABEL_DATATABLE_SPROCESSING',
104
            'sLengthMenu': 'LABEL_DATATABLE_SLENGTHMENU',
105
            'sZeroRecords': 'LABEL_DATATABLE_SZERORECORDS',
106
            'sEmptyTable': 'LABEL_DATATABLE_SEMPTYTABLE',
107
            'sInfo': 'LABEL_DATATABLE_SINFO',
108
            'sInfoEmpty': 'LABEL_DATATABLE_SINFOEMPTY',
109
            'sInfoFiltered': 'LABEL_DATATABLE_SINFOFILTERED',
110
            'sInfoPostFix': '',
111
            'sSearch': 'LABEL_DATATABLE_SSEARCH',
112
            'sUrl': '',
113
            'sInfoThousands': ',',
114
            'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
115
            'oPaginate': {
116
                'sFirst': 'LABEL_DATATABLE_SFIRST',
117
                'sLast': 'LABEL_DATATABLE_SLAST',
118
                'sNext': 'LABEL_DATATABLE_SNEXT',
119
                'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
120
            },
121
            'oAria': {
122
                'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
123
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
124
            },
125
        },
4116 stevensc 126
        'drawCallback': function(settings) {
127
            NProgress.done();
16822 efrain 128
 
4116 stevensc 129
        },
863 geraldo 130
        'aoColumns': [{
131
                'mDataProp': 'type'
132
            },
133
            {
134
                'mDataProp': 'name'
135
            },
136
            {
137
                'mDataProp': 'status'
138
            },
139
            {
140
                'mDataProp': 'actions'
141
            },
142
        ],
143
        'columnDefs': [{
144
                'targets': 0,
145
                'className': 'text-vertical-middle',
146
            },
147
            {
148
                'targets': 1,
149
                'className': 'text-vertical-middle',
150
            },
151
            {
152
                'targets': -2,
153
                'orderable': false,
154
                'className': 'text-center',
155
                'render': function(data, type, row) {
16822 efrain 156
                    checked = data == 'a'  ? 'checked' : '';
157
                    return '<div class="form-check">' +
16971 efrain 158
                        '<input type="checkbox" class="form-check-input" disabled="" ' + checked + '>' +
16822 efrain 159
                        '<label class="form-check-label" for="checkCheckedDisabled"></label></div>' ;
1 www 160
                }
161
            },
863 geraldo 162
            {
163
                'targets': -1,
164
                'orderable': false,
165
                'render': function(data, type, row) {
166
                    s = '';
167
                    if (allowEdit) {
16906 efrain 168
                        s = s + '<button class="btn btn-primary btn-edit" data-href="' + data['link_edit'] + '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pen"></i> LABEL_EDIT </button>&nbsp;';
1 www 169
                    }
863 geraldo 170
                    if (allowDelete) {
16822 efrain 171
                        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;';
1 www 172
                    }
863 geraldo 173
                    return s;
1 www 174
                }
863 geraldo 175
            }
176
        ],
177
    });
14989 efrain 178
 
863 geraldo 179
    var validator = $('#form').validate({
180
        debug: true,
181
        onclick: false,
182
        onkeyup: false,
183
        ignore: [],
184
        rules: {
185
            'competency_type_id': {
186
                required: true,
187
            },
188
            'name': {
189
                required: true,
190
                maxlength: 128,
191
            },
192
            'description': {
15443 efrain 193
                maxlength: 512,
863 geraldo 194
                required: true,
1 www 195
            },
863 geraldo 196
            'status': {
197
                required: false,
1 www 198
            },
14989 efrain 199
 
863 geraldo 200
        },
201
        submitHandler: function(form) {
14989 efrain 202
            if ($('input[type="hidden"].behavior_id').length == 0) {
203
                $.fn.showError('ERROR_NOT_OBSERVABLE_BEHAVIOR');
15394 efrain 204
                return false;
205
            }
891 geraldo 206
                $.ajax({
893 geraldo 207
                    'dataType': 'json',
208
                    'accept': 'application/json',
209
                    'method': 'post',
210
                    'url': $('#form').attr('action'),
14989 efrain 211
                    'data': $('#form').serialize(),
893 geraldo 212
                }).done(function(response) {
213
                    NProgress.start();
214
                    if (response['success']) {
215
                        $.fn.showSuccess(response['data']);
216
                        $('#row-form').hide();
217
                        $('#row-list').show();
218
                        gridTable.api().ajax.reload(null, false);
863 geraldo 219
                    } else {
893 geraldo 220
                        validator.resetForm();
221
                        if (jQuery.type(response['data']) == 'string') {
222
                            $.fn.showError(response['data']);
223
                        } else {
224
                            $.each(response['data'], function(fieldname, errors) {
225
                                $.fn.showFormErrorValidator('#form #' + fieldname, errors);
226
                            });
227
                        }
863 geraldo 228
                    }
893 geraldo 229
                }).fail(function(jqXHR, textStatus, errorThrown) {
230
                    $.fn.showError(textStatus);
231
                }).always(function() {
232
                    NProgress.done();
233
                });
15394 efrain 234
 
235
 
863 geraldo 236
        },
237
        invalidHandler: function(form, validator) {}
238
    });
14989 efrain 239
 
863 geraldo 240
    $('body').on('click', 'button.btn-add', function(e) {
241
        e.preventDefault();
14989 efrain 242
        NProgress.start();
243
 
244
 
245
        $.ajax({
246
            'dataType': 'json',
247
            'method': 'get',
248
            'url': '$routeAdd',
249
        }).done(function(response) {
250
            if (response['success']) {
251
 
252
                $('#table-behaviors tbody').empty();
253
 
254
                $('#select-behavior').children().not(':first').remove();
255
                $.each(response['data']['behaviors'], function(index, element) {
256
                    $('#select-behavior').append($('<option>', {
257
                        value: element.id,
258
                        text: element.description
259
                    }));
260
                });
261
 
262
 
16840 efrain 263
 
14989 efrain 264
                $('#form').attr('action', '$routeAdd');
265
                $('#form #name').val('');
266
                $('#form #competency_type_id').val('').trigger('change');
267
                $('#form #status').bootstrapToggle('on');
15443 efrain 268
                 $('#form #description').val('');
14989 efrain 269
 
270
                validator.resetForm();
271
 
272
                $('#row-form').show();
273
                $('#row-list').hide();
274
            } else {
275
                $.fn.showError(response['data']);
276
            }
277
        }).fail(function(jqXHR, textStatus, errorThrown) {
278
            $.fn.showError(textStatus);
279
        }).always(function() {
280
            NProgress.done();
281
        });
282
 
283
 
284
 
285
 
863 geraldo 286
        return false;
287
    });
14989 efrain 288
 
863 geraldo 289
    $('body').on('click', 'button.btn-edit', function(e) {
290
        e.preventDefault();
16822 efrain 291
 
863 geraldo 292
        NProgress.start();
293
        var action = $(this).data('href');
294
        $.ajax({
295
            'dataType': 'json',
296
            'method': 'get',
297
            'url': action,
298
        }).done(function(response) {
299
            if (response['success']) {
16840 efrain 300
 
863 geraldo 301
                $('#form').attr('action', action);
302
                $('#form #name').val(response['data']['name']);
303
                $('#form #competency_type_id').val(response['data']['competency_type_id']).trigger('change');
304
                $('#form #status').bootstrapToggle(response['data']['status'] == '$status_active' ? 'on' : 'off')
15443 efrain 305
                $('#form #description').val(response['data']['description']);
14989 efrain 306
 
307
 
308
                $('input[type="hidden"].behavior').remove();
309
                $('#select-behavior').children().not(':first').remove();
310
 
311
 
312
                $('#table-behaviors tbody').empty();
313
 
314
                $.each(response['data']['behaviors'], function(index, element) {
315
                    $('#select-behavior').append($('<option>', {
316
                        value: element.id,
317
                        text: element.description
318
                    }));
319
 
320
                    if(element.checked ) {
321
                        let data = {
322
                            id : element.id,
323
                            description : element.description,
324
                        };
325
 
326
                        $('#table-behaviors tbody').append(
327
                            $('#trBehaviorTemplate').render( data )
328
                        );
329
 
330
 
331
                    }
332
                 });
333
 
334
 
335
 
336
 
863 geraldo 337
                validator.resetForm();
866 geraldo 338
                $('#row-form').show();
873 geraldo 339
                $('#row-list').hide();
863 geraldo 340
            } else {
341
                $.fn.showError(response['data']);
342
            }
343
        }).fail(function(jqXHR, textStatus, errorThrown) {
344
            $.fn.showError(textStatus);
345
        }).always(function() {
346
            NProgress.done();
28 efrain 347
        });
863 geraldo 348
        return false;
349
    });
14989 efrain 350
 
863 geraldo 351
    $('body').on('click', 'button.btn-refresh', function(e) {
352
        e.preventDefault();
353
        gridTable.api().ajax.reload(null, false);
354
        return false;
355
    });
14989 efrain 356
 
16822 efrain 357
    $('body').on('click', 'button.btn-delete', function(e) {
358
        e.preventDefault();
359
        var action = $(this).data('href');
360
 
361
 
362
          swal.fire({
363
            title: 'LABEL_ARE_YOU_SURE',
364
            icon: 'question',
365
            cancelButtonText: 'LABEL_NO',
366
            showCancelButton: true,
367
            confirmButtonText: 'LABEL_YES'
368
          }).then((result) => {
369
            if (result.isConfirmed) {
370
 
371
                    NProgress.start();
372
                    $.ajax({
373
                        'dataType'  : 'json',
374
                        'accept'    : 'application/json',
375
                        'method'    : 'post',
376
                        'url'       :  action,
377
                    }).done(function(response) {
378
                        if(response['success']) {
379
                            $.fn.showSuccess(response['data']);
380
                            gridTable.api().ajax.reload(null, false);
381
                        } else {
382
                            $.fn.showError(response['data']);
383
                        }
384
                    }).fail(function( jqXHR, textStatus, errorThrown) {
385
                        $.fn.showError(textStatus);
386
                    }).always(function() {
387
                        NProgress.done();
388
                    });
389
            }
390
       });
391
    });
392
 
393
 
863 geraldo 394
    $('body').on('click', 'button.btn-import', function(e) {
395
        e.preventDefault();
396
        NProgress.start();
397
        $.ajax({
398
            'dataType': 'json',
399
            'method': 'post',
400
            'url': '$routeImport',
401
        }).done(function(response) {
402
            if (response['success']) {
403
                $.fn.showSuccess(response['data']);
404
                gridTable.api().ajax.reload(null, false);
405
            } else {
406
                $.fn.showError(response['data']);
407
            }
408
        }).fail(function(jqXHR, textStatus, errorThrown) {
409
            $.fn.showError(textStatus);
410
        }).always(function() {
411
            NProgress.done();
1 www 412
        });
863 geraldo 413
        return false;
414
    });
14989 efrain 415
 
863 geraldo 416
    $('body').on('click', 'button.btn-cancel', function(e) {
417
        e.preventDefault();
14989 efrain 418
        $('#row-form').hide();
419
        $('#row-list').show();
863 geraldo 420
    });
14989 efrain 421
 
863 geraldo 422
    $('#form #competency_type_id').select2({
16918 efrain 423
        theme: 'bootstrap-5',
863 geraldo 424
        width: '100%',
425
    });
1226 geraldo 426
 
14989 efrain 427
    $('#select-behavior').select2({
16918 efrain 428
        theme: 'bootstrap-5',
1226 geraldo 429
        width: '100%',
430
    });
431
 
863 geraldo 432
    $('#form #status').bootstrapToggle({
433
        'on': 'LABEL_ACTIVE',
434
        'off': 'LABEL_INACTIVE',
435
        'width': '160px',
436
        'height': '40px'
437
    });
15443 efrain 438
 
439
    $('#form #description').maxlength({
440
        alwaysShow: true,
441
        validate: true
3842 stevensc 442
    });
14989 efrain 443
 
444
 
15443 efrain 445
 
14989 efrain 446
    $('body').on('click', 'button.btn-remove-behavior', function(e) {
862 geraldo 447
        e.preventDefault();
14989 efrain 448
 
449
        var key = '#tr_behavior_id_' + $(this).data('id');
450
        var element = $(key);
451
        if(element) {
452
            $(element).remove();
453
        }
454
 
455
        return false;
456
 
862 geraldo 457
    });
14989 efrain 458
 
459
    $('#btn-select-behavior').click(function(e) {
460
        e.preventDefault();
461
 
16842 efrain 462
 
463
 
14989 efrain 464
        var id  = $('#select-behavior option:selected').val();
16842 efrain 465
 
15036 stevensc 466
 
14989 efrain 467
        if(!id) {
468
            return false;
863 geraldo 469
        }
14989 efrain 470
 
471
        var description = $('#select-behavior option:selected').text();
472
        var key         = '#tr_behavior_id_' + id ;
16842 efrain 473
        var element     = $(key)
14989 efrain 474
 
475
        if(element.length > 0) {
476
            $.fn.showError( 'ERROR_BEHAVIOR_WAS_PREVIOUSLY_ADDED');
477
            return false;
478
        }
479
 
16842 efrain 480
 
481
        if(description.length > 50) {
482
           description = description.substr(0, 50) + '...';
483
        }
484
 
14989 efrain 485
        let data = {
486
            id : id,
487
            description : description,
488
        };
489
 
490
        $('#table-behaviors tbody').append(
491
            $('#trBehaviorTemplate').render( data )
492
        );
493
 
494
        return false;
495
 
496
 
497
 
862 geraldo 498
    });
14989 efrain 499
 
500
 
501
 
16842 efrain 502
    $('button.btn-cancel').click(function(e) {
873 geraldo 503
        e.preventDefault();
504
        $('#row-form').hide();
505
        $('#row-list').show();
506
    });
14989 efrain 507
 
508
 
509
 
510
 
863 geraldo 511
});
1115 geraldo 512
 
1 www 513
JS;
514
$this->inlineScript()->captureEnd();
515
?>
3896 stevensc 516
 
16822 efrain 517
<div class="container">
16842 efrain 518
	<div class="card" id="row-list">
519
 
520
	 	<div class="card-body">
521
	 		<h6 class="card-title">LABEL_COMPETENCIES</h6>
522
	 		<div class="row">
523
	 	         <div class="col-12 mt-3">
16845 efrain 524
	 	         <table id="gridTable" class="table   table-bordered">
3896 stevensc 525
                            <thead>
526
                                <tr>
527
                                    <th>LABEL_TYPE</th>
528
                                    <th>LABEL_NAME</th>
529
                                    <th>LABEL_ACTIVE</th>
530
                                    <th>LABEL_ACTIONS</th>
531
                                </tr>
532
                            </thead>
533
                            <tbody>
534
                            </tbody>
16842 efrain 535
                        </table>
536
	 	         </div>
537
	 	     </div>
538
	 	</div>
539
	 	<div class="card-footer text-right">
3896 stevensc 540
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
541
                            <?php if ($allowImport) : ?>
542
                                <button type="button" class="btn btn-primary btn-import"><i class="fa fa-upload"></i> LABEL_IMPORT </button>
543
                            <?php endif; ?>
544
                            <?php if ($allowAdd) : ?>
545
                                <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
546
                            <?php endif; ?>
16842 efrain 547
	 	</div>
548
	</div>
549
 
550
	<div class="card" id="row-form" style="display: none">
551
	 	                        <?php
3896 stevensc 552
                        $form = $this->form;
553
                        $form->setAttributes([
554
                            'method'    => 'post',
555
                            'name'      => 'form',
556
                            'id'        => 'form'
557
                        ]);
558
 
559
                        $form->prepare();
560
                        echo $this->form()->openTag($form);
561
                        ?>
16842 efrain 562
	 	<div class="card-body">
563
	 		<h6 class="card-title">LABEL_COMPETENCIES</h6>
564
	 		<div class="row">
565
	 	         <div class="col-12 mt-3">
566
	 	   			<?php
3896 stevensc 567
                                    $element = $form->get('competency_type_id');
568
                                    $element->setOptions(['label' => 'LABEL_TYPE']);
569
 
570
                                    echo $this->formLabel($element);
571
                                    echo $this->formSelect($element);
572
                                    ?>
16842 efrain 573
          		</div>
574
         	</div>
575
			<div class="row">
576
	 	         <div class="col-12 mt-3">
3896 stevensc 577
                                    <?php
578
                                    $element = $form->get('name');
579
                                    $element->setOptions(['label' => 'LABEL_NAME']);
580
                                    $element->setAttributes(['class' => 'form-control']);
581
 
582
                                    echo $this->formLabel($element);
583
                                    echo $this->formText($element);
584
                                    ?>
585
                                </div>
586
                            </div>
16842 efrain 587
			<div class="row">
588
	 	         <div class="col-12 mt-3">
3896 stevensc 589
                                    <label>LABEL_STATUS</label>
590
                                    <br />
591
                                    <?php
592
                                    $element = $form->get('status');
593
                                    $element->setOptions(['label' => 'LABEL_STATUS']);
594
                                    // echo $this->formLabel($element);
595
                                    echo $this->formCheckbox($element);
596
                                    ?>
597
                                </div>
598
                            </div>
16842 efrain 599
			<div class="row">
600
	 	         <div class="col-12 mt-3">
3896 stevensc 601
                                    <?php
602
                                    $element = $form->get('description');
603
                                    $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
604
                                    $element->setAttributes(['class' => 'form-control']);
605
 
606
                                    echo $this->formLabel($element);
607
                                    echo $this->formTextArea($element);
608
                                    ?>
609
                                </div>
610
                            </div>
14989 efrain 611
 
16842 efrain 612
			<div class="row">
613
	 	         <div class="col-8 mt-3">
614
					<select name="select-behavior" id="select-behavior" >
615
                   		<option value="">LABEL_SELECT</option>
616
                  	</select>
617
         		</div>
618
         		<div class="col-4 mt-3">
619
                 	<button type="button" class="btn btn-primary" id="btn-select-behavior" data-toggle="tooltip" title="LABEL_ADD LABEL_BEHAVIOR">LABEL_ADD LABEL_BEHAVIOR</button>
620
       			</div>
621
 
622
     		</div>
623
			<div class="row">
624
	 	         <div class="col-12 mt-3">
3896 stevensc 625
                            <div class="table-responsive">
14989 efrain 626
                                <table id="table-behaviors" class="table table-bordered">
3896 stevensc 627
                                    <thead>
628
                                        <tr>
629
                                            <th style="width: 60%;">LABEL_DESCRIPTION</th>
630
                                            <th style="width: 20%;">LABEL_ACTIONS</th>
631
                                        </tr>
632
                                    </thead>
14989 efrain 633
                                    <tbody >
634
                                    </tbody>
3896 stevensc 635
                                </table>
636
                            </div>
16842 efrain 637
 
638
    	 	     </div>
639
    	 	</div>
640
    	 </div>
641
	 	<div class="card-footer text-right">
642
	 	      <button type="submit" form="form" class="btn btn-primary">LABEL_SAVE</button>
643
        	<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
644
	 	</div>
645
	 	<?php echo $this->form()->closeTag($form); ?>
646
	</div>
16822 efrain 647
</div>
14989 efrain 648
 
16842 efrain 649
 
650
 
651
 
652
 
14989 efrain 653
<script id="trBehaviorTemplate" type="text/x-jsrender">
654
    <tr id="tr_behavior_id_{{:id}}">
655
 
656
       <td class="text-left">
657
         <input type="hidden" class="behavior_id" name="behavior_id[]" value="{{:id}}" />
658
         {{:description}}
659
       </td>
890 geraldo 660
       <td>
14989 efrain 661
           <button class="btn btn-default btn-remove-behavior" data-id="{{:id}}" data-toggle="tooltip"  data-original-title="LABEL_DELETE"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE</button>
890 geraldo 662
       </td>
663
   </tr>
664
</script>