Gabriel Santiago Plaza преди 3 години
родител
ревизия
cde82e26e8

+ 11
- 12
app/controllers/AnnualPlansController.php Целия файл

@@ -343,17 +343,15 @@ class AnnualPlansController extends \BaseController
343 343
       Log::info($outcomes->id);
344 344
       Log::info($annual_plan['first']['objectives'][$outcomes->id]);
345 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 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 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 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 355
         foreach ($annual_plan['first']['trans_actions'][$objective->id] as $trans) {
358 356
           Log::info($annual_plan['first']['typ_objective_id'][$objective->id]->id);
359 357
           Log::info($trans->id);
@@ -363,7 +361,7 @@ class AnnualPlansController extends \BaseController
363 361
             Log::info("entró");
364 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 367
     foreach ($annual_plan['second']['outcomes'] as $outcomes) {
@@ -371,11 +369,12 @@ class AnnualPlansController extends \BaseController
371 369
       foreach ($annual_plan['second']['objectives'][$outcomes->id] as $objective) {
372 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 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 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 379
         Log::info($annual_plan['second']['typ_objective_id'][$objective->id]->id);
381 380
         foreach ($annual_plan['second']['trans_actions'][$objective->id] as $trans) {
@@ -386,7 +385,7 @@ class AnnualPlansController extends \BaseController
386 385
             Log::info("entró");
387 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 Целия файл

@@ -210,7 +210,7 @@ $(document).ready(function()
210 210
           if(transformativeDefault!= undefined){
211 211
           optionsForTa+="<optgroup label = 'Custom'>";
212 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 Целия файл

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