Clean code

This commit is contained in:
Laurent Destailleur 2024-02-03 11:38:34 +01:00
parent c0417615b1
commit e88965677e
10 changed files with 13 additions and 24 deletions

View file

@ -612,7 +612,6 @@ class CommandeFournisseur extends CommonOrder
*/
public function fetch_lines($only_product = 0)
{
global $conf;
// phpcs:enable
$this->lines = array();
@ -753,7 +752,7 @@ class CommandeFournisseur extends CommonOrder
*/
public function valid($user, $idwarehouse = 0, $notrigger = 0)
{
global $langs, $conf;
global $conf;
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$error = 0;
@ -888,7 +887,7 @@ class CommandeFournisseur extends CommonOrder
public function LibStatut($status, $mode = 0, $billed = 0)
{
// phpcs:enable
global $conf, $langs, $hookmanager;
global $langs, $hookmanager;
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
$langs->load('orders');
@ -1021,7 +1020,7 @@ class CommandeFournisseur extends CommonOrder
*/
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0)
{
global $langs, $conf, $user, $hookmanager;
global $langs, $user, $hookmanager;
$result = '';
$params = [
@ -1112,7 +1111,7 @@ class CommandeFournisseur extends CommonOrder
*/
public function getNextNumRef($soc)
{
global $db, $langs, $conf;
global $langs, $conf;
$langs->load("orders");
if (getDolGlobalString('COMMANDE_SUPPLIER_ADDON_NUMBER')) {
@ -3306,7 +3305,7 @@ class CommandeFournisseur extends CommonOrder
*/
public function getInputMethod()
{
global $db, $langs;
global $langs;
if ($this->methode_commande_id > 0) {
$sql = "SELECT rowid, code, libelle as label";
@ -3435,18 +3434,18 @@ class CommandeFournisseur extends CommonOrder
/**
* Function used to replace a product id with another one.
*
* @param DoliDB $db Database handler
* @param int $origin_id Old product id
* @param int $dest_id New product id
* @param DoliDB $dbs Database handler
* @param int $origin_id Old product id
* @param int $dest_id New product id
* @return bool
*/
public static function replaceProduct(DoliDB $db, $origin_id, $dest_id)
public static function replaceProduct(DoliDB $dbs, $origin_id, $dest_id)
{
$tables = array(
'commande_fournisseurdet'
);
return CommonObject::commonReplaceProduct($db, $origin_id, $dest_id, $tables);
return CommonObject::commonReplaceProduct($dbs, $origin_id, $dest_id, $tables);
}
/**
@ -3489,6 +3488,8 @@ class CommandeFournisseur extends CommonOrder
{
global $conf, $langs;
$langs->load('orders');
$text = '';
if ($this->statut == self::STATUS_ORDERSENT || $this->statut == self::STATUS_RECEIVED_PARTIALLY) {
@ -3518,8 +3519,6 @@ class CommandeFournisseur extends CommonOrder
*/
public function calcAndSetStatusDispatch(User $user, $closeopenorder = 1, $comment = '')
{
global $conf, $langs;
if (isModEnabled("supplier_order")) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php';
@ -3817,8 +3816,6 @@ class CommandeFournisseurLigne extends CommonOrderLine
*/
public function fetch($rowid)
{
global $conf;
$sql = 'SELECT cd.rowid, cd.fk_commande, cd.fk_product, cd.product_type, cd.description, cd.qty, cd.tva_tx, cd.special_code,';
$sql .= ' cd.localtax1_tx, cd.localtax2_tx, cd.localtax1_type, cd.localtax2_type, cd.ref as ref_supplier,';
$sql .= ' cd.remise, cd.remise_percent, cd.subprice,';

View file

@ -2337,7 +2337,6 @@ ExportUseLowMemoryModeHelp=Use the low memory mode to generate the dump file (co
ModuleWebhookName = Webhook
ModuleWebhookDesc = Interface to catch dolibarr triggers and send data of the event to an URL
WebhookSetup = Webhook setup
Settings = Settings
WebhookSetupPage = Webhook setup page
ShowQuickAddLink=Show a button to quickly add an element in top right menu
ShowSearchAreaInTopMenu=Show the search area in the top menu

View file

@ -190,7 +190,6 @@ MenuBookcalIndex=Online appointment
BookcalLabelAvailabilityHelp=Label of the availability range. For example:<br>General availability<br>Availability during christmas holidays
DurationOfRange=Duration of ranges
BookCalSetup = Online appointment setup
Settings = Settings
BookCalSetupPage = Online appointment setup page
BOOKCAL_PUBLIC_INTERFACE_TOPIC = Interface title
About = About

View file

@ -34,7 +34,6 @@ PaymentEvent=Payment of event
NewRegistration=Registration
EventOrganizationSetup=Event Organization setup
EventOrganization=Event organization
Settings=Settings
EventOrganizationSetupPage = Event Organization setup page
EVENTORGANIZATION_TASK_LABEL = Label of tasks to create automatically when project is validated
EVENTORGANIZATION_TASK_LABELTooltip = When you validate an event to organize, some tasks can be automatically created in the project<br><br>For example: <br>Send Call for Conferences<br>Send Call for Booths<br>Validate suggestions of Conferences<br>Validate application for Booths<br>Open subscriptions to the event for attendees<br>Send a remind of the event to speakers<br>Send a remind of the event to Booth hosters<br>Send a remind of the event to attendees

View file

@ -26,7 +26,6 @@ ModuleKnowledgeManagementDesc=Manage a Knowledge Management (KM) or Help-Desk ba
# Admin page
#
KnowledgeManagementSetup = Knowledge Management System setup
Settings = Settings
KnowledgeManagementSetupPage = Knowledge Management System setup page

View file

@ -1261,3 +1261,4 @@ InvoiceSubtype=Invoice subtype
ConfirmMassReverse=Bulk Reverse confirmation
ConfirmMassReverseQuestion=Are you sure you want to reverse the %s selected record(s)?
Encrypted=Encrypted
Settings=Settings

View file

@ -26,7 +26,6 @@ ModuleRecruitmentDesc = Manage and follow recruitment campaigns for new job posi
# Admin page
#
RecruitmentSetup = Recruitment setup
Settings = Settings
RecruitmentSetupPage = Enter here the setup of main options for the recruitment module
RecruitmentArea=Recruitement area
PublicInterfaceRecruitmentDesc=Public pages of jobs are public URLs to show and answer to open jobs. There is one different link for each open job, found on each job record.

View file

@ -314,7 +314,6 @@ StockStransferIncrementedShort=Stocks transferred
StockStransferIncrementedShortCancel=Increase of destination warehouses canceled
StockTransferNoBatchForProduct=Product %s doesn't use batch, clear batch on line and retry
StockTransferSetup = Stocks Transfer module configuration
Settings=Settings
StockTransferSetupPage = Configuration page for stocks transfer module
StockTransferRightRead=Read stocks transfers
StockTransferRightCreateUpdate=Create/Update stocks transfers

View file

@ -8,7 +8,6 @@ NewSupplierInvoice = New vendor invoice
History=History
ListOfSuppliers=List of vendors
ShowSupplier=Show vendor
OrderDate=Order date
BuyingPriceMin=Best buying price
BuyingPriceMinShort=Best buying price
TotalBuyingPriceMinShort=Total of subproducts buying prices

View file

@ -157,7 +157,6 @@ Booking=Booking
Reservation=Reservation
PagesViewedPreviousMonth=Pages viewed (previous month)
PagesViewedTotal=Pages viewed (total)
Visibility=Visibility
Everyone=Everyone
AssignedContacts=Assigned contacts
WebsiteTypeLabel=Type of Web site
@ -170,7 +169,6 @@ ModuleWebPortalDesc=A ready to use native web portal for customers, suppliers, p
WebPortalDescription=Public web portal module for membership and partnership
WebPortalSetup=WebPortal setup
WebPortalCSS=Web portal CSS
Settings=Settings
WebPortalSetupPage=WebPortal setup page
WEBPORTAL_TITLE=Brand name on header of public page
UserAccountForWebPortalAreInThirdPartyTabHelp=Users accounts for WebPortal can be set on each third party card in Website accounts tab