diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 10a9ccb5fc3..4b9de2568c7 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -7,7 +7,8 @@ * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud - * + * Copyright (C) 2018 Nicolas ZABOURI + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -666,6 +667,12 @@ if ($mode == 'common') // Version print ''; print $versiontrans; + if (!empty($objMod->url_last_version)) { + $newversion = file_get_contents($objMod->url_last_version); + if (version_compare($newversion, $versiontrans) > 0) { + print " $newversion"; + } + } print "\n"; // Activate/Disable and Setup (2 columns) diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 0ca707daa1c..1a3d8569dc8 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) ---Put here your own copyright and developer email--- * * This program is free software; you can redistribute it and/or modify @@ -73,6 +74,9 @@ class modMyModule extends DolibarrModules // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' $this->version = '1.0'; + + //Url to the file with your last numberversion of this module + $this->url_last_version = 'http://www.example.com/versionmodule.txt'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Name of image file used for this module.