From 9a1ec900bdd4c4288fb024465b7f5ce5683b1d2e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Oct 2015 00:31:32 +0200 Subject: [PATCH] NEW Add into about page, a sample text to use to promote new version release (visible only if version is last stable) --- htdocs/admin/system/about.php | 82 ++++++++++++++++++++++++++++++++++- htdocs/langs/en_US/admin.lang | 8 +++- 2 files changed, 88 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/system/about.php b/htdocs/admin/system/about.php index 737e0712ea6..e9d3f96ad55 100644 --- a/htdocs/admin/system/about.php +++ b/htdocs/admin/system/about.php @@ -25,11 +25,15 @@ */ require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; $langs->load("admin"); $langs->load("help"); $langs->load("members"); +$youuselaststable = 0; + /* * View @@ -42,9 +46,54 @@ print load_fiche_titre("Dolibarr",'','title_setup'); print '
'.img_picto_common('', 'dolibarr_box.png','height="120"').'
'; + + +print '
'; + print $langs->trans("Version").' / '.$langs->trans("DolibarrLicense").':'; print '
    '; -print '
  • '.DOL_VERSION.' / GNU-GPL v3+
  • '; +print '
  • '.DOL_VERSION.''; + +$result = getURLContent('http://sourceforge.net/projects/dolibarr/rss'); +//var_dump($result['content']); +$sfurl = simplexml_load_string($result['content']); +if ($sfurl) +{ + $title=$sfurl->channel[0]->item[0]->title; + + function word_limiter($text, $limit = 30, $chars = '0123456789.') + { + if (strlen( $text ) > $limit) + { + $words = str_word_count($text, 2, $chars); + $words = array_reverse($words, TRUE); + foreach($words as $length => $word) { + if ($length + strlen( $word ) >= $limit) + { + array_shift($words); + } else { + break; + } + } + $words = array_reverse($words); + $text = implode(" ", $words) . ''; + } + return $text; + } + + $str = word_limiter($title); + $str = preg_replace('/[^0-9\.]/', '', $str); + print ' ('.$langs->trans("LastStableVersion").': '.$str.''; + if (DOL_VERSION == $str) + { + $youuselaststable=1; + print $langs->trans("YouUseLastStableVersion"); + } + print ')'; + print ' / GNU-GPL v3+
  • '; +} + + print '
'; //print "
\n"; @@ -114,6 +163,9 @@ print ''; print ''; +print '
'; + + print $langs->trans("HelpCenter").':'; print ''; +print '
'; +print '
'; +print '
'; + + +if ($youuselaststable) +{ + print '
'; + print '
'; + + $tmp=versiondolibarrarray(); + if ((empty($tmp[2]) && (strpos($tmp[1], '0') === 0)) || (strpos($tmp[2], '0') === 0)) + { + print $langs->trans("TitleExampleForMajorRelease").':
'; + print ''; + } + else + { + print $langs->trans("TitleExampleForMaintenanceRelease").':
'; + print ''; + } +} + llxFooter(); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 46112d624ce..ed2eb3cdffa 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1693,4 +1693,10 @@ MailToSendSupplierRequestForQuotation=To send quotation request to supplier MailToSendSupplierOrder=To send supplier order MailToSendSupplierInvoice=To send supplier invoice MailToThirdparty=To send email from thirdparty page -ByDefaultInList=Show by default on list view \ No newline at end of file +ByDefaultInList=Show by default on list view +YouUseLastStableVersion=You use the last stable version +TitleExampleForMajorRelease=Example of message you can use to announce this major release (feel free to use it on your web sites) +TitleExampleForMaintenanceRelease=Example of message you can use to announce this maintenance release (feel free to use it on your web sites) +ExampleOfNewsMessageForMajorRelease=Dolibarr ERP & CRM %s is available. Version %s is a major release with a lot of new features for both users and developers. You can download it from the download area of http://www.dolibarr.org portal (subdirectory Stable versions). You can read
ChangeLog for complete list of changes. +ExampleOfNewsMessageForMaintenanceRelease=Dolibarr ERP & CRM %s is available. Version %s is a maintenance version, so it contains only fixes of bugs. We recommend everybody using an older version to upgrade to this one. As any maintenance release, no new features, nor data structure change is present into this version. You can download it from the download area of http://www.dolibarr.org portal (subdirectory Stable versions). You can read ChangeLog for complete list of changes. + \ No newline at end of file