Commit e7fecfdb6ecdd556bf267290dd06561fa9231dc3

Authored by Jarrett Jordaan
1 parent 6df03d8e

PT:2492070 : Fist Login wizard added

Committed by: Jarrett Jordaan

Reviewed by: Megan Watson
setup/firstlogin/config/community_config.xml
@@ -4,12 +4,12 @@ @@ -4,12 +4,12 @@
4 Document : config.xml 4 Document : config.xml
5 Created on : 01 July 2009, 9:57 AM 5 Created on : 01 July 2009, 9:57 AM
6 Author : KnowledgeTree Team 6 Author : KnowledgeTree Team
7 - Description: First login steps 7 + Description: Commercial steps
8 --> 8 -->
9 9
10 -<migrate version="3.7" type="Commercial Edition"> 10 +<firstlogin version="3.7" type="Commercial Edition">
11 <steps> 11 <steps>
12 <step name="Apply Folder Template">templates</step> 12 <step name="Apply Folder Template">templates</step>
13 <step name="Complete">complete</step> 13 <step name="Complete">complete</step>
14 </steps> 14 </steps>
15 - </migrate>  
16 \ No newline at end of file 15 \ No newline at end of file
  16 + </firstlogin>
17 \ No newline at end of file 17 \ No newline at end of file
setup/firstlogin/config/config.xml
@@ -7,9 +7,9 @@ @@ -7,9 +7,9 @@
7 Description: First login steps 7 Description: First login steps
8 --> 8 -->
9 9
10 -<migrate version="3.7" type="Commercial Edition"> 10 +<firstlogin version="3.7" type="Commercial Edition">
11 <steps> 11 <steps>
12 <step name="Apply Folder Template">templates</step> 12 <step name="Apply Folder Template">templates</step>
13 <step name="Complete">complete</step> 13 <step name="Complete">complete</step>
14 </steps> 14 </steps>
15 - </migrate>  
16 \ No newline at end of file 15 \ No newline at end of file
  16 + </firstlogin>
17 \ No newline at end of file 17 \ No newline at end of file
setup/firstlogin/firstlogin.php
@@ -489,11 +489,9 @@ class firstlogin { @@ -489,11 +489,9 @@ class firstlogin {
489 489
490 private function loadNeeded() { 490 private function loadNeeded() {
491 $this->_readXml(); // Xml steps 491 $this->_readXml(); // Xml steps
492 - // Make sure session is cleared  
493 - $this->_resetSessions(); 492 + $this->_resetSessions(); // Make sure session is cleared
494 $this->_loadFromSessions(); 493 $this->_loadFromSessions();
495 - if(isset($_POST['Next'])) {  
496 - $this->action = 'next'; 494 + if(isset($_POST['Next'])) { $this->action = 'next';
497 $this->response = 'next'; 495 $this->response = 'next';
498 } elseif (isset($_POST['Previous'])) { 496 } elseif (isset($_POST['Previous'])) {
499 $this->action = 'previous'; 497 $this->action = 'previous';
@@ -504,6 +502,9 @@ class firstlogin { @@ -504,6 +502,9 @@ class firstlogin {
504 } elseif (isset($_POST['Edit'])) { 502 } elseif (isset($_POST['Edit'])) {
505 $this->action = 'edit'; 503 $this->action = 'edit';
506 $this->response = 'next'; 504 $this->response = 'next';
  505 + } elseif (isset($_POST['Skip'])) {
  506 + $this->action = 'next';
  507 + $this->response = 'next';
507 } else { 508 } else {
508 $this->response = ''; 509 $this->response = '';
509 $this->action = ''; 510 $this->action = '';
setup/firstlogin/firstloginWizard.php
@@ -80,7 +80,7 @@ class firstloginWizard extends WizardBase { @@ -80,7 +80,7 @@ class firstloginWizard extends WizardBase {
80 $ins = new firstlogin(); // Instantiate 80 $ins = new firstlogin(); // Instantiate
81 $ins->resolveErrors($response); // Run step 81 $ins->resolveErrors($response); // Run step
82 } else { 82 } else {
83 - $ins = new firstlogin(new Session()); // Instantiate and pass the session class 83 + $ins = new firstlogin(new wSession()); // Instantiate and pass the session class
84 $ins->step(); // Run step 84 $ins->step(); // Run step
85 } 85 }
86 } 86 }
setup/firstlogin/steps/firstloginComplete.php
@@ -68,7 +68,7 @@ class firstloginComplete extends Step { @@ -68,7 +68,7 @@ class firstloginComplete extends Step {
68 } 68 }
69 69
70 function doRun() { 70 function doRun() {
71 - 71 +
72 return 'landing'; 72 return 'landing';
73 } 73 }
74 74
setup/firstlogin/steps/firstloginTemplates.php
@@ -43,6 +43,11 @@ @@ -43,6 +43,11 @@
43 * @version Version 0.1 43 * @version Version 0.1
44 */ 44 */
45 45
  46 +// Load needed system files.
  47 +require_once(SYSTEM_DIR . "config/dmsDefaults.php");
  48 +require_once(KT_LIB_DIR . '/plugins/plugin.inc.php');
  49 +require_once(KT_LIB_DIR . '/plugins/pluginregistry.inc.php');
  50 +
46 class firstloginTemplates extends Step { 51 class firstloginTemplates extends Step {
47 /** 52 /**
48 * Flag if step needs to run silently 53 * Flag if step needs to run silently
@@ -62,18 +67,61 @@ class firstloginTemplates extends Step { @@ -62,18 +67,61 @@ class firstloginTemplates extends Step {
62 */ 67 */
63 function doStep() { 68 function doStep() {
64 $this->temp_variables = array( 69 $this->temp_variables = array(
65 - "step_name"=>"folderstructures", 70 + "step_name"=>"templates",
66 "silent"=>$this->silent); 71 "silent"=>$this->silent);
67 - return $this->doRun(); 72 + if(!$this->inStep("templates")) { // Landing
  73 + return 'landing';
  74 + }
  75 + if($this->next()) { // Next click
  76 + $this->applyTemplates(); // Apply folder template structures
  77 + return 'next'; // And go to next step
  78 + } else if($this->skip()) { // Skip Step
  79 + return 'next';
  80 + }
  81 +
  82 + $this->doRun(); // Set folder structure templates
  83 + return 'landing'; // Default to landing
68 } 84 }
69 85
70 function doRun() { 86 function doRun() {
71 - 87 + $this->temp_variables['aFolderTemplates'] = $this->getTemplates();
72 return 'landing'; 88 return 'landing';
73 } 89 }
74 90
  91 + function applyTemplates() {
  92 +
  93 + }
  94 +
  95 + function getTemplates() {
  96 + if (KTPluginUtil::pluginIsActive('fs.FolderTemplatesPlugin.plugin')) { // Check if folder templates plugin is active
  97 + $oRegistry =& KTPluginRegistry::getSingleton();
  98 + $oPlugin =& $oRegistry->getPlugin('fs.FolderTemplatesPlugin.plugin'); // Get a handle on the plugin
  99 + return $oPlugin->getFirstLoginTemplates();
  100 + }
  101 + }
  102 +
  103 + function getTemplateNodes() {
  104 + if (KTPluginUtil::pluginIsActive('fs.FolderTemplatesPlugin.plugin')) { // Check if folder templates plugin is active
  105 + $oRegistry =& KTPluginRegistry::getSingleton();
  106 + $oPlugin =& $oRegistry->getPlugin('fs.FolderTemplatesPlugin.plugin'); // Get a handle on the plugin
  107 + return $oPlugin->getFirstLoginTemplates();
  108 + }
  109 + }
  110 +
75 public function getErrors() { 111 public function getErrors() {
76 return $this->error; 112 return $this->error;
77 } 113 }
  114 +
  115 + /**
  116 + * Stores varibles used by template
  117 + *
  118 + * @author KnowledgeTree Team
  119 + * @params none
  120 + * @access public
  121 + * @return array
  122 + */
  123 + public function getStepVars() {
  124 + return $this->temp_variables;
  125 + }
78 } 126 }
79 ?> 127 ?>
80 \ No newline at end of file 128 \ No newline at end of file
setup/firstlogin/templates/complete.tpl
1 -<form action="index.php?step_name=<?php echo $step_name; ?>" method="post" id="<?php echo $step_name; ?>"> 1 +<form id="<?php echo $step_name; ?>">
2 <p class="title">Preferences Completed</p> 2 <p class="title">Preferences Completed</p>
3 -  
4 - <p class="description">Your system preferences have been applied</p>  
5 <div id="step_content_<?php echo $step_name; ?>" class="step"> 3 <div id="step_content_<?php echo $step_name; ?>" class="step">
6 -  
7 - <input class="button_next" type="submit" value="Next" name="Next"/> 4 + <p class="description">Your system preferences have been applied</p>
  5 + </div>
  6 + <input type="submit" name="Next" value="Finish" class="button_next"/>
8 </form> 7 </form>
  8 +<script type="text/javascript">
  9 + $("#duname").focus();
  10 +</script>
9 <?php if (AJAX) { echo $html->js('form.js'); } ?> 11 <?php if (AJAX) { echo $html->js('form.js'); } ?>
10 \ No newline at end of file 12 \ No newline at end of file
setup/firstlogin/templates/error.tpl
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 <span style="font-size:80%;"> <?php echo $fl_type; ?> </span> 17 <span style="font-size:80%;"> <?php echo $fl_type; ?> </span>
18 </div> 18 </div>
19 </div> 19 </div>
20 - <div id="wrapper"> 20 + <div id="wrapper" class="wizard">
21 <div id="container"> 21 <div id="container">
22 <div id="sidebar"> 22 <div id="sidebar">
23 <span class="current">Welcome</span><br><span class="inactive">Current Installation</span><br><span class="inactive">Deactivate Services</span><br><span class="inactive">Database Migration</span><br><span class="inactive">Complete</span><br></div> 23 <span class="current">Welcome</span><br><span class="inactive">Current Installation</span><br><span class="inactive">Deactivate Services</span><br><span class="inactive">Database Migration</span><br><span class="inactive">Complete</span><br></div>
setup/firstlogin/templates/templates.tpl
1 <form id="<?php echo $step_name; ?>" action="index.php?step_name=<?php echo $step_name; ?>" method="post"> 1 <form id="<?php echo $step_name; ?>" action="index.php?step_name=<?php echo $step_name; ?>" method="post">
2 - <p class="title">Apply A Folder Template to KnowledgeTree</p> 2 + <p class="title">Apply Applying Templates</p>
  3 + <p class="description">You can select a base folder layout to apply to your root folder of KnowledgeTree.</p>
3 <div id="step_content_<?php echo $step_name; ?>" class="step"> 4 <div id="step_content_<?php echo $step_name; ?>" class="step">
  5 + <div class="field ">
  6 + <p class="descriptiveText">Choose a template, if you would like to generate predefined folders.</p>
  7 + <p class="errorMessage"></p>
  8 + <select name="data[templateId]">
  9 + <option selected="selected" value="">- No template -</option>
  10 + <?php
  11 + foreach ($aFolderTemplates as $oFolderTemplate) {
  12 + echo "<option onclick=\"javascript:{showFolderTemplateTree('{$oFolderTemplate->getId()}')}\" value=\"{$oFolderTemplate->getId()}\">".$oFolderTemplate->getName()."</option>";
  13 + }
  14 + ?>
  15 + </select>
4 </div> 16 </div>
5 - <input type="submit" name="Previous" value="Previous" class="button_previous"/> 17 + <div id="templates_tree">
  18 + <table cellspacing="0" class="tree_table">
  19 + <?php
  20 + foreach ($aFolderTemplates as $oFolderTemplate) {
  21 + ?>
  22 + <tr style="display:none;" id="template_<?php echo $oFolderTemplate->getId(); ?>">
  23 + <td>
  24 + <div class="tree_icon tree_folder closed">&nbsp;</div>
  25 + </td>
  26 + <td>
  27 + <label>
  28 + <?php echo $oFolderTemplate->getName(); ?>
  29 + </label>
  30 + </td>
  31 + </tr>
  32 + <tr style="display:none;" id="templates_<?php echo $oFolderTemplate->getId(); ?>">
  33 + <?php
  34 + }
  35 + ?>
  36 + </table>
  37 + </div>
  38 + </div>
  39 + <input type="submit" name="Skip" value="Skip" class="button_skip"/>
6 <input type="submit" name="Next" value="Next" class="button_next"/> 40 <input type="submit" name="Next" value="Next" class="button_next"/>
7 </form> 41 </form>
8 <script type="text/javascript"> 42 <script type="text/javascript">
setup/firstlogin/templates/wizard.tpl
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 <?php echo $html->js('jquery.form.js'); ?> 7 <?php echo $html->js('jquery.form.js'); ?>
8 <?php echo $html->js('jquery.blockUI.js'); ?> 8 <?php echo $html->js('jquery.blockUI.js'); ?>
9 <?php echo $html->js('jquery.hotkeys.js'); ?> 9 <?php echo $html->js('jquery.hotkeys.js'); ?>
10 - <?php echo $html->js('wizard.js'); ?> 10 + <?php echo $html->js('firstlogin.js'); ?>
11 <?php echo $html->css('wizard.css'); ?> 11 <?php echo $html->css('wizard.css'); ?>
12 <?php echo $html->css('firstlogin.css'); ?> 12 <?php echo $html->css('firstlogin.css'); ?>
13 <?php if(AGENT == "IE6") echo $html->css('ie6.css'); ?> 13 <?php if(AGENT == "IE6") echo $html->css('ie6.css'); ?>
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 <span style="font-size:120%;"> <?php if (isset($vars['fl_version'])) echo $vars['fl_type']; ?></span> 26 <span style="font-size:120%;"> <?php if (isset($vars['fl_version'])) echo $vars['fl_type']; ?></span>
27 </div> 27 </div>
28 </div> 28 </div>
29 - <div id="wrapper"> 29 + <div id="wrapper" class="wizard">
30 <div id="container"> 30 <div id="container">
31 <div id="sidebar"> 31 <div id="sidebar">
32 <?php echo $vars['left']; ?> 32 <?php echo $vars['left']; ?>
@@ -49,5 +49,5 @@ @@ -49,5 +49,5 @@
49 </body> 49 </body>
50 </html> 50 </html>
51 <script> 51 <script>
52 - var w = new wizard(); 52 + var fl = new firstlogin();
53 </script> 53 </script>
54 \ No newline at end of file 54 \ No newline at end of file
setup/firstlogin/wSession.php 0 → 100644
  1 +<?php
  2 +/**
  3 +* Session Controller.
  4 +*
  5 +* KnowledgeTree Community Edition
  6 +* Document Management Made Simple
  7 +* Copyright (C) 2008, 2009, 2010 KnowledgeTree Inc.
  8 +*
  9 +* This program is free software; you can redistribute it and/or modify it under
  10 +* the terms of the GNU General Public License version 3 as published by the
  11 +* Free Software Foundation.
  12 +*
  13 +* This program is distributed in the hope that it will be useful, but WITHOUT
  14 +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  15 +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  16 +* details.
  17 +*
  18 +* You should have received a copy of the GNU General Public License
  19 +* along with this program. If not, see <http://www.gnu.org/licenses/>.
  20 +*
  21 +* You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
  22 +* California 94120-7775, or email info@knowledgetree.com.
  23 +*
  24 +* The interactive user interfaces in modified source and object code versions
  25 +* of this program must display Appropriate Legal Notices, as required under
  26 +* Section 5 of the GNU General Public License version 3.
  27 +*
  28 +* In accordance with Section 7(b) of the GNU General Public License version 3,
  29 +* these Appropriate Legal Notices must retain the display of the "Powered by
  30 +* KnowledgeTree" logo and retain the original copyright notice. If the display of the
  31 +* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
  32 +* must display the words "Powered by KnowledgeTree" and retain the original
  33 +* copyright notice.
  34 +* Contributor( s): ______________________________________
  35 +*/
  36 +
  37 +/**
  38 +*
  39 +* @copyright 2008-2010, KnowledgeTree Inc.
  40 +* @license GNU General Public License version 3
  41 +* @author KnowledgeTree Team
  42 +* @package First Login
  43 +* @version Version 0.1
  44 +*/
  45 +class wSession extends SessionBase
  46 +{
  47 + public $salt = 'firstlogin';
  48 +
  49 + /**
  50 + * Constructs session object
  51 + *
  52 + * @author KnowledgeTree Team
  53 + * @access public
  54 + * @param none
  55 + */
  56 + public function __construct() {
  57 + $this->setSalt($this->salt);
  58 + $this->startSession();
  59 + }
  60 +
  61 +}
  62 +?>
0 \ No newline at end of file 63 \ No newline at end of file
setup/migrate/migrateWizard.php
@@ -80,7 +80,7 @@ class MigrateWizard extends WizardBase { @@ -80,7 +80,7 @@ class MigrateWizard extends WizardBase {
80 $ins = new Migrater(); // Instantiate the migrater 80 $ins = new Migrater(); // Instantiate the migrater
81 $ins->resolveErrors($response); // Run step 81 $ins->resolveErrors($response); // Run step
82 } else { 82 } else {
83 - $ins = new Migrater(new Session()); // Instantiate the migrater and pass the session class 83 + $ins = new Migrater(new wSession()); // Instantiate the migrater and pass the session class
84 $ins->step(); // Run step 84 $ins->step(); // Run step
85 } 85 }
86 } 86 }
setup/migrate/templates/error.tpl
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 <span style="font-size:80%;"> <?php echo $migrate_type; ?> </span> 17 <span style="font-size:80%;"> <?php echo $migrate_type; ?> </span>
18 </div> 18 </div>
19 </div> 19 </div>
20 - <div id="wrapper"> 20 + <div id="wrapper" class="wizard">
21 <div id="container"> 21 <div id="container">
22 <div id="sidebar"> 22 <div id="sidebar">
23 <span class="current">Welcome</span><br><span class="inactive">Current Installation</span><br><span class="inactive">Deactivate Services</span><br><span class="inactive">Database Migration</span><br><span class="inactive">Complete</span><br></div> 23 <span class="current">Welcome</span><br><span class="inactive">Current Installation</span><br><span class="inactive">Deactivate Services</span><br><span class="inactive">Database Migration</span><br><span class="inactive">Complete</span><br></div>
setup/migrate/templates/wizard.tpl
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 <span style="font-size:120%;"> <?php if (isset($vars['migrate_version'])) echo $vars['migrate_type']; ?></span> 26 <span style="font-size:120%;"> <?php if (isset($vars['migrate_version'])) echo $vars['migrate_type']; ?></span>
27 </div> 27 </div>
28 </div> 28 </div>
29 - <div id="wrapper"> 29 + <div id="wrapper" class="wizard">
30 <div id="container"> 30 <div id="container">
31 <div id="sidebar"> 31 <div id="sidebar">
32 <?php echo $vars['left']; ?> 32 <?php echo $vars['left']; ?>
setup/migrate/wSession.php 0 → 100644
  1 +<?php
  2 +/**
  3 +* Session Controller.
  4 +*
  5 +* KnowledgeTree Community Edition
  6 +* Document Management Made Simple
  7 +* Copyright (C) 2008, 2009, 2010 KnowledgeTree Inc.
  8 +*
  9 +* This program is free software; you can redistribute it and/or modify it under
  10 +* the terms of the GNU General Public License version 3 as published by the
  11 +* Free Software Foundation.
  12 +*
  13 +* This program is distributed in the hope that it will be useful, but WITHOUT
  14 +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  15 +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  16 +* details.
  17 +*
  18 +* You should have received a copy of the GNU General Public License
  19 +* along with this program. If not, see <http://www.gnu.org/licenses/>.
  20 +*
  21 +* You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
  22 +* California 94120-7775, or email info@knowledgetree.com.
  23 +*
  24 +* The interactive user interfaces in modified source and object code versions
  25 +* of this program must display Appropriate Legal Notices, as required under
  26 +* Section 5 of the GNU General Public License version 3.
  27 +*
  28 +* In accordance with Section 7(b) of the GNU General Public License version 3,
  29 +* these Appropriate Legal Notices must retain the display of the "Powered by
  30 +* KnowledgeTree" logo and retain the original copyright notice. If the display of the
  31 +* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
  32 +* must display the words "Powered by KnowledgeTree" and retain the original
  33 +* copyright notice.
  34 +* Contributor( s): ______________________________________
  35 +*/
  36 +
  37 +/**
  38 +*
  39 +* @copyright 2008-2010, KnowledgeTree Inc.
  40 +* @license GNU General Public License version 3
  41 +* @author KnowledgeTree Team
  42 +* @package Migrater
  43 +* @version Version 0.1
  44 +*/
  45 +class wSession extends SessionBase
  46 +{
  47 + public $salt = 'migrate';
  48 +
  49 + /**
  50 + * Constructs session object
  51 + *
  52 + * @author KnowledgeTree Team
  53 + * @access public
  54 + * @param none
  55 + */
  56 + public function __construct() {
  57 + $this->setSalt($this->salt);
  58 + $this->startSession();
  59 + }
  60 +
  61 +}
  62 +?>
0 \ No newline at end of file 63 \ No newline at end of file
setup/upgrade/templates/error.tpl
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 <span style="font-size:80%;"> <?php echo $upgrade_type; ?> </span> 18 <span style="font-size:80%;"> <?php echo $upgrade_type; ?> </span>
19 </div> 19 </div>
20 </div> 20 </div>
21 - <div id="wrapper"> 21 + <div id="wrapper" class="wizard">
22 <div id="container"> 22 <div id="container">
23 <div id="sidebar"> 23 <div id="sidebar">
24 <span class="current">Welcome</span><br> 24 <span class="current">Welcome</span><br>
setup/upgrade/templates/progress.tpl
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 <span style="font-size:80%;">Community Edition</span> 18 <span style="font-size:80%;">Community Edition</span>
19 </div> 19 </div>
20 </div> 20 </div>
21 - <div id="wrapper"> 21 + <div id="wrapper" class="wizard">
22 <div id="container"> 22 <div id="container">
23 <div id="sidebar"> 23 <div id="sidebar">
24 <?php echo $left; ?> 24 <?php echo $left; ?>
setup/upgrade/templates/wizard.tpl
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 <span style="font-size:120%;"> <?php echo $vars['upgrade_type']; ?> </span> 26 <span style="font-size:120%;"> <?php echo $vars['upgrade_type']; ?> </span>
27 </div> 27 </div>
28 </div> 28 </div>
29 - <div id="wrapper"> 29 + <div id="wrapper" class="wizard">
30 <div id="container"> 30 <div id="container">
31 <div id="sidebar"> 31 <div id="sidebar">
32 <?php echo $vars['left']; ?> 32 <?php echo $vars['left']; ?>
setup/wizard/installWizard.php
@@ -67,7 +67,7 @@ class InstallWizard extends WizardBase { @@ -67,7 +67,7 @@ class InstallWizard extends WizardBase {
67 $ins = new Installer(); // Instantiate the installer 67 $ins = new Installer(); // Instantiate the installer
68 $ins->resolveErrors($response); // Run step 68 $ins->resolveErrors($response); // Run step
69 } else { 69 } else {
70 - $ins = new Installer(new Session()); // Instantiate the installer and pass the session class 70 + $ins = new Installer(new wSession()); // Instantiate the installer and pass the session class
71 $ins->step(); // Run step 71 $ins->step(); // Run step
72 } 72 }
73 } 73 }
setup/wizard/lib/helpers/htmlHelper.php
@@ -103,7 +103,7 @@ class htmlHelper { @@ -103,7 +103,7 @@ class htmlHelper {
103 } 103 }
104 104
105 function tpjs($name) { 105 function tpjs($name) {
106 - return "<script type=\"text/javascript\" src=\"".WIZARD_ROOT."thirdpartyjs/jquery/$name\"></script>"; 106 + return "<script type=\"text/javascript\" src=\"".WIZARD_ROOTURL."thirdpartyjs/jquery/$name\"></script>";
107 } 107 }
108 108
109 function js($name) { 109 function js($name) {
setup/wizard/path.php
@@ -133,8 +133,8 @@ @@ -133,8 +133,8 @@
133 } else { 133 } else {
134 define('INSTALL_TYPE', 'community'); 134 define('INSTALL_TYPE', 'community');
135 } 135 }
136 - define('WIZARD_ROOT',guessRootUrl().DS);  
137 - define('WIZARD_SETUP',WIZARD_ROOT . "setup"); 136 + define('WIZARD_ROOTURL',guessRootUrl().DS); # Used by template resources
  137 + define('WIZARD_SETUP',WIZARD_ROOTURL . "setup");
138 138
139 function guessRootUrl() { 139 function guessRootUrl() {
140 $urlpath = $_SERVER['SCRIPT_NAME']; 140 $urlpath = $_SERVER['SCRIPT_NAME'];
setup/wizard/resources/css/firstlogin.css
1 -#step_content_folderstructures { 1 +#step_content_templates {
2 border: 1px solid rgb(207, 207, 207); 2 border: 1px solid rgb(207, 207, 207);
3 overflow: auto; 3 overflow: auto;
4 padding: 5px; 4 padding: 5px;
5 min-height:315px; 5 min-height:315px;
  6 +}
  7 +
  8 +.button_skip {
  9 + float:right;
  10 + margin-left:5px;
  11 + margin-top:10px;
6 } 12 }
7 \ No newline at end of file 13 \ No newline at end of file
setup/wizard/resources/js/firstlogin.js
  1 +// Class Wizard
  2 +var ajaxOn;
  3 +var ktfolderAccess = "plugins/commercial/folder-templates/KTFolderTemplates.php?action=";
  4 +var ktmanageFolderAccess = "admin.php?kt_path_info=misc/adminfoldertemplatesmanagement&action=";
  5 +var actionForm = false;
  6 +
  7 +function firstlogin() {
  8 + this.ajaxOn = false;
  9 +}
  10 +
  11 +var showFolderTemplateTree = function(templateId) {
  12 + alert($('template_' + templateId).attr('style'));
  13 + $('template_' + templateId).attr('style', 'display:block'); // Show template
  14 +// var address = this.ktfolderAccess + "getTemplateNodes&templateId="+templateId;
  15 +// getUrl("templates_" + templateId, "template_" + templateId, address);
  16 +}
  17 +
1 /* 18 /*
2 -* Create the electronic signature dialog 19 +* Create the dialog
3 */ 20 */
4 -var showForm = function(){  
5 - createForm();  
6 - // create the window  
7 - this.win = new Ext.Window({ 21 +var showForm = function() {
  22 + createForm(); // Populate the form
  23 + this.win = new Ext.Window({ // create the window
8 applyTo : 'firstlogin', 24 applyTo : 'firstlogin',
9 layout : 'fit', 25 layout : 'fit',
10 width : 800, 26 width : 800,
@@ -20,9 +36,9 @@ var showForm = function(){ @@ -20,9 +36,9 @@ var showForm = function(){
20 36
21 var createForm = function() { 37 var createForm = function() {
22 var holder = "<div id='firstlogin'></div>"; 38 var holder = "<div id='firstlogin'></div>";
23 - $("#wrapper").append(holder);// Append to current dashboard 39 + $("#wrapper").append(holder); // Append to current dashboard
24 var address = "setup/firstlogin/index.php"; 40 var address = "setup/firstlogin/index.php";
25 - getUrl(address, "firstlogin"); 41 + getUrl(address, "firstlogin"); // Pull in existing wizard
26 } 42 }
27 43
28 // Send request and update a div 44 // Send request and update a div
@@ -40,6 +56,6 @@ var getUrl = function (address, div) { @@ -40,6 +56,6 @@ var getUrl = function (address, div) {
40 } 56 }
41 57
42 $(function() { // Document is ready 58 $(function() { // Document is ready
43 -  
44 - showForm(); 59 + if($("#wrapper").attr('class') != 'wizard') // Check if we in a wizard, or on the dashboard
  60 + showForm(); // Display first login wizard
45 }); 61 });
setup/wizard/share/stepBase.php
@@ -246,6 +246,22 @@ class StepBase { @@ -246,6 +246,22 @@ class StepBase {
246 } 246 }
247 247
248 /** 248 /**
  249 + * Checks if skip button has been clicked
  250 + *
  251 + * @author KnowledgeTree Team
  252 + * @param none
  253 + * @access public
  254 + * @return boolean
  255 + */
  256 + public function skip() {
  257 + if(isset($_POST['Skip'])) {
  258 + return true;
  259 + }
  260 +
  261 + return false;
  262 + }
  263 +
  264 + /**
249 * Checks if Confirm button has been clicked 265 * Checks if Confirm button has been clicked
250 * 266 *
251 * @author KnowledgeTree Team 267 * @author KnowledgeTree Team
setup/wizard/templates/error.tpl
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 <span style="font-size:80%;"> <?php echo $install_type; ?> </span> 19 <span style="font-size:80%;"> <?php echo $install_type; ?> </span>
20 </div> 20 </div>
21 </div> 21 </div>
22 - <div id="wrapper"> 22 + <div id="wrapper" class="wizard">
23 <div id="container"> 23 <div id="container">
24 <div id="sidebar"> 24 <div id="sidebar">
25 <span id="welcome" class="current">Welcome</span><br><span id="license" class="inactive">License Agreement</span><br><span id="installtype" class="inactive">Install Type</span><br><span id="dependencies" class="inactive">PHP Dependencies</span><br><span id="configuration" class="inactive">System Configuration</span><br><span id="services" class="inactive">Service Dependency</span><br><span id="database" class="inactive">Database Configuration</span><br><span id="registration" class="inactive">Registration</span><br><span id="install" class="inactive">Install</span><br><span id="complete" class="inactive">Complete</span><br></div> 25 <span id="welcome" class="current">Welcome</span><br><span id="license" class="inactive">License Agreement</span><br><span id="installtype" class="inactive">Install Type</span><br><span id="dependencies" class="inactive">PHP Dependencies</span><br><span id="configuration" class="inactive">System Configuration</span><br><span id="services" class="inactive">Service Dependency</span><br><span id="database" class="inactive">Database Configuration</span><br><span id="registration" class="inactive">Registration</span><br><span id="install" class="inactive">Install</span><br><span id="complete" class="inactive">Complete</span><br></div>
setup/wizard/templates/wizard.tpl
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 <span style="font-size:120%;"><?php echo $vars['install_type']; ?></span> 25 <span style="font-size:120%;"><?php echo $vars['install_type']; ?></span>
26 </div> 26 </div>
27 </div> 27 </div>
28 - <div id="wrapper"> 28 + <div id="wrapper" class="wizard">
29 <div id="container"> 29 <div id="container">
30 <div id="sidebar"> 30 <div id="sidebar">
31 <?php echo $vars['left']; ?> 31 <?php echo $vars['left']; ?>
setup/wizard/wSession.php 0 → 100644
  1 +<?php
  2 +/**
  3 +* Session Controller.
  4 +*
  5 +* KnowledgeTree Community Edition
  6 +* Document Management Made Simple
  7 +* Copyright (C) 2008, 2009, 2010 KnowledgeTree Inc.
  8 +*
  9 +* This program is free software; you can redistribute it and/or modify it under
  10 +* the terms of the GNU General Public License version 3 as published by the
  11 +* Free Software Foundation.
  12 +*
  13 +* This program is distributed in the hope that it will be useful, but WITHOUT
  14 +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  15 +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  16 +* details.
  17 +*
  18 +* You should have received a copy of the GNU General Public License
  19 +* along with this program. If not, see <http://www.gnu.org/licenses/>.
  20 +*
  21 +* You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
  22 +* California 94120-7775, or email info@knowledgetree.com.
  23 +*
  24 +* The interactive user interfaces in modified source and object code versions
  25 +* of this program must display Appropriate Legal Notices, as required under
  26 +* Section 5 of the GNU General Public License version 3.
  27 +*
  28 +* In accordance with Section 7(b) of the GNU General Public License version 3,
  29 +* these Appropriate Legal Notices must retain the display of the "Powered by
  30 +* KnowledgeTree" logo and retain the original copyright notice. If the display of the
  31 +* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
  32 +* must display the words "Powered by KnowledgeTree" and retain the original
  33 +* copyright notice.
  34 +* Contributor( s): ______________________________________
  35 +*/
  36 +
  37 +/**
  38 +*
  39 +* @copyright 2008-2010, KnowledgeTree Inc.
  40 +* @license GNU General Public License version 3
  41 +* @author KnowledgeTree Team
  42 +* @package Installer
  43 +* @version Version 0.1
  44 +*/
  45 +class wSession extends SessionBase
  46 +{
  47 +
  48 + public $salt = 'installers';
  49 +
  50 + /**
  51 + * Constructs session object
  52 + *
  53 + * @author KnowledgeTree Team
  54 + * @access public
  55 + * @param none
  56 + */
  57 + public function __construct() {
  58 + $this->setSalt($this->salt);
  59 + $this->startSession();
  60 + }
  61 +
  62 +
  63 +}
  64 +?>
0 \ No newline at end of file 65 \ No newline at end of file