From e78a1d0f6f2a89d860850739fbfe70e7e7e3b637 Mon Sep 17 00:00:00 2001 From: Kevin Fourie Date: Wed, 23 May 2007 13:43:15 +0000 Subject: [PATCH] KTS-1918 "Update the admin version notifier to use the DEV and STABLE versions" Done. --- docs/VERSION-OSS-DEV.txt | 1 + docs/VERSION-OSS.txt | 2 +- lib/util/ktutil.inc | 14 ++++++++++++-- plugins/ktstandard/KTAdminVersionPlugin.php | 54 +++++++++++++++++++++++++++--------------------------- resources/js/adminversiondashlet.js | 50 +++++++++++++++++++++++++------------------------- templates/ktcore/principals/about.smarty | 5 +++-- view.php | 15 ++++++++++----- 7 files changed, 79 insertions(+), 62 deletions(-) create mode 100644 docs/VERSION-OSS-DEV.txt diff --git a/docs/VERSION-OSS-DEV.txt b/docs/VERSION-OSS-DEV.txt new file mode 100644 index 0000000..5a95802 --- /dev/null +++ b/docs/VERSION-OSS-DEV.txt @@ -0,0 +1 @@ +3.5 diff --git a/docs/VERSION-OSS.txt b/docs/VERSION-OSS.txt index 276a69c..2f4b607 100644 --- a/docs/VERSION-OSS.txt +++ b/docs/VERSION-OSS.txt @@ -1 +1 @@ -DEV-3.4.5 +3.4 diff --git a/lib/util/ktutil.inc b/lib/util/ktutil.inc index 53363cb..0822439 100644 --- a/lib/util/ktutil.inc +++ b/lib/util/ktutil.inc @@ -700,12 +700,22 @@ class KTUtil { $aVersions = array(); $sProfessionalFile = KT_DIR . '/docs/VERSION-PRO.txt'; $sOssFile = KT_DIR . '/docs/VERSION-OSS.txt'; - if (file_exists($sProfessionalFile)) { + $sDevProfessionalFile = KT_DIR . '/docs/VERSION-PRO-DEV.txt'; + $sDevOssFile = KT_DIR . '/docs/VERSION-OSS-DEV.txt'; + if (file_exists($sDevProfessionalFile)) { + $sVersion = trim(file_get_contents($sDevProfessionalFile)); + $aVersions['Development Commercial'] = $sVersion; + } elseif (file_exists($sDevOssFile)) { + $sVersion = trim(file_get_contents($sDevOssFile)); + $aVersions['Development OSS'] = $sVersion; + } elseif (file_exists($sProfessionalFile)) { $sVersion = trim(file_get_contents($sProfessionalFile)); $aVersions['Pro'] = $sVersion; - } else { + } elseif (file_exists($sOssFile)) { $sVersion = trim(file_get_contents($sOssFile)); $aVersions['OSS'] = $sVersion; + } else { + $aVersions['ERR'] = "Unknown version"; } return $aVersions; } diff --git a/plugins/ktstandard/KTAdminVersionPlugin.php b/plugins/ktstandard/KTAdminVersionPlugin.php index 3434548..424f317 100644 --- a/plugins/ktstandard/KTAdminVersionPlugin.php +++ b/plugins/ktstandard/KTAdminVersionPlugin.php @@ -26,7 +26,7 @@ require_once(KT_LIB_DIR . '/plugins/plugin.inc.php'); require_once(KT_LIB_DIR . '/plugins/pluginregistry.inc.php'); require_once(KT_LIB_DIR . '/dashboard/dashlet.inc.php'); - + define('KT_VERSION_URL', 'http://www.knowledgetree.com/kt_versions'); class AdminVersionDashlet extends KTBaseDashlet { @@ -38,50 +38,50 @@ class AdminVersionDashlet extends KTBaseDashlet { } function is_active($oUser) { - $this->oUser = $oUser; - return Permission::userIsSystemAdministrator($oUser); + $this->oUser = $oUser; + return Permission::userIsSystemAdministrator($oUser); } - + function render() { - global $default; + global $default; $oPlugin =& $this->oPlugin; - $oTemplating =& KTTemplating::getSingleton(); - $oTemplate = $oTemplating->loadTemplate('ktstandard/adminversion/dashlet'); + $oTemplating =& KTTemplating::getSingleton(); + $oTemplate = $oTemplating->loadTemplate('ktstandard/adminversion/dashlet'); - $aVersions = KTUtil::getKTVersions(); - $sVersions = '{'; - - foreach($aVersions as $k=>$v) { - $sVersions .= "'$k' : '$v',"; - } + $aVersions = KTUtil::getKTVersions(); + $sVersions = '{'; - $sVersions = substr($sVersions, 0, -1) . '}'; + foreach($aVersions as $k=>$v) { + $sVersions .= "'$k' : '$v',"; + } + + $sVersions = substr($sVersions, 0, -1) . '}'; $sUrl = $oPlugin->getPagePath('versions'); - $aTemplateData = array('context' => $this, - 'kt_versions' => $sVersions, - 'kt_versions_url' => $sUrl, - ); + $aTemplateData = array('context' => $this, + 'kt_versions' => $sVersions, + 'kt_versions_url' => $sUrl, + ); - return $oTemplate->render($aTemplateData); + return $oTemplate->render($aTemplateData); } } - + class AdminVersionPlugin extends KTPlugin { var $sNamespace = "ktstandard.adminversion.plugin"; var $autoRegister = true; - + function AdminVersionPlugin($sFilename = null) { - $res = parent::KTPlugin($sFilename); - $this->sFriendlyName = _kt('Admin Version Plugin'); - return $res; + $res = parent::KTPlugin($sFilename); + $this->sFriendlyName = _kt('Admin Version Plugin'); + return $res; } - + function setup() { if (function_exists('curl_init') || (!OS_WINDOWS)) { - $this->registerDashlet('AdminVersionDashlet', 'ktstandard.adminversion.dashlet', 'KTAdminVersionPlugin.php'); - $this->registerPage('versions', 'AdminVersionPage'); + $this->registerDashlet('AdminVersionDashlet', 'ktstandard.adminversion.dashlet', 'KTAdminVersionPlugin.php'); + $this->registerPage('versions', 'AdminVersionPage'); } } } diff --git a/resources/js/adminversiondashlet.js b/resources/js/adminversiondashlet.js index 9283024..cd98828 100644 --- a/resources/js/adminversiondashlet.js +++ b/resources/js/adminversiondashlet.js @@ -3,45 +3,45 @@ function AdminVersionDashlet() { AdminVersionDashlet.prototype = { 'initialize' : function() { - this.dashlet = $('admin_version_dashlet'); - this.span_newVersion = $('new_version'); - this.currentVersions = _KT_VERSIONS; - this.check(); + this.dashlet = $('admin_version_dashlet'); + this.span_newVersion = $('new_version'); + this.currentVersions = _KT_VERSIONS; + this.check(); }, 'check' : function() { - var res = loadJSONDoc(_KT_VERSIONS_URL); - res.addCallback(bind(this.callbackCheck, this)); + var res = loadJSONDoc(_KT_VERSIONS_URL); + res.addCallback(bind(this.callbackCheck, this)); }, 'callbackCheck' : function(res) { - var updates = 0; + var updates = 0; - for(var k in this.currentVersions) { - if(res[k]!=this.currentVersions[k]) { - updates ++; - appendChildNodes('up_upgrades', SPAN({'class':'up_new_version'}, k + ': ' + res[k]), BR(null)); - } - } + for(var k in this.currentVersions) { + if(res[k]!=this.currentVersions[k]) { + updates ++; + appendChildNodes('up_upgrades', SPAN({'class':'up_new_version'}, k + ': ' + res[k]), BR(null)); + } + } - if(updates == 0) { + if(updates == 0) { // next line is cause I thought this dashlet was causing orphaned // dashlet buttons. it doesn't seem to be, but this may be needed. // more investigation necessary. // this.dashlet.style.display = 'none'; - } else if(updates == 1) { - $('up_single').style.display = 'block'; - this.dashlet.style.display = 'block'; - } else { - $('up_multi').style.display = 'block'; - this.dashlet.style.display = 'block'; - } + } else if(updates == 1) { + $('up_single').style.display = 'block'; + this.dashlet.style.display = 'block'; + } else { + $('up_multi').style.display = 'block'; + this.dashlet.style.display = 'block'; + } } } - + addLoadEvent(function() { - var d = new AdminVersionDashlet(); - d.initialize(); - }); + var d = new AdminVersionDashlet(); + d.initialize(); + }); diff --git a/templates/ktcore/principals/about.smarty b/templates/ktcore/principals/about.smarty index d7f8eb0..69feaef 100644 --- a/templates/ktcore/principals/about.smarty +++ b/templates/ktcore/principals/about.smarty @@ -1,7 +1,8 @@ +

{i18n arg_appname="$appname" arg_versionname="$versionname"}#appname# #versionname#{/i18n}

{i18n arg_version="$versionnumber"}Version #version#{/i18n}

Copyright © 2004-2007 The Jam Warehouse Software (Pty) Ltd. All Rights Reserved. View License Agreement
-KnowledgeTree™ is trademarks of The Jam Warehouse Software (Pty) Ltd. +KnowledgeTree™ is a trademark of The Jam Warehouse Software (Pty) Ltd.

KnowledgeTree is a business unit of The Jam Warehouse Software (Pty) Ltd.
@@ -69,7 +70,7 @@ Call Sales: +1 415 670-9759

Third Party Software

- +
diff --git a/view.php b/view.php index 1efc689..4baf7cb 100755 --- a/view.php +++ b/view.php @@ -9,10 +9,15 @@ * http://www.knowledgetree.com/KPL * * Software distributed under the License is distributed on an "AS IS" - * basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. + * See the License for the specific language governing rights and + * limitations under the License. + * + * All copies of the Covered Code must include on each user interface screen: + * (i) the "Powered by KnowledgeTree" logo and + * (ii) the KnowledgeTree copyright notice + * in the same form as they appear in the distribution. See the License for + * requirements. * * The Original Code is: KnowledgeTree Open Source * @@ -21,7 +26,7 @@ * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright * (C) 2007 The Jam Warehouse Software (Pty) Ltd; * All Rights Reserved. - * + * Contributor( s): ______________________________________ */ // boilerplate. -- libgit2 0.21.4
Pear