Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev Autor Línea Nro. Línea
15337 efrain 1
<?php
2
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser    = $this->currentUserHelper();
4
 
5
$roleName = $currentUser->getUserTypeId();
6
 
7
 
8
$routeDatatable = $this->url('settings/private-networks');
9
$routeAdd       = $this->url('settings/private-networks/add');
10
 
11
$allowAdd       = $acl->isAllowed($roleName, 'settings/private-networks/add') ? 1 : 0;
12
$allowEdit      = $acl->isAllowed($roleName, 'settings/private-networks/edit') ? 1 : 0;
13
$allowDelete    = $acl->isAllowed($roleName, 'settings/private-networks/delete') ? 1 : 0;
14
 
15
 
16
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
17
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
18
 
19
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
20
 
21
 
22
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
23
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
24
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
25
 
26
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
27
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
28
 
29
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
30
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
31
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
32
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
33
 
34
 
35
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
36
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
37
 
38
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
39
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
40
 
41
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/select2.js'));
42
$this->inlineScript()->appendFile($this->basePath('plugins/select2/js/i18n/es.js'));
43
$this->headLink()->appendStylesheet($this->basePath('plugins/select2/css/select2.css'));
44
 
45
$this->headLink()->appendStylesheet($this->basePath('plugins/select2-bootstrap4-theme/select2-bootstrap4.css'));
46
 
47
 
48
 
49
$status_active = \LeadersLinked\Model\Network::STATUS_ACTIVE;
50
 
51
$this->inlineScript()->captureStart();
52
echo <<<JS
53
jQuery( document ).ready(function( $ ) {
54
    $.validator.addMethod('passwordStrengthCheck', function(value) {
55
        return /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$^x%x*-]).{6,16}$/.test(value)
56
    }, 'ERROR_PASSWORD_STRENGTH');
57
 
58
    var allowEdit   = $allowEdit;
59
    var allowDelete = $allowDelete;
60
 
61
    $.validator.setDefaults({
62
        debug: true,
63
        highlight: function(element) {
64
            $(element).addClass('is-invalid');
65
        },
66
        unhighlight: function(element) {
67
            $(element).removeClass('is-invalid');
68
        },
69
        errorElement: 'span',
70
        errorClass: 'error invalid-feedback',
71
        errorPlacement: function(error, element) {
72
            if(element.parent('.form-group').length) {
73
                error.insertAfter(element);
74
            } else if(element.parent('.toggle').length) {
75
                error.insertAfter(element.parent().parent());
76
            } else {
77
                error.insertAfter(element.parent());
78
            }
79
        }
80
    });
81
 
82
 
83
    $.fn.showFormErrorValidator = function(fieldname, errors) {
84
        var field = $(fieldname);
85
        if(field) {
86
            $(field).addClass('is-invalid');
87
 
88
            var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
89
            if(field.parent('.form-group').length) {
90
                error.insertAfter(field);
91
            } else  if(field.parent('.toggle').length) {
92
                error.insertAfter(field.parent().parent());
93
            } else {
94
                error.insertAfter(field.parent());
95
            }
96
        }
97
    };
98
 
99
    var gridTable = $('#gridTable').dataTable( {
100
        'processing': true,
101
        'serverSide': true,
102
        'searching': true,
103
        'order': [[ 0, 'asc' ]],
104
        'ordering':  true,
105
        'ordenable' : true,
106
        'responsive': true,
107
        'select' : false,
108
        'paging': true,
109
        'pagingType': 'simple_numbers',
110
    	'ajax': {
111
    	   'url' : '$routeDatatable',
112
    		'type' : 'get',
113
            'beforeSend': function (request) {
114
                NProgress.start();
115
            },
116
            'dataFilter': function(response) {
117
                var response = jQuery.parseJSON( response );
118
 
119
                var json                = {};
120
                json.recordsTotal       = 0;
121
                json.recordsFiltered    = 0;
122
                json.data               = [];
123
 
124
 
125
                if(response.success) {
126
                    json.recordsTotal       = response.data.total;
127
                    json.recordsFiltered    = response.data.total;
128
                    json.data               = response.data.items;
129
                } else {
130
                    $.fn.showError(response.data)
131
                }
132
 
133
                return JSON.stringify( json );
134
            }
135
        },
136
        'language' : {
137
            'sProcessing':     'LABEL_DATATABLE_SPROCESSING',
138
            'sLengthMenu':     'LABEL_DATATABLE_SLENGTHMENU',
139
            'sZeroRecords':    'LABEL_DATATABLE_SZERORECORDS',
140
            'sEmptyTable':     'LABEL_DATATABLE_SEMPTYTABLE',
141
            'sInfo':           'LABEL_DATATABLE_SINFO',
142
            'sInfoEmpty':      'LABEL_DATATABLE_SINFOEMPTY',
143
            'sInfoFiltered':   'LABEL_DATATABLE_SINFOFILTERED',
144
            'sInfoPostFix':    '',
145
            'sSearch':         'LABEL_DATATABLE_SSEARCH',
146
            'sUrl':            '',
147
            'sInfoThousands':  ',',
148
            'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
149
            'oPaginate': {
150
                'sFirst':    'LABEL_DATATABLE_SFIRST',
151
                'sLast':     'LABEL_DATATABLE_SLAST',
152
                'sNext':     'LABEL_DATATABLE_SNEXT',
153
                'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
154
            },
155
            'oAria': {
156
                'sSortAscending':  ': LABEL_DATATABLE_SSORTASCENDING',
157
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
158
            },
159
        },
160
        'drawCallback': function( settings ) {
161
            NProgress.done();
162
            $('button.btn-delete').confirmation({
163
                rootSelector: 'button.btn-delete',
164
                title : 'LABEL_ARE_YOU_SURE',
165
                singleton : true,
166
                btnOkLabel: 'LABEL_YES',
167
                btnCancelLabel: 'LABEL_NO',
168
                onConfirm: function(value) {
169
                    var action = $(this).data('href');
170
                    NProgress.start();
171
                    $.ajax({
172
                        'dataType'  : 'json',
173
                        'accept'    : 'application/json',
174
                        'method'    : 'post',
175
                        'url'       :  action,
176
                    }).done(function(response) {
177
                        if(response['success']) {
178
                            $.fn.showSuccess(response['data']);
179
                            gridTable.api().ajax.reload(null, false);
180
                        } else {
181
                            $.fn.showError(response['data']);
182
                        }
183
                    }).fail(function( jqXHR, textStatus, errorThrown) {
184
                        $.fn.showError(textStatus);
185
                    }).always(function() {
186
                        NProgress.done();
187
                    });
188
                },
189
            });
190
        },
191
        'aoColumns': [
192
            { 'mDataProp': 'name' },
193
            { 'mDataProp': 'main_hostname' },
194
            { 'mDataProp': 'admin_hostname' },
195
            { 'mDataProp': 'status' },
196
            { 'mDataProp': 'actions' },
197
        ],
198
        'columnDefs': [
199
            {
200
                'targets':0,
201
                'className' : 'text-vertical-middle',
202
            },
203
            {
204
                'targets': -2,
205
                'orderable': false,
206
                'className' : 'text-center',
207
                'render' : function ( data, type, row ) {
208
 
209
                    checked = data == 'a' ? ' checked="checked" ' : '';
210
                    return '<div class="checkbox checkbox-success">' +
211
                        '<input class="styled" type="checkbox" ' + checked + ' disabled="disabled">' +
212
                        '<label ></label></div>';
213
                }
214
            },
215
            {
216
                'targets': -1,
217
                'orderable': false,
218
                'render' : function ( data, type, row ) {
219
                    s = '';
220
 
221
                    if(allowEdit && data['link_edit']) {
222
                        s = s + '<button class="btn btn-primary btn-edit" data-href="' + data['link_edit']+ '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pencil"></i> LABEL_EDIT </button>&nbsp;';
223
                    }
224
                    if(allowDelete  && data['link_delete']) {
225
                        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;';
226
                    }
227
                    return s;
228
                }
229
            }
230
        ],
231
    });
232
 
233
    var validatorAdd = $('#form-add').validate({
234
        debug: true,
235
        onclick: false,
236
        onkeyup: false,
237
        ignore: [':hidden'],
238
        rules: {
239
            'first_name': {
240
                required: true,
241
                maxlength: 64,
242
            },
243
            'last_name': {
244
                required: true,
245
                maxlength: 64,
246
            },
247
            'email': {
248
                required: true,
249
                email: true,
250
                maxlength: 250,
251
            },
252
            'password': {
253
                required: true,
254
                minlength: 6,
255
                maxlength: 16,
256
                passwordStrengthCheck: true,
257
            },
258
            'confirmation' : {
259
                required: true,
260
                minlength: 6,
261
                maxlength: 16,
262
                equalTo: '#form-add #password'
263
            },
264
            'company': {
265
                required: true,
266
                maxlength: 128,
267
            },
268
            'company_size_id': {
269
                required: true,
270
            },
271
            'industry_id': {
272
               required: true,
273
            },
274
            'main_hostname': {
275
                required: true,
276
                maxlength: 250,
15459 efrain 277
                url: true,
15337 efrain 278
            },
15452 efrain 279
            'alternative_hostname': {
280
                required: false,
281
                maxlength: 250,
15459 efrain 282
                 url: true,
15452 efrain 283
            },
15337 efrain 284
            'admin_hostname': {
285
                required: true,
15459 efrain 286
                maxlength: 250,
287
                 url: true,
15337 efrain 288
            },
15831 efrain 289
            'moodle_name': {
290
                required: false,
291
                maxlength: 20,
292
            },
15459 efrain 293
            'moodle_url': {
294
                required: false,
295
                maxlength: 250,
15831 efrain 296
                url: true,
15459 efrain 297
            },
15831 efrain 298
            'microlearning_appstore': {
299
                required: false,
300
                maxlength: 250,
301
                url: true,
302
            },
303
            'microlearning_playstore': {
304
                required: false,
305
                maxlength: 250,
306
                url: true,
307
            },
15459 efrain 308
            'relationship_user_mode': {
309
                required: true,
310
            },
311
            'status': {
312
                required: false,
313
            },
15441 efrain 314
            'theme_id': {
315
                required: true,
316
            },
15337 efrain 317
        },
318
        submitHandler: function(form)
319
        {
320
            NProgress.start();
321
            $.ajax({
322
                'dataType'  : 'json',
323
                'accept'    : 'application/json',
324
                'method'    : 'post',
325
                'url'       : $('#form-add').attr('action'),
326
                'data'      : $('#form-add').serialize()
327
            }).done(function(response) {
328
                if(response.success) {
329
                    $.fn.showSuccess(response.data);
330
 
331
                    $('#modalAdd').modal('hide');
332
                    gridTable.api().ajax.reload(null, false);
333
                } else {
334
                    if(jQuery.type(response.data) == 'string') {
335
                        $.fn.showError(response.data)
336
                    } else  {
337
                        $.each(response.data, function( fieldname, errors ) {
338
                            $.fn.showFormErrorValidator('#form-add #' + fieldname, errors);
339
                        });
340
                    }
341
                }
342
            }).fail(function( jqXHR, textStatus, errorThrown) {
343
                $.fn.showError(textStatus)
344
 
345
            }).always(function() {
346
                NProgress.done();
347
            })
348
        },
349
        invalidHandler: function(form, validator) {
350
        }
351
    });
352
 
353
    var validatorEdit = $('#form-edit').validate({
354
        debug: true,
355
        onclick: false,
356
        onkeyup: false,
357
        ignore: [':hidden'],
358
        rules: {
15441 efrain 359
            'theme_id' : {
360
                required: true,
361
            },
15337 efrain 362
            'name': {
363
                required: true,
364
                maxlength: 128,
365
            },
366
            'main_hostname': {
367
                required: true,
368
                maxlength: 250,
369
            },
15452 efrain 370
            'alternative_hostname': {
371
                required: false,
372
                maxlength: 250,
373
            },
15337 efrain 374
            'admin_hostname': {
375
                required: true,
376
                maxlength: 250,
377
            },
15459 efrain 378
            'status': {
379
                required: false,
15337 efrain 380
            },
15831 efrain 381
            'moodle_name': {
382
                required: false,
383
                maxlength: 20,
384
            },
385
 
15459 efrain 386
            'moodle_url': {
387
                required: false,
388
                maxlength: 250,
389
                 url: true,
390
            },
15831 efrain 391
            'microlearning_appstore': {
392
                required: false,
393
                maxlength: 250,
394
                url: true,
395
            },
396
            'microlearning_playstore': {
397
                required: false,
398
                maxlength: 250,
399
                url: true,
400
            },
15459 efrain 401
            'relationship_user_mode': {
402
                required: true,
403
            },
15441 efrain 404
            'theme_id': {
405
                required: true,
406
            },
15337 efrain 407
        },
408
        submitHandler: function(form)
409
        {
410
            NProgress.start();
411
            $.ajax({
412
                'dataType'  : 'json',
413
                'accept'    : 'application/json',
414
                'method'    : 'post',
415
                'url'       : $('#form-edit').attr('action'),
416
                'data'      : $('#form-edit').serialize()
417
            }).done(function(response) {
418
                if(response.success) {
419
                    $.fn.showSuccess(response.data);
420
 
421
                    $('#modalEdit').modal('hide');
422
                    gridTable.api().ajax.reload(null, false);
423
                } else {
424
                    if(jQuery.type(response.data) == 'string') {
425
                        $.fn.showError(response.data)
426
                    } else  {
427
                        $.each(response.data, function( fieldname, errors ) {
428
                            $.fn.showFormErrorValidator('#form-edit #' + fieldname, errors);
429
                        });
430
                    }
431
                }
432
            }).fail(function( jqXHR, textStatus, errorThrown) {
433
                $.fn.showError(textStatus)
434
 
435
            }).always(function() {
436
                NProgress.done();
437
            })
438
        },
439
        invalidHandler: function(form, validator) {
440
        }
441
    });
442
 
443
    $('body').on('click', 'button.btn-add', function(e) {
444
        e.preventDefault();
445
 
446
        $('#form-add #first_name').val('');
447
        $('#form-add #last_name').val('');
448
        $('#form-add #email').val('');
449
        $('#form-add #password').val('');
450
        $('#form-add #confirmation').val('');
451
        $('#form-add #company').val('');
452
        $('#form-add #company_size_id').val('').trigger('change');
453
        $('#form-add #industry_id').val('').trigger('change');
454
        $('#form-add #main_hostname').val('');
15452 efrain 455
        $('#form-add #alternative_hostname').val('');
15337 efrain 456
        $('#form-add #admin_hostname').val('');
15831 efrain 457
        $('#form-add #moodle_name').val('');
15459 efrain 458
        $('#form-add #moodle_url').val('');
15831 efrain 459
        $('#form-add #microlearning_appstore').val('');
460
        $('#form-add #microlearning_playstore').val('');
15459 efrain 461
        $('#form-add #relationship_user_mode').val('').trigger('change');
15441 efrain 462
        $('#form-add #theme_id').val('');
15337 efrain 463
 
464
        validatorAdd.resetForm();
465
        $('#modalAdd').modal('show');
466
    });
467
 
468
    $('body').on('click', 'button.btn-edit', function(e) {
469
        e.preventDefault();
470
        NProgress.start();
471
        var action = $(this).data('href');
472
 
473
        $.ajax({
474
            'dataType'  : 'json',
475
            'method'    : 'get',
476
            'url'       :  action,
477
        }).done(function(response) {
478
            if(response['success']) {
479
 
480
                $('#form-edit').attr('action', action);
481
                $('#form-edit #name').val(response['data']['name']);
482
                $('#form-edit #main_hostname').val(response['data']['main_hostname']);
15452 efrain 483
                $('#form-edit #alternative_hostname').val(response['data']['alternative_hostname']);
15337 efrain 484
                $('#form-edit #admin_hostname').val(response['data']['admin_hostname']);
485
                $('#form-edit #status').bootstrapToggle(response['data']['status'] == '$status_active' ? 'on' : 'off')
15441 efrain 486
                $('#form-edit #theme_id').val(response['data']['theme_id']);
15831 efrain 487
                $('#form-edit #moodle_name').val(response['data']['moodle_name']);
15459 efrain 488
                $('#form-edit #moodle_url').val(response['data']['moodle_url']);
15831 efrain 489
                $('#form-edit #microlearning_appstore').val(response['data']['microlearning_appstore']);
490
                $('#form-edit #microlearning_playstore').val(response['data']['microlearning_playstore']);
15459 efrain 491
                $('#form-edit #relationship_user_mode').val(response['data']['relationship_user_mode']).trigger('change');
15337 efrain 492
                validatorEdit.resetForm();
493
 
494
                $('#modalEdit').modal('show');
495
            } else {
496
                $.fn.showError(response['data']);
497
            }
498
        }).fail(function( jqXHR, textStatus, errorThrown) {
499
            $.fn.showError(textStatus);
500
        }).always(function() {
501
            NProgress.done();
502
        });
503
    });
504
 
505
 
506
    $('body').on('click', 'button.btn-refresh', function(e) {
507
        e.preventDefault();
508
        gridTable.api().ajax.reload(null, false);
509
    });
510
 
511
 
512
 
513
 
514
    $('body').on('click', 'button.btn-cancel', function(e) {
515
        e.preventDefault();
516
        $('#modalAdd').modal('hide');
517
        $('#modalEdit').modal('hide');
518
    });
519
 
520
    $('#form-add #company_size_id').select2({
521
        theme: 'bootstrap4',
522
        width: '100%',
523
    });
524
 
525
    $('#form-add #industry_id').select2({
526
        theme: 'bootstrap4',
527
        width: '100%',
528
    });
529
 
530
    $('#form-edit #status').bootstrapToggle({'on' : 'LABEL_ACTIVE',  'off' : 'LABEL_INACTIVE', 'width' : '160px', 'height' : '40px'});
531
 
532
});
533
JS;
534
$this->inlineScript()->captureEnd();
535
?>
536
 
537
<!-- Content Header (Page header) -->
538
<section class="content-header">
539
    <div class="container-fluid">
540
        <div class="row mb-2">
541
            <div class="col-sm-12">
542
                <h1>LABEL_PRIVATE_NETWORKS</h1>
543
            </div>
544
        </div>
545
    </div><!-- /.container-fluid -->
546
</section>
547
 
548
<section class="content">
549
    <div class="container-fluid">
550
        <div class="row">
551
            <div class="col-12">
552
                <div class="card">
553
                    <div class="card-body">
554
                        <table id="gridTable" class="table table-striped table-hover">
555
                            <thead>
556
                                <tr>
557
                                    <th>LABEL_NAME</th>
558
                                    <th>LABEL_MAIN_HOSTNAME</th>
559
                                    <th>LABEL_ADMIN_HOSTNAME</th>
560
                                    <th>LABEL_ACTIVE</th>
561
                                    <th>LABEL_ACTIONS</th>
562
                                </tr>
563
                            </thead>
564
                            <tbody>
565
                            </tbody>
566
                        </table>
567
                    </div>
568
                    <div class="card-footer clearfix">
569
                        <div style="float:right;">
570
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
571
                            <?php if ($allowAdd) : ?>
572
                                <button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
573
                            <?php endif; ?>
574
 
575
                        </div>
576
                    </div>
577
                </div>
578
            </div>
579
        </div>
580
    </div>
581
</section>
582
 
583
 
584
<!-- The Modal -->
585
<div class="modal" id="modalAdd">
586
	<div class="modal-dialog  modal-xl">
587
    	<div class="modal-content">
588
 
589
            <!-- Modal Header -->
590
      		<div class="modal-header">
591
        		<h4 class="modal-title">LABEL_NEW_PRIVATE_NETWORK<span id="form-title"></span></h4>
592
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
593
      		</div>
594
 
595
            <!-- Modal body -->
596
      		<div class="modal-body">
597
       			 <?php
598
                    $form = $this->formAdd;
599
            		$form->setAttributes([
600
                        'method'    => 'post',
601
                        'name'      => 'form-add',
602
                        'id'        => 'form-add',
603
            		    'action'    => $routeAdd,
604
                    ]);
605
 
606
                    $form->prepare();
607
                    echo $this->form()->openTag($form);
608
                    ?>
609
                      	<div class="form-group">
610
        					<?php
611
        					$element = $form->get('first_name');
612
        					$element->setOptions(['label' => 'LABEL_FIRST_NAME']);
613
                            $element->setAttributes(['class' => 'form-control']);
614
 
615
                            echo $this->formLabel($element);
616
                            echo $this->formText($element);
617
                            ?>
618
						</div>
619
    					<div class="form-group">
620
        					<?php
621
        					$element = $form->get('last_name');
622
        					$element->setOptions(['label' => 'LABEL_LAST_NAME']);
623
                            $element->setAttributes(['class' => 'form-control']);
624
 
625
                            echo $this->formLabel($element);
626
                            echo $this->formText($element);
627
                            ?>
628
						</div>
629
						<div class="form-group">
630
                    	<?php
631
                    	    $element = $form->get('email');
632
                    	    $element->setOptions(['label' => 'LABEL_EMAIL']);
633
                            $element->setAttributes(['class' => 'form-control']);
634
 
635
                            echo $this->formLabel($element);
636
                            echo $this->formText($element);
637
                        ?>
638
						</div>
639
						<div class="form-group">
640
                    	<?php
641
                    	    $element = $form->get('password');
642
                    	    $element->setOptions(['label' => 'LABEL_PASSWORD']);
643
                            $element->setAttributes(['class' => 'form-control']);
644
 
645
                            echo $this->formLabel($element);
646
                            echo $this->formPassword($element);
647
                        ?>
648
						</div>
649
						<div class="form-group">
650
                    	<?php
651
                    	    $element = $form->get('confirmation');
652
                    	    $element->setOptions(['label' => 'LABEL_CONFIRMATION']);
653
                            $element->setAttributes(['class' => 'form-control']);
654
 
655
                            echo $this->formLabel($element);
656
                            echo $this->formPassword($element);
657
                        ?>
658
						</div>
659
						<div class="form-group">
660
                    	<?php
661
                    	    $element = $form->get('company');
662
                    	    $element->setOptions(['label' => 'LABEL_COMPANY']);
663
                            $element->setAttributes(['class' => 'form-control']);
664
 
665
                            echo $this->formLabel($element);
666
                            echo $this->formText($element);
667
                        ?>
668
						</div>
669
						<div class="form-group">
670
                    	<?php
671
                    	    $element = $form->get('industry_id');
672
                    	    $element->setOptions(['label' => 'LABEL_INDUSTRY']);
673
                            $element->setAttributes(['class' => 'form-control']);
674
 
675
                            echo $this->formLabel($element);
676
                            echo $this->formSelect($element);
677
                        ?>
678
						</div>
679
						<div class="form-group">
680
                    	<?php
681
                    	    $element = $form->get('company_size_id');
682
                    	    $element->setOptions(['label' => 'LABEL_COMPANY_SIZE']);
683
                            $element->setAttributes(['class' => 'form-control']);
684
 
685
                            echo $this->formLabel($element);
686
                            echo $this->formSelect($element);
687
                        ?>
688
						</div>
689
						<div class="form-group">
690
                    	<?php
691
                    	    $element = $form->get('main_hostname');
692
                    	    $element->setOptions(['label' => 'LABEL_MAIN_HOSTNAME']);
693
                            $element->setAttributes(['class' => 'form-control']);
694
 
695
                            echo $this->formLabel($element);
696
                            echo $this->formText($element);
697
                        ?>
698
						</div>
699
						<div class="form-group">
700
                    	<?php
15452 efrain 701
                    	    $element = $form->get('alternative_hostname');
702
                    	    $element->setOptions(['label' => 'LABEL_ALTERNATIVE_HOSTNAME']);
703
                            $element->setAttributes(['class' => 'form-control']);
704
 
705
                            echo $this->formLabel($element);
706
                            echo $this->formText($element);
707
                        ?>
708
						</div>
709
 
710
 
711
 
712
						<div class="form-group">
713
                    	<?php
15337 efrain 714
                    	    $element = $form->get('admin_hostname');
715
                    	    $element->setOptions(['label' => 'LABEL_ADMIN_HOSTNAME']);
716
                            $element->setAttributes(['class' => 'form-control']);
717
 
718
                            echo $this->formLabel($element);
719
                            echo $this->formText($element);
720
                        ?>
721
						</div>
15441 efrain 722
						<div class="form-group">
723
                    	<?php
15831 efrain 724
                    	    $element = $form->get('moodle_name');
725
                    	    $element->setOptions(['label' => 'LABEL_MY_ONROOM_NAME']);
726
                            $element->setAttributes(['class' => 'form-control']);
727
 
728
                            echo $this->formLabel($element);
729
                            echo $this->formText($element);
730
                        ?>
731
						</div>
732
						<div class="form-group">
733
                    	<?php
15459 efrain 734
                    	    $element = $form->get('moodle_url');
735
                    	    $element->setOptions(['label' => 'LABEL_MY_ONROOM_URL']);
736
                            $element->setAttributes(['class' => 'form-control']);
737
 
738
                            echo $this->formLabel($element);
739
                            echo $this->formText($element);
740
                        ?>
741
						</div>
15831 efrain 742
						<div class="form-group">
743
                    	<?php
744
                    	    $element = $form->get('microlearning_appstore');
745
                    	    $element->setOptions(['label' => 'LABEL_MY_MICROLEARNING_APPSTORE']);
746
                            $element->setAttributes(['class' => 'form-control']);
747
 
748
                            echo $this->formLabel($element);
749
                            echo $this->formText($element);
750
                        ?>
751
						</div>
752
						<div class="form-group">
753
                    	<?php
754
                    	    $element = $form->get('microlearning_playstore');
755
                    	    $element->setOptions(['label' => 'LABEL_MY_MICROLEARNING_PLAYSTORE']);
756
                            $element->setAttributes(['class' => 'form-control']);
757
 
758
                            echo $this->formLabel($element);
759
                            echo $this->formText($element);
760
                        ?>
761
						</div>
762
 
763
 
764
 
765
 
766
 
767
 
15459 efrain 768
                        <div class="form-group">
769
                    	<?php
770
                    	    $element = $form->get('relationship_user_mode');
771
                    	    $element->setOptions(['label' => 'LABEL_THEME']);
772
                            $element->setAttributes(['class' => 'form-control']);
773
 
774
                            echo $this->formLabel($element);
775
                            echo $this->formSelect($element);
776
                        ?>
777
						</div>
778
						<div class="form-group">
779
                    	<?php
15441 efrain 780
                    	    $element = $form->get('theme_id');
781
                    	    $element->setOptions(['label' => 'LABEL_THEME']);
782
                            $element->setAttributes(['class' => 'form-control']);
15337 efrain 783
 
15441 efrain 784
                            echo $this->formLabel($element);
785
                            echo $this->formSelect($element);
786
                        ?>
787
						</div>
15337 efrain 788
 
789
        				<div class="form-group">
790
                    		<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
791
                    		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
792
                   		</div>
793
     	      		<?php echo $this->form()->closeTag($form); ?>
794
      		</div>
795
 
796
            <!-- Modal footer -->
797
      		<div class="modal-footer">
798
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
799
      		</div>
800
 
801
    	</div>
802
	</div>
803
</div>
804
 
805
 
806
<!-- The Modal -->
807
<div class="modal" id="modalEdit">
808
	<div class="modal-dialog  modal-xl">
809
    	<div class="modal-content">
810
 
811
            <!-- Modal Header -->
812
      		<div class="modal-header">
813
        		<h4 class="modal-title">LABEL_EDIT_PRIVATE_NETWORK<span id="form-title"></span></h4>
814
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
815
      		</div>
816
 
817
            <!-- Modal body -->
818
      		<div class="modal-body">
819
       			 <?php
820
                    $form = $this->formEdit;
821
            		$form->setAttributes([
822
                        'method'    => 'post',
823
                        'name'      => 'form-edit',
824
                        'id'        => 'form-edit',
825
 
826
                    ]);
827
 
828
                    $form->prepare();
829
                    echo $this->form()->openTag($form);
830
                    ?>
831
 
832
						<div class="form-group">
833
                    	<?php
834
                    	    $element = $form->get('name');
835
                    	    $element->setOptions(['label' => 'LABEL_NAME']);
836
                            $element->setAttributes(['class' => 'form-control']);
837
 
838
                            echo $this->formLabel($element);
839
                            echo $this->formText($element);
840
                        ?>
841
						</div>
842
						<div class="form-group">
843
                    	<?php
844
                    	    $element = $form->get('main_hostname');
845
                    	    $element->setOptions(['label' => 'LABEL_MAIN_HOSTNAME']);
846
                            $element->setAttributes(['class' => 'form-control']);
847
 
848
                            echo $this->formLabel($element);
849
                            echo $this->formText($element);
850
                        ?>
851
						</div>
852
						<div class="form-group">
853
                    	<?php
15452 efrain 854
                    	    $element = $form->get('alternative_hostname');
855
                    	    $element->setOptions(['label' => 'LABEL_ALTERNATIVE_HOSTNAME']);
856
                            $element->setAttributes(['class' => 'form-control']);
857
 
858
                            echo $this->formLabel($element);
859
                            echo $this->formText($element);
860
                        ?>
861
						</div>
862
 
863
						<div class="form-group">
864
                    	<?php
15337 efrain 865
                    	    $element = $form->get('admin_hostname');
866
                    	    $element->setOptions(['label' => 'LABEL_ADMIN_HOSTNAME']);
867
                            $element->setAttributes(['class' => 'form-control']);
868
 
869
                            echo $this->formLabel($element);
870
                            echo $this->formText($element);
871
                        ?>
872
						</div>
873
						<div class="form-group">
874
                            <?php
875
                            $element = $form->get('status');
876
                            echo $this->formCheckbox($element);
877
                            ?>
878
                        </div>
15831 efrain 879
						<div class="form-group">
15459 efrain 880
                    	<?php
15831 efrain 881
                    	    $element = $form->get('moodle_name');
882
                    	    $element->setOptions(['label' => 'LABEL_MY_ONROOM_NAME']);
883
                            $element->setAttributes(['class' => 'form-control']);
884
 
885
                            echo $this->formLabel($element);
886
                            echo $this->formText($element);
887
                        ?>
888
						</div>
889
						<div class="form-group">
890
                    	<?php
15459 efrain 891
                    	    $element = $form->get('moodle_url');
892
                    	    $element->setOptions(['label' => 'LABEL_MY_ONROOM_URL']);
893
                            $element->setAttributes(['class' => 'form-control']);
894
 
895
                            echo $this->formLabel($element);
896
                            echo $this->formText($element);
897
                        ?>
898
						</div>
15831 efrain 899
						<div class="form-group">
900
                    	<?php
901
                    	    $element = $form->get('microlearning_appstore');
902
                    	    $element->setOptions(['label' => 'LABEL_MY_MICROLEARNING_APPSTORE']);
903
                            $element->setAttributes(['class' => 'form-control']);
904
 
905
                            echo $this->formLabel($element);
906
                            echo $this->formText($element);
907
                        ?>
908
						</div>
909
						<div class="form-group">
910
                    	<?php
911
                    	    $element = $form->get('microlearning_playstore');
912
                    	    $element->setOptions(['label' => 'LABEL_MY_MICROLEARNING_PLAYSTORE']);
913
                            $element->setAttributes(['class' => 'form-control']);
914
 
915
                            echo $this->formLabel($element);
916
                            echo $this->formText($element);
917
                        ?>
918
						</div>
15459 efrain 919
                        <div class="form-group">
920
                    	<?php
921
                    	    $element = $form->get('relationship_user_mode');
922
                    	    $element->setOptions(['label' => 'LABEL_THEME']);
923
                            $element->setAttributes(['class' => 'form-control']);
924
 
925
                            echo $this->formLabel($element);
926
                            echo $this->formSelect($element);
927
                        ?>
928
						</div>
929
 
930
 
931
 
15441 efrain 932
                      	<div class="form-group">
933
                    	<?php
934
                    	    $element = $form->get('theme_id');
935
                    	    $element->setOptions(['label' => 'LABEL_THEME']);
936
                            $element->setAttributes(['class' => 'form-control']);
15337 efrain 937
 
15441 efrain 938
                            echo $this->formLabel($element);
939
                            echo $this->formSelect($element);
940
                        ?>
941
						</div>
942
 
15337 efrain 943
 
944
        				<div class="form-group">
945
                    		<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
946
                    		<button type="button" class="btn btn-light btn-cancel">LABEL_CANCEL</button>
947
                   		</div>
948
     	      		<?php echo $this->form()->closeTag($form); ?>
949
      		</div>
950
 
951
            <!-- Modal footer -->
952
      		<div class="modal-footer">
953
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
954
      		</div>
955
 
956
    	</div>
957
	</div>
958
</div>
959