From: hickert Date: Fri, 28 May 2010 07:42:09 +0000 (+0000) Subject: Added gosa_version to feedback formular X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=10e532c9e9bc9fa91fcaee8579ef39cc0feb6b78;p=gosa.git Added gosa_version to feedback formular git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@18781 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index 200558212..d89d0fb22 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -2263,18 +2263,37 @@ function validate($string) /*! \brief Evaluate the current GOsa version from the build in revision string */ function get_gosa_version() { - global $svn_revision, $svn_path; + global $svn_revision, $svn_path; - /* Extract informations */ - $revision= preg_replace('/^[^0-9]*([0-9]+)[^0-9]*$/', '\1', $svn_revision); + /* Extract informations */ + $revision= preg_replace('/^[^0-9]*([0-9]+)[^0-9]*$/', '\1', $svn_revision); + + // Extract the relevant part out of the svn url + $release= preg_replace('%^.*/gosa/(.*)/include/functions.inc.*$%', '\1', $svn_path); + + // Remove stuff which is not interesting + if(preg_match("/gosa-core/i", $release)) $release = preg_replace("/[\/]gosa-core/i","",$release); + + // A Tagged Version + if(preg_match("#/tags/#i", $svn_path)){ + $release = preg_replace("/tags[\/]*/i","",$release); + $release = preg_replace("/\//","",$release) ; + return (sprintf(_("GOsa %s"),$release)); + } + + // A Branched Version + if(preg_match("#/branches/#i", $svn_path)){ + $release = preg_replace("/branches[\/]*/i","",$release); + $release = preg_replace("/\//","",$release) ; + return (sprintf(_("GOsa %s snapshot (Rev %s)"),$release , $revision)); + } + + // The trunk version + if(preg_match("#/trunk/#i", $svn_path)){ + return (sprintf(_("GOsa development snapshot (Rev %s)"), $revision)); + } - /* Release or development? */ - if (preg_match('%/gosa/trunk/%', $svn_path)){ - return (sprintf(_("GOsa development snapshot (Rev %s)"), $revision)); - } else { - $release= preg_replace('%^.*/([^/]+)/include/functions.inc.*$%', '\1', $svn_path); return (sprintf(_("GOsa $release"), $revision)); - } } diff --git a/gosa-core/setup/class_setupStep_Feedback.inc b/gosa-core/setup/class_setupStep_Feedback.inc index 23c670a1d..b2a6d17f6 100644 --- a/gosa-core/setup/class_setupStep_Feedback.inc +++ b/gosa-core/setup/class_setupStep_Feedback.inc @@ -167,6 +167,7 @@ class Step_Feedback extends setup_step $smarty->assign("feedback_send",$this->feedback_send); $smarty->assign("years",$years); $smarty->assign("features_used",$this->features_used); + $smarty->assign("gosa_version",get_gosa_version()); $smarty->assign("additional_info", reverse_html_entities($additional_info)); $smarty->assign ("must", "*"); return($smarty->fetch(get_template_path("setup_feedback.tpl",TRUE,dirname(__FILE__)))); @@ -252,6 +253,7 @@ class Step_Feedback extends setup_step $str .="\nDistribution: ".$this->distribution; $str .="\nWeb Server: ".$this->web_server; $str .="\nPHP_Version: ".$this->php_version; + $str .="\nGOsa_Version: ".strip_tags(get_gosa_version()); $str .="\nLDAP Server: ".$this->ldap_server; $str .="\nObject count: ".$this->object_count; $str .="\nMissing features: ".($this->want_to_see_next); diff --git a/gosa-core/setup/setup_feedback.tpl b/gosa-core/setup/setup_feedback.tpl index eb326bad0..453760c19 100644 --- a/gosa-core/setup/setup_feedback.tpl +++ b/gosa-core/setup/setup_feedback.tpl @@ -110,6 +110,14 @@ + + + {t}GOsa version{/t} + + + {$gosa_version} + +
{t}LDAP{/t}