Clean code

This commit is contained in:
Laurent Destailleur 2022-12-28 23:20:42 +01:00
parent 1168a2393e
commit aea48e87de
10 changed files with 15 additions and 16 deletions

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
* Copyright (C) 2017-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2022 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -31,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
$error = 0;
// Load translation files required by the page
$langs->loadLangs(array("bills", "accountancy"));
$langs->loadLangs(array("bills", "accountancy", "compta"));
$id = GETPOST('id', 'int');
$cancel = GETPOST('cancel', 'alpha');

View File

@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
// Load translation files required by the page
$langs->load("categories");
$langs->loadLangs(array("categories", "compta"));
$id = GETPOST('id', 'int');
$label = GETPOST('label', 'alpha');

View File

@ -1622,7 +1622,6 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
$newmenu->add("/accountancy/admin/accountmodel.php?id=31&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Pcg_version"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chartmodel', 40);
$newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41);
$newmenu->add("/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ChartOfSubaccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41);
$newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 50);
$newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 60);
if (isModEnabled('banque')) {
$newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_bank', 70);
@ -1640,6 +1639,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
if ($conf->global->MAIN_FEATURES_LEVEL > 1) {
$newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_closure', 120);
}
$newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 125);
$newmenu->add("/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ExportOptions"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_export', 130);
}

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Alicealalalamdskfldmjgdfgdfhfghgfh Adminson <testldr9@dolicloud.com>
* Copyright (C) 2019 Destailleur Laurent <eldy@users.sourceforge.net>
*
* 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

View File

@ -104,9 +104,9 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
$target = array();
$j = 0;
$sql = " select rowid as id, email, firstname, lastname, plan, partner";
$sql = " select rowid as id, label, firstname, lastname";
$sql .= " from ".MAIN_DB_PREFIX."myobject";
$sql .= " where email IS NOT NULL AND email != ''";
$sql .= " where email IS NOT NULL AND email <> ''";
if (GETPOSTISSET('filter') && GETPOST('filter', 'alphanohtml') != 'none') {
$sql .= " AND status = '".$this->db->escape(GETPOST('filter', 'alphanohtml'))."'";
}
@ -129,10 +129,10 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
'name' => $obj->lastname,
'id' => $obj->id,
'firstname' => $obj->firstname,
'other' => $obj->plan.';'.$obj->partner,
'other' => $obj->label,
'source_url' => $this->url($obj->id),
'source_id' => $obj->id,
'source_type' => 'dolicloud'
'source_type' => 'myobject@mymodule'
);
$old = $obj->email;
$j++;

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2019 Alicealalalamdskfldmjgdfgdfhfghgfh Adminson <testldr9@dolicloud.com>
/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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

View File

@ -3065,7 +3065,7 @@ class Product extends CommonObject
}
// If stock decrease is on invoice validation, the theorical stock continue to
// count the orders to ship in theorical stock when some are already removed b invoice validation.
// count the orders to ship in theorical stock when some are already removed by invoice validation.
// If option DECREASE_ONLY_UNINVOICEDPRODUCTS is on, we make a compensation.
if (!empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
if (!empty($conf->global->DECREASE_ONLY_UNINVOICEDPRODUCTS)) {

View File

@ -1,6 +1,5 @@
<?php
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2020 Adminson Alicealalalamdskfldmjgdfgdfhfghgfh <testldr9@dolicloud.com>
/* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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

View File

@ -1,6 +1,5 @@
<?php
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2020 Adminson Alicealalalamdskfldmjgdfgdfhfghgfh <testldr9@dolicloud.com>
/* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2020 Adminson Alicealalalamdskfldmjgdfgdfhfghgfh <testldr9@dolicloud.com>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
*
* 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