Commit c9b1737eb9b8ef30405deb1d2a557cc778a060fe

Authored by jjordaan
2 parents 873bae71 eefae680

Merge branch 'master' of git@github.com:ktgit/knowledgetree

lib/database/schema.inc.php
@@ -1012,7 +1012,7 @@ class KTSchemaUtil @@ -1012,7 +1012,7 @@ class KTSchemaUtil
1012 1012
1013 if (!$result) 1013 if (!$result)
1014 { 1014 {
1015 - print "..."; 1015 + //print "...";
1016 } 1016 }
1017 1017
1018 return $result; 1018 return $result;
plugins/ktcore/KTPermissions.php
@@ -874,7 +874,7 @@ class KTDocumentRolesAction extends KTDocumentAction { @@ -874,7 +874,7 @@ class KTDocumentRolesAction extends KTDocumentAction {
874 function do_main() { 874 function do_main() {
875 $this->oPage->setTitle(_kt("View Roles")); 875 $this->oPage->setTitle(_kt("View Roles"));
876 $this->oPage->setBreadcrumbDetails(_kt("View Roles")); 876 $this->oPage->setBreadcrumbDetails(_kt("View Roles"));
877 - $oTemplating = new KTTemplating; 877 + $oTemplating =& KTTemplating::getSingleton();
878 $oTemplate = $oTemplating->loadTemplate("ktcore/action/view_roles"); 878 $oTemplate = $oTemplating->loadTemplate("ktcore/action/view_roles");
879 879
880 // we need to have: 880 // we need to have:
setup/upgrade.php
@@ -183,10 +183,11 @@ if (PEAR::isError($dbSupport)) { @@ -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 <html> 187 <html>
187 <head> 188 <head>
188 <title><?php echo APP_NAME;?> Upgrade</title> 189 <title><?php echo APP_NAME;?> Upgrade</title>
189 - <style> 190 + <style type="text/css">
190 th { text-align: left; } 191 th { text-align: left; }
191 td { vertical-align: top; } 192 td { vertical-align: top; }
192 .foo { float: left; } 193 .foo { float: left; }
@@ -203,13 +204,13 @@ td { vertical-align: top; } @@ -203,13 +204,13 @@ td { vertical-align: top; }
203 echo $oKTConfig->get('ui/mainLogo'); 204 echo $oKTConfig->get('ui/mainLogo');
204 }else{ 205 }else{
205 echo '../resources/graphics/ktlogo-topbar_base.png'; 206 echo '../resources/graphics/ktlogo-topbar_base.png';
206 - }?>"> 207 + }?>"/>
207 <p> 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 <tr><td> 211 <tr><td>
211 <P> 212 <P>
212 - <script> 213 + <script type="text/javascript">
213 function do_start(action) 214 function do_start(action)
214 { 215 {
215 document.location='?go=' + action; 216 document.location='?go=' + action;
@@ -458,8 +459,8 @@ function create_restore_stmt($targetfile) @@ -458,8 +459,8 @@ function create_restore_stmt($targetfile)
458 459
459 $tmpdir=resolveTempDir(); 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 $stmt .= $prefix ."mysql --user=\"$adminUser\" -p $mechanism \"$dbName\" < \"$targetfile\"\n"; 466 $stmt .= $prefix ."mysql --user=\"$adminUser\" -p $mechanism \"$dbName\" < \"$targetfile\"\n";
@@ -478,7 +479,7 @@ function title($title) @@ -478,7 +479,7 @@ function title($title)
478 { 479 {
479 if (!isset($_SESSION['setup_user'])) 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 print "<h1>$title</h1>"; 484 print "<h1>$title</h1>";
484 } 485 }
@@ -511,10 +512,10 @@ function upgradeConfirm() @@ -511,10 +512,10 @@ function upgradeConfirm()
511 if (!isset($_SESSION['backupStatus']) || $_SESSION['backupStatus'] === false) 512 if (!isset($_SESSION['backupStatus']) || $_SESSION['backupStatus'] === false)
512 { 513 {
513 ?> 514 ?>
514 -<br> 515 +<br/>
515 <font color="Red">Please ensure that you have made a backup before continuing with the upgrade process.</font> 516 <font color="Red">Please ensure that you have made a backup before continuing with the upgrade process.</font>
516 <p> 517 <p>
517 -<br> 518 +<br/>
518 <?php 519 <?php
519 } 520 }
520 ?> 521 ?>
@@ -550,7 +551,7 @@ Your mysql installation has been resolved. Manually, you would do the following: @@ -550,7 +551,7 @@ Your mysql installation has been resolved. Manually, you would do the following:
550 <tr> 551 <tr>
551 <td> 552 <td>
552 <nobr>cd "<?php echo $dir;?>"</nobr> 553 <nobr>cd "<?php echo $dir;?>"</nobr>
553 -<br> 554 +<br/>
554 <?php 555 <?php
555 } 556 }
556 else 557 else
@@ -617,7 +618,7 @@ function restoreSelect() @@ -617,7 +618,7 @@ function restoreSelect()
617 <P> 618 <P>
618 Select a backup to restore from the list below: 619 Select a backup to restore from the list below:
619 <P> 620 <P>
620 - <script> 621 + <script type="text/javascript">
621 function selectRestore(filename) 622 function selectRestore(filename)
622 { 623 {
623 document.location='?go=RestoreSelected&file=' + filename; 624 document.location='?go=RestoreSelected&file=' + filename;
@@ -659,7 +660,7 @@ function restoreSelected() @@ -659,7 +660,7 @@ function restoreSelected()
659 $dir = resolveTempDir(); 660 $dir = resolveTempDir();
660 $_SESSION['backupFile'] = $dir . '/' . $file; 661 $_SESSION['backupFile'] = $dir . '/' . $file;
661 ?> 662 ?>
662 -<script> 663 +<script type="text/javascript">
663 document.location='?go=RestoreConfirm'; 664 document.location='?go=RestoreConfirm';
664 </script> 665 </script>
665 <?php 666 <?php
@@ -691,7 +692,7 @@ Manually, you would do the following to restore the backup: @@ -691,7 +692,7 @@ Manually, you would do the following to restore the backup:
691 <tr> 692 <tr>
692 <td> 693 <td>
693 <nobr>cd "<?php echo $dir;?>"</nobr> 694 <nobr>cd "<?php echo $dir;?>"</nobr>
694 -<br> 695 +<br/>
695 <?php 696 <?php
696 } 697 }
697 else 698 else
@@ -709,6 +710,8 @@ You can continue to do the restore manually using the following command(s): @@ -709,6 +710,8 @@ You can continue to do the restore manually using the following command(s):
709 } 710 }
710 ?> 711 ?>
711 <nobr><?php echo $stmt['display'];?></nobr> 712 <nobr><?php echo $stmt['display'];?></nobr>
  713 +</td>
  714 +</tr>
712 </table> 715 </table>
713 <P> 716 <P>
714 <?php 717 <?php
@@ -729,7 +732,7 @@ Press &lt;i&gt;continue to restore&lt;/i&gt; to attempt the command(s) above. @@ -729,7 +732,7 @@ Press &lt;i&gt;continue to restore&lt;/i&gt; to attempt the command(s) above.
729 if ($dir != '') 732 if ($dir != '')
730 { 733 {
731 ?> 734 ?>
732 -<script> 735 +<script type="text/javascript">
733 function restore() 736 function restore()
734 { 737 {
735 if (confirm('Are you sure you want to restore? This is your last chance if the current data has not been backed up.')) 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,7 +761,7 @@ function backupDone()
758 { 761 {
759 $stmt=create_restore_stmt($filename); 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 <P> It appears as though the <font color=green>backup has been successful</font>. 765 <P> It appears as though the <font color=green>backup has been successful</font>.
763 <P> 766 <P>
764 <?php 767 <?php
@@ -771,7 +774,7 @@ function backupDone() @@ -771,7 +774,7 @@ function backupDone()
771 <tr> 774 <tr>
772 <td> 775 <td>
773 <nobr>cd <?php echo $stmt['dir'];?></nobr> 776 <nobr>cd <?php echo $stmt['dir'];?></nobr>
774 - <br> 777 + <br/>
775 <?php 778 <?php
776 } 779 }
777 else 780 else
@@ -809,7 +812,7 @@ We appologise for the inconvenience. @@ -809,7 +812,7 @@ We appologise for the inconvenience.
809 812
810 } 813 }
811 ?> 814 ?>
812 -<br> 815 +<br/>
813 816
814 &nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="back" onclick="javascript:do_start('welcome')"> 817 &nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="back" onclick="javascript:do_start('welcome')">
815 <?php 818 <?php
@@ -833,7 +836,7 @@ function restoreDone() @@ -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 <P> 840 <P>
838 It appears as though the <font color=green>restore has been successful</font>. 841 It appears as though the <font color=green>restore has been successful</font>.
839 <P> 842 <P>
@@ -861,7 +864,7 @@ We appologise for the inconvenience. @@ -861,7 +864,7 @@ We appologise for the inconvenience.
861 } 864 }
862 ?> 865 ?>
863 866
864 -<br> 867 +<br/>
865 868
866 &nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="back" onclick="javascript:do_start('welcome')"> 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,7 +881,7 @@ function check_state($value, $state=&#39;Home&#39;)
878 if ($_SESSION['state'] != $value) 881 if ($_SESSION['state'] != $value)
879 { 882 {
880 ?> 883 ?>
881 - <script> 884 + <script type="text/javascript">
882 document.location="?go=<?php echo $state;?>"; 885 document.location="?go=<?php echo $state;?>";
883 </script> 886 </script>
884 <?php 887 <?php
@@ -935,7 +938,7 @@ function backup() @@ -935,7 +938,7 @@ function backup()
935 $_SESSION['backupStatus'] = false; 938 $_SESSION['backupStatus'] = false;
936 } 939 }
937 ?> 940 ?>
938 - <script> 941 + <script type="text/javascript">
939 document.location="?go=BackupDone"; 942 document.location="?go=BackupDone";
940 </script> 943 </script>
941 <?php 944 <?php
@@ -1007,7 +1010,7 @@ function restore() @@ -1007,7 +1010,7 @@ function restore()
1007 1010
1008 1011
1009 ?> 1012 ?>
1010 - <script> 1013 + <script type="text/javascript">
1011 document.location="?go=RestoreDone"; 1014 document.location="?go=RestoreDone";
1012 </script> 1015 </script>
1013 <?php 1016 <?php
@@ -1033,22 +1036,22 @@ function welcome() @@ -1033,22 +1036,22 @@ function welcome()
1033 { 1036 {
1034 set_state(1); 1037 set_state(1);
1035 ?> 1038 ?>
1036 -<br> 1039 +<br/>
1037 Welcome to the <?php echo APP_NAME;?> Database Upgrade Wizard.<P> If you have just updated 1040 Welcome to the <?php echo APP_NAME;?> Database Upgrade Wizard.<P> If you have just updated
1038 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. 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 <P> 1042 <P>
1040 You will not be able to log into <?php echo APP_NAME;?> until your the database upgrade process is completed. 1043 You will not be able to log into <?php echo APP_NAME;?> until your the database upgrade process is completed.
1041 <P> 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 <P> 1046 <P>
1044 If you have already done this, you may skip this step can continue directly to the upgrade. 1047 If you have already done this, you may skip this step can continue directly to the upgrade.
1045 <P> 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 <?php 1057 <?php
@@ -1069,7 +1072,7 @@ function UpgradePreview() @@ -1069,7 +1072,7 @@ function UpgradePreview()
1069 $upgradeTable = generateUpgradeTable(); 1072 $upgradeTable = generateUpgradeTable();
1070 print $upgradeTable; 1073 print $upgradeTable;
1071 ?> 1074 ?>
1072 - <br> 1075 + <br/>
1073 1076
1074 &nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="back" onclick="javascript:do_start('home')"> 1077 &nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="back" onclick="javascript:do_start('home')">
1075 &nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="next" onclick="javascript:do_start('Upgrade')"> 1078 &nbsp;&nbsp; &nbsp; &nbsp; <input type=button value="next" onclick="javascript:do_start('Upgrade')">
@@ -1091,14 +1094,14 @@ function Upgrade() @@ -1091,14 +1094,14 @@ function Upgrade()
1091 if (PEAR::isError($pre_res)) 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 <?php 1098 <?php
1096 } 1099 }
1097 else 1100 else
1098 { 1101 {
1099 ?> 1102 ?>
1100 <p> 1103 <p>
1101 -<font color="green">Pre-Upgrade actions succeeded.</font><br> 1104 +<font color="green">Pre-Upgrade actions succeeded.</font><br/>
1102 <?php 1105 <?php
1103 } 1106 }
1104 ?> 1107 ?>
@@ -1125,15 +1128,15 @@ function Upgrade() @@ -1125,15 +1128,15 @@ function Upgrade()
1125 if (PEAR::isError($post_res)) 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 <?php 1132 <?php
1130 } 1133 }
1131 else 1134 else
1132 { 1135 {
1133 ?> 1136 ?>
1134 <p> 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 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.") 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 </script> 1141 </script>
1139 <?php 1142 <?php
@@ -1151,6 +1154,6 @@ function Upgrade() @@ -1151,6 +1154,6 @@ function Upgrade()
1151 if($oKTConfig->get('ui/poweredByDisabled') == '0'){ 1154 if($oKTConfig->get('ui/poweredByDisabled') == '0'){
1152 ?> align="right"><img src="<?php echo $oKTConfig->get('ui/powerLogo');?>"></td> 1155 ?> align="right"><img src="<?php echo $oKTConfig->get('ui/powerLogo');?>"></td>
1153 <?php }else{ ?> 1156 <?php }else{ ?>
1154 - background="../resources/graphics/ktbg.png">&nbsp;</td> 1157 + style="background:url('../resources/graphics/ktbg.png')>&nbsp;</td>
1155 <?php }?> 1158 <?php }?>
1156 </table> 1159 </table>