Browse Source

Update 'db/upgrade.php'

- Indentation details arount lines 515-518
- Changed 8 'echo' by 'print' (lines 546-553/601) - 'echo' is reserved to 'dubugs'
leo 3 years ago
parent
commit
6a6d9d208f
1 changed files with 18 additions and 17 deletions
  1. 18 17
      db/upgrade.php

+ 18 - 17
db/upgrade.php

@@ -14,7 +14,7 @@
  * The commands in here will all be database-neutral,
  * using the functions defined in lib/ddllib.php
  * 
- * - v 1.5.1 2020/05/28
+ * - v 1.5.1 2020/05/28-30
  *     + Avoid to update one iLM causing colision with other instance of the same iLM
  * - v 1.4 2013/09/19
  *     + Insert general fields for iassign statement (grade, timeavaliable, timedue, preventlate, test, max_experiment).
@@ -26,7 +26,7 @@
  * @author Leônidas O. Brandão
  * @author Patricia Alves Rodrigues
  * @author Igor Moreira Félix
- * @version v 1.5.1 2020/05/28
+ * @version v 1.5.1 2020/05/28-30
  * @version v 1.5 2019/03/13
  * @version v 1.4 2013/09/19
  * @package mod_iassign_db
@@ -515,10 +515,11 @@ function xmldb_iassign_upgrade ($oldversion) {
                 }
               } // if ($exist1 == 1)
 
-          } else {
+            }
+          else {
             $DB->insert_record("iassign_ilm", $newentry, false);
-          }
-        } // foreach ($records as $record)
+            }
+          } // foreach ($records as $record)
 
         $not_found = '';
         if ($iassign_ilm) {
@@ -529,32 +530,32 @@ function xmldb_iassign_upgrade ($oldversion) {
               if ($iassign->name == $record['name']) {
                 $found = true;
                 break;
+                }
               }
-            }
 
             if (!$found) {
               $not_found .= '<li>' . $iassign->name . ' - <a href="' . $iassign->url . '" target="_blank">' . $iassign->url . '</a></li>';
-              
+
               $updateentry = new stdClass();
               $updateentry->id = $iassign->id;
               $updateentry->enable = 0;
               $updateentry->timemodified = time();
 
               $DB->update_record("iassign_ilm", $updateentry);
+              }
             }
           }
-        }
 
         if ($not_found != '') {
-          echo '<div class="alert alert-warning alert-block fade in " role="alert" data-aria-autofocus="true" tabindex="0" >';
-          echo get_string('upgrade_alert_iMA_msg', 'iassign');
-          echo '<ul style="margin-top: 1rem;">';
-          echo $not_found;
-          echo '</ul>';
-          echo get_string('upgrade_alert_iMA_solution_pt1', 'iassign');
-          echo '<a href="'.new moodle_url('/admin/settings.php?section=modsettingiassign').'">' . get_string('upgrade_alert_iMA_solution_pt2', 'iassign') . '</a>.';
-          echo '</div>';
-        }
+          print '<div class="alert alert-warning alert-block fade in " role="alert" data-aria-autofocus="true" tabindex="0" >';
+          print get_string('upgrade_alert_iMA_msg', 'iassign');
+          print '<ul style="margin-top: 1rem;">';
+          print $not_found;
+          print '</ul>';
+          print get_string('upgrade_alert_iMA_solution_pt1', 'iassign');
+          print '<a href="'.new moodle_url('/admin/settings.php?section=modsettingiassign').'">' . get_string('upgrade_alert_iMA_solution_pt2', 'iassign') . '</a>.';
+          print '</div>';
+          }
 
         $iassign_ilm = $DB->get_records('iassign_ilm');