Commit e78a1d0f6f2a89d860850739fbfe70e7e7e3b637

Authored by Kevin Fourie
1 parent d4d226f2

KTS-1918

"Update the admin version notifier to use the DEV and STABLE versions"
Done.

Reviewed By: Jalaloedien



git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6584 c91229c3-7414-0410-bfa2-8a42b809f60b
docs/VERSION-OSS-DEV.txt 0 → 100644
  1 +3.5
docs/VERSION-OSS.txt
1 -DEV-3.4.5 1 +3.4
lib/util/ktutil.inc
@@ -700,12 +700,22 @@ class KTUtil { @@ -700,12 +700,22 @@ class KTUtil {
700 $aVersions = array(); 700 $aVersions = array();
701 $sProfessionalFile = KT_DIR . '/docs/VERSION-PRO.txt'; 701 $sProfessionalFile = KT_DIR . '/docs/VERSION-PRO.txt';
702 $sOssFile = KT_DIR . '/docs/VERSION-OSS.txt'; 702 $sOssFile = KT_DIR . '/docs/VERSION-OSS.txt';
703 - if (file_exists($sProfessionalFile)) { 703 + $sDevProfessionalFile = KT_DIR . '/docs/VERSION-PRO-DEV.txt';
  704 + $sDevOssFile = KT_DIR . '/docs/VERSION-OSS-DEV.txt';
  705 + if (file_exists($sDevProfessionalFile)) {
  706 + $sVersion = trim(file_get_contents($sDevProfessionalFile));
  707 + $aVersions['Development Commercial'] = $sVersion;
  708 + } elseif (file_exists($sDevOssFile)) {
  709 + $sVersion = trim(file_get_contents($sDevOssFile));
  710 + $aVersions['Development OSS'] = $sVersion;
  711 + } elseif (file_exists($sProfessionalFile)) {
704 $sVersion = trim(file_get_contents($sProfessionalFile)); 712 $sVersion = trim(file_get_contents($sProfessionalFile));
705 $aVersions['Pro'] = $sVersion; 713 $aVersions['Pro'] = $sVersion;
706 - } else { 714 + } elseif (file_exists($sOssFile)) {
707 $sVersion = trim(file_get_contents($sOssFile)); 715 $sVersion = trim(file_get_contents($sOssFile));
708 $aVersions['OSS'] = $sVersion; 716 $aVersions['OSS'] = $sVersion;
  717 + } else {
  718 + $aVersions['ERR'] = "Unknown version";
709 } 719 }
710 return $aVersions; 720 return $aVersions;
711 } 721 }
plugins/ktstandard/KTAdminVersionPlugin.php
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 require_once(KT_LIB_DIR . '/plugins/plugin.inc.php'); 26 require_once(KT_LIB_DIR . '/plugins/plugin.inc.php');
27 require_once(KT_LIB_DIR . '/plugins/pluginregistry.inc.php'); 27 require_once(KT_LIB_DIR . '/plugins/pluginregistry.inc.php');
28 require_once(KT_LIB_DIR . '/dashboard/dashlet.inc.php'); 28 require_once(KT_LIB_DIR . '/dashboard/dashlet.inc.php');
29 - 29 +
30 define('KT_VERSION_URL', 'http://www.knowledgetree.com/kt_versions'); 30 define('KT_VERSION_URL', 'http://www.knowledgetree.com/kt_versions');
31 31
32 class AdminVersionDashlet extends KTBaseDashlet { 32 class AdminVersionDashlet extends KTBaseDashlet {
@@ -38,50 +38,50 @@ class AdminVersionDashlet extends KTBaseDashlet { @@ -38,50 +38,50 @@ class AdminVersionDashlet extends KTBaseDashlet {
38 } 38 }
39 39
40 function is_active($oUser) { 40 function is_active($oUser) {
41 - $this->oUser = $oUser;  
42 - return Permission::userIsSystemAdministrator($oUser); 41 + $this->oUser = $oUser;
  42 + return Permission::userIsSystemAdministrator($oUser);
43 } 43 }
44 - 44 +
45 function render() { 45 function render() {
46 - global $default; 46 + global $default;
47 $oPlugin =& $this->oPlugin; 47 $oPlugin =& $this->oPlugin;
48 - $oTemplating =& KTTemplating::getSingleton();  
49 - $oTemplate = $oTemplating->loadTemplate('ktstandard/adminversion/dashlet'); 48 + $oTemplating =& KTTemplating::getSingleton();
  49 + $oTemplate = $oTemplating->loadTemplate('ktstandard/adminversion/dashlet');
50 50
51 - $aVersions = KTUtil::getKTVersions();  
52 - $sVersions = '{';  
53 -  
54 - foreach($aVersions as $k=>$v) {  
55 - $sVersions .= "'$k' : '$v',";  
56 - } 51 + $aVersions = KTUtil::getKTVersions();
  52 + $sVersions = '{';
57 53
58 - $sVersions = substr($sVersions, 0, -1) . '}'; 54 + foreach($aVersions as $k=>$v) {
  55 + $sVersions .= "'$k' : '$v',";
  56 + }
  57 +
  58 + $sVersions = substr($sVersions, 0, -1) . '}';
59 59
60 $sUrl = $oPlugin->getPagePath('versions'); 60 $sUrl = $oPlugin->getPagePath('versions');
61 61
62 - $aTemplateData = array('context' => $this,  
63 - 'kt_versions' => $sVersions,  
64 - 'kt_versions_url' => $sUrl,  
65 - ); 62 + $aTemplateData = array('context' => $this,
  63 + 'kt_versions' => $sVersions,
  64 + 'kt_versions_url' => $sUrl,
  65 + );
66 66
67 - return $oTemplate->render($aTemplateData); 67 + return $oTemplate->render($aTemplateData);
68 } 68 }
69 } 69 }
70 - 70 +
71 class AdminVersionPlugin extends KTPlugin { 71 class AdminVersionPlugin extends KTPlugin {
72 var $sNamespace = "ktstandard.adminversion.plugin"; 72 var $sNamespace = "ktstandard.adminversion.plugin";
73 var $autoRegister = true; 73 var $autoRegister = true;
74 - 74 +
75 function AdminVersionPlugin($sFilename = null) { 75 function AdminVersionPlugin($sFilename = null) {
76 - $res = parent::KTPlugin($sFilename);  
77 - $this->sFriendlyName = _kt('Admin Version Plugin');  
78 - return $res; 76 + $res = parent::KTPlugin($sFilename);
  77 + $this->sFriendlyName = _kt('Admin Version Plugin');
  78 + return $res;
79 } 79 }
80 - 80 +
81 function setup() { 81 function setup() {
82 if (function_exists('curl_init') || (!OS_WINDOWS)) { 82 if (function_exists('curl_init') || (!OS_WINDOWS)) {
83 - $this->registerDashlet('AdminVersionDashlet', 'ktstandard.adminversion.dashlet', 'KTAdminVersionPlugin.php');  
84 - $this->registerPage('versions', 'AdminVersionPage'); 83 + $this->registerDashlet('AdminVersionDashlet', 'ktstandard.adminversion.dashlet', 'KTAdminVersionPlugin.php');
  84 + $this->registerPage('versions', 'AdminVersionPage');
85 } 85 }
86 } 86 }
87 } 87 }
resources/js/adminversiondashlet.js
@@ -3,45 +3,45 @@ function AdminVersionDashlet() { @@ -3,45 +3,45 @@ function AdminVersionDashlet() {
3 3
4 AdminVersionDashlet.prototype = { 4 AdminVersionDashlet.prototype = {
5 'initialize' : function() { 5 'initialize' : function() {
6 - this.dashlet = $('admin_version_dashlet');  
7 - this.span_newVersion = $('new_version');  
8 - this.currentVersions = _KT_VERSIONS;  
9 - this.check(); 6 + this.dashlet = $('admin_version_dashlet');
  7 + this.span_newVersion = $('new_version');
  8 + this.currentVersions = _KT_VERSIONS;
  9 + this.check();
10 }, 10 },
11 11
12 'check' : function() { 12 'check' : function() {
13 - var res = loadJSONDoc(_KT_VERSIONS_URL);  
14 - res.addCallback(bind(this.callbackCheck, this)); 13 + var res = loadJSONDoc(_KT_VERSIONS_URL);
  14 + res.addCallback(bind(this.callbackCheck, this));
15 }, 15 },
16 16
17 'callbackCheck' : function(res) { 17 'callbackCheck' : function(res) {
18 - var updates = 0; 18 + var updates = 0;
19 19
20 - for(var k in this.currentVersions) {  
21 - if(res[k]!=this.currentVersions[k]) {  
22 - updates ++;  
23 - appendChildNodes('up_upgrades', SPAN({'class':'up_new_version'}, k + ': ' + res[k]), BR(null));  
24 - }  
25 - } 20 + for(var k in this.currentVersions) {
  21 + if(res[k]!=this.currentVersions[k]) {
  22 + updates ++;
  23 + appendChildNodes('up_upgrades', SPAN({'class':'up_new_version'}, k + ': ' + res[k]), BR(null));
  24 + }
  25 + }
26 26
27 - if(updates == 0) { 27 + if(updates == 0) {
28 // next line is cause I thought this dashlet was causing orphaned 28 // next line is cause I thought this dashlet was causing orphaned
29 // dashlet buttons. it doesn't seem to be, but this may be needed. 29 // dashlet buttons. it doesn't seem to be, but this may be needed.
30 // more investigation necessary. 30 // more investigation necessary.
31 // this.dashlet.style.display = 'none'; 31 // this.dashlet.style.display = 'none';
32 - } else if(updates == 1) {  
33 - $('up_single').style.display = 'block';  
34 - this.dashlet.style.display = 'block';  
35 - } else {  
36 - $('up_multi').style.display = 'block';  
37 - this.dashlet.style.display = 'block';  
38 - } 32 + } else if(updates == 1) {
  33 + $('up_single').style.display = 'block';
  34 + this.dashlet.style.display = 'block';
  35 + } else {
  36 + $('up_multi').style.display = 'block';
  37 + this.dashlet.style.display = 'block';
  38 + }
39 } 39 }
40 } 40 }
41 41
42 - 42 +
43 43
44 addLoadEvent(function() { 44 addLoadEvent(function() {
45 - var d = new AdminVersionDashlet();  
46 - d.initialize();  
47 - }); 45 + var d = new AdminVersionDashlet();
  46 + d.initialize();
  47 + });
templates/ktcore/principals/about.smarty
  1 +<img src="{$rootUrl}/resources/graphics/ktlogo-topbar-right.png" border="0" />
1 <h2>{i18n arg_appname="$appname" arg_versionname="$versionname"}#appname# #versionname#{/i18n}</h2> 2 <h2>{i18n arg_appname="$appname" arg_versionname="$versionname"}#appname# #versionname#{/i18n}</h2>
2 <p><strong>{i18n arg_version="$versionnumber"}Version #version#{/i18n}</strong></p> 3 <p><strong>{i18n arg_version="$versionnumber"}Version #version#{/i18n}</strong></p>
3 <p>Copyright &copy; 2004-2007 <a href="http://www.jamwarehouse.com/">The Jam Warehouse Software (Pty) Ltd.</a> All Rights Reserved. <a href="http://www.knowledgetree.com/About/legal/license">View License Agreement</a><br /> 4 <p>Copyright &copy; 2004-2007 <a href="http://www.jamwarehouse.com/">The Jam Warehouse Software (Pty) Ltd.</a> All Rights Reserved. <a href="http://www.knowledgetree.com/About/legal/license">View License Agreement</a><br />
4 -KnowledgeTree&trade; is <a href="http://www.knowledgetree.com/About/legal/trademark_usage_grant">trademarks</a> of The Jam Warehouse Software (Pty) Ltd. 5 +KnowledgeTree&trade; is a <a href="http://www.knowledgetree.com/About/legal/trademark_usage_grant">trademark</a> of The Jam Warehouse Software (Pty) Ltd.
5 </p> 6 </p>
6 <p> 7 <p>
7 <strong>KnowledgeTree is a business unit of The Jam Warehouse Software (Pty) Ltd.</strong><br /> 8 <strong>KnowledgeTree is a business unit of The Jam Warehouse Software (Pty) Ltd.</strong><br />
@@ -69,7 +70,7 @@ Call Sales: +1 415 670-9759 @@ -69,7 +70,7 @@ Call Sales: +1 415 670-9759
69 </ul> 70 </ul>
70 71
71 <p><strong>Third Party Software</strong></p> 72 <p><strong>Third Party Software</strong></p>
72 -<table border="0"> 73 +<table border="0" cellpadding="10">
73 <tr> 74 <tr>
74 <td><div style="background-color:#339900; width:104px;"><img src="{$rootUrl}/resources/graphics/thirdparty/pear.gif"/></div></td> 75 <td><div style="background-color:#339900; width:104px;"><img src="{$rootUrl}/resources/graphics/thirdparty/pear.gif"/></div></td>
75 <td>Pear</td> 76 <td>Pear</td>
view.php
@@ -9,10 +9,15 @@ @@ -9,10 +9,15 @@
9 * http://www.knowledgetree.com/KPL 9 * http://www.knowledgetree.com/KPL
10 * 10 *
11 * Software distributed under the License is distributed on an "AS IS" 11 * Software distributed under the License is distributed on an "AS IS"
12 - * basis,  
13 - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License  
14 - * for the specific language governing rights and limitations under the  
15 - * License. 12 + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
  13 + * See the License for the specific language governing rights and
  14 + * limitations under the License.
  15 + *
  16 + * All copies of the Covered Code must include on each user interface screen:
  17 + * (i) the "Powered by KnowledgeTree" logo and
  18 + * (ii) the KnowledgeTree copyright notice
  19 + * in the same form as they appear in the distribution. See the License for
  20 + * requirements.
16 * 21 *
17 * The Original Code is: KnowledgeTree Open Source 22 * The Original Code is: KnowledgeTree Open Source
18 * 23 *
@@ -21,7 +26,7 @@ @@ -21,7 +26,7 @@
21 * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright 26 * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright
22 * (C) 2007 The Jam Warehouse Software (Pty) Ltd; 27 * (C) 2007 The Jam Warehouse Software (Pty) Ltd;
23 * All Rights Reserved. 28 * All Rights Reserved.
24 - * 29 + * Contributor( s): ______________________________________
25 */ 30 */
26 31
27 // boilerplate. 32 // boilerplate.