Anonymous avatar Anonymous committed 13fa246

Integrated the patch mechanism into the multi-site module (admin.php script)

Comments (0)

Files changed (3)

     }
     else {
       $row = sqlQuery("SELECT * FROM version LIMIT 1");
+      $database_patch_txt = "";
+      if ( !(empty($row['v_realpatch'])) && $row['v_realpatch'] != 0 ) {
+        $database_patch_txt = " (" . $row['v_realpatch'] .")";
+      }
       $openemr_version = $row['v_major'] . "." . $row['v_minor'] . "." .
-        $row['v_patch'] . $row['v_tag'];
+        $row['v_patch'] . $row['v_tag'] . $database_patch_txt;
       $database_version = 0 + $row['v_database'];
+      $database_patch = 0 + $row['v_realpatch'];
     }
 
     // Display relevant columns.
     echo "  <td>$openemr_name</td>\n";
     echo "  <td>$openemr_version</td>\n";
-    if ($v_database == $database_version) {
-      echo "  <td><a href='interface/login/login_frame.php?site=$sfname'>Log In</a></td>\n";
+    if ($v_database != $database_version) {
+      echo "  <td><a href='sql_upgrade.php?site=$sfname'>Upgrade Database</a></td>\n";
+    }
+    else if ( ($v_realpatch != $database_patch) ) {
+      echo "  <td><a href='sql_patch.php?site=$sfname'>Patch Database</a></td>\n";
     }
     else {
-      echo "  <td><a href='sql_upgrade.php?site=$sfname'>Upgrade Database</a></td>\n";
+      echo "  <td><a href='interface/login/login_frame.php?site=$sfname'>Log In</a></td>\n";
     }
   }
   echo " </tr>\n";
 }
 
 echo "<font color='green'>Updating version indicators...</font><br />\n";
-sqlStatement("UPDATE version SET v_major = '$v_major', v_minor = '$v_minor', " .
-  "v_patch = '$v_patch', v_realpatch = '$v_realpatch', v_tag = '$v_tag', v_database = '$v_database'");
+sqlStatement("UPDATE version SET v_realpatch = '$v_realpatch'");
 
 echo "<p><font color='green'>Database patch finished.</font></p>\n";
 echo "</body></html>\n";
 
   echo "<font color='green'>Updating version indicators...</font><br />\n";
   sqlStatement("UPDATE version SET v_major = '$v_major', v_minor = '$v_minor', " .
-    "v_patch = '$v_patch', v_realpatch = '$v_realpatch', v_tag = '$v_tag', v_database = '$v_database'");
+    "v_patch = '$v_patch', v_tag = '$v_tag', v_database = '$v_database'");
 
   echo "<p><font color='green'>Database upgrade finished.</font></p>\n";
   echo "</body></html>\n";
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.