remove unused code (#31610)

* remove unused code

* remove unused code

* fix typo

* fix

* fix

* fix
This commit is contained in:
Frédéric FRANCE 2024-10-28 19:49:01 +01:00 committed by GitHub
parent 46c6827ccb
commit 7dfa9b7d33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 52 additions and 120 deletions

View file

@ -256,7 +256,7 @@ class Asset extends CommonObject
*/
public function __construct(DoliDB $db)
{
global $conf, $langs;
global $langs;
$this->db = $db;
@ -343,13 +343,7 @@ class Asset extends CommonObject
//
// // Load source object
// $result = $object->fetchCommon($fromid);
// if ($result > 0 && !empty($object->table_element_line)) {
// $object->fetchLines();
// }
//
// // get lines so they will be clone
// //foreach($this->lines as $line)
// // $line->fetch_optionals();
//
// // Reset some properties
// unset($object->id);
@ -420,6 +414,7 @@ class Asset extends CommonObject
// $this->db->rollback();
// return -1;
// }
return -1;
}
@ -434,10 +429,6 @@ class Asset extends CommonObject
{
$result = $this->fetchCommon($id, $ref);
if ($result > 0) {
if (!empty($this->table_element_line)) {
$this->fetchLines();
}
$res = $this->hasDepreciationLinesInBookkeeping();
if ($res < 0) {
return -1;
@ -454,18 +445,6 @@ class Asset extends CommonObject
return $result;
}
/**
* Load object lines in memory from the database
*
* @return int Return integer <0 if KO, 0 if not found, >0 if OK
*/
public function fetchLines()
{
$this->lines = array();
return 1;
}
/**
* Load list of objects in memory from the database.
@ -1591,18 +1570,6 @@ class Asset extends CommonObject
return $this->initAsSpecimenCommon();
}
/**
* Create an array of lines
*
* @return array|int array of lines if OK, <0 if KO
*/
public function getLinesArray()
{
$this->lines = array();
return $this->lines;
}
/**
* Returns the reference to the following non used object depending on the active numbering module.
*

View file

@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2021 Open-Dsi <support@open-dsi.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2021 Open-Dsi <support@open-dsi.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.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
@ -263,13 +263,6 @@ class AssetModel extends CommonObject
// Load source object
$result = $object->fetchCommon($fromid);
if ($result > 0 && !empty($object->table_element_line)) {
$object->fetchLines();
}
// get lines so they will be clone
//foreach($this->lines as $line)
// $line->fetch_optionals();
// Reset some properties
unset($object->id);
@ -354,25 +347,10 @@ class AssetModel extends CommonObject
public function fetch($id, $ref = null)
{
$result = $this->fetchCommon($id, $ref);
if ($result > 0 && !empty($this->table_element_line)) {
$this->fetchLines();
}
return $result;
}
/**
* Load object lines in memory from the database
*
* @return int Return integer <0 if KO, 0 if not found, >0 if OK
*/
public function fetchLines()
{
$this->lines = array();
return 1;
}
/**
* Load list of objects in memory from the database.
*
@ -810,46 +788,4 @@ class AssetModel extends CommonObject
return $this->initAsSpecimenCommon();
}
/**
* Create an array of lines
*
* @return array|int array of lines if OK, <0 if KO
*/
public function getLinesArray()
{
$this->lines = array();
return $this->lines;
}
/**
* Action executed by scheduler
* CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters'
* Use public function doScheduledJob($param1, $param2, ...) to get parameters
*
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
*/
public function doScheduledJob()
{
//global $conf, $langs;
//$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log';
$error = 0;
$this->output = '';
$this->error = '';
dol_syslog(__METHOD__, LOG_DEBUG);
$now = dol_now();
$this->db->begin();
// ...
$this->db->commit();
return $error;
}
}

View file

@ -1,9 +1,9 @@
<?php
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2023 Joachim Kueter <git-jk@bloxera.com>
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2023 Joachim Kueter <git-jk@bloxera.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.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
@ -47,7 +47,7 @@ class Invoices extends DolibarrApi
private $invoice;
/**
* @var FactureRec $templte_invoice {@type FactureRec}
* @var FactureRec $template_invoice {@type FactureRec}
*/
private $template_invoice;

View file

@ -1,9 +1,10 @@
<?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2024 Frédéric France <frederic.france@free.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
@ -141,10 +142,20 @@ class Conf extends stdClass
public $format_date_hour_text_short;
public $format_date_hour_text;
/**
* @var int limit for list
*/
public $liste_limit;
/**
* @var int checkboxes are on left column if 1
*/
public $main_checkbox_left_column;
public $tzuserinputkey = 'tzserver'; // Use 'tzuserrel' to always store date in GMT and show date in time zone of user.
/**
* @var string Use 'tzuserrel' to always store date in GMT and show date in time zone of user.
*/
public $tzuserinputkey = 'tzserver';
// TODO Remove this part.

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.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
@ -44,7 +45,14 @@ class Link extends CommonObject
*/
public $entity;
/**
* @var int|'' date add
*/
public $datea;
/**
* @var string Object url
*/
public $url;
/**
@ -52,7 +60,14 @@ class Link extends CommonObject
*/
public $label;
/**
* @var string Object type
*/
public $objecttype;
/**
* @var int Object ID
*/
public $objectid;
@ -167,11 +182,11 @@ class Link extends CommonObject
}
// Clean parameters
$this->url = clean_url($this->url, 1);
$this->url = clean_url($this->url, 1);
if (empty($this->label)) {
$this->label = basename($this->url);
}
$this->label = trim($this->label);
$this->label = trim($this->label);
$this->db->begin();

View file

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*

View file

@ -125,6 +125,9 @@ class Context
*/
public $rootUrl;
/**
* @var string[]
*/
public $menu_active = array();
/**