parent
commit
cde82e26e8

+ 11
- 12
app/controllers/AnnualPlansController.php View File

343
       Log::info($outcomes->id);
343
       Log::info($outcomes->id);
344
       Log::info($annual_plan['first']['objectives'][$outcomes->id]);
344
       Log::info($annual_plan['first']['objectives'][$outcomes->id]);
345
       foreach ($annual_plan['first']['objectives'][$outcomes->id] as $objective) {
345
       foreach ($annual_plan['first']['objectives'][$outcomes->id] as $objective) {
346
-        Log::info($objective->id);
347
-        Log::info($an_semesters->semester_start);
348
-        Log::info($an_semesters->program_id);
349
-        Log::info(DB::select("select id from typ_semester_objectives where objective_id = {$objective->id} and  typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id ={$outcomes->id} and semester_id ={$an_semesters->semester_start} and typ_program_id in(select id from typ_program where program_id ={$an_semesters->program_id})) "));
350
         $annual_plan['first']['typ_objective_id'][$objective->id] = DB::select("select id from typ_semester_objectives where objective_id = {$objective->id} and  typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id ={$outcomes->id} and semester_id ={$an_semesters->semester_start} and typ_program_id in(select id from typ_program where program_id ={$an_semesters->program_id})) ")[0];
346
         $annual_plan['first']['typ_objective_id'][$objective->id] = DB::select("select id from typ_semester_objectives where objective_id = {$objective->id} and  typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id ={$outcomes->id} and semester_id ={$an_semesters->semester_start} and typ_program_id in(select id from typ_program where program_id ={$an_semesters->program_id})) ")[0];
351
-        $annual_plan['first']['courses'][$objective->id] = DB::select("select typ.id typ_id, typ.course_id, c.code, c.number from (select course_id, id from typ_semester_courses where typ_semester_objective_id = {$annual_plan['first']['typ_objective_id'][$objective->id]->id}) typ, courses c where c.id = typ.course_id");
347
+        $annual_plan['first']['courses'][$objective->id] = DB::select("select typ.id typ_course_id, typ.course_id, c.code, c.number from (select course_id, id from typ_semester_courses where typ_semester_objective_id = {$annual_plan['first']['typ_objective_id'][$objective->id]->id}) typ, courses c where c.id = typ.course_id");
352
         foreach ($annual_plan['first']['courses'][$objective->id] as $course) {
348
         foreach ($annual_plan['first']['courses'][$objective->id] as $course) {
353
-          $annual_plan['first']['criteria'][$objective->id][$course->course_id] = DB::select("select * from criteria where id in(select criteria_id from annual_plan_objective where annual_plan_id = {$an_id} and typ_semester_course_id = {$course->typ_id} )");
349
+          $annual_plan['first']['criteria'][$objective->id][$course->typ_course_id] = DB::select("select * from criteria where id in(select criteria_id from annual_plan_objective where annual_plan_id = {$an_id} and typ_semester_course_id = {$course->typ_course_id} )");
350
+          $annual_plan['first']['trans_actions'][$objective->id][$course->typ_course_id] = DB::select("select * from transformative_actions where id in (select trans_id from annual_plan_transformative where typ_semester_course_id = {$course->typ_course_id})");
354
         }
351
         }
352
+
355
         Log::info($objective->id);
353
         Log::info($objective->id);
356
-        $annual_plan['first']['trans_actions'][$objective->id] = DB::select("select * from transformative_actions where id in (select trans_id from annual_plan_transformative where typ_semester_objective_id ={$annual_plan['first']['typ_objective_id'][$objective->id]->id})");
354
+        /*$annual_plan['first']['trans_actions'][$objective->id] = DB::select("select * from transformative_actions where id in (select trans_id from annual_plan_transformative where typ_semester_objective_id ={$annual_plan['first']['typ_objective_id'][$objective->id]->id})");
357
         foreach ($annual_plan['first']['trans_actions'][$objective->id] as $trans) {
355
         foreach ($annual_plan['first']['trans_actions'][$objective->id] as $trans) {
358
           Log::info($annual_plan['first']['typ_objective_id'][$objective->id]->id);
356
           Log::info($annual_plan['first']['typ_objective_id'][$objective->id]->id);
359
           Log::info($trans->id);
357
           Log::info($trans->id);
363
             Log::info("entró");
361
             Log::info("entró");
364
             $annual_plan['fill_info'][$annual_plan['first']['typ_objective_id'][$objective->id]->id][$trans->id] =  $annual_plan['fill_info'][$annual_plan['first']['typ_objective_id'][$objective->id]->id][$trans->id][0];
362
             $annual_plan['fill_info'][$annual_plan['first']['typ_objective_id'][$objective->id]->id][$trans->id] =  $annual_plan['fill_info'][$annual_plan['first']['typ_objective_id'][$objective->id]->id][$trans->id][0];
365
           }
363
           }
366
-        }
364
+        }*/
367
       }
365
       }
368
     }
366
     }
369
     foreach ($annual_plan['second']['outcomes'] as $outcomes) {
367
     foreach ($annual_plan['second']['outcomes'] as $outcomes) {
371
       foreach ($annual_plan['second']['objectives'][$outcomes->id] as $objective) {
369
       foreach ($annual_plan['second']['objectives'][$outcomes->id] as $objective) {
372
         $annual_plan['second']['typ_objective_id'][$objective->id] = DB::select("select id from typ_semester_objectives where objective_id = {$objective->id} and  typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id ={$outcomes->id} and semester_id ={$an_semesters->semester_end} and typ_program_id in(select id from typ_program where program_id ={$an_semesters->program_id})) ")[0];
370
         $annual_plan['second']['typ_objective_id'][$objective->id] = DB::select("select id from typ_semester_objectives where objective_id = {$objective->id} and  typ_semester_outcome_id in (select id from typ_semester_outcome where outcome_id ={$outcomes->id} and semester_id ={$an_semesters->semester_end} and typ_program_id in(select id from typ_program where program_id ={$an_semesters->program_id})) ")[0];
373
 
371
 
374
-        $annual_plan['second']['courses'][$objective->id] = DB::select("select typ.id typ_id, typ.course_id, c.code, c.number from (select course_id, id from typ_semester_courses where typ_semester_objective_id = {$annual_plan['second']['typ_objective_id'][$objective->id]->id}) typ, courses c where c.id = typ.course_id");
372
+        $annual_plan['second']['courses'][$objective->id] = DB::select("select typ.id typ_course_id, typ.course_id, c.code, c.number from (select course_id, id from typ_semester_courses where typ_semester_objective_id = {$annual_plan['second']['typ_objective_id'][$objective->id]->id}) typ, courses c where c.id = typ.course_id");
375
         foreach ($annual_plan['second']['courses'][$objective->id] as $course) {
373
         foreach ($annual_plan['second']['courses'][$objective->id] as $course) {
376
-          $annual_plan['second']['criteria'][$objective->id][$course->course_id] = DB::select("select * from criteria where id in(select criteria_id from annual_plan_objective where annual_plan_id = {$an_id} and typ_semester_course_id ={$course->typ_id})");
374
+          $annual_plan['second']['criteria'][$objective->id][$course->course_id] = DB::select("select * from criteria where id in(select criteria_id from annual_plan_objective where annual_plan_id = {$an_id} and typ_semester_course_id ={$course->typ_course_id})");
375
+          $annual_plan['second']['trans_actions'][$objective->id][$course->typ_course_id] = DB::select("select * from transformative_actions where id in (select trans_id from annual_plan_transformative where typ_semester_course_id = {$course->typ_course_id})");
377
         }
376
         }
378
-
377
+        /*
379
         $annual_plan['second']['trans_actions'][$objective->id] = DB::select("select * from transformative_actions where id in (select trans_id from annual_plan_transformative where typ_semester_objective_id ={$annual_plan['second']['typ_objective_id'][$objective->id]->id})");
378
         $annual_plan['second']['trans_actions'][$objective->id] = DB::select("select * from transformative_actions where id in (select trans_id from annual_plan_transformative where typ_semester_objective_id ={$annual_plan['second']['typ_objective_id'][$objective->id]->id})");
380
         Log::info($annual_plan['second']['typ_objective_id'][$objective->id]->id);
379
         Log::info($annual_plan['second']['typ_objective_id'][$objective->id]->id);
381
         foreach ($annual_plan['second']['trans_actions'][$objective->id] as $trans) {
380
         foreach ($annual_plan['second']['trans_actions'][$objective->id] as $trans) {
386
             Log::info("entró");
385
             Log::info("entró");
387
             $annual_plan['fill_info'][$annual_plan['second']['typ_objective_id'][$objective->id]->id][$trans->id] =  $annual_plan['fill_info'][$annual_plan['second']['typ_objective_id'][$objective->id]->id][$trans->id][0];
386
             $annual_plan['fill_info'][$annual_plan['second']['typ_objective_id'][$objective->id]->id][$trans->id] =  $annual_plan['fill_info'][$annual_plan['second']['typ_objective_id'][$objective->id]->id][$trans->id][0];
388
           }
387
           }
389
-        }
388
+        }*/
390
       }
389
       }
391
     }
390
     }
392
 
391
 

+ 1
- 1
app/views/local/managers/sCoords/annual-plans.blade.php View File

210
           if(transformativeDefault!= undefined){
210
           if(transformativeDefault!= undefined){
211
           optionsForTa+="<optgroup label = 'Custom'>";
211
           optionsForTa+="<optgroup label = 'Custom'>";
212
             for(trans in transformativeDefault){
212
             for(trans in transformativeDefault){
213
-            optionsForTa+= "<option value='"+transformativeDefault[trans].id+"'>"+transformativeDefault[trans].at_text+"</option> ";
213
+            optionsForTa+= "<option value='"+transformativeDefault[trans].ta_id+"'>"+transformativeDefault[trans].at_text+"</option> ";
214
             
214
             
215
           }
215
           }
216
           }
216
           }

+ 35
- 17
app/views/local/managers/sCoords/view-annual-plans.blade.php View File

151
   'id':"buttonForAll"
151
   'id':"buttonForAll"
152
 
152
 
153
 }).html('Export whole year');
153
 }).html('Export whole year');
154
+/*
154
 $buttonForInform = $('<button/>', {
155
 $buttonForInform = $('<button/>', {
155
   'class':'btn btn-secondary',
156
   'class':'btn btn-secondary',
156
   'type':'button',
157
   'type':'button',
157
   'data-toggle':'modal',
158
   'data-toggle':'modal',
158
   'data-target':'#modal_inform'
159
   'data-target':'#modal_inform'
159
   
160
   
160
-}).html('Report annual plan');
161
+}).html('Report annual plan');*/
161
 $('#here2').html($buttonAll);
162
 $('#here2').html($buttonAll);
162
-$('#here2').append("<br><br>");
163
-$('#here2').append($buttonForInform);
163
+$('#here2').append("<br><br>"); /*
164
+$('#here2').append($buttonForInform);*/
164
 
165
 
165
 
166
 
166
 
167
 
291
               var objHTML = '<strong> '+nextLetter+'. '+theObj.text+'</strong>';
292
               var objHTML = '<strong> '+nextLetter+'. '+theObj.text+'</strong>';
292
               nextLetter = nextChar(nextLetter);
293
               nextLetter = nextChar(nextLetter);
293
               var courseHTML = '';
294
               var courseHTML = '';
295
+              var courseTAhtml ='';
294
 
296
 
295
               for(course in json.first.courses[theObj.id]){
297
               for(course in json.first.courses[theObj.id]){
296
 
298
 
297
                 var theCourse = json.first.courses[theObj.id][course];
299
                 var theCourse = json.first.courses[theObj.id][course];
298
                 courseHTML+= '&#8226; '+theCourse.code + " "+ theCourse.number +'\n\n\n<br>';
300
                 courseHTML+= '&#8226; '+theCourse.code + " "+ theCourse.number +'\n\n\n<br>';
299
-                for(criterion in json.first.criteria[theObj.id][theCourse.course_id]){
300
-                  theCrit = json.first.criteria[theObj.id][theCourse.course_id][criterion];
301
+                courseTAhtml += '&#8226; '+theCourse.code + " "+ theCourse.number +'\n\n\n<br>';
302
+
303
+                for(criterion in json.first.criteria[theObj.id][theCourse.typ_course_id]){
304
+                  theCrit = json.first.criteria[theObj.id][theCourse.typ_course_id][criterion];
301
                   courseHTML += '\t&nbsp;&nbsp; '+(parseInt(criterion)+1)+". "+theCrit.name+'\n<br>';
305
                   courseHTML += '\t&nbsp;&nbsp; '+(parseInt(criterion)+1)+". "+theCrit.name+'\n<br>';
306
+                  
307
+                }
308
+                for(trans in json.first.trans_actions[theObj.id][theCourse.typ_course_id]){
309
+                  theTA = json.first.trans_actions[theObj.id][theCourse.typ_course_id][trans]
310
+                  courseTAhtml +='\t&nbsp;&nbsp; '+(parseInt(trans)+1)+". "+theTA.at_text+'\n<br>'; 
302
                 }
311
                 }
303
               }
312
               }
304
               //courseHTML += '</ul>';
313
               //courseHTML += '</ul>';
309
              //   criteriaHTML += '&#8226; '+crit.name+'\n<br>';
318
              //   criteriaHTML += '&#8226; '+crit.name+'\n<br>';
310
               //}
319
               //}
311
 
320
 
312
-              var trans_html ='';
321
+              /*var trans_html ='';
313
               number = 1;
322
               number = 1;
314
               amount_of_TA_per_objective[index_per_objective]= [];
323
               amount_of_TA_per_objective[index_per_objective]= [];
315
               for(trans in json.first.trans_actions[theObj.id]){
324
               for(trans in json.first.trans_actions[theObj.id]){
344
 
353
 
345
               theTypId = json.first.typ_objective_id[theObj.id].id;
354
               theTypId = json.first.typ_objective_id[theObj.id].id;
346
               
355
               
347
-              for(fill_info in json.fill_info[theTypId]){
356
+              /*for(fill_info in json.fill_info[theTypId]){
348
            theInfo = json.fill_info[theTypId][fill_info];
357
            theInfo = json.fill_info[theTypId][fill_info];
349
                 $('#hizo-trans-'+fill_info+'_typ-'+theTypId+'-'+((theInfo.cycle_of_life)-1)).prop("checked", true);
358
                 $('#hizo-trans-'+fill_info+'_typ-'+theTypId+'-'+((theInfo.cycle_of_life)-1)).prop("checked", true);
350
                 $('#logro-trans-'+fill_info+'_typ-'+theTypId+'-'+theInfo.accomplished).prop("checked", true);
359
                 $('#logro-trans-'+fill_info+'_typ-'+theTypId+'-'+theInfo.accomplished).prop("checked", true);
351
                 continuedSem = 1;
360
                 continuedSem = 1;
352
                 if(!theInfo.semester_continue) continuedSem =0;
361
                 if(!theInfo.semester_continue) continuedSem =0;
353
                 $('#continued-trans-'+fill_info+'_typ-'+theTypId+'-'+continuedSem).prop("checked", true);
362
                 $('#continued-trans-'+fill_info+'_typ-'+theTypId+'-'+continuedSem).prop("checked", true);
354
-              }
355
-             
363
+              }*/
364
+             /*
356
               amount_of_TA_per_objective[index_per_objective].push(counter);
365
               amount_of_TA_per_objective[index_per_objective].push(counter);
357
 
366
 
358
               counter+=1;
367
               counter+=1;
359
 
368
 
360
-              }
369
+              }*/
361
 
370
 
362
 
371
 
363
               //$('#theReport').append()
372
               //$('#theReport').append()
365
               $table.row.add([
374
               $table.row.add([
366
                 objHTML,
375
                 objHTML,
367
                 courseHTML,
376
                 courseHTML,
368
-                trans_html
377
+                courseTAhtml
369
               ]);
378
               ]);
370
 
379
 
371
               index_per_objective +=1;
380
               index_per_objective +=1;
425
               var objHTML = '<strong> '+nextLetter+'. '+theObj.text+'</strong>';
434
               var objHTML = '<strong> '+nextLetter+'. '+theObj.text+'</strong>';
426
               nextLetter = nextChar(nextLetter);
435
               nextLetter = nextChar(nextLetter);
427
               var courseHTML = '';
436
               var courseHTML = '';
437
+              var courseTAhtml ='';
428
 
438
 
429
               for(course in json.second.courses[theObj.id]){
439
               for(course in json.second.courses[theObj.id]){
430
 
440
 
431
                 var theCourse = json.second.courses[theObj.id][course];
441
                 var theCourse = json.second.courses[theObj.id][course];
432
                 courseHTML+= '&#8226'+theCourse.code + " "+ theCourse.number +'\n\n\n<br>';
442
                 courseHTML+= '&#8226'+theCourse.code + " "+ theCourse.number +'\n\n\n<br>';
433
-                for(criterion in json.second.criteria[theObj.id][theCourse.course_id]){
434
-                  theCrit = json.second.criteria[theObj.id][theCourse.course_id][criterion];
443
+                courseTAhtml += '&#8226; '+theCourse.code + " "+ theCourse.number +'\n\n\n<br>';
444
+                for(criterion in json.second.criteria[theObj.id][theCourse.typ_course_id]){
445
+                  theCrit = json.second.criteria[theObj.id][theCourse.typ_course_id][criterion];
435
                   courseHTML += '&nbsp;&nbsp; '+(parseInt(criterion)+1)+". "+theCrit.name+'\n<br>';
446
                   courseHTML += '&nbsp;&nbsp; '+(parseInt(criterion)+1)+". "+theCrit.name+'\n<br>';
447
+
448
+
449
+                }
450
+
451
+                for(trans in json.second.trans_actions[theObj.id][theCourse.typ_course_id]){
452
+                  theTA = json.second.trans_actions[theObj.id][theCourse.typ_course_id][trans]
453
+                  courseTAhtml +='\t&nbsp;&nbsp; '+(parseInt(trans)+1)+". "+theTA.at_text+'\n<br>'; 
436
                 }
454
                 }
437
               }
455
               }
438
               //courseHTML += '</ul>';
456
               //courseHTML += '</ul>';
439
-              var criteriaHTML = '';
457
+              /*var criteriaHTML = '';
440
 
458
 
441
               for(criterion in json.second.criteria[theObj.id]){
459
               for(criterion in json.second.criteria[theObj.id]){
442
                 crit = json.second.criteria[theObj.id][criterion];
460
                 crit = json.second.criteria[theObj.id][criterion];
475
               $('#theReport').append(form);
493
               $('#theReport').append(form);
476
 
494
 
477
               theTypId = json.second.typ_objective_id[theObj.id].id;
495
               theTypId = json.second.typ_objective_id[theObj.id].id;
478
-              
496
+              /*
479
               for(fill_info in json.fill_info[theTypId]){
497
               for(fill_info in json.fill_info[theTypId]){
480
                 theInfo = json.fill_info[theTypId][fill_info];
498
                 theInfo = json.fill_info[theTypId][fill_info];
481
                 $('#hizo-trans-'+fill_info+'_typ-'+theTypId+'-'+((theInfo.cycle_of_life)-1)).prop("checked", true);
499
                 $('#hizo-trans-'+fill_info+'_typ-'+theTypId+'-'+((theInfo.cycle_of_life)-1)).prop("checked", true);
489
               amount_of_TA_per_objective[index_per_objective].push(counter);
507
               amount_of_TA_per_objective[index_per_objective].push(counter);
490
 
508
 
491
               counter+=1;
509
               counter+=1;
492
-              }
510
+              }*/
493
               index_per_objective +=1;
511
               index_per_objective +=1;
494
               
512
               
495
               $table.row.add([
513
               $table.row.add([
496
                 objHTML,
514
                 objHTML,
497
                 courseHTML,
515
                 courseHTML,
498
                 
516
                 
499
-                trans_html
517
+                courseTAhtml
500
               ]);
518
               ]);
501
              }
519
              }
502
              
520