Commit 39d747b07d6a06b8c8f05b9e1d15284869607453

Authored by Megan Watson
2 parents c302b7c9 0f21f249

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

Showing 41 changed files with 238 additions and 152 deletions
plugins/ktcore/document/edit.php
... ... @@ -216,6 +216,31 @@ class KTDocumentEditAction extends KTDocumentAction {
216 216 $values = (array) KTUtil::arrayGet($data, 'fieldset_' . $oFieldset->getId());
217 217 foreach ($fields as $oField) {
218 218 $val = KTUtil::arrayGet($values, 'metadata_' . $oField->getId());
  219 +
  220 + // for html fields we want to do some stripping :)
  221 + if ($oField->getIsHTML())
  222 + {
  223 + // NOTE this works great...once the text is saved a first time
  224 + // but the first time the <script> tags come through encoded, so decode first
  225 + // HOWEVER html_entity_decode decodes too much (e.g. &nbsp; - which causes a DB error for some reason)! use this instead
  226 + // NOTE I considered a preg_replace_callback but str_replace is probably more efficient in this case as we only have
  227 + // two symbols to replace
  228 + $val = str_replace('&lt;', '<', $val);
  229 + $val = str_replace('&gt;', '>', $val);
  230 + //$val = preg_replace_callback('/&lt;([^&]*)&gt;/', create_function('$matches', 'return "<" . $matches[1] . ">";'), $val);
  231 + // in case of script which does not yet contain <!-- //--> around the actual code (i.e. first submission again)
  232 + // these will not be correctly removed by strip_tags
  233 + $val = preg_replace('/<script[^>]*>([^<]*)<\/script>/', '', $val);
  234 + // remove any attempts to call an onclick/onmouseover/onwhatever call
  235 + $val = preg_replace_callback('/on[^= ]*=[^; \/>]*;?"? *\/? *(>?)/',
  236 + create_function('$matches', 'if (isset($matches[1])) return $matches[1]; else return null;'),
  237 + $val);
  238 + // now strip remaining tags including script tags with code surrounded by <!-- //-->,
  239 + // which would not be stripped by the previous regex
  240 + $val = strip_tags($val, '<p><a><b><strong><ol><ul><li><p><br><i><em><u><span>');
  241 + // remove empty <p> tags?
  242 + $val = preg_replace('/<p><\/p>\r?\n?/', '', $val);
  243 + }
219 244  
220 245 if($oField->getDataType() == "LARGE TEXT" && !is_null($oField->getMaxLength()))
221 246 {
... ...
plugins/multiselect/templates/ktcore/search2/adv_query_builder.smarty
... ... @@ -429,6 +429,7 @@ function createText(groupid, fid, type)
429 429 html += "<option value=\"is not\">{/literal}{i18n}is not{/i18n}{literal}";
430 430 break;
431 431 case 'STRING':
  432 + case 'LARGE TEXT':
432 433 html += "<option value=\"is\">{/literal}{i18n}is{/i18n}{literal}";
433 434 html += "<option value=\"is not\">{/literal}{i18n}is not{/i18n}{literal}";
434 435 html += "<option value=\"contains\">{/literal}{i18n}contains{/i18n}{literal}";
... ... @@ -496,7 +497,7 @@ function addFieldTypeSelection(groupid, fid, type, options)
496 497 }
497 498 // want to fall through
498 499 case 'FULLTEXT':
499   -
  500 + case 'LARGE TEXT':
500 501 case 'STRINGMATCH':
501 502 html = createText(groupid, fid, type);
502 503 break;
... ...
setup/migrate/migrateUtil.php
... ... @@ -157,15 +157,6 @@ class MigrateUtil {
157 157 return $this->bootstrap->absoluteURI($url = null, $protocol = null, $port = null);
158 158 }
159 159  
160   - /**
161   - * Portably execute a command on any of the supported platforms.
162   - *
163   - * @author KnowledgeTree Team
164   - * @access public
165   - * @param string $aCmd
166   - * @param array $aOptions
167   - * @return array
168   - */
169 160 public function pexec($aCmd, $aOptions = null) {
170 161 return $this->bootstrap->pexec($aCmd, $aOptions = null);
171 162 }
... ...
setup/migrate/templates/complete.tpl
... ... @@ -67,5 +67,6 @@
67 67 ?>
68 68 </table>
69 69 </div>
70   - <input class="button_next" type="submit" value="Back To Installer" name="BInstall"/>
71   -</form>
72 70 \ No newline at end of file
  71 + <input class="button_next" type="submit" value="Continue Installion" name="BInstall"/>
  72 +</form>
  73 +<?php if (AJAX) { echo $html->js('form.js'); } ?>
73 74 \ No newline at end of file
... ...
setup/migrate/templates/database.tpl
... ... @@ -18,4 +18,5 @@
18 18 </form>
19 19 <script type="text/javascript">
20 20 $("#duname").focus();
21   -</script>
22 21 \ No newline at end of file
  22 +</script>
  23 +<?php if (AJAX) { echo $html->js('form.js'); } ?>
23 24 \ No newline at end of file
... ...
setup/migrate/templates/installation.tpl
... ... @@ -46,4 +46,5 @@
46 46 </form>
47 47 <script type="text/javascript">
48 48 $("#location").focus();
49   -</script>
50 49 \ No newline at end of file
  50 +</script>
  51 +<?php if (AJAX) { echo $html->js('form.js'); } ?>
51 52 \ No newline at end of file
... ...
setup/migrate/templates/installation_confirm.tpl
... ... @@ -71,4 +71,4 @@
71 71 <input type="submit" name="Edit" value="Back" class="button_previous"/>
72 72 <input type="submit" name="Confirm" value="Confirm" class="button_next"/>
73 73 </form>
74   -<?php if (AJAX) { ?> <script type="text/javascript" src="resources/form.js"></script> <?php } ?>
75 74 \ No newline at end of file
  75 +<?php if (AJAX) { echo $html->js('form.js'); } ?>
76 76 \ No newline at end of file
... ...
setup/migrate/templates/services.tpl
... ... @@ -79,4 +79,5 @@
79 79 </div>
80 80 <input type="submit" name="Previous" value="Back" class="button_previous"/>
81 81 <input type="submit" name="Next" value="Next" class="button_next"/>
82   -</form>
83 82 \ No newline at end of file
  83 +</form>
  84 +<?php if (AJAX) { echo $html->js('form.js'); } ?>
84 85 \ No newline at end of file
... ...
setup/wizard/installUtil.php
... ... @@ -66,21 +66,6 @@ class InstallUtil {
66 66 return false;
67 67 }
68 68  
69   - /**
70   - * Check if system needs to be migrated
71   - *
72   - * @author KnowledgeTree Team
73   - * @access public
74   - * @param none
75   - * @return boolean
76   - */
77   - public function isMigration() {
78   - if (isset($_POST['Migrate'])) {
79   - return true;
80   - }
81   - return false;
82   - }
83   -
84 69 public function error($error) {
85 70 $template_vars['error'] = $error;
86 71 $file = "templates/error.tpl";
... ... @@ -518,6 +503,42 @@ class InstallUtil {
518 503 }
519 504  
520 505 /**
  506 + * Check if system needs to be migrated
  507 + *
  508 + * @author KnowledgeTree Team
  509 + * @access public
  510 + * @param none
  511 + * @return boolean
  512 + */
  513 + public function migrationSpecified() {
  514 + if(isset($_POST['installtype'])) {
  515 + if($_POST['installtype'] == "Upgrade Installation") {
  516 + return true;
  517 + }
  518 + }
  519 +
  520 + return false;
  521 + }
  522 +
  523 + /**
  524 + * Check if system needs to be migrated
  525 + *
  526 + * @author KnowledgeTree Team
  527 + * @access public
  528 + * @param none
  529 + * @return boolean
  530 + */
  531 + public function upgradeSpecified() {
  532 + if(isset($_POST['installtype'])) {
  533 + if($_POST['installtype'] == "Upgrade Only") {
  534 + return true;
  535 + }
  536 + }
  537 +
  538 + return false;
  539 + }
  540 +
  541 + /**
521 542 * Get session data from package
522 543 *
523 544 * @author KnowledgeTree Team
... ... @@ -644,7 +665,30 @@ class InstallUtil {
644 665 return '';
645 666 }
646 667  
  668 + /**
  669 + * Deletes migration lock file if a clean install is chosen
  670 + * This is in case someone changes their mind after choosing upgrade/migrate and clicks back up to this step
  671 + *
  672 + * @author KnowledgeTree Team
  673 + * @access private
  674 + * @return void
  675 + */
  676 + function deleteMigrateFile() {
  677 + if(file_exists("migrate.lock"))
  678 + @unlink("migrate.lock");
  679 + }
647 680  
  681 + /**
  682 + * Check if we are migrating an existing installation
  683 + *
  684 + * @return unknown
  685 + */
  686 + function isMigration() {
  687 + if(file_exists("migrate.lock"))
  688 + return true;
  689 + return false;
  690 + }
  691 +
648 692 /**
649 693 * Portably execute a command on any of the supported platforms.
650 694 *
... ...
setup/wizard/installWizard.php
... ... @@ -116,18 +116,6 @@ class InstallWizard {
116 116 }
117 117  
118 118 /**
119   - * Check if system has to be migrated
120   - *
121   - * @author KnowledgeTree Team
122   - * @access private
123   - * @param none
124   - * @return boolean
125   - */
126   - private function isMigration() {
127   - return $this->util->isMigration();
128   - }
129   -
130   - /**
131 119 * Display the wizard
132 120 *
133 121 * @author KnowledgeTree Team
... ... @@ -295,8 +283,10 @@ class InstallWizard {
295 283 $this->createInstallFile();
296 284 }
297 285 if(!$this->isSystemInstalled()) { // Check if the systems not installed
298   - if($this->isMigration()) { // Check if the migrator needs to be accessed
  286 + if($this->util->migrationSpecified()) { // Check if the migrator needs to be accessed
299 287 $this->util->redirect('../migrate');
  288 + } elseif ($this->util->upgradeSpecified()) {
  289 + $this->util->redirect('../upgrade');
300 290 }
301 291 $response = $this->systemChecks();
302 292 if($response === true) {
... ...
setup/wizard/installer.php
... ... @@ -414,8 +414,6 @@ class Installer {
414 414 */
415 415 private function _completeInstall() {
416 416 @touch("install.lock");
417   - if(file_exists("migrate.lock"))
418   - @unlink("migrate.lock");
419 417 }
420 418  
421 419 /**
... ...
setup/wizard/lib/services/unixLucene.php
... ... @@ -59,7 +59,7 @@ class unixLucene extends unixService {
59 59 * @param string
60 60 * @return void
61 61 */
62   - public function load() {
  62 + public function load($options = null) {
63 63 $this->setLuceneSource("ktlucene.jar");
64 64 $this->setLuceneDir(SYSTEM_DIR."bin".DS."luceneserver".DS);
65 65 $this->setIndexerDir(SYSTEM_DIR."search2".DS."indexing".DS."bin".DS);
... ...
setup/wizard/lib/services/unixOpenOffice.php
... ... @@ -63,7 +63,7 @@ class unixOpenOffice extends unixService {
63 63 * @param string
64 64 * @return void
65 65 */
66   - public function load() {
  66 + public function load($options = null) {
67 67 $this->setPort("8100");
68 68 $this->setHost("localhost");
69 69 $this->soffice = $this->util->getOpenOffice();
... ...
setup/wizard/lib/services/unixScheduler.php
... ... @@ -57,7 +57,7 @@ class unixScheduler extends unixService {
57 57 * @param string
58 58 * @return void
59 59 */
60   - public function load() {
  60 + public function load($options = null) {
61 61 $this->setPhpCli();
62 62 $this->scheduler = 'scheduler';
63 63 $this->setSchedulerSource('schedulerTask.sh');
... ...
setup/wizard/lib/services/windowsLucene.php
... ... @@ -140,7 +140,7 @@ class windowsLucene extends windowsService {
140 140 * @param string
141 141 * @return void
142 142 */
143   - public function load() {
  143 + public function load($options = null) {
144 144 $this->setJavaBin();
145 145 $this->setLuceneDIR(SYSTEM_DIR."bin".DS."luceneserver");
146 146 $this->setLuceneExe("KTLuceneService.exe");
... ...
setup/wizard/lib/services/windowsOpenOffice.php
... ... @@ -140,8 +140,10 @@ class windowsOpenOffice extends windowsService {
140 140 * @param string
141 141 * @return void
142 142 */
143   - public function load() {
144   - // hack for testing
  143 + public function load($options = null) {
  144 + if(isset($options['binary'])) {
  145 + $this->setBin($options['binary']);
  146 + }
145 147 $this->setPort("8100");
146 148 $this->setHost("127.0.0.1");
147 149 $this->setLog("openoffice.log");
... ... @@ -173,7 +175,7 @@ class windowsOpenOffice extends windowsService {
173 175 }
174 176  
175 177 private function setBin($bin) {
176   - $this->bin = "\"".$bin."\"";
  178 + $this->bin = $bin;
177 179 }
178 180  
179 181 public function getBin() {
... ... @@ -198,15 +200,18 @@ class windowsOpenOffice extends windowsService {
198 200 public function install() {
199 201 $status = $this->status();
200 202 if($status == '') {
201   - $services = $this->util->getDataFromSession('services');
202   - $this->setBin($services['openOfficeExe']);
203   - $cmd = "\"{$this->winservice}\" install $this->name "."-displayname {$this->name} -start auto {$this->getBin()} -headless -invisible -accept=socket,host={$this->host},port={$this->port};urp;";;
204   - if(DEBUG) {
205   - echo "Command : $cmd<br/>";
206   - return ;
207   - }
208   - $response = $this->util->pexec($cmd);
209   - return $response;
  203 + //$binary = $this->util->openOfficeSpecified();
  204 + $binary = $this->getBin();
  205 + if($binary != '') {
  206 + $cmd = "\"{$this->winservice}\" install $this->name "."-displayname {$this->name} -start auto \"".$binary."\" -headless -invisible -accept=socket,host={$this->host},port={$this->port};urp;";;
  207 + if(DEBUG) {
  208 + echo "Command : $cmd<br/>";
  209 + return ;
  210 + }
  211 + $response = $this->util->pexec($cmd);
  212 + return $response;
  213 + }
  214 + return $status;
210 215 }
211 216 else {
212 217 return $status;
... ...
setup/wizard/lib/services/windowsScheduler.php
... ... @@ -85,7 +85,7 @@ class windowsScheduler extends windowsService {
85 85 * @param string
86 86 * @return void
87 87 */
88   - function load() {
  88 + function load($options = null) {
89 89 $this->setSchedulerDIR($this->varDir."bin");
90 90 $this->setSchedulerScriptPath("taskrunner.bat");
91 91 $this->setSchedulerSource("schedulerService.php");
... ...
setup/wizard/lib/validation/openofficeValidation.php
... ... @@ -63,8 +63,7 @@ class openofficeValidation extends serviceValidation {
63 63 */
64 64 private $unixLocations = array("/usr/local/bin", "/usr/bin");
65 65  
66   -
67   - public function preset() {
  66 + public function preset($options = null) {
68 67 $this->specifyOpenOffice();
69 68 }
70 69  
... ... @@ -91,15 +90,15 @@ class openofficeValidation extends serviceValidation {
91 90 public function binaryChecks() {
92 91 if($this->util->openOfficeSpecified()) {
93 92 $this->soffice = $this->util->openOfficeSpecified();
94   - if(file_exists($this->soffice))
95   - return true;
  93 + if(file_exists($this->soffice))
  94 + return $this->soffice;
96 95 else
97 96 return false;
98 97 } else {
99 98 $auto = $this->detectOpenOffice();
100 99 if($auto) {
101 100 $this->soffice = $auto;
102   - return true;
  101 + return $this->soffice;
103 102 }
104 103 return false;
105 104 }
... ...
setup/wizard/resources/css/wizard.css
... ... @@ -102,13 +102,13 @@ select {
102 102 border: 1px solid rgb(207, 207, 207);
103 103 padding: 5px;
104 104 overflow: auto;
105   - height: 400px;
  105 + min-height: 400px;
106 106 }
107 107  
108 108 #step_content_dependencies {
109 109 border: 1px solid rgb(207, 207, 207);
110 110 padding: 5px;
111   - min-height:265px;
  111 + min-height:285px;
112 112 }
113 113  
114 114 #step_content_configuration {
... ... @@ -323,6 +323,12 @@ select {
323 323 margin-top:10px;
324 324 }
325 325  
  326 +.button_radio_next {
  327 + float:none;
  328 + margin-left:0px;
  329 + margin-top:0px;
  330 +}
  331 +
326 332 .buttons a {
327 333 background: #DDDDDD;
328 334 border: solid 1px #888;
... ... @@ -533,4 +539,10 @@ td.dir_description {
533 539 position:relative;
534 540 height:0px;
535 541 width:0px;
  542 +}
  543 +
  544 +#install_options {
  545 + position:relative;
  546 + padding-left: 400px;
  547 + padding-top: 10px;
536 548 }
537 549 \ No newline at end of file
... ...
setup/wizard/resources/js/wizard.js
... ... @@ -218,17 +218,11 @@ wizard.prototype.sendRegistration = function () {
218 218 }
219 219  
220 220 wizard.prototype.clearSessions = function () {
221   - <?php
222   - echo 'All Clear';
223   - $_SESSION['installers'] = null;
224   - $_SESSION['migrate'] = null;
225   - $_SESSION['upgrade'] = null;
226   - ?>
227 221 // var address = 'session.php?action=destroyAll';
228 222 // $.ajax({
229 223 // url: address,
230 224 // dataType: "html",
231 225 // type: "POST",
232 226 // cache: false,
233   -// });
  227 +// });
234 228 }
235 229 \ No newline at end of file
... ...
setup/wizard/step.php
... ... @@ -295,10 +295,12 @@ class Step
295 295 * @return boolean
296 296 */
297 297 function migrate() {
298   - if(isset($_POST['Migrate'])) {
299   - return true;
300   - }
301   -
  298 + if(isset($_POST['installtype'])) {
  299 + if($_POST['installtype'] == "Upgrade Installation") {
  300 + return true;
  301 + }
  302 + }
  303 +
302 304 return false;
303 305 }
304 306  
... ...
setup/wizard/steps/complete.php
... ... @@ -52,6 +52,7 @@ class complete extends Step {
52 52 private $paths_check = 'tick';
53 53 private $privileges_check = 'tick';
54 54 private $database_check = 'tick';
  55 + private $migrate_check = false;
55 56 protected $silent = true;
56 57  
57 58 function doStep() {
... ... @@ -61,14 +62,11 @@ class complete extends Step {
61 62 }
62 63  
63 64 function doRun() {
64   - // check filesystem (including location of document directory and logging)
65   - $this->checkFileSystem();
66   - // check database
67   - $this->checkDb();
68   - // check services
69   - $this->checkServices();
  65 + $this->checkFileSystem(); // check filesystem (including location of document directory and logging)
  66 + $this->checkDb(); // check database
  67 + $this->checkServices(); // check services
  68 + $this->checkInstallType();// Set silent mode variables
70 69 $this->storeSilent();// Set silent mode variables
71   -
72 70 }
73 71  
74 72 private function checkFileSystem()
... ... @@ -219,6 +217,14 @@ class complete extends Step {
219 217 return true;
220 218 }
221 219  
  220 + function checkInstallType() {
  221 + if ($this->util->isMigration()) {
  222 + $this->migrate_check = true;
  223 + } else {
  224 + $this->migrate_check = false;
  225 + }
  226 + }
  227 +
222 228 /**
223 229 * Set all silent mode varibles
224 230 *
... ... @@ -228,11 +234,7 @@ class complete extends Step {
228 234 $this->temp_variables['paths_check'] = $this->paths_check;
229 235 $this->temp_variables['privileges_check'] = $this->privileges_check;
230 236 $this->temp_variables['database_check'] = $this->database_check;
231   - if (file_exists('migrate.lock')) {
232   - $this->temp_variables['migrate_check'] = true;
233   - } else {
234   - $this->temp_variables['migrate_check'] = false;
235   - }
  237 + $this->temp_variables['migrate_check'] = $this->migrate_check;
236 238 }
237 239 }
238 240 ?>
239 241 \ No newline at end of file
... ...
setup/wizard/steps/configuration.php
... ... @@ -310,7 +310,7 @@ class configuration extends Step
310 310 $server = $conf['server'];
311 311 $paths = $conf['paths'];
312 312 // TODO
313   - if (file_exists('migrate.lock')) { // Check if its an upgrade
  313 + if ($this->util->isMigration()) { // Check if its an upgrade
314 314 $this->readInstallation();
315 315 } else {
316 316 $this->readConfigPath(); // initialise writing to config.ini
... ... @@ -448,14 +448,14 @@ class configuration extends Step
448 448 private function getPathInfo($fileSystemRoot)
449 449 {
450 450 if(isset($this->temp_variables['paths'])) {
451   - if (file_exists('migrate.lock')) { // Check if its an upgrade
  451 + if ($this->util->isMigration()) { // Check if its an upgrade
452 452 $this->readInstallation(); // Read values from config.ini of other installation
453 453 $dirs = $this->getFromConfigPath(); // Store contents
454 454 } else {
455 455 $dirs = $this->temp_variables['paths']; // Pull from temp
456 456 }
457 457 } else {
458   - if (file_exists('migrate.lock')) { // Check if its an upgrade
  458 + if ($this->util->isMigration()) { // Check if its an upgrade
459 459 $this->readInstallation(); // Read values from config.ini of other installation
460 460 } else {
461 461 $this->readConfigPath(); // Read contents of config-path file
... ...
setup/wizard/steps/database.php
... ... @@ -557,8 +557,8 @@ class database extends Step
557 557 */
558 558 private function mysql() {
559 559 $con = $this->connectMysql();
560   - // check for migrate.lock file which indicates this is a migration and not a clean install
561   - if (file_exists('migrate.lock')) {
  560 + // check for migrate lock file which indicates this is a migration and not a clean install
  561 + if ($this->util->isMigration()) {
562 562 if(!$this->migrateDB($con)) {
563 563 $this->error['con'] = "Could not Create Database: ";
564 564 return false;
... ...
setup/wizard/steps/installtype.php
... ... @@ -48,10 +48,11 @@ class installType extends step
48 48 if(!$this->inStep("installtype")) {
49 49 return 'landing';
50 50 }
  51 +
51 52 if($this->migrate()) {
52 53 return 'migrate';
53 54 } if($this->next()) {
54   - $this->deleteMigrateFile();
  55 + $this->util->deleteMigrateFile();
55 56 return 'next';
56 57 } else if($this->previous()) {
57 58 return 'previous';
... ... @@ -68,17 +69,5 @@ class installType extends step
68 69 public function getErrors() {
69 70 return $this->error;
70 71 }
71   -
72   - /**
73   - * Deletes migration lock file if a clean install is chosen
74   - * This is in case someone changes their mind after choosing upgrade/migrate and clicks back up to this step
75   - *
76   - * @author KnowledgeTree Team
77   - * @access private
78   - * @return void
79   - */
80   - private function deleteMigrateFile() {
81   - @unlink("migrate.lock");
82   - }
83 72 }
84 73 ?>
85 74 \ No newline at end of file
... ...
setup/wizard/steps/services.php
... ... @@ -216,10 +216,10 @@ class services extends Step
216 216 $class = strtolower($service)."Validation";
217 217 $this->$class->preset(); // Sets defaults
218 218 if(!$this->$class->installed) {
219   - if(!WINDOWS_OS) { $this->$class->getBinary(); } // Get binary, if it exists
  219 + if(!WINDOWS_OS) { $binary = $this->$class->getBinary(); } // Get binary, if it exists
220 220 $passed = $this->$class->binaryChecks(); // Run Binary Pre Checks
221 221 if ($passed) { // Install Service
222   - $this->installService($service);
  222 + $this->installService($service, $passed);
223 223 }
224 224 } else {
225 225 $this->$class->installed();
... ... @@ -323,10 +323,10 @@ class services extends Step
323 323 * @access private
324 324 * @return boolean
325 325 */
326   - private function installService($serviceName) {
  326 + private function installService($serviceName, $binary) {
327 327 $className = OS.$serviceName;
328 328 $service = new $className();
329   - $status = $this->serviceHelper($service);
  329 + $status = $this->serviceHelper($service, $binary);
330 330 if (!$status) {
331 331 $this->serviceCheck = 'cross_orange';
332 332 }
... ... @@ -340,8 +340,8 @@ class services extends Step
340 340 * @access private
341 341 * @return string
342 342 */
343   - private function serviceHelper($service) {
344   - $service->load(); // Load Defaults
  343 + private function serviceHelper($service, $binary) {
  344 + $service->load(array('binary'=>$binary)); // Load Defaults
345 345 $response = $service->install(); // Install service
346 346 $statusCheck = OS."ServiceInstalled";
347 347 return $this->$statusCheck($service);
... ... @@ -446,7 +446,7 @@ class services extends Step
446 446 * @return mixed
447 447 */
448 448 public function installStep() {
449   - if (!file_exists('migrate.lock')) { // Check if it is a migration
  449 + if (!$this->util->isMigration()) { // Check if it is a migration
450 450 foreach ($this->getServices() as $serviceName) {
451 451 $className = OS.$serviceName;
452 452 $service = new $className();
... ...
setup/wizard/templates/complete.tpl
... ... @@ -12,7 +12,7 @@
12 12 . 'Click Here for help on overcoming post install issues</a></div><br/>';
13 13 }
14 14 ?>
15   - <div id="step_content_complete" class="step">
  15 + <div id="step_content_<?php echo $step_name; ?>" class="step">
16 16 <!-- Paths and Permissions -->
17 17 <div>
18 18 <h3><?php echo "<span class='{$paths_check}'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>"; ?>Paths and Permissions</h3>
... ... @@ -65,6 +65,7 @@
65 65 </div>
66 66 <!-- Services -->
67 67 <br/><br/>
  68 +<?php if(!$migrate_check) { ?>
68 69 <div>
69 70 <h3><?php echo "<span class='{$services_check}'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>"; ?>Services</h3>
70 71 <?php if($silent) { ?>
... ... @@ -116,11 +117,13 @@
116 117 </div>
117 118 <?php } ?>
118 119 </div>
  120 + <?php } ?>
119 121 </div>
  122 +
120 123 <?php if($migrate_check) { ?>
121   - <a href="../../login.php" class="buttons back upgrade" style="width:80px;" onclick="javascript:{w.clearSessions();}">Goto Login</a>
  124 + <a href="../../control.php" class="buttons back upgrade" style="width:80px;" onclick="javascript:{w.clearSessions();}">Goto Login</a>
122 125 <?php } else { ?>
123   - <a href="../../login.php" class="buttons back upgrade" style="width:80px;" onclick="javascript:{w.clearSessions();}">Goto Login</a>
  126 + <a href="../../control.php" class="buttons back upgrade" style="width:80px;" onclick="javascript:{w.clearSessions();}">Goto Login</a>
124 127 <?php } ?>
125 128 <?php
126 129 if (INSTALL_TYPE == 'Zend') {
... ...
setup/wizard/templates/configuration.tpl
1   -<form id="dependencies_configuration_services" action="index.php?step_name=configuration" method="post">
  1 +<form id="dependencies_configuration_services" action="index.php?step_name=<?php echo $step_name; ?>" method="post">
2 2 <p class="title">Checking System Configuration</p>
3 3  
4 4 <p class="description">
... ... @@ -32,7 +32,7 @@
32 32 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://wiki.knowledgetree.com/Web_Based_Installer#System_Configuration" target="_blank">Click here for help on overcoming configuration issues</a>
33 33 <?php } ?>
34 34 <!--Content-->
35   - <div id="step_content_configuration" class="step">
  35 + <div id="step_content_<?php echo $step_name; ?>" class="step">
36 36 <h3>Server Settings</h3>
37 37  
38 38 <p class="description">
... ...
setup/wizard/templates/configuration_confirm.tpl
1   -<form id="dependencies_configuration_services" action="index.php?step_name=configuration" method="post">
  1 +<form id="dependencies_configuration_services" action="index.php?step_name=<?php echo $step_name; ?>" method="post">
2 2 <p class="title">System Configuration</p>
3 3 <!--Continue Message-->
4 4 <?php
... ... @@ -26,7 +26,7 @@
26 26 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://wiki.knowledgetree.com/Web_Based_Installer#System_Configuration" target="_blank">Click here for help on overcoming configuration issues</a>
27 27 <?php } ?>
28 28 <!--Content-->
29   - <div id="step_content_configuration" class="step">
  29 + <div id="step_content_<?php echo $step_name; ?>" class="step">
30 30 <h3>Server Settings</h3>
31 31 <table>
32 32 <tr>
... ...
setup/wizard/templates/database.tpl
... ... @@ -15,7 +15,7 @@
15 15 This step configures the connection to the database server and installs the database. The details for an administrative <br/>
16 16 user on the database server are required in order to be able to configure and install the installation database.
17 17 </div>
18   - <div id="step_content_database" class="step">
  18 + <div id="step_content_<?php echo $step_name; ?>" class="step">
19 19  
20 20 <table class="dbconf">
21 21 <?php
... ...
setup/wizard/templates/database_confirm.tpl
... ... @@ -4,7 +4,7 @@
4 4 <div class="description">
5 5 Please confirm whether KnowledgeTree has correctly determined your database settings before proceeding. Print this page for future use. <a href="javascript:window.print()">Click to Print This Page</a>
6 6 </div>
7   - <div id="step_content_database_confirm" class="step">
  7 + <div id="step_content_<?php echo $step_name; ?>_confirm" class="step">
8 8 <h3><b>Database Settings</b></h3>
9 9 <table class="dbconf">
10 10 <?php
... ...
setup/wizard/templates/dependencies.tpl
1   -<form id="license_dependencies_configuration" action="index.php?step_name=dependencies" method="post">
  1 +<form id="license_dependencies_configuration" action="index.php?step_name=<?php echo $step_name; ?>" method="post">
2 2 <p class="title">Checking PHP Dependencies</p>
3 3 <p class="description">
4 4 The wizard will review your system to determine whether you have the right PHP components in place to run KnowledgeTree. <br/>
... ... @@ -29,7 +29,7 @@
29 29 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://wiki.knowledgetree.com/Web_Based_Installer#PHP_Dependencies" target="_blank" class="description_click">Click here for help on overcoming dependency issues</span></a>
30 30 <?php } ?>
31 31 <!--Content-->
32   - <div id="step_content_dependencies" class="step">
  32 + <div id="step_content_<?php echo $step_name; ?>" class="step">
33 33 <h3><?php echo "<span class='{$php}'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>"; ?>PHP Version Check</h3>
34 34 <?php if($silent) { ?>
35 35 <?php if($versionSection) {
... ...
setup/wizard/templates/install.tpl
1   -<form id="registration_install_complete" action="index.php?step_name=install" method="post">
  1 +<form id="registration_install_complete" action="index.php?step_name=<?php echo $step_name; ?>" method="post">
2 2 <p class="title">Finalizing System Installation</p>
3 3  
4   - <div id="step_content" class="step">
  4 + <div id="step_content_<?php echo $step_name; ?>" class="step">
5 5 <br/>
6 6 <br/>
7 7 <p class="empty_space">
... ...
setup/wizard/templates/installtype.tpl
1   -<form id="registration_install_complete" action="index.php?step_name=installtype" method="post">
  1 +<form id="registration_install_complete" action="index.php?step_name=<?php echo $step_name; ?>" method="post">
2 2 <p class="title">Installation Type</p>
3 3  
4 4 <div id="step_content" class="step">
5 5 <br/>
6   - <br/>
7   - <p class="empty_space">
8   - The wizard will require you choose between an upgrade of an existing sytem or a clean install.
9   - </p>
10   - <div class="demo"><?php echo $html->image('kt_browse.png'); ?></div>
  6 + The wizard will require you choose an installation type.
  7 + <br/><br/>
  8 + <table>
  9 + <tr>
  10 + <td> <input type="radio" name="installtype" value="Clean Install" checked id="clean" /> </td>
  11 + <td> <label for="clean"><b>Clean Install</b> - New Installation of KnowledgeTree</label> </td>
  12 + </tr>
  13 + <tr>
  14 + <td> <input type="radio" name="installtype" value="Upgrade Installation" id="migrate" /> </td>
  15 + <td> <label for="migrate"><b>Upgrade Installation</b> - Upgrade an existing Installation of KnowledgeTree</label> </td>
  16 + </tr>
  17 + <tr>
  18 + <td> <input type="radio" name="installtype" value="Upgrade Only" id="upgrade" /> </td>
  19 + <td> <label for="upgrade"><b>Source Only Upgrade</b> - Manually Update Source and Upgrade Database only</label> </td>
  20 + </tr>
  21 + </table>
11 22 </div>
12 23 <input type="submit" name="Previous" value="Previous" class="button_previous"/>
13   - <input type="submit" name="Next" value="Clean Install" class="button_next"/>
14   - <input type="submit" name="Migrate" value="Upgrade Install" class="button_next"/>
  24 + <input type="submit" name="Next" value="Next" class="button_next" />
15 25 </form>
  26 +<script type="text/javascript">
  27 + function clear() {
  28 +
  29 + }
  30 +</script>
16 31 <?php if (AJAX) { echo $html->js('form.js'); } ?>
17 32 \ No newline at end of file
... ...
setup/wizard/templates/registration.tpl
... ... @@ -20,7 +20,7 @@
20 20 and services. Please see our <a href="http://www.knowledgetree.com/about/legal" target="_blank">Privacy and Data Retention policies</a> for more information.
21 21 </p>
22 22 <br/>
23   - <div id="step_content_registration" class="step">
  23 + <div id="step_content_<?php echo $step_name; ?>" class="step">
24 24 <span class="error" id="reg_error"></span>
25 25 <?php if(WINDOWS_OS) $input_width = 40; else { $input_width = 32; } ?>
26 26 <table>
... ...
setup/wizard/templates/registration_confirm.tpl
1 1 <form id="database_registration_install" action="index.php?step_name=install" method="post">
2 2 <p class="title">Thank you for registering</p>
3   - <div id="step_content_registration_confirm" class="step">
  3 + <div id="step_content_<?php echo $step_name; ?>_confirm" class="step">
4 4 <br/>
5 5 <br/>
6 6 <p class="empty_space">
... ...
setup/wizard/templates/services.tpl
1 1 <?php if (AJAX) { ?>
2   - <form id="configuration_services_database" action="index.php?step_name=services" method="post" id="services">
  2 + <form id="configuration_services_database" action="index.php?step_name=<?php echo $step_name; ?>" method="post" id="services">
3 3 <?php } else { ?>
4   - <form action="index.php?step_name=services" method="post" id="services">
  4 + <form action="index.php?step_name=<?php echo $step_name; ?>" method="post" id="_<?php echo $step_name; ?>">
5 5 <?php } ?>
6 6  
7 7 <p class="title">Checking Service Dependencies</p>
... ...
setup/wizard/templates/welcome.tpl
1   -<form id="welcome_license" action="index.php?step_name=welcome" method="post">
  1 +<form id="welcome_license" action="index.php?step_name=<?php echo $step_name; ?>" method="post">
2 2 <p class="title">Welcome to KnowledgeTree</p>
3 3 <div id="step_content" class="step">
4 4 <br/>
... ...
templates/kt3/fieldsets/simple.smarty
... ... @@ -8,8 +8,17 @@
8 8 {foreach item=aFieldPair from=$fieldset_values name=fields}
9 9 <tr class="{cycle values=even,odd} {if $smarty.foreach.fields.first}first{/if}">
10 10 <th>{$aFieldPair.field->getName()}</th>
11   - <td>{if ($aFieldPair.value !== null)}{$aFieldPair.value|sanitize}
12   - {else}<span class="descriptiveText">{i18n}no value{/i18n}</span>{/if}</td>
  11 + <td>
  12 + {if ($aFieldPair.value !== null)}
  13 + {if ($aFieldPair.field->getIsHTML())}
  14 + {$aFieldPair.value}
  15 + {else}
  16 + {$aFieldPair.value|sanitize}
  17 + {/if}
  18 + {else}
  19 + <span class="descriptiveText">{i18n}no value{/i18n}</span>
  20 + {/if}
  21 + </td>
13 22 </tr>
14 23 {/foreach}
15 24 </table>
... ...
templates/ktcore/forms/widgets/textarea.smarty
1 1 <!--------------------------------------
2 2 ---- Changes for Custom Fields -----
3   - -------------------------------------->
  3 + ------------------------------------
  4 + Bold, italics, underline, hyperlink and colour.
  5 +Lists, ordered and unordered (<ul>, <ol>, <li>).
  6 +Paragraph and break tags.
  7 + -->
4 8 {if $options.field->getIsHTML()}
5 9 {literal}
6 10 <script type="text/javascript" src="/thirdpartyjs/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
... ... @@ -15,10 +19,8 @@ theme : &quot;advanced&quot;,
15 19 plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",
16 20  
17 21 // Theme options
18   -theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
19   -theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
20   -theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
21   -theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
  22 +theme_advanced_buttons1 : "bold,italic,underline,|,forecolor,backcolor,|,bullist,numlist,|,link,unlink,anchor,|,pagebreak,|,insertdate,inserttime,preview,help",
  23 +theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,undo,redo,|,cleanup,removeformat,print,fullscreen,spellchecker",
22 24 theme_advanced_toolbar_location : "top",
23 25 theme_advanced_toolbar_align : "left",
24 26 theme_advanced_statusbar_location : "bottom",
... ...
templates/ktcore/search2/adv_query_builder.smarty
... ... @@ -382,6 +382,7 @@ function createText(groupid, fid, type)
382 382 html += "<option value=\"is not\">{/literal}{i18n}is not{/i18n}{literal}";
383 383 break;
384 384 case 'STRING':
  385 + case 'LARGE TEXT':
385 386 html += "<option value=\"is\">{/literal}{i18n}is{/i18n}{literal}";
386 387 html += "<option value=\"is not\">{/literal}{i18n}is not{/i18n}{literal}";
387 388 html += "<option value=\"contains\">{/literal}{i18n}contains{/i18n}{literal}";
... ... @@ -449,7 +450,7 @@ function addFieldTypeSelection(groupid, fid, type, options)
449 450 }
450 451 // want to fall through
451 452 case 'FULLTEXT':
452   -
  453 + case 'LARGE TEXT':
453 454 case 'STRINGMATCH':
454 455 html = createText(groupid, fid, type);
455 456 break;
... ...