|
@@ -336,7 +336,7 @@
|
336
|
336
|
var user= element.closest('tr');
|
337
|
337
|
$('#id').val(user.find('.user-name').data('user-id'));
|
338
|
338
|
$('#name').text(user.find('.user-name').text());
|
339
|
|
- <!-- $('#email').text(user.find('.user-email').text()); -->
|
|
339
|
+ /* $('#email').text(user.find('.user-email').text()); */
|
340
|
340
|
$('#email').val(user.find('.user-email').text());
|
341
|
341
|
$('#has_access').val(user.find('.user-has-access').data('value'));
|
342
|
342
|
|
|
@@ -379,14 +379,14 @@
|
379
|
379
|
// Remove all but first program
|
380
|
380
|
modal.find('.program').not(':first').parent().remove();
|
381
|
381
|
|
382
|
|
- <!-- Select Admin role and "All" school and program -->
|
|
382
|
+ /* Select Admin role and "All" school and program */
|
383
|
383
|
$('#new_role option[value="1"]').prop('selected', true);
|
384
|
384
|
$('#new_school option[value="0"]').prop('selected', true);
|
385
|
385
|
modal.find('.program option[value="0"]').prop('selected', true);
|
386
|
386
|
|
387
|
387
|
fetchPrograms(modal);
|
388
|
388
|
|
389
|
|
- <!-- Disable school and program -->
|
|
389
|
+ /* Disable school and program */
|
390
|
390
|
$('#new_school').prop('disabled', true);
|
391
|
391
|
modal.find('.program').prop('disabled', true);
|
392
|
392
|
|
|
@@ -408,7 +408,7 @@
|
408
|
408
|
var modal = $(this).closest('.modal');
|
409
|
409
|
switch($(this).find(':selected').val())
|
410
|
410
|
{
|
411
|
|
- <!-- If admin, set both to All and disable selection on both-->
|
|
411
|
+ /* If admin, set both to All and disable selection on both*/
|
412
|
412
|
case '1':
|
413
|
413
|
|
414
|
414
|
modal.find('.school option[value="0"]').prop('selected', true);
|
|
@@ -427,9 +427,9 @@
|
427
|
427
|
modal.find('.add-program').hide();
|
428
|
428
|
|
429
|
429
|
break;
|
430
|
|
- <!-- If scoord, set program to all and disable it -->
|
|
430
|
+ /* If scoord, set program to all and disable it */
|
431
|
431
|
case '2':
|
432
|
|
- <!-- Disable "All" option in schools and program -->
|
|
432
|
+ /* Disable "All" option in schools and program */
|
433
|
433
|
modal.find('.school option[value="0"]').attr('disabled', true);
|
434
|
434
|
|
435
|
435
|
if(modal.find('.school').find(':selected').val() == 0)
|
|
@@ -452,13 +452,13 @@
|
452
|
452
|
modal.find('.add-program').hide();
|
453
|
453
|
|
454
|
454
|
break;
|
455
|
|
- <!-- If pcoord or professor, enable everything -->
|
|
455
|
+ /* If pcoord or professor, enable everything */
|
456
|
456
|
case '3':
|
457
|
457
|
case '4':
|
458
|
|
- <!-- Disable "All" option in school -->
|
|
458
|
+ /* Disable "All" option in school */
|
459
|
459
|
modal.find('.school option[value="0"]').attr('disabled', true);
|
460
|
460
|
|
461
|
|
- <!-- Enable School and select an available option for school-->
|
|
461
|
+ /* Enable School and select an available option for school*/
|
462
|
462
|
modal.find('.school').prop('disabled', false);
|
463
|
463
|
|
464
|
464
|
if(modal.find('.school').find(':selected').val() == 0)
|
|
@@ -466,24 +466,24 @@
|
466
|
466
|
modal.find('.school option:enabled:first').prop('selected', true);
|
467
|
467
|
}
|
468
|
468
|
|
469
|
|
- <!-- Enable program-->
|
|
469
|
+ /* Enable program*/
|
470
|
470
|
modal.find('.program').prop('disabled', false);
|
471
|
471
|
|
472
|
472
|
// If it only has one child (most likely when changing from admin or scoord)
|
473
|
473
|
if(modal.find('.programs').children().length == 1)
|
474
|
474
|
{
|
475
|
|
- <!-- Fetch programs for the available school -->
|
|
475
|
+ /* Fetch programs for the available school */
|
476
|
476
|
fetchPrograms(modal);
|
477
|
477
|
|
478
|
|
- <!-- Disable "All" option in schools and program -->
|
|
478
|
+ /* Disable "All" option in schools and program */
|
479
|
479
|
modal.find('.program option[value="0"]').attr('disabled', true);
|
480
|
480
|
|
481
|
|
- <!-- Select available option -->
|
|
481
|
+ /* Select available option */
|
482
|
482
|
modal.find('.program option:enabled:first').prop('selected', true);
|
483
|
483
|
}
|
484
|
484
|
else
|
485
|
485
|
{
|
486
|
|
- <!-- Disable "All" option in schools and program -->
|
|
486
|
+ /* Disable "All" option in schools and program */
|
487
|
487
|
modal.find('.program option[value="0"]').attr('disabled', true);
|
488
|
488
|
}
|
489
|
489
|
|
|
@@ -572,36 +572,34 @@
|
572
|
572
|
case 1:
|
573
|
573
|
fetchPrograms(modal);
|
574
|
574
|
|
575
|
|
- <!-- Select "All" in school and program -->
|
|
575
|
+ /* Select "All" in school and program */
|
576
|
576
|
$('.school option[value="0"]').prop('selected', true);
|
577
|
577
|
modal.find('.program option[value="0"]').prop('selected', true);
|
578
|
578
|
|
579
|
|
- <!-- Disable school and program -->
|
|
579
|
+ /* Disable school and program */
|
580
|
580
|
$('.school').prop('disabled', true);
|
581
|
581
|
modal.find('.program').prop('disabled', true);
|
582
|
582
|
|
583
|
583
|
break;
|
584
|
584
|
case 2:
|
585
|
585
|
|
586
|
|
- <!-- Find and select user's school -->
|
|
586
|
+ /* Find and select user's school */
|
587
|
587
|
var school_id = user.find('.user-school').data('school-id');
|
588
|
588
|
$('.school option[value="'+school_id+'"]').prop('selected', true);
|
589
|
589
|
|
590
|
|
- <!-- Fetch programs -->
|
|
590
|
+ /* Fetch programs */
|
591
|
591
|
fetchPrograms(modal);
|
592
|
592
|
|
593
|
|
- <!-- Disable "All" option in school and select the next one-->
|
|
593
|
+ /* Disable "All" option in school and select the next one*/
|
594
|
594
|
$('.school option[value="0"]').attr('disabled', true);
|
595
|
595
|
|
596
|
|
- <!-- Disable all options in program -->
|
|
596
|
+ /* Disable all options in program */
|
597
|
597
|
modal.find('.program').prop('disabled', true);
|
598
|
598
|
|
599
|
|
- <!-- -->
|
600
|
|
-
|
601
|
599
|
break;
|
602
|
600
|
case 3:
|
603
|
601
|
case 4:
|
604
|
|
- <!-- Make sure school and program are not disabled -->
|
|
602
|
+ /* Make sure school and program are not disabled */
|
605
|
603
|
$('.school').prop('disabled', false);
|
606
|
604
|
modal.find('.program').prop('disabled', false);
|
607
|
605
|
|
|
@@ -635,9 +633,14 @@
|
635
|
633
|
|
636
|
634
|
});
|
637
|
635
|
|
638
|
|
- for(var i =0; i < program_ids.length; i++) { var program_id=program_ids[i]; modal.find('.program:eq('+i+')
|
639
|
|
- option[value="'+program_id+'" ]').prop('selected', true); } modal.find('.add-program').show(); <!-- Disable "All"
|
640
|
|
- option in school and program-->
|
|
636
|
+ for(var i =0; i < program_ids.length; i++)
|
|
637
|
+ {
|
|
638
|
+ var program_id=program_ids[i];
|
|
639
|
+ modal.find('.program:eq('+i+') option[value="'+program_id+'" ]').prop('selected', true);
|
|
640
|
+ }
|
|
641
|
+ modal.find('.add-program').show();
|
|
642
|
+ /* Disable "All"
|
|
643
|
+ option in school and program*/
|
641
|
644
|
$('.school option[value="0"]').attr('disabled', true);
|
642
|
645
|
modal.find('.program option[value="0"]').attr('disabled', true);
|
643
|
646
|
|