Skip to content
This repository was archived by the owner on Nov 27, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,30 @@ ___

# NOT RELEASED

## RELEASE 3.9

- FIX: Replace `is_callable('parent::method')` with `is_callable(parent::class.'::method')` to avoid deprecation warning on php8.2 - *27/11/2024* - 3.9.2
- FIX: constructor TResponseMail, class properties was not defined with old PHP constructor - *30/07/2024* - 3.9.1
- FIX : Compat v20
Changed Dolibarr compatibility range to 16 min - 20 max - *04/08/2024* - 3.9.0

## RELEASE 3.6
- FIX : Warning php 8.2 warning undefined array key visible - *13/03/2024* - 3.8.3
- FIX : Warning php 8.2 warning undefined array key visible - *14/12/2023* - 3.8.2
- FIX : Warning php 8.2 - *11/12/2023* - 3.8.1
- NEW : Compatibilité Dolibarr 19 - *22/11/2023* - 3.8.0
Attention : perte compatibilité Dolibarr inférieur à 6
- NEW : TObjetStd add nullable property to integer fields - *21/11/2023* - 3.7.0
- NEW : script de pré-configuration (initialisation / remplacement de certaines const) lors des installs / montées de version - *19/10/2023* - 3.6.0
- FIX : traitement séparation des requêtes SQL, erreur sql lors de l'activation module productbycompany *7/12/2023* - 3.6.1

## RELEASE 3.5

- FIX : PHP8: date string versus timestamp mixup - *05/09/2023* - 3.5.10
- FIX : PHP8: warnings - *30/08/2023* - 3.5.9
- FIX : Prise en compte du paramètre titre dans la fonction setup_print_title - *29/08/2023* - 3.5.8
- FIX : setup_print_title function correction *03/08/2023* - 3.5.7
- FIX : Query escape column names and Mysql/Pgsql compatibility *24/03/2023* - 3.5.6
- FIX : Substitution script include ticket ref *3.5.5* - **27/02/2023**
- FIX : script de migration des ticketsup prend en compte la ref dans actioncomm + traitement erreur extrafields - *21/12/2022* - 3.5.4
- FIX : Retro compat *18/11/2022* - 3.5.3
Expand All @@ -18,6 +37,7 @@ ___


## RELEASE 3.4 - 11/03/2022

- FIX : Fatal inclusion lib fail - *09/08/2022* - 3.4.10
- FIX : V16 FAMILY - *02/06/2022* - 3.4.9
- FIX : V16 NewToken() - *02/06/2022* - 3.4.8
Expand All @@ -35,6 +55,7 @@ ___
- NEW : Script for set to 1 encrypting of the password in multicompany admin/security conf *14/01/2022* - 3.3

## RELEASE 3.2 - 29/06/2021

- FIX : fatal php8.1 remove &$GLOBAL to $GLOBAL - *31/05/2022)* - 3.2.9
- FIX : Script for MVD add missing substitutions *08/07/2021* - 3.2.8
- FIX : Script for MVD add missing substitutions *07/07/2021* - 3.2.7
Expand Down
1 change: 1 addition & 0 deletions admin/abricot_setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
print '<td align="center" width="200">';
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="action" value="set_ABRICOT_MAILS_FORMAT">';
print '<input type="hidden" name="token" value="'. newToken() .'">';
print $form->selectarray('ABRICOT_MAILS_FORMAT',array('iso-8859-1'=>'iso-8859-1', 'UTF-8'=>'UTF-8'),$conf->global->ABRICOT_MAILS_FORMAT);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</form>';
Expand Down
5 changes: 5 additions & 0 deletions backport/v12/core/lib/fonctions.lib.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* SPDX-License-Identifier: GPL-3.0-or-later
* This file is part of Dolibarr module Abricot
*/



if ((float) DOL_VERSION < 12) {
Expand Down
8 changes: 4 additions & 4 deletions core/modules/modAbricot.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function __construct($db)
// (where XXX is value of numeric property 'numero' of module)
$this->description = "Collection of specific ATM functions and classes";
// Possible values for version are: 'development', 'experimental' or version
$this->version = '3.5.5';
$this->version = '3.9.2';
$this->editor_name = 'ATM Consulting';
$this->editor_url = 'https://www.atm-consulting.fr';
// Key used in llx_const table to save module status enabled/disabled
Expand Down Expand Up @@ -115,9 +115,9 @@ public function __construct($db)
// List of modules id to disable if this one is disabled
$this->requiredby = array();
// Minimum version of PHP required by module
$this->phpmin = array(5, 3);
$this->phpmin = array(7, 0);
// Minimum version of Dolibarr required by module
$this->need_dolibarr_version = array(3, 2);
$this->need_dolibarr_version = array(16, 0);
$this->langfiles = 'abricot@abricot'; // langfiles@mymodule
// Constants
// List of particular constants to add when module is enabled
Expand Down Expand Up @@ -168,7 +168,7 @@ public function __construct($db)
// 'categories_x' to add a tab in category view
// (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
// Dictionnaries
if (! isset($conf->mymodule->enabled)) {
if (!isModEnabled('mymodule')) {
$conf->mymodule=new stdClass();
$conf->mymodule->enabled = 0;
}
Expand Down
5 changes: 5 additions & 0 deletions downlist.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<?php
/**
* SPDX-License-Identifier: GPL-3.0-or-later
* This file is part of Dolibarr module Abricot
*/


$s_name = $_POST['session_name'] or die('Pas de session trouvée');
session_name($s_name);
Expand Down
4 changes: 2 additions & 2 deletions includes/class/class.form.core.php
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,7 @@ function combo($pLib,$pName,$pListe,$pDefault,$pTaille=1,$onChange='',$plus='',$
$valueofempty=$showEmpty;
}

$field.='<option value="'.($show_empty < 0 ? $show_empty : -1).'"'.( $pDefault==$valueofempty ?' selected':'').'>'.$textforempty.'</option>'."\n"; // id is -2 because -1 is already "do not contact"
$field.='<option value="'.(isset($show_empty) && $show_empty < 0 ? $show_empty : -1).'"'.( $pDefault==$valueofempty ?' selected':'').'>'.$textforempty.'</option>'."\n"; // id is -2 because -1 is already "do not contact"
}

$field.=$this->_combo_option($pListe, $pDefault);
Expand Down Expand Up @@ -2017,7 +2017,7 @@ function button_js($array){
if($pVal=='')$pVal='Supprimer';
if($url!=''){
//la page se rafraichi sur elle meme, meme en popin car c'est l'action suivant qui fera le rafraichissement.
if((substr($url,0,4)=='http')||($url[0] == '?')){
if((substr($url,0,4)=='http')||(mb_substr($url, 0, 1) == '?')){
$url = "document.location.href='".$url."&mode=popin'";
}
else{
Expand Down
2 changes: 1 addition & 1 deletion includes/class/class.list.tbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private function getSearchKey($key, &$TParam) {
$TKey[] = $prefixe.'`'. $field .'`';
}
} else {
$TKey[] =$TPrefixe[0].'`'. strtr($key,';','*').'`';
$TKey[] = (isset($TPrefixe[0])?$TPrefixe[0]:'').'`'. strtr($key,';','*').'`';
}

return $TKey;
Expand Down
31 changes: 26 additions & 5 deletions includes/class/class.objet_std.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,15 @@ function addFieldsInDb(&$db) {

if(!in_array($champs, $Tab)) {
if($this->_is_int($info)) {
$db->Execute('ALTER TABLE `'.$this->get_table().'` ADD `'.$champs.'` int(11) NOT NULL DEFAULT \''.(!empty($info['default']) && is_int($info['default']) ? $info['default'] : '0').'\'');
$sqlAlterInt = 'ALTER TABLE `'.$this->get_table().'` ADD `'.$champs.'` integer';
if(! isset($info['nullable']) || $info['nullable'] === false) $sqlAlterInt .= ' NOT';
$sqlAlterInt .= ' NULL';

if(empty($info['default']) || ! is_int($info['default']) && strtoupper($info['default']) !== 'NULL') $sqlAlterInt .= ' DEFAULT 0';
else $sqlAlterInt .= ' DEFAULT '.$info['default'];

$db->Execute($sqlAlterInt);
// $db->Execute('ALTER TABLE `'.$this->get_table().'` ADD `'.$champs.'` integer NOT NULL DEFAULT \''.(!empty($info['default']) && is_int($info['default']) ? $info['default'] : '0').'\'');
}else if($this->_is_date($info)) {

$db->Execute('ALTER TABLE `'.$this->get_table().'` ADD `'.$champs.'` datetime NULL');
Expand Down Expand Up @@ -474,7 +482,11 @@ function _set_save_query(&$query){
else $query[$nom_champ] = NULL;
}
else{
$date = date('Y-m-d H:i:s',$this->{$nom_champ});
if (preg_match('/^\d{4}-\d{2}-\d{2}( \d{2}:\d{2}:\d{2})?$/', $this->{$nom_champ})) {
$date = $this->{$nom_champ};
} else {
$date = date('Y-m-d H:i:s', $this->{$nom_champ});
}
$query[$nom_champ] = $date;
}
}
Expand All @@ -485,8 +497,16 @@ function _set_save_query(&$query){
$query[$nom_champ] = serialize($this->{$nom_champ});
}

else if($this->_is_int($info)){
$query[$nom_champ] = (int)Tools::string2num($this->{$nom_champ});
else if($this->_is_int($info)) {
$res = (int) Tools::string2num($this->{$nom_champ});

// Handle nullable properties
if(isset($info['default']) && $res === 0 && $res !== $info['default']) {
$res = $info['default'];
if(isset($info['nullable']) && strtoupper($info['default']) === 'NULL') $res = null;
}

$query[$nom_champ] = $res;
}

else if($this->_is_float($info)){
Expand Down Expand Up @@ -958,7 +978,8 @@ function get_tab($recursif = false, $object = null) {
else $Tab[$key] = $value;
}
else if(substr($key,0, strlen(OBJETSTD_DATEMASK) )===OBJETSTD_DATEMASK){
if($value===FALSE)$Tab[$key] = '0000-00-00 00:00:00';
if($value===FALSE) $Tab[$key] = '0000-00-00 00:00:00';
elseif (is_string($value) && preg_match('/\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d/', $value)) $Tab[$key] = $value;
else $Tab[$key] = date('Y-m-d H:i:s',$value);
}
else{
Expand Down
2 changes: 1 addition & 1 deletion includes/class/class.reponse.mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TReponseMail{
* Constructor
* @access protected
*/
function TReponseMail($emailfrom="",$emailto="",$titre="",$corps=""){
function __construct($emailfrom="",$emailto="",$titre="",$corps=""){
global $conf;

$this->emailfrom=$emailfrom;
Expand Down
Loading