Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 17178 | Rev 17250 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 17178 Rev 17248
Línea 146... Línea 146...
146
    		'ajax': {
146
    		'ajax': {
147
    			'url' : '$routeDatatable',
147
    			'url' : '$routeDatatable',
148
    			'type' : 'get',
148
    			'type' : 'get',
149
                'data': function ( d ) {
149
                'data': function ( d ) {
150
                    d.topic_uuid = $('#form-filter #topic_uuid').val();
150
                    d.topic_uuid = $('#form-filter #topic_uuid').val();
151
                    d.capsule_uuid = $('#form-filter #capsule_uuid').val();
-
 
152
                },
151
                },
153
                'beforeSend': function (request) {
152
                'beforeSend': function (request) {
154
                  NProgress.start();
153
                  NProgress.start();
155
                },
154
                },
156
                'dataFilter': function(response) {
155
                'dataFilter': function(response) {
Línea 160... Línea 159...
160
                    json.recordsTotal       = 0;
159
                    json.recordsTotal       = 0;
161
                    json.recordsFiltered    = 0;
160
                    json.recordsFiltered    = 0;
162
                    json.data               = [];
161
                    json.data               = [];
Línea 163... Línea 162...
163
                    
162
                    
164
                    if(response.success) {
163
                    if(response.success) {
165
                        $('#form-capsule-add').attr('action', response.data.link_add ); 
-
 
166
 
-
 
167
                        if(response.data.capsules) {
-
 
168
                            $('#form-filter #capsule_uuid').empty();
-
 
169
                            $.each(response.data.capsules, function(index, value) {
-
 
170
                                  $('#form-filter #capsule_uuid').append('<option value="' + index + '">' + value + '</option>')
-
 
171
                            });
-
 
Línea 172... Línea 164...
172
                        } 
164
                        $('#form-topic-add').attr('action', response.data.link_add ); 
173
 
165
 
Línea 174... Línea 166...
174
                        routeUpload = response.data.link_upload;
166
                        routeUpload = response.data.link_upload;
Línea 291... Línea 283...
291
                    }
283
                    }
292
                }
284
                }
293
              ],
285
              ],
294
        });
286
        });
Línea 295... Línea -...
295
 
-
 
296
    $('#form-filter #topic_uuid').change(function(e) {
-
 
297
        e.preventDefault();
-
 
298
 
-
 
299
        $('#form-filter #capsule_uuid').empty();
-
 
300
        gridTable.api().ajax.reload(null, false);
-
 
301
    })
-
 
302
 
-
 
303
 
-
 
304
    $('#form-filter #capsule_uuid').change(function(e) {
-
 
305
        e.preventDefault();
-
 
306
 
-
 
307
        gridTable.api().ajax.reload(null, false);
-
 
Línea 308... Línea 287...
308
    })
287
 
309
 
288
 
Línea 310... Línea 289...
310
    $('body').on('click', 'button.btn-notification', function(e) {
289
    $('body').on('click', 'button.btn-notification', function(e) {
Línea 416... Línea 395...
416
        
395
        
417
        }
396
        }
Línea 418... Línea 397...
418
    });
397
    });
419
 
398
 
420
 
399
 
421
    var validatorCapsuleCustomer = $('#form-capsule-customer').validate({
400
    var validatorTopicCustomer = $('#form-topic-customer').validate({
422
        debug: true,
401
        debug: true,
423
        onclick: false,
402
        onclick: false,
Línea 453... Línea 432...
453
            }).done(function(response) {
432
            }).done(function(response) {
454
                if(response['success']) {
433
                if(response['success']) {
Línea 455... Línea 434...
455
 
434
 
456
                    $('#table-upload-customers-key').val(response['data']['key']);
435
                    $('#table-upload-customers-key').val(response['data']['key']);
457
                    $('#table-upload-customers-topic').val(response['data']['topic']);
-
 
Línea 458... Línea 436...
458
          			$('#table-upload-customers-capsule').val(response['data']['capsule']);
436
                    $('#table-upload-customers-topic').val(response['data']['topic']);
Línea 459... Línea 437...
459
    
437
    
Línea 465... Línea 443...
465
                        var s = '<tr>';
443
                        var s = '<tr>';
466
                        s = s + '<td>' + item['id'] + '</td>';
444
                        s = s + '<td>' + item['id'] + '</td>';
467
                        s = s + '<td>' + item['first_name'] + '</td>';
445
                        s = s + '<td>' + item['first_name'] + '</td>';
468
                        s = s + '<td>' + item['last_name'] + '</td>';
446
                        s = s + '<td>' + item['last_name'] + '</td>';
469
                        s = s + '<td>' + item['email'] + '</td>';
447
                        s = s + '<td>' + item['email'] + '</td>';
470
                        s = s + '<td class="text-right">' + item['assigned_capsules'] + '</td>';
448
                        s = s + '<td class="text-right">' + item['assigned_topics'] + '</td>';
471
                        s = s + '</tr>';
449
                        s = s + '</tr>';
Línea 472... Línea 450...
472
    
450
    
Línea 489... Línea 467...
489
                        $('#gridTableUploadError tbody').append(s);
467
                        $('#gridTableUploadError tbody').append(s);
Línea 490... Línea 468...
490
                
468
                
Línea 491... Línea 469...
491
    
469
    
492
                    });     
470
                    });     
Línea 493... Línea 471...
493
    
471
    
494
                    $('#modalCapsuleCustomer').modal('hide');
472
                    $('#modalTopicCustomer').modal('hide');
495
                    $('#modalUploadCustomers').modal('show');
473
                    $('#modalUploadCustomers').modal('show');
496
 
474
 
497
 
475
 
498
                    
476
                    
499
                } else {
477
                } else {
500
                    validatorCapsuleCustomer.resetForm();
478
                    validatorTopicCustomer.resetForm();
501
                    if(jQuery.type(response['data']) == 'string') {
479
                    if(jQuery.type(response['data']) == 'string') {
502
                        $.fn.showError(response['data']);
480
                        $.fn.showError(response['data']);
503
                    } else  {
481
                    } else  {
504
                        $.each(response['data'], function( fieldname, errors ) {
482
                        $.each(response['data'], function( fieldname, errors ) {
Línea 518... Línea 496...
518
        
496
        
519
        }
497
        }
Línea 520... Línea 498...
520
    });
498
    });
521
 
499
 
522
 
500
 
523
    $('#form-capsule-customer #file').fileinput({
501
    $('#form-topic-customer #file').fileinput({
524
        theme: 'fas',
502
        theme: 'fas',
525
        language: 'es',
503
        language: 'es',
Línea 530... Línea 508...
530
    });
508
    });
Línea 531... Línea 509...
531
 
509
 
532
    $('body').on('click', 'button.btn-upload', function(e) {
510
    $('body').on('click', 'button.btn-upload', function(e) {
Línea 533... Línea 511...
533
        e.preventDefault();
511
        e.preventDefault();
534
 
512
 
Línea 535... Línea 513...
535
        $('#form-capsule-customer #file').fileinput('reset');
513
        $('#form-topic-customer #file').fileinput('reset');
536
        $('#form-capsule-customer #file').val('');
514
        $('#form-topic-customer #file').val('');
Línea 537... Línea 515...
537
 
515
 
538
        $('#modalCapsuleCustomer').modal('show');
516
        $('#modalTopicCustomer').modal('show');
539
    });
517
    });
Línea 562... Línea 540...
562
                document.body.removeChild(anchor);
540
                document.body.removeChild(anchor);
Línea 563... Línea 541...
563
 
541
 
564
                var s = response['data']['users_processed'] + ' LABEL_USTUDENTS_PROCESED <br>' + 
542
                var s = response['data']['users_processed'] + ' LABEL_USTUDENTS_PROCESED <br>' + 
565
                response['data']['users_assigned'] + ' LABEL_STUDENTS_ASSIGNED <br>' + 
543
                response['data']['users_assigned'] + ' LABEL_STUDENTS_ASSIGNED <br>' + 
566
                response['data']['users_previous'] + ' LABEL_USTUDENTS_PREVIOUS <br>' + 
544
                response['data']['users_previous'] + ' LABEL_USTUDENTS_PREVIOUS <br>' + 
Línea 567... Línea 545...
567
                response['data']['users_in_the_capsule'] + ' LABEL_STUDENTS_TOTAL';
545
                response['data']['users_in_the_topic'] + ' LABEL_STUDENTS_TOTAL';
Línea 568... Línea 546...
568
                
546
                
569
                $.fn.showSuccess(s);
547
                $.fn.showSuccess(s);
Línea 692... Línea 670...
692
                                    echo $this->formLabel($element);
670
                                    echo $this->formLabel($element);
693
                                    echo $this->formSelect($element);
671
                                    echo $this->formSelect($element);
694
                                    ?>
672
                                    ?>
Línea 695... Línea 673...
695
                              	
673
                              	
696
                            </div>
-
 
697
                            <div class="col-6 mt-3">
-
 
698
                         
-
 
699
                                    <?php
-
 
700
                                    $element = $form->get('capsule_uuid');
-
 
701
                                    $element->setOptions(['label' => 'LABEL_CAPSULE']);
-
 
702
                                    $element->setAttributes(['class' => 'form-control']);
-
 
703
                                    echo $this->formLabel($element);
-
 
704
                                    echo $this->formSelect($element);
-
 
705
                                    ?>
-
 
706
                          			
-
 
707
                            </div>
674
                            </div>
Línea 708... Línea 675...
708
	 		</div>
675
	 		</div>
709
	 	
676
	 	
Línea 804... Línea 771...
804
	</div>
771
	</div>
805
</div> 
772
</div> 
Línea 806... Línea 773...
806
 
773
 
807
 
774
 
808
<!-- The Modal -->
775
<!-- The Modal -->
809
<div class="modal" id="modalCapsuleCustomer">
776
<div class="modal" id="modalTopicCustomer">
Línea 810... Línea 777...
810
	<div class="modal-dialog  modal-xl">
777
	<div class="modal-dialog  modal-xl">
811
    	<div class="modal-content">
778
    	<div class="modal-content">
812
 
779
 
813
            <!-- Modal Header -->
780
            <!-- Modal Header -->
814
      		<div class="modal-header">
781
      		<div class="modal-header">
Línea 815... Línea 782...
815
        		<h6 class="modal-title">LABEL_UPLOAD</h6>
782
        		<h6 class="modal-title">LABEL_UPLOAD</h6>
816
        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
783
        		<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
817
      		</div>
784
      		</div>
818
 
785
 
819
 <?php 
786
 <?php 
820
                    $form = $this->formCapsuleCustomer;
787
                    $form = $this->formTopicCustomer;
821
            		$form->setAttributes([
788
            		$form->setAttributes([
Línea 822... Línea 789...
822
                        'method'    => 'post',
789
                        'method'    => 'post',
823
                        'name'      => 'form-capsule-customer',
790
                        'name'      => 'form-topic-customer',
824
                        'id'        => 'form-capsule-customer'
791
                        'id'        => 'form-topic-customer'
Línea 882... Línea 849...
882
      					<div class="col-12 mt-3">
849
      					<div class="col-12 mt-3">
883
      					<label>LABEL_TOPIC</label>
850
      					<label>LABEL_TOPIC</label>
884
      					<input type="text" readonly="readonly" id="table-upload-customers-topic" class="form-control" >
851
      					<input type="text" readonly="readonly" id="table-upload-customers-topic" class="form-control" >
885
      					</div>
852
      					</div>
886
      				</div>
853
      				</div>
887
      				<div class="row">
-
 
888
      					<div class="col-12 mt-3">
-
 
889
      					<label>LABEL_CAPSULE</label>
-
 
890
      					<input type="text" readonly="readonly" id="table-upload-customers-capsule" class="form-control" >
-
 
891
      					</div>
-
 
892
      				</div>
-
 
893
      			</form>
854
      			</form>
Línea 894... Línea 855...
894
      			
855
      			
895
      			<div class="row">
856
      			<div class="row">
Línea 913... Línea 874...
913
                                			<tr>
874
                                			<tr>
914
                                				<th>LABEL_ID</th>
875
                                				<th>LABEL_ID</th>
915
                                          		<th>LABEL_FIRST_NAME</th>
876
                                          		<th>LABEL_FIRST_NAME</th>
916
                                         		<th>LABEL_LAST_NAME</th>
877
                                         		<th>LABEL_LAST_NAME</th>
917
                                             	<th>LABEL_EMAIL</th>
878
                                             	<th>LABEL_EMAIL</th>
918
                                           		<th>LABEL_CAPSULES</th>	
879
                                           		<th>LABEL_TOPICS</th>	
919
                                 			</tr>
880
                                 			</tr>
920
                                      	</thead>
881
                                      	</thead>
921
                                   		<tbody>
882
                                   		<tbody>
922
                                   		</tbody>
883
                                   		</tbody>
923
                             		</table>
884
                             		</table>