Commit fc001bbfe0d1498b69228e76ffd67cc53d92df08

Authored by Jarrett Jordaan
1 parent 182ef4ad

Code cleanup.

Committed by: Jarrett Jordaan

Reviewed by: Megan Watson
setup/migrate/steps/migrateComplete.php
... ... @@ -164,7 +164,6 @@ class migrateComplete extends Step {
164 164 if($state == "STARTED" || $state == "RUNNING")
165 165 $running = true;
166 166 } else {
167   - //TODO : Read fomr my.cnf file
168 167 $mysqlPid = "/var/run/mysqld/mysqld.sock";
169 168 if(file_exists($mysqlPid))
170 169 $running = true;
... ...
setup/migrate/steps/migrateDatabase.php
... ... @@ -155,31 +155,20 @@ class migrateDatabase extends Step
155 155 unlink($sqlFile);
156 156 }
157 157 }
158   - $noFile = true;
159 158 // Handle failed dump
160 159 if(WINDOWS_OS) {
161 160 // Could be permissions, check error code.
162   - if(!$noFile) {
163   - $sqlFile = "C:\\kt-backup-$date.sql"; // Use tmp instead due to permissions
164   - }
  161 + $sqlFile = "C:\\kt-backup-$date.sql"; // Use tmp instead due to permissions
165 162 } else {
166   - if(!$noFile) {
167   - $sqlFile = "/tmp/kt-backup-$date.sql"; // Use tmp instead due to permissions
168   - }
  163 + $sqlFile = "/tmp/kt-backup-$date.sql"; // Use tmp instead due to permissions
169 164 }
170 165 $cmd = $exe.' -u"'.$dbAdminUser.'" -p"'.$dbAdminPass.'" --port="'.$port.'" '.$dbName.' > '.$sqlFile;
171   - if($noFile) {
172   - $this->error[]['error'] = "The KnowledgeTree Setup Wizard was unable to connect to your KnowledgeTree 3.6.1 database.";
173   - $this->error[]['msg'] = "Ensure that your KnowledgeTree Mysql service is running.";
174   - $this->error[]['cmd'] = "Click <b>Next</b> after resolving the above errors.";
175   - $this->temp_variables['manual_export'] = "";
176   - } else {
177   - $this->error[]['error'] = "Could not export database:";
178   - $this->error[]['msg'] = "Execute the following command in a $termOrBash.";
179   - $this->error[]['cmd'] = $cmd;
180   - $this->temp_variables['manual_export'] = $sqlFile;
181   - }
182   -
  166 + $this->error[]['error'] = "The KnowledgeTree Setup Wizard was unable to connect to your KnowledgeTree 3.6.1 database.";
  167 + $this->error[]['msg'] = "Ensure that your KnowledgeTree Mysql service is running.";
  168 + $this->error[]['cmd'] = "Click <b>Next</b> after resolving the above errors.";
  169 + $this->temp_variables['dumpLocation'] = $sqlFile;
  170 + $this->temp_variables['manual_export'] = $sqlFile;
  171 + $this->error[]['manual'] = $cmd;
183 172 return false;
184 173 }
185 174  
... ... @@ -274,7 +263,7 @@ class migrateDatabase extends Step
274 263 return $this->error;
275 264 }
276 265  
277   - private function storeSilent() {
  266 + public function storeSilent() {
278 267 // TODO
279 268 $_SESSION['migrate']['database']['dumpLocation'] = $this->sqlDumpFile;
280 269 $this->temp_variables['dumpLocation'] = $this->sqlDumpFile;
... ...
setup/migrate/steps/migrateServices.php
... ... @@ -398,7 +398,7 @@ class migrateServices extends Step
398 398 * @access private
399 399 * @return void
400 400 */
401   - private function storeSilent() {
  401 + public function storeSilent() {
402 402 $this->temp_variables['alreadyUninstalled'] = $this->alreadyUninstalled;
403 403 $this->temp_variables['serviceCheck'] = $this->serviceCheck;
404 404 $this->temp_variables['msg'] = "Turn off KnowledgeTree Mysql Instance.";
... ...
setup/migrate/templates/database.tpl
... ... @@ -118,6 +118,16 @@
118 118 <?php } ?>
119 119 </p>
120 120 <br/>
  121 +<p class="description">
  122 + Manually perform a KnowledgeTree 3.6.1 database export
  123 +</p>
  124 +<p class="disclaimer">
  125 +<?php
  126 +if(isset($error['manual'])) {
  127 + echo $error['manual'];
  128 + }
  129 +?>
  130 +</p>
121 131 <?php
122 132 }
123 133 ?>
... ...
setup/migrate/templates/wizard.tpl
... ... @@ -21,7 +21,7 @@
21 21 <div id="outer-wrapper" align="left">
22 22 <div id="header">
23 23 <div id="logo"><?php echo $html->image('dame/installer-header_logo.png'); ?> </div>
24   - <div id="install_details">
  24 + <div id="version_details">
25 25 <span style="font-size:120%;"> <?php if (isset($vars['migrate_version'])) echo $vars['migrate_version']; ?> </span>
26 26 <span style="font-size:120%;"> <?php if (isset($vars['migrate_version'])) echo $vars['migrate_type']; ?></span>
27 27 </div>
... ...
setup/upgrade/steps/upgradeComplete.php
... ... @@ -88,7 +88,7 @@ class upgradeComplete extends Step {
88 88 * Set all silent mode varibles
89 89 *
90 90 */
91   - protected function storeSilent() {
  91 + public function storeSilent() {
92 92 $v = $this->getDataFromSession('upgradeProperties');
93 93 $this->temp_variables['sysVersion'] = $this->util->readVersion();
94 94 $this->temp_variables['migrateCheck'] = $this->migrateCheck;
... ...
setup/upgrade/templates/complete.tpl
... ... @@ -31,11 +31,15 @@
31 31 <br/>
32 32 [START MENU] => [Programs] => [KnowledgeTree 3.7.x] => [services]
33 33 <br/>
34   - Right-Click and run [Install Services] as administrator
  34 + Right-Click and run [Install Services] as administrator, if applicable, or
  35 + <br/>
  36 + Click [Install Services]
35 37 <br/>
36 38 [START MENU] => [Programs] => [KnowledgeTree 3.7.x] => [services]
37 39 <br/>
38   - Right-Click and run [Start Services] as administrator
  40 + Right-Click and run [Start Services] as administrator, if applicable, or
  41 + <br/>
  42 + Click [Start Services]
39 43 <br/>
40 44 <br/>
41 45 <b>Alternatively:</b>
... ...
setup/upgrade/templates/wizard.tpl
... ... @@ -21,7 +21,7 @@
21 21 <div id="outer-wrapper" align="left">
22 22 <div id="header">
23 23 <div id="logo"><?php echo $html->image('dame/installer-header_logo.png'); ?></div>
24   - <div id="upgrade_details">
  24 + <div id="version_details">
25 25 <span style="font-size:120%;"> <?php echo $vars['upgrade_version']; ?> </span>
26 26 <span style="font-size:120%;"> <?php echo $vars['upgrade_type']; ?> </span>
27 27 </div>
... ...
setup/wizard/resources/css/wizard.css
1 1 * { margin: 0; padding: 0; }
2   -
3 2 body {
4 3 background-attachment:scroll;
5 4 background-color:transparent;
... ... @@ -70,7 +69,7 @@ select {
70 69 #outer-wrapper {
71 70 border:1px solid #B7B7B7;
72 71 margin-top:20px;
73   - /*width:1024px;*/width:964px;
  72 + width:964px;
74 73 }
75 74  
76 75 #header {
... ... @@ -87,12 +86,12 @@ select {
87 86 #container {
88 87 background: white url("../graphics/left.png") repeat-y left;
89 88 overflow:auto;
90   - /*min-height:630px;height:410px;*/min-height:500px;
  89 + min-height:500px;
91 90 }
92 91  
93 92 #content {
94 93 margin-left: 220px;
95   - /*height:515px;*/height:500px;
  94 + height:500px;
96 95 }
97 96  
98 97 #content_container {
... ... @@ -105,19 +104,19 @@ select {
105 104 border: 1px solid rgb(207, 207, 207);
106 105 padding: 5px;
107 106 overflow: auto;
108   - /*min-height: 400px;*/min-height: 300px;
  107 + min-height: 300px;
109 108 }
110 109  
111 110 #step_content_dependencies {
112 111 border: 1px solid rgb(207, 207, 207);
113   - /*padding: 5px;*/padding: 12px;
114   - /*min-height:270px;*/min-height:170px;
  112 + padding: 12px;
  113 + /min-height:170px;
115 114 }
116 115  
117 116 #step_content_configuration {
118 117 border: 1px solid rgb(207, 207, 207);
119 118 padding: 5px;
120   - /*min-height:320px;*//*height:330px*/min-height:130px;
  119 + min-height:130px;
121 120 }
122 121  
123 122 #step_content_services {
... ... @@ -129,25 +128,25 @@ select {
129 128 #step_content_registration {
130 129 border: 1px solid rgb(207, 207, 207);
131 130 padding: 5px;
132   - /*min-height:320px;*/min-height:100px;
  131 + min-height:100px;
133 132 }
134 133  
135 134 #step_content_registration_confirm {
136 135 border: 1px solid rgb(207, 207, 207);
137 136 padding: 5px;
138   - /*min-height:400px;*/min-height:300px;
  137 + min-height:300px;
139 138 }
140 139  
141 140 #step_content_install {
142 141 border: 1px solid rgb(207, 207, 207);
143 142 padding: 5px;
144   - /*min-height:400px;*/min-height:150px;
  143 + min-height:150px;
145 144 }
146 145  
147 146 #step_content_database {
148 147 border: 1px solid rgb(207, 207, 207);
149 148 padding: 5px;
150   - /*min-height:365px;*/min-height:240px;
  149 + min-height:240px;
151 150 }
152 151  
153 152 #step_content_database_confirm {
... ... @@ -164,7 +163,7 @@ select {
164 163  
165 164 .license_agreement {
166 165 overflow: scroll;
167   - /*height:370px;*/height:270px;
  166 + height:270px;
168 167 overflow-x:hidden;
169 168 border:1px solid #CFCFCF;
170 169 }
... ... @@ -204,11 +203,11 @@ select {
204 203  
205 204 #logo {
206 205 position:relative;
207   - /*right:760px;*/right:75%;
208   - /*top:20px;*/top:25%;
  206 + right:75%;
  207 + top:25%;
209 208 }
210 209  
211   -#install_details {
  210 +#version_details {
212 211 bottom:20px;
213 212 position:relative;
214 213 right:10px;
... ... @@ -282,7 +281,7 @@ select {
282 281 }
283 282  
284 283 .conf_paths {
285   - /*width:755px;*/width:100%;
  284 + width:100%;
286 285 }
287 286  
288 287 .errors {
... ... @@ -320,7 +319,6 @@ select {
320 319 font-size:13px;
321 320 font-weight:bold;
322 321 margin-left:5px;
323   - /*margin-top:10px;*/
324 322 }
325 323  
326 324 .step .radio {
... ... @@ -368,7 +366,9 @@ select {
368 366 .onclick {
369 367 cursor: pointer;
370 368 color: #EC7725;
371   - /*width: 150px;*//*width:350px;top:12px;position:relative;*/width:350px;padding-top:12px;position:static;
  369 + width:350px;
  370 + padding-top:12px;
  371 + position:static;
372 372 }
373 373  
374 374 .description {
... ... @@ -415,18 +415,10 @@ table#dbconf tr td input{
415 415 padding: 5px 8px;
416 416 }
417 417  
418   -/*#section {
419   -
420   -}*/
421   -
422 418 .php_ext_details table {
423   - width:745px;
  419 + width:645px;
424 420 }
425 421  
426   -/*.php_ext_details table tr {
427   -
428   -}*/
429   -
430 422 td.ext_indicator {
431 423 width:10px;
432 424 }
... ... @@ -456,7 +448,7 @@ td.dir_description {
456 448 }
457 449  
458 450 .php_con_details table {
459   - /*width:745px;*/width:675px;
  451 + width:675px;
460 452 }
461 453  
462 454 .error_message {
... ... @@ -515,12 +507,6 @@ td.dir_description {
515 507 font-size:12pt;
516 508 }
517 509  
518   -.demo {
519   - /*left:75px;
520   - position:relative;
521   - width:600px*/
522   -}
523   -
524 510 .text_message {
525 511  
526 512 }
... ... @@ -540,7 +526,7 @@ td.dir_description {
540 526  
541 527 #loading {
542 528 bottom:250px;
543   - /*left:500px;*/left:400px;
  529 + left:400px;
544 530 position:relative;
545 531 height:0px;
546 532 width:0px;
... ... @@ -563,15 +549,15 @@ td.dir_description {
563 549 }
564 550  
565 551 .dependency_details {
566   - /*top:12px;*/padding-top:12px;
567   - /*position:relative;*/position:static;
  552 + padding-top:12px;
  553 + position:static;
568 554 width:650px;
569 555 }
570 556  
571 557 .dependencies {
572   - /*position:relative;*/position:static;
  558 + position:static;
573 559 right:30%;
574   - /*width:880px;*/width:650px;
  560 + width:650px;
575 561 }
576 562  
577 563 .registration_template {
... ... @@ -583,7 +569,7 @@ td.dir_description {
583 569 }
584 570  
585 571 .description_complete {
586   - /*position:relative;*/position:static;
  572 + position:static;
587 573 right:35%;
588 574 width:100%;
589 575 }
... ... @@ -603,14 +589,6 @@ td.dir_description {
603 589 font-family:sans-serif;
604 590 }
605 591  
606   -.twitter {
607   -
608   -}
609   -
610   -.facebook {
611   -
612   -}
613   -
614 592 .connect {
615 593 float:none;
616 594 padding-bottom:0;
... ...
setup/wizard/steps/complete.php
... ... @@ -169,7 +169,6 @@ class complete extends Step {
169 169 $this->util->dbUtilities->load($dbconf['dhost'], $dbconf['dport'], $dbconf['dmsusername'], $dbconf['dmsuserpassword'], $dbconf['dname']);
170 170 $loaded = $this->util->dbUtilities->getDatabaseLink();
171 171 // if we can log in to the database, check access
172   - // TODO check write access?
173 172 if ($loaded)
174 173 {
175 174 $this->temp_variables['dbConnectUser'] .= sprintf($html, 'tick', '', 'Database connectivity successful (user: ' . $dbconf['dmsusername'] . ')');
... ... @@ -257,7 +256,7 @@ class complete extends Step {
257 256 * Set all silent mode varibles
258 257 *
259 258 */
260   - private function storeSilent() {
  259 + public function storeSilent() {
261 260 $this->temp_variables['services_check'] = $this->services_check;
262 261 $this->temp_variables['paths_check'] = $this->paths_check;
263 262 $this->temp_variables['privileges_check'] = $this->privileges_check;
... ...
setup/wizard/steps/database.php
... ... @@ -886,7 +886,7 @@ class database extends Step
886 886 private function closeMysql() {
887 887 try {
888 888 $this->util->dbUtilities->close();
889   - } catch (Exeption $e) {
  889 + } catch (Exception $e) {
890 890 $this->error['con'] = "Could not close: " . $e;
891 891 }
892 892 }
... ...
setup/wizard/steps/services.php
... ... @@ -245,8 +245,7 @@ class services extends Step
245 245 $this->serviceCheck = 'tick';
246 246 }
247 247 $this->storeSilent(); // Store info needed for silent mode
248   - if(!empty($errors))
249   - return false;
  248 +
250 249 return true;
251 250 }
252 251  
... ...
setup/wizard/templates/wizard.tpl
... ... @@ -20,7 +20,7 @@
20 20 <div id="outer-wrapper" align="left">
21 21 <div id="header">
22 22 <div id="logo"><?php echo $html->image('dame/installer-header_logo.png'); ?> </div>
23   - <div id="install_details">
  23 + <div id="version_details">
24 24 <span style="font-size:120%;"> <?php echo $vars['install_version']; ?> </span>
25 25 <span style="font-size:120%;"><?php echo $vars['install_type']; ?></span>
26 26 </div>
... ... @@ -45,7 +45,6 @@
45 45 </div>
46 46 <div class="clearing">&nbsp;</div>
47 47 </div>
48   -
49 48 <div id="footer">
50 49 <?php echo $html->image('dame/powered-by-kt.png', array("height"=>"23px", "width"=>"105px", "style"=>"padding: 5px;")); ?>
51 50 </div>
... ...