diff --git a/ChangeLog.md b/ChangeLog.md index bb87604..ebc83f5 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - +- NEW : COMPATV19 - *01/12/2023* - 1.2.0 ## Version 1.1 diff --git a/admin/scrollto_about.php b/admin/scrollto_about.php deleted file mode 100644 index f6d55c4..0000000 --- a/admin/scrollto_about.php +++ /dev/null @@ -1,76 +0,0 @@ - - * Copyright (C) 2015 ATM Consulting - * - * 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 - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file admin/about.php - * \ingroup scrollto - * \brief This file is an example about page - * Put some comments here - */ -// Dolibarr environment -$res = @include("../../main.inc.php"); // From htdocs directory -if (! $res) { - $res = @include("../../../main.inc.php"); // From "custom" directory -} - -// Libraries -require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; -require_once '../lib/scrollto.lib.php'; - -// Translations -$langs->load("scrollto@scrollto"); - -// Access control -if (! $user->admin) { - accessforbidden(); -} - -/* - * View - */ -$page_name = "ScrollToAbout"; -llxHeader('', $langs->trans($page_name)); - -// Subheader -$linkback = '' - . $langs->trans("BackToModuleList") . ''; -print_fiche_titre($langs->trans($page_name), $linkback); - -// Configuration header -$head = scrolltoAdminPrepareHead(); -dol_fiche_head( - $head, - 'about', - $langs->trans("Module104001Name"), - 0, - 'scrollto@scrollto' -); - -// About page goes here -print '
'; -print '
'.$langs->trans('ATMAbout').'
'; - -dol_fiche_end(); - -print '
'; -print ''; -print '
'; - -llxFooter(); - -$db->close(); \ No newline at end of file diff --git a/admin/scrollto_setup.php b/admin/scrollto_setup.php deleted file mode 100644 index 9a5c57c..0000000 --- a/admin/scrollto_setup.php +++ /dev/null @@ -1,126 +0,0 @@ - - * Copyright (C) 2015 ATM Consulting - * - * 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 - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file admin/scrollto.php - * \ingroup scrollto - * \brief This file is an example module setup page - * Put some comments here - */ -// Dolibarr environment -$res = @include("../../main.inc.php"); // From htdocs directory -if (! $res) { - $res = @include("../../../main.inc.php"); // From "custom" directory -} - -// Libraries -require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; -require_once '../lib/scrollto.lib.php'; - -// Translations -$langs->load("scrollto@scrollto"); - -// Access control -if (! $user->admin) { - accessforbidden(); -} - -// Parameters -$action = GETPOST('action', 'alpha'); - -/* - * Actions - */ -if (preg_match('/set_(.*)/',$action,$reg)) -{ - $code=$reg[1]; - if (dolibarr_set_const($db, $code, GETPOST($code), 'chaine', 0, '', $conf->entity) > 0) - { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } - else - { - dol_print_error($db); - } -} - -if (preg_match('/del_(.*)/',$action,$reg)) -{ - $code=$reg[1]; - if (dolibarr_del_const($db, $code, 0) > 0) - { - Header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } - else - { - dol_print_error($db); - } -} - -/* - * View - */ -$page_name = "ScrollToSetup"; -llxHeader('', $langs->trans($page_name)); - -// Subheader -$linkback = '' - . $langs->trans("BackToModuleList") . ''; -print_fiche_titre($langs->trans($page_name), $linkback); - -// Configuration header -$head = scrolltoAdminPrepareHead(); -dol_fiche_head( - $head, - 'settings', - $langs->trans("Module104001Name"), - 0, - "scrollto@scrollto" -); - -// Setup page goes here -$form=new Form($db); -$var=false; -print ''; -print ''; -print ''."\n"; -print ''; -print ''."\n"; - - -// Example with a yes / no select -$var=!$var; -print ''; -print ''; -print ''; -print ''; - -print '
'.$langs->trans("Parameters").' '.$langs->trans("Value").'
'.$langs->trans("ParamLabel").' '; -print '
'; -print ''; -print ''; -print $form->selectyesno("CONSTNAME",$conf->global->CONSTNAME,1); -print ''; -print '
'; -print '
'; - -llxFooter(); - -$db->close(); \ No newline at end of file diff --git a/class/actions_scrollto.class.php b/class/actions_scrollto.class.php deleted file mode 100644 index a4a5de5..0000000 --- a/class/actions_scrollto.class.php +++ /dev/null @@ -1,88 +0,0 @@ - - * Copyright (C) 2015 ATM Consulting - * - * 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 - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file class/actions_scrollto.class.php - * \ingroup scrollto - * \brief This file is an example hook overload class file - * Put some comments here - */ - -/** - * Class ActionsScrollTo - */ -class ActionsScrollTo -{ - /** - * @var array Hook results. Propagated to $hookmanager->resArray for later reuse - */ - public $results = array(); - - /** - * @var string String displayed by executeHook() immediately after return - */ - public $resprints; - - /** - * @var array Errors - */ - public $errors = array(); - - /** - * Constructor - */ - public function __construct() - { - } - - /** - * Overloading the doActions function : replacing the parent's function with the one below - * - * @param array() $parameters Hook metadatas (context, etc...) - * @param CommonObject &$object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...) - * @param string &$action Current action (if set). Generally create or edit or null - * @param HookManager $hookmanager Hook manager propagated to allow calling another hook - * @return int < 0 on error, 0 on success, 1 to replace standard code - */ - function doActions($parameters, &$object, &$action, $hookmanager) - { - $error = 0; // Error counter - $myvalue = 'test'; // A result value - - print_r($parameters); - echo "action: " . $action; - print_r($object); - - if (in_array('somecontext', explode(':', $parameters['context']))) - { - // do something only for the context 'somecontext' - } - - if (! $error) - { - $this->results = array('myreturn' => $myvalue); - $this->resprints = 'A text to show'; - return 0; // or return 1 to replace standard code - } - else - { - $this->errors[] = 'Error message'; - return -1; - } - } -} \ No newline at end of file diff --git a/core/modules/modScrollTo.class.php b/core/modules/modScrollTo.class.php index 545dcd8..c375231 100644 --- a/core/modules/modScrollTo.class.php +++ b/core/modules/modScrollTo.class.php @@ -58,7 +58,7 @@ function __construct($db) // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) $this->description = "Description of module ScrollTo"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version - $this->version = '1.1.0'; + $this->version = '1.2.0'; // 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); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) @@ -103,8 +103,8 @@ function __construct($db) $this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->conflictwith = array(); // List of modules id this module is in conflict with - $this->phpmin = array(5,0); // Minimum version of PHP required by module - $this->need_dolibarr_version = array(3,0); // Minimum version of Dolibarr required by module + $this->phpmin = array(7,0); // Minimum version of PHP required by module + $this->need_dolibarr_version = array(10,0); // Minimum version of Dolibarr required by module $this->langfiles = array("scrollto@scrollto"); // Constants