[Weberp-svn] SF.net SVN: weberp:[4243] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-01-10 13:47:17
|
Revision: 4243 http://weberp.svn.sourceforge.net/weberp/?rev=4243&view=rev Author: tim_schofield Date: 2011-01-10 13:47:11 +0000 (Mon, 10 Jan 2011) Log Message: ----------- Improvements to the database upgrade system Modified Paths: -------------- trunk/Z_UpgradeDatabase.php trunk/includes/UpgradeDB_mysql.inc Modified: trunk/Z_UpgradeDatabase.php =================================================================== --- trunk/Z_UpgradeDatabase.php 2011-01-10 12:03:32 UTC (rev 4242) +++ trunk/Z_UpgradeDatabase.php 2011-01-10 13:47:11 UTC (rev 4243) @@ -54,16 +54,25 @@ if (isset($_POST['CreateSQLFile'])) { $SQLFile=fopen("./companies/" . $_SESSION['DatabaseName'] . "/reportwriter/UpgradeDB" . $StartingUpdate ."-".$EndingUpdate.".sql","w"); } - echo '<table>'; + unset($_SESSION['Updates']); + $_SESSION['Updates']['Errors']=0; + $_SESSION['Updates']['Successes']=0; + $_SESSION['Updates']['Warnings']=0; for($UpdateNumber=$StartingUpdate; $UpdateNumber<=$EndingUpdate; $UpdateNumber++) { - echo '<tr><td>'.$UpdateNumber.'</td>'; +// echo '<tr><td>'.$UpdateNumber.'</td>'; $sql="SET FOREIGN_KEY_CHECKS=0"; $result=DB_Query($sql, $db); include('sql/mysql/updates/'.$UpdateNumber.'.php'); $sql="SET FOREIGN_KEY_CHECKS=1"; $result=DB_Query($sql, $db); - echo '</tr>'; +// echo '</tr>'; } + echo '<table class="selection"><tr>'; + echo '<th colspan="4"><font size="2" color="navy"><b>'._('Database Updates Have Been Run').'</b></font></th></tr>'; + echo '<tr><td style="background-color: #fddbdb;color: red;">'.$_SESSION['Updates']['Errors'].' '._('updates have errors in them').'</td></tr>'; + echo '<tr><td style="background-color: #b9ecb4;color: #006400;">'.$_SESSION['Updates']['Successes'].' '._('updates have succeeded').'</td></tr>'; + echo '<tr><td style="background-color: #c7ccf6;color: navy;">'.$_SESSION['Updates']['Warnings'].' '._('updates have not been done as the update was unnecessary on this database').'</td></tr>'; + echo '</table>'; } if (isset($SQLFile)) { // header('Location: Z_UpgradeDatabase.php'); //divert to the db upgrade if the table doesn't exist Modified: trunk/includes/UpgradeDB_mysql.inc =================================================================== --- trunk/includes/UpgradeDB_mysql.inc 2011-01-10 12:03:32 UTC (rev 4242) +++ trunk/includes/UpgradeDB_mysql.inc 2011-01-10 13:47:11 UTC (rev 4243) @@ -368,14 +368,18 @@ function OutputResult($msg, $status) { if ($status=='error') { - echo '<td style="background-color: #fddbdb;color: red;">'; + $_SESSION['Updates']['Errors']++; + $_SESSION['Updates']['Messages'][]=$msg; +// echo '<td style="background-color: #fddbdb;color: red;">'; } else if ($status=='success') { - echo '<td style="background-color: #b9ecb4;color: #006400;">'; + $_SESSION['Updates']['Successes']++; +// echo '<td style="background-color: #b9ecb4;color: #006400;">'; } else { - echo '<td style="background-color: #c7ccf6;color: navy;">'; + $_SESSION['Updates']['Warnings']++; +// echo '<td style="background-color: #c7ccf6;color: navy;">'; } - echo $msg; - echo '</td>'; +// echo $msg; +// echo '</td>'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |