Commit eefae6806cd91acedbebaeac3a7554690964746c

Authored by jarrett
1 parent 2bdbb238

KTC-718 Fixed upgrade Output issue

Commited by: Jarrett Jordaan

Reviewed by: Megan Watson
lib/database/schema.inc.php
... ... @@ -1012,7 +1012,7 @@ class KTSchemaUtil
1012 1012  
1013 1013 if (!$result)
1014 1014 {
1015   - print "...";
  1015 + //print "...";
1016 1016 }
1017 1017  
1018 1018 return $result;
... ...
setup/upgrade.php
... ... @@ -183,10 +183,11 @@ if (PEAR::isError($dbSupport)) {
183 183  
184 184  
185 185 ?>
  186 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">
186 187 <html>
187 188 <head>
188 189 <title><?php echo APP_NAME;?> Upgrade</title>
189   - <style>
  190 + <style type="text/css">
190 191 th { text-align: left; }
191 192 td { vertical-align: top; }
192 193 .foo { float: left; }
... ... @@ -203,13 +204,13 @@ td { vertical-align: top; }
203 204 echo $oKTConfig->get('ui/mainLogo');
204 205 }else{
205 206 echo '../resources/graphics/ktlogo-topbar_base.png';
206   - }?>">
  207 + }?>"/>
207 208 <p>
208   - <img src="upgrade-title.jpg">
209   - <table width=800 height=500>
  209 + <img src="upgrade-title.jpg"/>
  210 + <table style="width:800; height:500">
210 211 <tr><td>
211 212 <P>
212   - <script>
  213 + <script type="text/javascript">
213 214 function do_start(action)
214 215 {
215 216 document.location='?go=' + action;
... ... @@ -458,8 +459,8 @@ function create_restore_stmt($targetfile)
458 459  
459 460 $tmpdir=resolveTempDir();
460 461  
461   - $stmt = $prefix ."mysqladmin --user=\"$adminUser\" -p $mechanism drop \"$dbName\"<br>";
462   - $stmt .= $prefix ."mysqladmin --user=\"$adminUser\" -p $mechanism create \"$dbName\"<br>";
  462 + $stmt = $prefix ."mysqladmin --user=\"$adminUser\" -p $mechanism drop \"$dbName\"<br/>";
  463 + $stmt .= $prefix ."mysqladmin --user=\"$adminUser\" -p $mechanism create \"$dbName\"<br/>";
463 464  
464 465  
465 466 $stmt .= $prefix ."mysql --user=\"$adminUser\" -p $mechanism \"$dbName\" < \"$targetfile\"\n";
... ... @@ -478,7 +479,7 @@ function title($title)
478 479 {
479 480 if (!isset($_SESSION['setup_user']))
480 481 {
481   - print "<script>document.location='?go=Login'</script>";
  482 + print "<script type='text/javascript'>document.location='?go=Login'</script>";
482 483 }
483 484 print "<h1>$title</h1>";
484 485 }
... ... @@ -511,10 +512,10 @@ function upgradeConfirm()
511 512 if (!isset($_SESSION['backupStatus']) || $_SESSION['backupStatus'] === false)
512 513 {
513 514 ?>
514   -<br>
  515 +<br/>
515 516 <font color="Red">Please ensure that you have made a backup before continuing with the upgrade process.</font>
516 517 <p>
517   -<br>
  518 +<br/>
518 519 <?php
519 520 }
520 521 ?>
... ... @@ -550,7 +551,7 @@ Your mysql installation has been resolved. Manually, you would do the following:
550 551 <tr>
551 552 <td>
552 553 <nobr>cd "<?php echo $dir;?>"</nobr>
553   -<br>
  554 +<br/>
554 555 <?php
555 556 }
556 557 else
... ... @@ -617,7 +618,7 @@ function restoreSelect()
617 618 <P>
618 619 Select a backup to restore from the list below:
619 620 <P>
620   - <script>
  621 + <script type="text/javascript">
621 622 function selectRestore(filename)
622 623 {
623 624 document.location='?go=RestoreSelected&file=' + filename;
... ... @@ -659,7 +660,7 @@ function restoreSelected()
659 660 $dir = resolveTempDir();
660 661 $_SESSION['backupFile'] = $dir . '/' . $file;
661 662 ?>
662   -<script>
  663 +<script type="text/javascript">
663 664 document.location='?go=RestoreConfirm';
664 665 </script>
665 666 <?php
... ... @@ -691,7 +692,7 @@ Manually, you would do the following to restore the backup:
691 692 <tr>
692 693 <td>
693 694 <nobr>cd "<?php echo $dir;?>"</nobr>
694   -<br>
  695 +<br/>
695 696 <?php
696 697 }
697 698 else
... ... @@ -709,6 +710,8 @@ You can continue to do the restore manually using the following command(s):
709 710 }
710 711 ?>
711 712 <nobr><?php echo $stmt['display'];?></nobr>
  713 +</td>
  714 +</tr>
712 715 </table>
713 716 <P>
714 717 <?php
... ... @@ -729,7 +732,7 @@ Press &lt;i&gt;continue to restore&lt;/i&gt; to attempt the command(s) above.
729 732 if ($dir != '')
730 733 {
731 734 ?>
732   -<script>
  735 +<script type="text/javascript">
733 736 function restore()
734 737 {
735 738 if (confirm('Are you sure you want to restore? This is your last chance if the current data has not been backed up.'))
... ... @@ -758,7 +761,7 @@ function backupDone()
758 761 {
759 762 $stmt=create_restore_stmt($filename);
760 763 ?>
761   - The backup file <nobr><I>"<?php echo $filename;?>"</i></nobr> has been created.
  764 + The backup file <nobr><i>"<?php echo $filename;?>"</i></nobr> has been created.
762 765 <P> It appears as though the <font color=green>backup has been successful</font>.
763 766 <P>
764 767 <?php
... ... @@ -771,7 +774,7 @@ function backupDone()
771 774 <tr>
772 775 <td>
773 776 <nobr>cd <?php echo $stmt['dir'];?></nobr>
774   - <br>
  777 + <br/>
775 778 <?php
776 779 }
777 780 else
... ... @@ -809,7 +812,7 @@ We appologise for the inconvenience.
809 812  
810 813 }
811 814 ?>
812   -<br>
  815 +<br/>
813 816  
814 817 &nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="back" onclick="javascript:do_start('welcome')">
815 818 <?php
... ... @@ -833,7 +836,7 @@ function restoreDone()
833 836 {
834 837  
835 838 ?>
836   - The restore of <nobr><I>"<?php echo $filename;?>"</i></nobr> has been completed.
  839 + The restore of <nobr><i>"<?php echo $filename;?>"</i></nobr> has been completed.
837 840 <P>
838 841 It appears as though the <font color=green>restore has been successful</font>.
839 842 <P>
... ... @@ -861,7 +864,7 @@ We appologise for the inconvenience.
861 864 }
862 865 ?>
863 866  
864   -<br>
  867 +<br/>
865 868  
866 869 &nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="back" onclick="javascript:do_start('welcome')">
867 870  
... ... @@ -878,7 +881,7 @@ function check_state($value, $state=&#39;Home&#39;)
878 881 if ($_SESSION['state'] != $value)
879 882 {
880 883 ?>
881   - <script>
  884 + <script type="text/javascript">
882 885 document.location="?go=<?php echo $state;?>";
883 886 </script>
884 887 <?php
... ... @@ -935,7 +938,7 @@ function backup()
935 938 $_SESSION['backupStatus'] = false;
936 939 }
937 940 ?>
938   - <script>
  941 + <script type="text/javascript">
939 942 document.location="?go=BackupDone";
940 943 </script>
941 944 <?php
... ... @@ -1007,7 +1010,7 @@ function restore()
1007 1010  
1008 1011  
1009 1012 ?>
1010   - <script>
  1013 + <script type="text/javascript">
1011 1014 document.location="?go=RestoreDone";
1012 1015 </script>
1013 1016 <?php
... ... @@ -1033,22 +1036,22 @@ function welcome()
1033 1036 {
1034 1037 set_state(1);
1035 1038 ?>
1036   -<br>
  1039 +<br/>
1037 1040 Welcome to the <?php echo APP_NAME;?> Database Upgrade Wizard.<P> If you have just updated
1038 1041 your <?php echo APP_NAME;?> code base, you will need to complete the upgrade process in order to ensure your system is fully operational with the new version.
1039 1042 <P>
1040 1043 You will not be able to log into <?php echo APP_NAME;?> until your the database upgrade process is completed.
1041 1044 <P>
1042   -<font color=orange>!!NB!! You are advised to backup the database before attempting the upgrade. !!NB!!</font>
  1045 +<font color="#ffa500">!!NB!! You are advised to backup the database before attempting the upgrade. !!NB!!</font>
1043 1046 <P>
1044 1047 If you have already done this, you may skip this step can continue directly to the upgrade.
1045 1048 <P>
1046 1049  
1047 1050  
1048   -&nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="cancel" onclick="document.location='..';">
1049   -&nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="backup now" onclick="javascript:do_start('BackupConfirm');">
1050   -&nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="next" onclick="javascript:do_start('UpgradeConfirm');">
1051   -&nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="restore database" onclick="javascript:do_start('RestoreConfirm');">
  1051 +&nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="cancel" onclick="document.location='..';"/>
  1052 +&nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="backup now" onclick="javascript:do_start('BackupConfirm');"/>
  1053 +&nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="next" onclick="javascript:do_start('UpgradeConfirm');"/>
  1054 +&nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="restore database" onclick="javascript:do_start('RestoreConfirm');"/>
1052 1055  
1053 1056  
1054 1057 <?php
... ... @@ -1069,7 +1072,7 @@ function UpgradePreview()
1069 1072 $upgradeTable = generateUpgradeTable();
1070 1073 print $upgradeTable;
1071 1074 ?>
1072   - <br>
  1075 + <br/>
1073 1076  
1074 1077 &nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="back" onclick="javascript:do_start('home')">
1075 1078 &nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="next" onclick="javascript:do_start('Upgrade')">
... ... @@ -1091,14 +1094,14 @@ function Upgrade()
1091 1094 if (PEAR::isError($pre_res))
1092 1095 {
1093 1096 ?>
1094   -<font color="red">Pre-Upgrade actions failed.</font><br>
  1097 +<font color="red">Pre-Upgrade actions failed.</font><br/>
1095 1098 <?php
1096 1099 }
1097 1100 else
1098 1101 {
1099 1102 ?>
1100 1103 <p>
1101   -<font color="green">Pre-Upgrade actions succeeded.</font><br>
  1104 +<font color="green">Pre-Upgrade actions succeeded.</font><br/>
1102 1105 <?php
1103 1106 }
1104 1107 ?>
... ... @@ -1125,15 +1128,15 @@ function Upgrade()
1125 1128 if (PEAR::isError($post_res))
1126 1129 {
1127 1130 ?>
1128   -<font color="red">Post-Upgrade actions failed.</font><br><br>
  1131 +<font color="red">Post-Upgrade actions failed.</font><br/><br/>
1129 1132 <?php
1130 1133 }
1131 1134 else
1132 1135 {
1133 1136 ?>
1134 1137 <p>
1135   -<font color="green">Post-Upgrade actions succeeded.</font><br><br>
1136   -<script>
  1138 +<font color="green">Post-Upgrade actions succeeded.</font><br/><br/>
  1139 +<script type="text/javascript">
1137 1140 alert("To complete the upgrade please do the following before continuing:\n\n1. Restart the services as appropriate for your environment.\n\n\nOn first run of your upgraded installaton please do the following:\n\n1. Hard refresh your bowser (CTRL-F5) on first view of the Dashboard.\n2. Enable the new plugins you wish to use.\n\n\nSelect 'next' at the bottom of this page to continue.")
1138 1141 </script>
1139 1142 <?php
... ... @@ -1151,6 +1154,6 @@ function Upgrade()
1151 1154 if($oKTConfig->get('ui/poweredByDisabled') == '0'){
1152 1155 ?> align="right"><img src="<?php echo $oKTConfig->get('ui/powerLogo');?>"></td>
1153 1156 <?php }else{ ?>
1154   - background="../resources/graphics/ktbg.png">&nbsp;</td>
  1157 + style="background:url('../resources/graphics/ktbg.png')>&nbsp;</td>
1155 1158 <?php }?>
1156 1159 </table>
... ...