2
0
forked from Wavyzz/dolibarr

Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2024-10-14 19:52:20 +02:00
2 changed files with 20 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2024 Alexandre Janniaux <alexandre.janniaux@gmail.com>
*
* 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
@@ -170,8 +171,13 @@ class AccountancySystem
$now = dol_now();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_system";
$sql .= " (date_creation, fk_user_author, numero, label)";
$sql .= " VALUES ('".$this->db->idate($now)."',".((int) $user->id).",'".$this->db->escape($this->numero)."','".$this->db->escape($this->label)."')";
$sql .= " (date_creation, fk_user_author, label, pcg_version, active)";
$sql .= " VALUES ('"
. $this->db->idate($now) ."',"
. ((int) $user->id) .",'"
. $this->db->escape($this->label) ."','"
. $this->db->escape($this->pcg_version) ."',"
. ((int) $this->active) .")";
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql = $this->db->query($sql);

View File

@@ -41,6 +41,7 @@ $id = GETPOSTINT('id');
$label = GETPOST('label', 'alpha');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
$langtodelete = GETPOST('langtodelete', 'alpha');
if ($id == '' && $label == '') {
dol_print_error(null, 'Missing parameter id');
@@ -76,6 +77,17 @@ if ($cancel == $langs->trans("Cancel")) {
$action = '';
}
// delete a translation
if ($action == 'delete' && $langtodelete && $user->hasRight('categorie', 'creer')) {
$res = $object->delMultiLangs($langtodelete, $user);
if ($res < 0) {
setEventMessages($object->error, $object->errors, 'errors');
} else {
unset($object->multilangs[$langtodelete]);
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
}
$action = '';
}
// validation of addition
if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && $permissiontoadd) {