Commit 704fefb09d1b6b9647113f63820b1a970778cc7c

Authored by Paul Barrett
2 parents 7d6b4102 6d2d3d5c

Merge branch 'edge' of github.com:ktgit/knowledgetree into edge

setup/migrate/steps/migrateComplete.php
... ... @@ -169,6 +169,9 @@ class migrateComplete extends Step {
169 169 $mysqlPid = "/var/run/mysqld/mysqld.sock";
170 170 if(file_exists($mysqlPid))
171 171 $running = true;
  172 + $mysqlPid = "/var/run/mysqld/mysqld.pid";
  173 + if(file_exists($mysqlPid))
  174 + $running = true;
172 175 }
173 176 if($running) {
174 177 $this->temp_variables['zmysql']['class'] = "tick";
... ...
setup/migrate/steps/migrateDatabase.php
... ... @@ -152,6 +152,8 @@ class migrateDatabase extends Step
152 152 if(!empty($fileContents)) {
153 153 $this->sqlDumpFile = realpath($sqlFile); // Store location of dump
154 154 return true;
  155 + } else {
  156 + unlink($sqlFile);
155 157 }
156 158 }
157 159 $noFile = true;
... ...
setup/migrate/steps/migrateInstallation.php
... ... @@ -128,7 +128,7 @@ class migrateInstallation extends step
128 128  
129 129 public function detectInstallation() {
130 130 if(WINDOWS_OS) {
131   - $knownWindowsLocations = array("C:\Program Files\ktdms"=>"C:\Program Files\ktdms\knowledgeTree\config\config-path","C:\Program Files x86\ktdms"=>"C:\Program Files x86\ktdms\knowledgeTree\config\config-path","C:\ktdms"=>"C:\ktdms\knowledgeTree\config\config-path");
  131 + $knownWindowsLocations = array("C:\Program Files\ktdms"=>"C:\Program Files\ktdms\knowledgeTree\config\config-path","C:\Program Files (x86)\ktdms"=>"C:\Program Files (x86)\ktdms\knowledgeTree\config\config-path","C:\ktdms"=>"C:\ktdms\knowledgeTree\config\config-path");
132 132 foreach ($knownWindowsLocations as $loc=>$configPath) {
133 133 if(file_exists($configPath))
134 134 $this->location = $loc;
... ... @@ -244,14 +244,8 @@ class migrateInstallation extends step
244 244 $this->ktSettings = array('fileSystemRoot'=> $froot);
245 245 $varDir = $froot.DS.'var';
246 246 $this->urlPaths = array(
247   -// array('name'=> 'Var Directory', 'path'=> $varDir),
248   -// array('name'=> 'Log Directory', 'path'=> $varDir.DS.'log'),
249 247 array('name'=> 'Document Root', 'path'=> $froot.DS.'Documents'),
250   -// array('name'=> 'Temporary Directory', 'path'=> $varDir.DS.'tmp'),
251   -// array('name'=> 'Cache Directory', 'path'=> $varDir.DS.'cache'),
252   -// array('name'=> 'Upload Directory', 'path'=> $varDir.DS.'uploads'),
253 248 );
254   -// $this->urlPaths = array();
255 249 $this->dbSettings['dbPort'] = $this->util->getPort($this->location); // Add Port
256 250 $this->temp_variables['urlPaths'] = $this->urlPaths;
257 251 $this->temp_variables['ktSettings'] = $this->ktSettings;
... ...
setup/migrate/steps/migrateServices.php
... ... @@ -285,11 +285,16 @@ class migrateServices extends Step
285 285 $serv = $this->util->loadInstallService($className);
286 286 $serv->load();
287 287 $sStatus = $serv->status();
288   - if($sStatus == 'STARTED' || $sStatus == 'RUNNING' || $sStatus == 'STOPPED') {
  288 + if($sStatus == 'STARTED' || $sStatus == 'RUNNING') {
289 289 $state = 'cross';
290 290 $this->error[] = "Service : {$serv->getName()} could not be uninstalled.<br/>";
291 291 $this->serviceCheck = 'cross';
292 292 $this->temp_variables['services'][$serv->getName()]['msg'] = "Service Running";
  293 + } elseif ($sStatus == 'STOPPED') {
  294 + $state = 'cross';
  295 + $this->error[] = "Service : {$serv->getName()} could not be uninstalled.<br/>";
  296 + $this->serviceCheck = 'cross';
  297 + $this->temp_variables['services'][$serv->getName()]['msg'] = "Service Stopped, please uninstall service";
293 298 } else {
294 299 $state = 'tick';
295 300 $this->temp_variables['services'][$serv->getName()]['msg'] = "Service has been uninstalled";
... ...
setup/migrate/templates/complete.tpl
... ... @@ -2,13 +2,6 @@
2 2 <p class="title">Migration Completed</p>
3 3  
4 4 <p class="description">Your database migration was successfully completed. Please check the section below for details of the migration and final instructions</p>
5   - <?php
6   - if($errors || $warnings){
7   - echo '<div>'
8   - . '<a href="http://wiki.knowledgetree.com/Web_Based_Migrater#Complete" target="_blank">'
9   - . 'Click Here for help on overcoming post migrate issues</a></div><br/>';
10   - }
11   - ?>
12 5 <div id="step_content_<?php echo $step_name; ?>" class="step">
13 6  
14 7 <!-- SQL -->
... ...
setup/migrate/templates/services.tpl
... ... @@ -75,7 +75,7 @@
75 75 </table>
76 76 <?php if ($serviceCheck != 'tick') { ?>
77 77 <br/>
78   - <p class=\"description\">Click <b>Next</b> if deactivating the above services.</p>
  78 + <p class=\"description\">Click <b>Next</b> if the above services are deactivated .</p>
79 79 <?php } ?>
80 80 <?php if($silent) { ?>
81 81 </div>
... ...
setup/migrate/templates/wizard.tpl
... ... @@ -13,6 +13,7 @@
13 13 <?php if(AGENT == "IE6") echo $html->css('ie6.css'); ?>
14 14 <?php if(AGENT == "IE7") echo $html->css('ie7.css'); ?>
15 15 <?php if(AGENT == "IE8") echo $html->css('ie8.css'); ?>
  16 + <?php if(INSTALL_TYPE == "community") echo $html->css('community.css'); ?>
16 17 <meta http-equiv=Content-Type content="text/html; charset=utf-8">
17 18 </head>
18 19 <body onload="">
... ...
setup/upgrade/templates/complete.tpl
... ... @@ -5,6 +5,12 @@
5 5 <div>
6 6 Your database has been upgraded to <?php echo $sysVersion; ?>
7 7 </div>
  8 + <br/>
  9 + <div>
  10 + <a href="http://wiki.knowledgetree.com/Web_Based_Installer#Post_Install" target="_blank">
  11 + Click Here for help on overcoming post install issues
  12 + </a>
  13 + </div>
8 14 <?php if($migrateCheck) { ?>
9 15 <br/>
10 16 <h3>Services</h3>
... ... @@ -20,17 +26,22 @@
20 26 <?php } ?>
21 27 <p class="disclaimer">
22 28 <?php if(WINDOWS_OS) { ?>
23   - [START MENU] => [Programs] => [KnowledgeTree] => [Services]
  29 + <b>Using shortcuts:</b>
  30 + <br/>
  31 + [START MENU] => [Programs] => [KnowledgeTree 3.7.x] => [services]
  32 + <br/>
  33 + Click [Install Services]
24 34 <br/>
25   - Click [Install Services]
  35 + [START MENU] => [Programs] => [KnowledgeTree 3.7.x] => [services]
26 36 <br/>
27   - Click [Start Services]
  37 + Click [Start Services]
28 38 <br/>
29 39 <br/>
30   - Alternatively:
  40 + <b>Alternatively:</b>
31 41 <br/>
32 42 Open a command prompt and enter the following:
33 43 <br/>
  44 + <br/>
34 45 cd <?php echo "\"".SYSTEM_DIR."\""; ?> <br/>
35 46 dmsctl.bat install<br/>
36 47 dmsctl.bat start
... ... @@ -47,11 +58,6 @@
47 58 <?php } else { ?>
48 59 <br>
49 60 <?php } ?>
50   - <div>
51   - <a href="http://wiki.knowledgetree.com/Web_Based_Installer#Post_Install" target="_blank">
52   - Click Here for help on overcoming post install issues
53   - </a>
54   - </div>
55 61 </div>
56 62 <!-- <a href="../../login.php" class="back button_next" style="width:50px;" onclick="javascript:{w.clearSessions();}">Finish</a>-->
57 63 <input type="submit" name="Next" value="Finish" class="button_next"/>
... ...
setup/upgrade/templates/database.tpl
... ... @@ -21,7 +21,7 @@
21 21 <?php }
22 22 else if ($action == 'confirm') {
23 23 if ($backupStatus) { ?>
24   - <p>We are about to start the upgrade process.<P>
  24 + <p>We are about to start the upgrade process. Are you sure you want to proceed with the upgrade process?<P>
25 25 <?php }
26 26 else { ?>
27 27 <p><font color="Red">Please ensure that you have made a backup before continuing with the upgrade process.</font><p>
... ...
setup/upgrade/templates/loading.tpl
1 1 <div id="loadingBar" style="display:none; text-align: center; padding: 4px;">
2   - <img src="/setup/wizard/resources/graphics/loading.gif">
  2 + <img src="../wizard/resources/graphics/loading.gif">
3 3 <br/>
4 4 <?php echo $loadingText; ?>
5 5 </div>
... ...
setup/upgrade/templates/wizard.tpl
... ... @@ -13,6 +13,7 @@
13 13 <?php if(AGENT == "IE6") echo $html->css('ie6.css'); ?>
14 14 <?php if(AGENT == "IE7") echo $html->css('ie7.css'); ?>
15 15 <?php if(AGENT == "IE8") echo $html->css('ie8.css'); ?>
  16 + <?php if(INSTALL_TYPE == "community") echo $html->css('community.css'); ?>
16 17 <meta http-equiv=Content-Type content="text/html; charset=utf-8">
17 18 </head>
18 19 <body onload="">
... ...
setup/wizard/lib/services/windowsLucene.php
... ... @@ -133,6 +133,8 @@ class windowsLucene extends windowsService {
133 133 public $name = "KTLucene";
134 134  
135 135 public $hrname = "KnowledgeTree Indexer Service. (KTLucene)";
  136 +
  137 + public $description = "KnowledgeTree Indexer Service.";
136 138  
137 139 /**
138 140 * Load defaults needed by service
... ... @@ -419,23 +421,15 @@ class windowsLucene extends windowsService {
419 421 */
420 422 public function install() {
421 423 $state = $this->status();
422   -// if($state == '') {
423 424 $luceneExe = $this->getLuceneExe();
424 425 $luceneSource = $this->getLuceneSource();
425 426 $luceneDir = $this->getluceneDir();
426   -// if($luceneExe && $luceneSource && $luceneDir) {
427   - $cmd = "\"{$luceneExe}\""." -install \"".$this->getName()."\" \"".$this->getJavaJVM(). "\" -Djava.class.path=\"".$luceneSource."\"". " -start ".$this->getLuceneServer(). " -out \"".$this->getLuceneOut()."\" -err \"".$this->getLuceneError()."\" -current \"".$luceneDir."\" -auto";
428   - if(DEBUG) {
429   - echo "$cmd<br/>";
430   - return false;
431   - }
432   - $this->writeLuceneInstall($cmd);
433   - //$response = $this->util->pexec($cmd);
434   -// return $response;
435   -// }
436   - return $state;
437   -// }
438   -
  427 + $cmd = "\"{$luceneExe}\""." -install \"".$this->getName()."\" -description "."\"".$this->description."\""." \"".$this->getJavaJVM(). "\" -Djava.class.path=\"".$luceneSource."\"". " -start ".$this->getLuceneServer(). " -out \"".$this->getLuceneOut()."\" -err \"".$this->getLuceneError()."\" -current \"".$luceneDir."\" -auto";
  428 + if(DEBUG) {
  429 + echo "$cmd<br/>";
  430 + return false;
  431 + }
  432 + $this->writeLuceneInstall($cmd);
439 433 return $state;
440 434 }
441 435  
... ...
setup/wizard/lib/services/windowsOpenOffice.php
... ... @@ -134,6 +134,8 @@ class windowsOpenOffice extends windowsService {
134 134  
135 135 public $hrname = "KnowledgeTree OpenOffice.org Service. (KTOpenOffice)";
136 136  
  137 + public $description = "KnowledgeTree OpenOffice.org Service.";
  138 +
137 139 /**
138 140 * Load defaults needed by service
139 141 *
... ... @@ -212,7 +214,7 @@ class windowsOpenOffice extends windowsService {
212 214 if($status == '') {
213 215 $binary = $this->getBin();
214 216 if($binary != '') {
215   - $cmd = "\"{$this->winservice}\" install $this->name "."-displayname {$this->name} -start auto \"".$binary."\" -headless -invisible -nofirststartwizard -\"accept=socket,host={$this->host},port={$this->port};urp;\"";;
  217 + $cmd = "\"{$this->winservice}\" install \"{$this->name}\" -description \"{$this->description}\" -displayname \"{$this->name}\" -start auto \"".$binary."\" -headless -invisible -nofirststartwizard -\"accept=socket,host={$this->host},port={$this->port};urp;\"";;
216 218 if(DEBUG) {
217 219 echo "$cmd<br/>";
218 220 return false;
... ...
setup/wizard/lib/services/windowsScheduler.php
... ... @@ -79,6 +79,8 @@ class windowsScheduler extends windowsService {
79 79  
80 80 public $hrname = "KnowledgeTree Scheduler Service. (KTScheduler)";
81 81  
  82 + public $description = "KnowledgeTree Scheduler Service.";
  83 +
82 84 /**
83 85 * Load defaults needed by service
84 86 *
... ... @@ -180,7 +182,7 @@ class windowsScheduler extends windowsService {
180 182 }
181 183  
182 184 private function setOptions() {
183   - $this->options = "-displayname {$this->name} -start auto -binary \"{$this->getSchedulerScriptPath()}\" -headless -invisible ";
  185 + $this->options = "-displayname \"{$this->name}\" -description \"{$this->description}\" -start auto -binary \"{$this->getSchedulerScriptPath()}\" -headless -invisible ";
184 186 }
185 187  
186 188 private function writeTaskRunner() {
... ... @@ -233,36 +235,9 @@ class windowsScheduler extends windowsService {
233 235 $state = $this->status();
234 236 if($state == '') {
235 237 $this->writeTaskRunner();
236   - //if (function_exists('win32_create_service')) { // TODO what if it does not exist? check how the dmsctl.bat does this
237   -// if(DEBUG) {
238   -// echo '<pre>';
239   -// print_r(array('service' => $this->name, 'display' => $this->name, 'path' => $this->getSchedulerScriptPath()));
240   -// echo '</pre>';
241   -// echo '<pre>';
242   -// print_r(file_get_contents($this->getSchedulerScriptPath()));
243   -// echo '</pre>';
244   -// return ;
245   -// }
246   - /*
247   - $response = win32_create_service(array(
248   - 'service' => $this->name,
249   - 'display' => $this->name,
250   - 'path' => $this->getSchedulerScriptPath()
251   - ));
252   - return $response;
253   - */
254   - //} else { // Attempt to use the winserv
255   - // TODO: Add service using winserv
256   - $this->setWinservice();
257   - $this->setOptions();
258   - $cmd = "\"{$this->winservice}\" install $this->name $this->options";
259   - if(DEBUG) {
260   - echo "$cmd<br/>";
261   - return false;
262   - }
263   - //$response = $this->util->pexec($cmd);
264   - //return $response;
265   - //}
  238 + $this->setWinservice();
  239 + $this->setOptions();
  240 + $cmd = "\"{$this->winservice}\" install $this->name $this->options";
266 241 $this->writeSchedulerInstall($cmd);
267 242 }
268 243 return $state;
... ... @@ -285,7 +260,7 @@ class windowsScheduler extends windowsService {
285 260 }
286 261  
287 262 public function getStopMsg($installDir) {
288   - return "";//"Execute from command prompt : $installDir/dmsctl.bat stop";
  263 + return "";
289 264 }
290 265 }
291 266 ?>
292 267 \ No newline at end of file
... ...
setup/wizard/resources/css/wizard.css
... ... @@ -609,4 +609,13 @@ td.dir_description {
609 609  
610 610 .facebook {
611 611  
  612 +}
  613 +
  614 +.connect {
  615 + float:none;
  616 + padding-bottom:0;
  617 + padding-left:560px;
  618 + padding-right:10px;
  619 + padding-top:10px;
  620 + position:static;
612 621 }
613 622 \ No newline at end of file
... ...
setup/wizard/steps/database.php
... ... @@ -638,6 +638,9 @@ class database extends Step
638 638 $this->error['con'] = "Could not populate schema ";
639 639 }
640 640 $this->writeBinaries();
  641 + $port = $conf['server']['port'];
  642 + $iserverPorts = 'UPDATE config_settings SET value = "'.$port.'" where group_name = "server" and item IN("internal_server_port", "server_port");'; // Update internal server port
  643 + $this->util->dbUtilities->query($iserverPorts);
641 644 // ensure a guid was generated and is stored
642 645 $this->util->getSystemIdentifier();
643 646 $this->reBuildPaths();
... ... @@ -767,10 +770,13 @@ class database extends Step
767 770 $this->parse_mysql_dump($sqlFile);
768 771 $dropPluginHelper = "TRUNCATE plugin_helper;"; // Remove plugin helper table
769 772 $this->util->dbUtilities->query($dropPluginHelper);
770   - $this->reBuildPaths();
771   -
  773 + $conf = $this->util->getDataFromSession('configuration');
  774 + $port = $conf['server']['port'];
  775 + $iserverPorts = 'UPDATE config_settings SET value = "'.$port.'" where group_name = "server" and item IN("internal_server_port", "server_port");'; // Update internal server port
  776 + $this->util->dbUtilities->query($iserverPorts);
772 777 $updateExternalBinaries = 'UPDATE config_settings c SET c.value = "default" where c.group_name = "externalBinary";'; // Remove references to old paths
773 778 $this->util->dbUtilities->query($updateExternalBinaries);
  779 + $this->reBuildPaths();
774 780 $this->writeBinaries(); // Rebuild some of the binaries
775 781 $this->util->getSystemIdentifier(); // ensure a guid was generated and is stored
776 782  
... ...
setup/wizard/templates/complete.tpl
... ... @@ -13,16 +13,7 @@
13 13 </div>
14 14 <br/>
15 15 <div id="step_content_<?php echo $step_name; ?>" class="step">
16   - <div style="padding: 0pt 0pt 40px 15px; float: right;">
17   - <a class="twitter" href="http://www.twitter.com/knowledgetreesw" style="color:#FFFFFF;" target="_blank">
18   - <?php echo $html->image('twitterbutton.png'); ?>
19   - </a>
20   - <br/>
21   - <br/>
22   - <a class="facebook" href="http://www.facebook.com/pages/KnowledgeTree-Document-Management-Made-Simple/59248880725" style="color:#FFFFFF;" target="_blank">
23   - <?php echo $html->image('facebookbutton.png'); ?>
24   - </a>
25   - </div>
  16 +
26 17 <?php if(!$servicesValidation) { ?>
27 18 <?php if(!$migrate_check) { ?>
28 19 <h3>Services</h3>
... ... @@ -38,14 +29,18 @@
38 29 <?php } ?>
39 30 <p class="disclaimer">
40 31 <?php if(WINDOWS_OS) { ?>
41   - [START MENU] => [Programs] => [KnowledgeTree] => [Services]
  32 + <b>Using shortcuts:</b>
  33 + <br/>
  34 + [START MENU] => [Programs] => [KnowledgeTree 3.7.x] => [services]
  35 + <br/>
  36 + Click [Install Services]
42 37 <br/>
43   - Click [Install Services]
  38 + [START MENU] => [Programs] => [KnowledgeTree 3.7.x] => [services]
44 39 <br/>
45   - Click [Start Services]
  40 + Click [Start Services]
46 41 <br/>
47 42 <br/>
48   - Alternatively:
  43 + <b>Alternatively:</b>
49 44 <br/>
50 45 Open a command prompt and enter the following:
51 46 <br/>
... ... @@ -187,6 +182,16 @@
187 182 </div>
188 183 <?php } ?>
189 184 <?php } ?>
  185 + <div class="connect">
  186 + <a class="twitter" href="http://www.twitter.com/knowledgetreesw" style="color:#FFFFFF;" target="_blank">
  187 + <?php echo $html->image('twitterbutton.png'); ?>
  188 + </a>
  189 + <br/>
  190 + <br/>
  191 + <a class="facebook" href="http://www.facebook.com/pages/KnowledgeTree-Document-Management-Made-Simple/59248880725" style="color:#FFFFFF;" target="_blank">
  192 + <?php echo $html->image('facebookbutton.png'); ?>
  193 + </a>
  194 + </div>
190 195 </div>
191 196 <?php
192 197 $script = $_SERVER['SCRIPT_NAME'];
... ...
setup/wizard/templates/database.tpl
... ... @@ -63,7 +63,7 @@
63 63 <table>
64 64 <tr>
65 65 <td width="10px"> <label for='dhost'>Host: </label> </td>
66   - <td width="205px"> <div id="tooltips" title="The address of the server where the database is located, if different to the current server">&nbsp;</div> </td>
  66 + <td width="10px"> <div id="tooltips" title="The address of the server where the database is located, if different to the current server">&nbsp;</div> </td>
67 67 <td width="10px"> <input type="text" value="<?php echo $dhost?>" id="dhost" name="dhost" size='<?php echo $input_size; ?>' class="textinput"/> </td>
68 68 </tr>
69 69 <tr>
... ...
setup/wizard/templates/wizard.tpl
... ... @@ -12,6 +12,7 @@
12 12 <?php if(AGENT == "IE6") echo $html->css('ie6.css'); ?>
13 13 <?php if(AGENT == "IE7") echo $html->css('ie7.css'); ?>
14 14 <?php if(AGENT == "IE8") echo $html->css('ie8.css'); ?>
  15 + <?php if(INSTALL_TYPE == "community") echo $html->css('community.css'); ?>
15 16 <meta http-equiv=Content-Type content="text/html; charset=utf-8">
16 17 </head>
17 18 <body onload="">
... ...