add visibility

This commit is contained in:
Frédéric FRANCE 2019-02-27 20:45:07 +01:00
parent c5d252fa2e
commit 9b165f6b3f
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
43 changed files with 1156 additions and 1156 deletions

View File

@ -81,7 +81,7 @@ if ($action == 'addprinter' && $user->admin) {
} }
if (! $error) { if (! $error) {
$result= $printer->AddPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter); $result= $printer->addPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter);
if ($result > 0) $error++; if ($result > 0) $error++;
if (! $error) if (! $error)
@ -107,7 +107,7 @@ if ($action == 'deleteprinter' && $user->admin) {
} }
if (! $error) { if (! $error) {
$result= $printer->DeletePrinter($printerid); $result= $printer->deletePrinter($printerid);
if ($result > 0) $error++; if ($result > 0) $error++;
if (! $error) if (! $error)
@ -133,7 +133,7 @@ if ($action == 'updateprinter' && $user->admin) {
} }
if (! $error) { if (! $error) {
$result= $printer->UpdatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid); $result= $printer->updatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid);
if ($result > 0) $error++; if ($result > 0) $error++;
if (! $error) { if (! $error) {
@ -156,7 +156,7 @@ if ($action == 'testprinter' && $user->admin) {
if (! $error) { if (! $error) {
// test // test
$ret = $printer->SendTestToPrinter($printerid); $ret = $printer->sendTestToPrinter($printerid);
if ($ret == 0) { if ($ret == 0) {
setEventMessages($langs->trans("TestSentToPrinter", $printername), null); setEventMessages($langs->trans("TestSentToPrinter", $printername), null);
} else { } else {
@ -176,7 +176,7 @@ if ($action == 'updatetemplate' && $user->admin) {
} }
if (! $error) { if (! $error) {
$result= $printer->UpdateTemplate($templatename, $template, $templateid); $result= $printer->updateTemplate($templatename, $template, $templateid);
if ($result > 0) $error++; if ($result > 0) $error++;
if (! $error) { if (! $error) {

View File

@ -486,7 +486,7 @@ class ActionComm extends CommonObject
* @param int $socid Id of thirdparty * @param int $socid Id of thirdparty
* @return int New id of clone * @return int New id of clone
*/ */
function createFromClone($fuser, $socid) public function createFromClone($fuser, $socid)
{ {
global $db, $user, $langs, $conf, $hookmanager; global $db, $user, $langs, $conf, $hookmanager;
@ -502,7 +502,7 @@ class ActionComm extends CommonObject
// fetch optionals attributes and labels // fetch optionals attributes and labels
$this->fetch_optionals(); $this->fetch_optionals();
// $this->fetch_userassigned(); //$this->fetch_userassigned();
$this->fetchResources(); $this->fetchResources();
$this->id=0; $this->id=0;
@ -566,7 +566,7 @@ class ActionComm extends CommonObject
* @param string $ref_ext Ref ext to get * @param string $ref_ext Ref ext to get
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id, $ref = '', $ref_ext = '') public function fetch($id, $ref = '', $ref_ext = '')
{ {
global $langs; global $langs;
@ -680,7 +680,7 @@ class ActionComm extends CommonObject
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetchResources() public function fetchResources()
{ {
$sql ='SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency'; $sql ='SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency';
$sql.=' FROM '.MAIN_DB_PREFIX.'actioncomm_resources'; $sql.=' FROM '.MAIN_DB_PREFIX.'actioncomm_resources';
@ -720,13 +720,13 @@ class ActionComm extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Initialize this->userassigned array with list of id of user assigned to event * Initialize this->userassigned array with list of id of user assigned to event
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch_userassigned() public function fetch_userassigned()
{ {
// phpcs:enable // phpcs:enable
$sql ="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency"; $sql ="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
@ -761,7 +761,7 @@ class ActionComm extends CommonObject
* @param int $notrigger 1 = disable triggers, 0 = enable triggers * @param int $notrigger 1 = disable triggers, 0 = enable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($notrigger = 0) public function delete($notrigger = 0)
{ {
global $user,$langs,$conf; global $user,$langs,$conf;
@ -838,7 +838,7 @@ class ActionComm extends CommonObject
* @param int $notrigger 1 = disable triggers, 0 = enable triggers * @param int $notrigger 1 = disable triggers, 0 = enable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user, $notrigger = 0) public function update($user, $notrigger = 0)
{ {
global $langs,$conf,$hookmanager; global $langs,$conf,$hookmanager;
@ -999,7 +999,7 @@ class ActionComm extends CommonObject
* @param string $limit Limit number of answers * @param string $limit Limit number of answers
* @return array or string Error string if KO, array with actions if OK * @return array or string Error string if KO, array with actions if OK
*/ */
static function getActions($db, $socid = 0, $fk_element = 0, $elementtype = '', $filter = '', $sortfield = 'a.datep', $sortorder = 'DESC', $limit = 0) public static function getActions($db, $socid = 0, $fk_element = 0, $elementtype = '', $filter = '', $sortfield = 'a.datep', $sortorder = 'DESC', $limit = 0)
{ {
global $conf, $langs; global $conf, $langs;
@ -1043,7 +1043,7 @@ class ActionComm extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate) * Load indicators for dashboard (this->nbtodo and this->nbtodolate)
* *
@ -1051,7 +1051,7 @@ class ActionComm extends CommonObject
* @param int $load_state_board Charge indicateurs this->nb de tableau de bord * @param int $load_state_board Charge indicateurs this->nb de tableau de bord
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/ */
function load_board($user, $load_state_board = 0) public function load_board($user, $load_state_board = 0)
{ {
// phpcs:enable // phpcs:enable
global $conf, $langs; global $conf, $langs;
@ -1112,7 +1112,7 @@ class ActionComm extends CommonObject
* @param int $id Id de la facture a charger * @param int $id Id de la facture a charger
* @return void * @return void
*/ */
function info($id) public function info($id)
{ {
$sql = 'SELECT '; $sql = 'SELECT ';
$sql.= ' a.id,'; $sql.= ' a.id,';
@ -1163,12 +1163,12 @@ class ActionComm extends CommonObject
* @param int $hidenastatus 1=Show nothing if status is "Not applicable" * @param int $hidenastatus 1=Show nothing if status is "Not applicable"
* @return string String with status * @return string String with status
*/ */
function getLibStatut($mode, $hidenastatus = 0) public function getLibStatut($mode, $hidenastatus = 0)
{ {
return $this->LibStatut($this->percentage, $mode, $hidenastatus, $this->datep); return $this->LibStatut($this->percentage, $mode, $hidenastatus, $this->datep);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return label of action status * Return label of action status
* *
@ -1178,7 +1178,7 @@ class ActionComm extends CommonObject
* @param int $datestart Date start of event * @param int $datestart Date start of event
* @return string Label * @return string Label
*/ */
function LibStatut($percent, $mode, $hidenastatus = 0, $datestart = '') public function LibStatut($percent, $mode, $hidenastatus = 0, $datestart = '')
{ {
// phpcs:enable // phpcs:enable
global $langs; global $langs;
@ -1256,7 +1256,7 @@ class ActionComm extends CommonObject
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string Chaine avec URL * @return string Chaine avec URL
*/ */
function getNomUrl($withpicto = 0, $maxlength = 0, $classname = '', $option = '', $overwritepicto = 0, $notooltip = 0, $save_lastsearch_value = -1) public function getNomUrl($withpicto = 0, $maxlength = 0, $classname = '', $option = '', $overwritepicto = 0, $notooltip = 0, $save_lastsearch_value = -1)
{ {
global $conf, $langs, $user, $hookmanager, $action; global $conf, $langs, $user, $hookmanager, $action;
@ -1379,7 +1379,7 @@ class ActionComm extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Export events from database into a cal file. * Export events from database into a cal file.
* *
@ -1390,7 +1390,7 @@ class ActionComm extends CommonObject
* @param array $filters Array of filters. Exemple array('notolderthan'=>99, 'year'=>..., 'idfrom'=>..., 'notactiontype'=>'systemauto', 'project'=>123, ...) * @param array $filters Array of filters. Exemple array('notolderthan'=>99, 'year'=>..., 'idfrom'=>..., 'notactiontype'=>'systemauto', 'project'=>123, ...)
* @return int <0 if error, nb of events in new file if ok * @return int <0 if error, nb of events in new file if ok
*/ */
function build_exportfile($format, $type, $cachedelay, $filename, $filters) public function build_exportfile($format, $type, $cachedelay, $filename, $filters)
{ {
// phpcs:enable // phpcs:enable
global $conf,$langs,$dolibarr_main_url_root,$mysoc; global $conf,$langs,$dolibarr_main_url_root,$mysoc;
@ -1618,7 +1618,7 @@ class ActionComm extends CommonObject
* *
* @return void * @return void
*/ */
function initAsSpecimen() public function initAsSpecimen()
{ {
global $user; global $user;

View File

@ -178,12 +178,12 @@ class ActionCommReminder extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label of status * @return string Label of status
*/ */
function getLibStatut($mode = 0) public function getLibStatut($mode = 0)
{ {
return $this->LibStatut($this->status, $mode); return $this->LibStatut($this->status, $mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return the status * Return the status
* *
@ -191,7 +191,7 @@ class ActionCommReminder extends CommonObject
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Label of status * @return string Label of status
*/ */
static function LibStatut($status, $mode = 0) public static function LibStatut($status, $mode = 0)
{ {
// phpcs:enable // phpcs:enable
global $langs; global $langs;

View File

@ -44,7 +44,7 @@ class AgendaEvents extends DolibarrApi
/** /**
* Constructor * Constructor
*/ */
function __construct() public function __construct()
{ {
global $db, $conf; global $db, $conf;
$this->db = $db; $this->db = $db;
@ -61,7 +61,7 @@ class AgendaEvents extends DolibarrApi
* *
* @throws RestException * @throws RestException
*/ */
function get($id) public function get($id)
{ {
if (! DolibarrApiAccess::$user->rights->agenda->myactions->read) { if (! DolibarrApiAccess::$user->rights->agenda->myactions->read) {
throw new RestException(401, "Insuffisant rights to read an event"); throw new RestException(401, "Insuffisant rights to read an event");
@ -99,7 +99,7 @@ class AgendaEvents extends DolibarrApi
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'%dol%') and (t.datec:<:'20160101')" * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'%dol%') and (t.datec:<:'20160101')"
* @return array Array of Agenda Events objects * @return array Array of Agenda Events objects
*/ */
function index($sortfield = "t.id", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '') public function index($sortfield = "t.id", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '')
{ {
global $db, $conf; global $db, $conf;
@ -188,7 +188,7 @@ class AgendaEvents extends DolibarrApi
* @param array $request_data Request data * @param array $request_data Request data
* @return int ID of Agenda Event * @return int ID of Agenda Event
*/ */
function post($request_data = null) public function post($request_data = null)
{ {
if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) { if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) {
throw new RestException(401, "Insuffisant rights to create your Agenda Event"); throw new RestException(401, "Insuffisant rights to create your Agenda Event");
@ -227,7 +227,7 @@ class AgendaEvents extends DolibarrApi
* @return int * @return int
*/ */
/* /*
function put($id, $request_data = null) public function put($id, $request_data = null)
{ {
if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) { if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) {
throw new RestException(401, "Insuffisant rights to create your Agenda Event"); throw new RestException(401, "Insuffisant rights to create your Agenda Event");
@ -263,7 +263,7 @@ class AgendaEvents extends DolibarrApi
* *
* @return array * @return array
*/ */
function delete($id) public function delete($id)
{ {
if(! DolibarrApiAccess::$user->rights->agenda->myactions->delete) { if(! DolibarrApiAccess::$user->rights->agenda->myactions->delete) {
throw new RestException(401, "Insuffisant rights to delete your Agenda Event"); throw new RestException(401, "Insuffisant rights to delete your Agenda Event");
@ -302,7 +302,7 @@ class AgendaEvents extends DolibarrApi
* @return array * @return array
* @throws RestException * @throws RestException
*/ */
function _validate($data) private function _validate($data)
{ {
$event = array(); $event = array();
foreach (AgendaEvents::$FIELDS as $field) { foreach (AgendaEvents::$FIELDS as $field) {
@ -319,7 +319,7 @@ class AgendaEvents extends DolibarrApi
* @param object $object Object to clean * @param object $object Object to clean
* @return array Array of cleaned object properties * @return array Array of cleaned object properties
*/ */
function _cleanObjectDatas($object) private function _cleanObjectDatas($object)
{ {
$object = parent::_cleanObjectDatas($object); $object = parent::_cleanObjectDatas($object);

View File

@ -68,7 +68,7 @@ class CActionComm
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
@ -79,7 +79,7 @@ class CActionComm
* @param int $id id or code of action type to read * @param int $id id or code of action type to read
* @return int 1=ok, 0=not found, -1=error * @return int 1=ok, 0=not found, -1=error
*/ */
function fetch($id) public function fetch($id)
{ {
$sql = "SELECT id, code, type, libelle as label, color, active, picto"; $sql = "SELECT id, code, type, libelle as label, color, active, picto";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm"; $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm";
@ -118,7 +118,7 @@ class CActionComm
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of event types: array(id=>label) or array(code=>label) * Return list of event types: array(id=>label) or array(code=>label)
* *
@ -130,7 +130,7 @@ class CActionComm
* @param int $shortlabel 1=Get short label instead of long label * @param int $shortlabel 1=Get short label instead of long label
* @return mixed Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode. * @return mixed Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode.
*/ */
function liste_array($active = '', $idorcode = 'id', $excludetype = '', $onlyautoornot = 0, $morefilter = '', $shortlabel = 0) public function liste_array($active = '', $idorcode = 'id', $excludetype = '', $onlyautoornot = 0, $morefilter = '', $shortlabel = 0)
{ {
// phpcs:enable // phpcs:enable
global $langs,$conf; global $langs,$conf;
@ -223,7 +223,7 @@ class CActionComm
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Picto only * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Picto only
* @return string Label of action type * @return string Label of action type
*/ */
function getNomUrl($withpicto = 0) public function getNomUrl($withpicto = 0)
{ {
global $langs; global $langs;

View File

@ -32,12 +32,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/xcal.lib.php';
*/ */
class ICal class ICal
{ {
var $file_text; // Text in file // Text in file
var $cal; // Array to save iCalendar parse data public $file_text;
var $event_count; // Number of Events public $cal; // Array to save iCalendar parse data
var $todo_count; // Number of Todos public $event_count; // Number of Events
var $freebusy_count; // Number of Freebusy public $todo_count; // Number of Todos
var $last_key; //Help variable save last key (multiline string) public $freebusy_count; // Number of Freebusy
public $last_key; //Help variable save last key (multiline string)
/** /**
@ -47,14 +48,14 @@ class ICal
{ {
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Read text file, icalender text file * Read text file, icalender text file
* *
* @param string $file File * @param string $file File
* @return string * @return string
*/ */
function read_file($file) public function read_file($file)
{ {
// phpcs:enable // phpcs:enable
$this->file = $file; $this->file = $file;
@ -69,25 +70,25 @@ class ICal
return $file_text; // return all text return $file_text; // return all text
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Returns the number of calendar events * Returns the number of calendar events
* *
* @return int * @return int
*/ */
function get_event_count() public function get_event_count()
{ {
// phpcs:enable // phpcs:enable
return $this->event_count; return $this->event_count;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Returns the number of to do * Returns the number of to do
* *
* @return int * @return int
*/ */
function get_todo_count() public function get_todo_count()
{ {
// phpcs:enable // phpcs:enable
return $this->todo_count; return $this->todo_count;
@ -99,7 +100,7 @@ class ICal
* @param string $uri Url * @param string $uri Url
* @return array|string * @return array|string
*/ */
function parse($uri) public function parse($uri)
{ {
$this->cal = array(); // new empty array $this->cal = array(); // new empty array
@ -201,7 +202,7 @@ class ICal
return $this->cal; return $this->cal;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Add to $this->ical array one value and key. * Add to $this->ical array one value and key.
* *
@ -210,7 +211,7 @@ class ICal
* @param string $value Value * @param string $value Value
* @return void * @return void
*/ */
function add_to_array($type, $key, $value) public function add_to_array($type, $key, $value)
{ {
// phpcs:enable // phpcs:enable
@ -263,14 +264,14 @@ class ICal
$this->last_key = $key; $this->last_key = $key;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Parse text "XXXX:value text some with : " and return array($key = "XXXX", $value="value"); * Parse text "XXXX:value text some with : " and return array($key = "XXXX", $value="value");
* *
* @param string $text Text * @param string $text Text
* @return array * @return array
*/ */
function retun_key_value($text) public function retun_key_value($text)
{ {
// phpcs:enable // phpcs:enable
/* /*
@ -288,14 +289,14 @@ class ICal
return explode(':', $text, 2); return explode(':', $text, 2);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Parse RRULE return array * Parse RRULE return array
* *
* @param string $value string * @param string $value string
* @return array * @return array
*/ */
function ical_rrule($value) public function ical_rrule($value)
{ {
// phpcs:enable // phpcs:enable
$result = array(); $result = array();
@ -308,14 +309,14 @@ class ICal
return $result; return $result;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return Unix time from ical date time fomrat (YYYYMMDD[T]HHMMSS[Z] or YYYYMMDD[T]HHMMSS) * Return Unix time from ical date time fomrat (YYYYMMDD[T]HHMMSS[Z] or YYYYMMDD[T]HHMMSS)
* *
* @param string $ical_date String date * @param string $ical_date String date
* @return int * @return int
*/ */
function ical_date_to_unix($ical_date) public function ical_date_to_unix($ical_date)
{ {
// phpcs:enable // phpcs:enable
$ical_date = str_replace('T', '', $ical_date); $ical_date = str_replace('T', '', $ical_date);
@ -331,7 +332,7 @@ class ICal
return $ntime; // ntime is a GTM time return $ntime; // ntime is a GTM time
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return unix date from iCal date format * Return unix date from iCal date format
* *
@ -339,7 +340,7 @@ class ICal
* @param string $value Value * @param string $value Value
* @return array * @return array
*/ */
function ical_dt_date($key, $value) public function ical_dt_date($key, $value)
{ {
// phpcs:enable // phpcs:enable
$return_value = array(); $return_value = array();
@ -362,13 +363,13 @@ class ICal
return array($key,$return_value); return array($key,$return_value);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return sorted eventlist as array or false if calendar is empty * Return sorted eventlist as array or false if calendar is empty
* *
* @return array|false * @return array|false
*/ */
function get_sort_event_list() public function get_sort_event_list()
{ {
// phpcs:enable // phpcs:enable
$temp = $this->get_event_list(); $temp = $this->get_event_list();
@ -383,7 +384,7 @@ class ICal
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Compare two unix timestamp * Compare two unix timestamp
* *
@ -391,67 +392,67 @@ class ICal
* @param array $b Operand b * @param array $b Operand b
* @return integer * @return integer
*/ */
function ical_dtstart_compare($a, $b) public function ical_dtstart_compare($a, $b)
{ {
// phpcs:enable // phpcs:enable
return strnatcasecmp($a['DTSTART']['unixtime'], $b['DTSTART']['unixtime']); return strnatcasecmp($a['DTSTART']['unixtime'], $b['DTSTART']['unixtime']);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return eventlist array (not sorted eventlist array) * Return eventlist array (not sorted eventlist array)
* *
* @return array * @return array
*/ */
function get_event_list() public function get_event_list()
{ {
// phpcs:enable // phpcs:enable
return (! empty($this->cal['VEVENT'])?$this->cal['VEVENT']:''); return (! empty($this->cal['VEVENT'])?$this->cal['VEVENT']:'');
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return eventlist array (not sort eventlist array) * Return eventlist array (not sort eventlist array)
* *
* @return array * @return array
*/ */
function get_freebusy_list() public function get_freebusy_list()
{ {
// phpcs:enable // phpcs:enable
return $this->cal['VFREEBUSY']; return $this->cal['VFREEBUSY'];
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return to do array (not sorted todo array) * Return to do array (not sorted todo array)
* *
* @return array * @return array
*/ */
function get_todo_list() public function get_todo_list()
{ {
// phpcs:enable // phpcs:enable
return $this->cal['VTODO']; return $this->cal['VTODO'];
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return base calendar data * Return base calendar data
* *
* @return array * @return array
*/ */
function get_calender_data() public function get_calender_data()
{ {
// phpcs:enable // phpcs:enable
return $this->cal['VCALENDAR']; return $this->cal['VCALENDAR'];
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return array with all data * Return array with all data
* *
* @return array * @return array
*/ */
function get_all_data() public function get_all_data()
{ {
// phpcs:enable // phpcs:enable
return $this->cal; return $this->cal;

View File

@ -58,20 +58,20 @@ class AdvanceTargetingMailing extends CommonObject
*/ */
public $id; public $id;
var $name; public $name;
var $entity; public $entity;
var $fk_element; public $fk_element;
var $type_element; public $type_element;
var $filtervalue; public $filtervalue;
var $fk_user_author; public $fk_user_author;
var $datec=''; public $datec='';
var $fk_user_mod; public $fk_user_mod;
var $tms=''; public $tms='';
var $select_target_type = array(); public $select_target_type = array();
var $type_statuscommprospect=array(); public $type_statuscommprospect=array();
var $thirdparty_lines; public $thirdparty_lines;
var $contact_lines; public $contact_lines;
/** /**
@ -79,7 +79,7 @@ class AdvanceTargetingMailing extends CommonObject
* *
* @param DoliDb $db Database handler * @param DoliDb $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $langs; global $langs;
$langs->load('customers'); $langs->load('customers');
@ -108,7 +108,7 @@ class AdvanceTargetingMailing extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, Id of created object if OK * @return int <0 if KO, Id of created object if OK
*/ */
function create($user, $notrigger = 0) public function create($user, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@ -202,7 +202,7 @@ class AdvanceTargetingMailing extends CommonObject
* @param int $id Id object * @param int $id Id object
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id) public function fetch($id)
{ {
global $langs; global $langs;
$sql = "SELECT"; $sql = "SELECT";
@ -253,14 +253,14 @@ class AdvanceTargetingMailing extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Load object in memory from the database * Load object in memory from the database
* *
* @param int $id Id object * @param int $id Id object
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch_by_mailing($id = 0) public function fetch_by_mailing($id = 0)
{ {
// phpcs:enable // phpcs:enable
global $langs; global $langs;
@ -319,7 +319,7 @@ class AdvanceTargetingMailing extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Load object in memory from the database * Load object in memory from the database
* *
@ -327,7 +327,7 @@ class AdvanceTargetingMailing extends CommonObject
* @param string $type_element Type target * @param string $type_element Type target
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch_by_element($id = 0, $type_element = 'mailing') public function fetch_by_element($id = 0, $type_element = 'mailing')
{ {
// phpcs:enable // phpcs:enable
global $langs; global $langs;
@ -390,7 +390,7 @@ class AdvanceTargetingMailing extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user, $notrigger = 0) public function update($user, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@ -469,7 +469,7 @@ class AdvanceTargetingMailing extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($user, $notrigger = 0) public function delete($user, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@ -528,7 +528,7 @@ class AdvanceTargetingMailing extends CommonObject
* @param array $arrayquery All element to Query * @param array $arrayquery All element to Query
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function savequery($user, $arrayquery) public function savequery($user, $arrayquery)
{ {
global $langs,$conf; global $langs,$conf;
@ -548,14 +548,14 @@ class AdvanceTargetingMailing extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Load object in memory from database * Load object in memory from database
* *
* @param array $arrayquery All element to Query * @param array $arrayquery All element to Query
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function query_thirdparty($arrayquery) public function query_thirdparty($arrayquery)
{ {
// phpcs:enable // phpcs:enable
global $langs,$conf; global $langs,$conf;
@ -699,7 +699,7 @@ class AdvanceTargetingMailing extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Load object in memory from database * Load object in memory from database
* *
@ -707,7 +707,7 @@ class AdvanceTargetingMailing extends CommonObject
* @param int $withThirdpartyFilter add contact with tridparty filter * @param int $withThirdpartyFilter add contact with tridparty filter
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function query_contact($arrayquery, $withThirdpartyFilter = 0) public function query_contact($arrayquery, $withThirdpartyFilter = 0)
{ {
// phpcs:enable // phpcs:enable
global $langs,$conf; global $langs,$conf;

View File

@ -42,7 +42,7 @@ class FormAdvTargetEmailing extends Form
* *
* @param DoliDB $db handler * @param DoliDB $db handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $langs; global $langs;
@ -56,7 +56,7 @@ class FormAdvTargetEmailing extends Form
* @param string $htmlname select field * @param string $htmlname select field
* @return string select field * @return string select field
*/ */
function multiselectProspectionStatus($selected_array = array(), $htmlname = 'cust_prospect_status') public function multiselectProspectionStatus($selected_array = array(), $htmlname = 'cust_prospect_status')
{ {
global $conf, $langs; global $conf, $langs;
$options_array = array(); $options_array = array();
@ -93,7 +93,7 @@ class FormAdvTargetEmailing extends Form
* @param array $selected_array or Code or Label of preselected country * @param array $selected_array or Code or Label of preselected country
* @return string HTML string with select * @return string HTML string with select
*/ */
function multiselectCountry($htmlname = 'country_id', $selected_array = array()) public function multiselectCountry($htmlname = 'country_id', $selected_array = array())
{ {
global $conf, $langs; global $conf, $langs;
@ -154,7 +154,7 @@ class FormAdvTargetEmailing extends Form
* @param User $user User action * @param User $user User action
* @return string combo list code * @return string combo list code
*/ */
function multiselectselectSalesRepresentatives($htmlname, $selected_array, $user) public function multiselectselectSalesRepresentatives($htmlname, $selected_array, $user)
{ {
global $conf; global $conf;
@ -195,7 +195,7 @@ class FormAdvTargetEmailing extends Form
* @param array $selected_array selected array * @param array $selected_array selected array
* @return string combo list code * @return string combo list code
*/ */
function multiselectselectLanguage($htmlname = '', $selected_array = array()) public function multiselectselectLanguage($htmlname = '', $selected_array = array())
{ {
global $conf,$langs; global $conf,$langs;
@ -222,7 +222,7 @@ class FormAdvTargetEmailing extends Form
* *
* @return string HTML combo * @return string HTML combo
*/ */
function advMultiselectarraySelllist($htmlname, $sqlqueryparam = array(), $selected_array = array()) public function advMultiselectarraySelllist($htmlname, $sqlqueryparam = array(), $selected_array = array())
{ {
$options_array=array(); $options_array=array();
@ -291,7 +291,7 @@ class FormAdvTargetEmailing extends Form
* @param array $selected_array Array * @param array $selected_array Array
* @return string HTML combo * @return string HTML combo
*/ */
function multiselectCivility($htmlname = 'civilite_id', $selected_array = array()) public function multiselectCivility($htmlname = 'civilite_id', $selected_array = array())
{ {
global $conf,$langs,$user; global $conf,$langs,$user;
$langs->load("dict"); $langs->load("dict");
@ -341,7 +341,7 @@ class FormAdvTargetEmailing extends Form
* @param int $showempty show empty * @param int $showempty show empty
* @return string HTML combo * @return string HTML combo
*/ */
function advMultiselectarray($htmlname, $options_array = array(), $selected_array = array(), $showempty = 0) public function advMultiselectarray($htmlname, $options_array = array(), $selected_array = array(), $showempty = 0)
{ {
global $conf, $langs; global $conf, $langs;
@ -357,7 +357,7 @@ class FormAdvTargetEmailing extends Form
* @param array $selected_array value selected * @param array $selected_array value selected
* @return string HTML combo * @return string HTML combo
*/ */
function multiselectCustomerCategories($htmlname = 'cust_cat', $selected_array = array()) public function multiselectCustomerCategories($htmlname = 'cust_cat', $selected_array = array())
{ {
return $this->multiselectCategories($htmlname, $selected_array, 2); return $this->multiselectCategories($htmlname, $selected_array, 2);
} }
@ -369,7 +369,7 @@ class FormAdvTargetEmailing extends Form
* @param array $selected_array value selected * @param array $selected_array value selected
* @return string HTML combo * @return string HTML combo
*/ */
function multiselectContactCategories($htmlname = 'contact_cat', $selected_array = array()) public function multiselectContactCategories($htmlname = 'contact_cat', $selected_array = array())
{ {
return $this->multiselectCategories($htmlname, $selected_array, 4); return $this->multiselectCategories($htmlname, $selected_array, 4);
} }

View File

@ -81,7 +81,7 @@ class Mailing extends CommonObject
* *
* @param DoliDb $db Database handler * @param DoliDb $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
@ -104,7 +104,7 @@ class Mailing extends CommonObject
* @param User $user Object of user making creation * @param User $user Object of user making creation
* @return int -1 if error, Id of created object if OK * @return int -1 if error, Id of created object if OK
*/ */
function create($user) public function create($user)
{ {
global $conf, $langs; global $conf, $langs;
@ -163,7 +163,7 @@ class Mailing extends CommonObject
* @param User $user Object of user making change * @param User $user Object of user making change
* @return int < 0 if KO, > 0 if OK * @return int < 0 if KO, > 0 if OK
*/ */
function update($user) public function update($user)
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing "; $sql = "UPDATE ".MAIN_DB_PREFIX."mailing ";
$sql .= " SET titre = '".$this->db->escape($this->titre)."'"; $sql .= " SET titre = '".$this->db->escape($this->titre)."'";
@ -195,7 +195,7 @@ class Mailing extends CommonObject
* @param int $rowid Id of emailing * @param int $rowid Id of emailing
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($rowid) public function fetch($rowid)
{ {
global $conf; global $conf;
@ -271,7 +271,7 @@ class Mailing extends CommonObject
* @param int $option2 Not used * @param int $option2 Not used
* @return int New id of clone * @return int New id of clone
*/ */
function createFromClone($fromid, $option1, $option2) public function createFromClone($fromid, $option1, $option2)
{ {
global $user,$langs; global $user,$langs;
@ -394,7 +394,7 @@ class Mailing extends CommonObject
* @param User $user Objet user qui valide * @param User $user Objet user qui valide
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function valid($user) public function valid($user)
{ {
$now=dol_now(); $now=dol_now();
@ -421,7 +421,7 @@ class Mailing extends CommonObject
* @param int $rowid id du mailing a supprimer * @param int $rowid id du mailing a supprimer
* @return int 1 en cas de succes * @return int 1 en cas de succes
*/ */
function delete($rowid) public function delete($rowid)
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing";
$sql.= " WHERE rowid = ".$rowid; $sql.= " WHERE rowid = ".$rowid;
@ -439,13 +439,13 @@ class Mailing extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Delete targets emailing * Delete targets emailing
* *
* @return int 1 if OK, 0 if error * @return int 1 if OK, 0 if error
*/ */
function delete_targets() public function delete_targets()
{ {
// phpcs:enable // phpcs:enable
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles";
@ -465,14 +465,14 @@ class Mailing extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Change status of each recipient * Change status of each recipient
* *
* @param User $user Objet user qui valide * @param User $user Objet user qui valide
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function reset_targets_status($user) public function reset_targets_status($user)
{ {
// phpcs:enable // phpcs:enable
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
@ -499,7 +499,7 @@ class Mailing extends CommonObject
* @param string $mode Mode ('alreadysent' = Sent success or error, 'alreadysentok' = Sent success, 'alreadysentko' = Sent error) * @param string $mode Mode ('alreadysent' = Sent success or error, 'alreadysentok' = Sent success, 'alreadysentko' = Sent error)
* @return int Nb of target with status * @return int Nb of target with status
*/ */
function countNbOfTargets($mode) public function countNbOfTargets($mode)
{ {
$sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."mailing_cibles"; $sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."mailing_cibles";
$sql.= " WHERE fk_mailing = ".$this->id; $sql.= " WHERE fk_mailing = ".$this->id;
@ -537,7 +537,7 @@ class Mailing extends CommonObject
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string String with URL * @return string String with URL
*/ */
function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
{ {
global $db, $conf, $langs, $hookmanager; global $db, $conf, $langs, $hookmanager;
global $dolibarr_main_authentication, $dolibarr_main_demo; global $dolibarr_main_authentication, $dolibarr_main_demo;
@ -608,12 +608,12 @@ class Mailing extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
* @return string Label * @return string Label
*/ */
function getLibStatut($mode = 0) public function getLibStatut($mode = 0)
{ {
return $this->LibStatut($this->statut, $mode); return $this->LibStatut($this->statut, $mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* *
@ -621,7 +621,7 @@ class Mailing extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label * @return string Label
*/ */
function LibStatut($statut, $mode = 0) public function LibStatut($statut, $mode = 0)
{ {
// phpcs:enable // phpcs:enable
global $langs; global $langs;
@ -634,30 +634,30 @@ class Mailing extends CommonObject
elseif ($mode == 2) elseif ($mode == 2)
{ {
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0').' '.$langs->trans($this->statuts[$statut]); if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0').' '.$langs->trans($this->statuts[$statut]);
if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]), 'statut1').' '.$langs->trans($this->statuts[$statut]); elseif ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]), 'statut1').' '.$langs->trans($this->statuts[$statut]);
if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]), 'statut3').' '.$langs->trans($this->statuts[$statut]); elseif ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]), 'statut3').' '.$langs->trans($this->statuts[$statut]);
if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]), 'statut6').' '.$langs->trans($this->statuts[$statut]); elseif ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]), 'statut6').' '.$langs->trans($this->statuts[$statut]);
} }
elseif ($mode == 3) elseif ($mode == 3)
{ {
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0'); if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0');
if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]), 'statut1'); elseif ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]), 'statut1');
if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]), 'statut3'); elseif ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]), 'statut3');
if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]), 'statut6'); elseif ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]), 'statut6');
} }
elseif ($mode == 4) elseif ($mode == 4)
{ {
if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0').' '.$langs->trans($this->statuts[$statut]); if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]), 'statut0').' '.$langs->trans($this->statuts[$statut]);
if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]), 'statut1').' '.$langs->trans($this->statuts[$statut]); elseif ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]), 'statut1').' '.$langs->trans($this->statuts[$statut]);
if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]), 'statut3').' '.$langs->trans($this->statuts[$statut]); elseif ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]), 'statut3').' '.$langs->trans($this->statuts[$statut]);
if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]), 'statut6').' '.$langs->trans($this->statuts[$statut]); elseif ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]), 'statut6').' '.$langs->trans($this->statuts[$statut]);
} }
elseif ($mode == 5) elseif ($mode == 5)
{ {
if ($statut == 0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]), 'statut0'); if ($statut == 0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]), 'statut0');
if ($statut == 1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]), 'statut1'); elseif ($statut == 1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]), 'statut1');
if ($statut == 2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]), 'statut3'); elseif ($statut == 2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]), 'statut3');
if ($statut == 3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]), 'statut6'); elseif ($statut == 3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]), 'statut6');
} }
} }
@ -687,37 +687,37 @@ class Mailing extends CommonObject
elseif ($mode == 2) elseif ($mode == 2)
{ {
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"), 'statut6'); elseif ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"), 'statut6');
if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"), 'statut4'); elseif ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"), 'statut4');
if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"), 'statut3'); elseif ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"), 'statut3');
} }
elseif ($mode == 3) elseif ($mode == 3)
{ {
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"), 'statut6'); elseif ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"), 'statut6');
if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"), 'statut4'); elseif ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"), 'statut4');
if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"), 'statut3'); elseif ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"), 'statut3');
} }
elseif ($mode == 4) elseif ($mode == 4)
{ {
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"), 'statut6'); elseif ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"), 'statut6');
if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"), 'statut4'); elseif ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"), 'statut4');
if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"), 'statut3'); elseif ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"), 'statut3');
} }
elseif ($mode == 5) elseif ($mode == 5)
{ {
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"), 'statut6'); elseif ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"), 'statut6');
if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"), 'statut4'); elseif ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"), 'statut4');
if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"), 'statut3'); elseif ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"), 'statut3');
} }
elseif ($mode == 6) elseif ($mode == 6)
{ {
if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc);
if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"), 'statut6'); elseif ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"), 'statut6');
if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"), 'statut4'); elseif ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"), 'statut4');
if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"), 'statut3'); elseif ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"), 'statut3');
} }
} }
} }

View File

@ -29,7 +29,6 @@ require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
*/ */
class Proposals extends DolibarrApi class Proposals extends DolibarrApi
{ {
/** /**
* @var array $FIELDS Mandatory fields, checked when create and update object * @var array $FIELDS Mandatory fields, checked when create and update object
*/ */
@ -45,7 +44,7 @@ class Proposals extends DolibarrApi
/** /**
* Constructor * Constructor
*/ */
function __construct() public function __construct()
{ {
global $db, $conf; global $db, $conf;
$this->db = $db; $this->db = $db;
@ -63,7 +62,7 @@ class Proposals extends DolibarrApi
* *
* @throws RestException * @throws RestException
*/ */
function get($id, $contact_list = 1) public function get($id, $contact_list = 1)
{ {
if(! DolibarrApiAccess::$user->rights->propal->lire) { if(! DolibarrApiAccess::$user->rights->propal->lire) {
throw new RestException(401); throw new RestException(401);
@ -97,7 +96,7 @@ class Proposals extends DolibarrApi
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')" * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')"
* @return array Array of order objects * @return array Array of order objects
*/ */
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
{ {
global $db, $conf; global $db, $conf;
@ -182,7 +181,7 @@ class Proposals extends DolibarrApi
* @param array $request_data Request data * @param array $request_data Request data
* @return int ID of proposal * @return int ID of proposal
*/ */
function post($request_data = null) public function post($request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->propal->creer) { if(! DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401, "Insuffisant rights"); throw new RestException(401, "Insuffisant rights");
@ -216,7 +215,7 @@ class Proposals extends DolibarrApi
* *
* @return int * @return int
*/ */
function getLines($id) public function getLines($id)
{ {
if(! DolibarrApiAccess::$user->rights->propal->lire) { if(! DolibarrApiAccess::$user->rights->propal->lire) {
throw new RestException(401); throw new RestException(401);
@ -248,9 +247,9 @@ class Proposals extends DolibarrApi
* *
* @return int * @return int
*/ */
function postLine($id, $request_data = null) public function postLine($id, $request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->propal->creer) { if (! DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401); throw new RestException(401);
} }
@ -259,8 +258,7 @@ class Proposals extends DolibarrApi
throw new RestException(404, 'Commercial Proposal not found'); throw new RestException(404, 'Commercial Proposal not found');
} }
if (! DolibarrApi::_checkAccessToResource('propal', $this->propal->id)) if (! DolibarrApi::_checkAccessToResource('propal', $this->propal->id)) {
{
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
@ -313,7 +311,7 @@ class Proposals extends DolibarrApi
* *
* @return object * @return object
*/ */
function putLine($id, $lineid, $request_data = null) public function putLine($id, $lineid, $request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->propal->creer) { if(! DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401); throw new RestException(401);
@ -382,7 +380,7 @@ class Proposals extends DolibarrApi
* @throws 401 * @throws 401
* @throws 404 * @throws 404
*/ */
function deleteLine($id, $lineid) public function deleteLine($id, $lineid)
{ {
if(! DolibarrApiAccess::$user->rights->propal->creer) { if(! DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401); throw new RestException(401);
@ -422,7 +420,7 @@ class Proposals extends DolibarrApi
* @throws 401 * @throws 401
* @throws 404 * @throws 404
*/ */
function postContact($id, $contactid, $type) public function postContact($id, $contactid, $type)
{ {
if(!DolibarrApiAccess::$user->rights->propal->creer) { if(!DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401); throw new RestException(401);
@ -464,7 +462,7 @@ class Proposals extends DolibarrApi
* @throws 404 * @throws 404
* @throws 500 * @throws 500
*/ */
function deleteContact($id, $rowid) public function deleteContact($id, $rowid)
{ {
if(!DolibarrApiAccess::$user->rights->propal->creer) { if(!DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401); throw new RestException(401);
@ -497,21 +495,21 @@ class Proposals extends DolibarrApi
* *
* @return int * @return int
*/ */
function put($id, $request_data = null) public function put($id, $request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->propal->creer) { if (! DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401); throw new RestException(401);
} }
$result = $this->propal->fetch($id); $result = $this->propal->fetch($id);
if( ! $result ) { if ( ! $result ) {
throw new RestException(404, 'Proposal not found'); throw new RestException(404, 'Proposal not found');
} }
if( ! DolibarrApi::_checkAccessToResource('propal', $this->propal->id)) { if ( ! DolibarrApi::_checkAccessToResource('propal', $this->propal->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
foreach($request_data as $field => $value) { foreach ($request_data as $field => $value) {
if ($field == 'id') continue; if ($field == 'id') continue;
$this->propal->$field = $value; $this->propal->$field = $value;
} }
@ -546,7 +544,7 @@ class Proposals extends DolibarrApi
* *
* @return array * @return array
*/ */
function delete($id) public function delete($id)
{ {
if(! DolibarrApiAccess::$user->rights->propal->supprimer) { if(! DolibarrApiAccess::$user->rights->propal->supprimer) {
throw new RestException(401); throw new RestException(401);
@ -581,7 +579,7 @@ class Proposals extends DolibarrApi
* *
* @return array * @return array
*/ */
function settodraft($id) public function settodraft($id)
{ {
if(! DolibarrApiAccess::$user->rights->propal->creer) { if(! DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401); throw new RestException(401);
@ -638,7 +636,7 @@ class Proposals extends DolibarrApi
* *
* @return array * @return array
*/ */
function validate($id, $notrigger = 0) public function validate($id, $notrigger = 0)
{ {
if(! DolibarrApiAccess::$user->rights->propal->creer) { if(! DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401); throw new RestException(401);
@ -686,7 +684,7 @@ class Proposals extends DolibarrApi
* *
* @return array * @return array
*/ */
function close($id, $status, $note_private = '', $notrigger = 0) public function close($id, $status, $note_private = '', $notrigger = 0)
{ {
if(! DolibarrApiAccess::$user->rights->propal->creer) { if(! DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401); throw new RestException(401);
@ -731,7 +729,7 @@ class Proposals extends DolibarrApi
* *
* @return array * @return array
*/ */
function setinvoiced($id) public function setinvoiced($id)
{ {
if (! DolibarrApiAccess::$user->rights->propal->creer) { if (! DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401); throw new RestException(401);
@ -772,7 +770,7 @@ class Proposals extends DolibarrApi
* @return array * @return array
* @throws RestException * @throws RestException
*/ */
function _validate($data) private function _validate($data)
{ {
$propal = array(); $propal = array();
foreach (Proposals::$FIELDS as $field) { foreach (Proposals::$FIELDS as $field) {
@ -790,7 +788,7 @@ class Proposals extends DolibarrApi
* @param object $object Object to clean * @param object $object Object to clean
* @return array Array of cleaned object properties * @return array Array of cleaned object properties
*/ */
function _cleanObjectDatas($object) private function _cleanObjectDatas($object)
{ {
$object = parent::_cleanObjectDatas($object); $object = parent::_cleanObjectDatas($object);

View File

@ -3734,7 +3734,7 @@ abstract class CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return incoterms informations * Return incoterms informations
* TODO Use a cache for label get * TODO Use a cache for label get

View File

@ -68,36 +68,50 @@ abstract class CommonStickerGenerator
*/ */
public $format; public $format;
// phpcs:disable PEAR.NamingConventions.ValidVariableName.PublicUnderscore
// protected // protected
public $_Avery_Name = ''; // Nom du format de l'etiquette // Nom du format de l'etiquette
public $_Margin_Left = 0; // Marge de gauche de l'etiquette protected $_Avery_Name = '';
public $_Margin_Top = 0; // marge en haut de la page avant la premiere etiquette // Marge de gauche de l'etiquette
public $_X_Space = 0; // Espace horizontal entre 2 bandes d'etiquettes protected $_Margin_Left = 0;
public $_Y_Space = 0; // Espace vertical entre 2 bandes d'etiquettes // marge en haut de la page avant la premiere etiquette
public $_X_Number = 0; // NX Nombre d'etiquettes sur la largeur de la page protected $_Margin_Top = 0;
public $_Y_Number = 0; // NY Nombre d'etiquettes sur la hauteur de la page // Espace horizontal entre 2 bandes d'etiquettes
public $_Width = 0; // Largeur de chaque etiquette protected $_X_Space = 0;
public $_Height = 0; // Hauteur de chaque etiquette // Espace vertical entre 2 bandes d'etiquettes
public $_Char_Size = 10; // Hauteur des caracteres protected $_Y_Space = 0;
public $_Line_Height = 10; // Hauteur par defaut d'une ligne // NX Nombre d'etiquettes sur la largeur de la page
public $_Metric = 'mm'; // Type of metric.. Will help to calculate good values protected $_X_Number = 0;
public $_Metric_Doc = 'mm'; // Type of metric for the doc.. // NY Nombre d'etiquettes sur la hauteur de la page
public $_COUNTX = 1; protected $_Y_Number = 0;
public $_COUNTY = 1; // Largeur de chaque etiquette
public $_First = 1; protected $_Width = 0;
// Hauteur de chaque etiquette
protected $_Height = 0;
// Hauteur des caracteres
protected $_Char_Size = 10;
// Hauteur par defaut d'une ligne
protected $_Line_Height = 10;
// Type of metric.. Will help to calculate good values
protected $_Metric = 'mm';
// Type of metric for the doc..
protected $_Metric_Doc = 'mm';
protected $_COUNTX = 1;
protected $_COUNTY = 1;
protected $_First = 1;
public $Tformat; public $Tformat;
// phpcs:enable
/** /**
* Constructor * Constructor
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Function to build PDF on disk, then output on HTTP strem. * Function to build PDF on disk, then output on HTTP strem.
* *
@ -107,7 +121,7 @@ abstract class CommonStickerGenerator
* @param string $outputdir Output directory for pdf file * @param string $outputdir Output directory for pdf file
* @return int 1=OK, 0=KO * @return int 1=OK, 0=KO
*/ */
abstract function write_file($arrayofrecords, $outputlangs, $srctemplatepath, $outputdir = ''); public abstract function write_file($arrayofrecords, $outputlangs, $srctemplatepath, $outputdir = '');
// phpcs:enable // phpcs:enable
/** /**
@ -118,9 +132,9 @@ abstract class CommonStickerGenerator
* @param array $param Associative array containing label content and optional parameters * @param array $param Associative array containing label content and optional parameters
* @return void * @return void
*/ */
abstract function addSticker(&$pdf, $outputlangs, $param); public abstract function addSticker(&$pdf, $outputlangs, $param);
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Methode qui permet de modifier la taille des caracteres * Methode qui permet de modifier la taille des caracteres
* Cela modiera aussi l'espace entre chaque ligne * Cela modiera aussi l'espace entre chaque ligne
@ -129,7 +143,7 @@ abstract class CommonStickerGenerator
* @param int $pt point * @param int $pt point
* @return void * @return void
*/ */
function Set_Char_Size(&$pdf, $pt) public function Set_Char_Size(&$pdf, $pt)
{ {
// phpcs:enable // phpcs:enable
if ($pt > 3) { if ($pt > 3) {
@ -139,7 +153,8 @@ abstract class CommonStickerGenerator
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* protected Print dot line * protected Print dot line
* *
@ -152,7 +167,7 @@ abstract class CommonStickerGenerator
* @param int $nbPointilles Nb pointilles * @param int $nbPointilles Nb pointilles
* @return void * @return void
*/ */
function _Pointille(&$pdf, $x1 = 0, $y1 = 0, $x2 = 210, $y2 = 297, $epaisseur = 1, $nbPointilles = 15) protected function _Pointille(&$pdf, $x1 = 0, $y1 = 0, $x2 = 210, $y2 = 297, $epaisseur = 1, $nbPointilles = 15)
{ {
// phpcs:enable // phpcs:enable
$pdf->SetLineWidth($epaisseur); $pdf->SetLineWidth($epaisseur);
@ -182,7 +197,8 @@ abstract class CommonStickerGenerator
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**
* protected Function realisant une croix aux 4 coins des cartes * protected Function realisant une croix aux 4 coins des cartes
* *
@ -195,7 +211,7 @@ abstract class CommonStickerGenerator
* @param int $taille Size * @param int $taille Size
* @return void * @return void
*/ */
function _Croix(&$pdf, $x1 = 0, $y1 = 0, $x2 = 210, $y2 = 297, $epaisseur = 1, $taille = 4) protected function _Croix(&$pdf, $x1 = 0, $y1 = 0, $x2 = 210, $y2 = 297, $epaisseur = 1, $taille = 4)
{ {
// phpcs:enable // phpcs:enable
$pdf->SetDrawColor(192, 192, 192); $pdf->SetDrawColor(192, 192, 192);
@ -240,14 +256,15 @@ abstract class CommonStickerGenerator
return $value; return $value;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**
* protected Give the height for a char size given. * protected Give the height for a char size given.
* *
* @param int $pt Point * @param int $pt Point
* @return int Height chars * @return int Height chars
*/ */
function _Get_Height_Chars($pt) protected function _Get_Height_Chars($pt)
{ {
// phpcs:enable // phpcs:enable
// Tableau de concordance entre la hauteur des caracteres et de l'espacement entre les lignes // Tableau de concordance entre la hauteur des caracteres et de l'espacement entre les lignes
@ -259,7 +276,8 @@ abstract class CommonStickerGenerator
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**
* protected Set format * protected Set format
* *
@ -267,7 +285,7 @@ abstract class CommonStickerGenerator
* @param string $format Format * @param string $format Format
* @return void * @return void
*/ */
function _Set_Format(&$pdf, $format) protected function _Set_Format(&$pdf, $format)
{ {
// phpcs:enable // phpcs:enable
$this->_Metric = $format['metric']; $this->_Metric = $format['metric'];

View File

@ -55,9 +55,26 @@ class Conf
public $css; // Contains full path of css page ("/theme/eldy/style.css.php", ...) public $css; // Contains full path of css page ("/theme/eldy/style.css.php", ...)
//! Used to store current menu handler //! Used to store current menu handler
public $standard_menu; public $standard_menu;
// List of activated modules
public $modules = array(); // List of activated modules public $modules = array();
public $modules_parts = array('css'=>array(),'js'=>array(),'tabs'=>array(),'triggers'=>array(),'login'=>array(),'substitutions'=>array(),'menus'=>array(),'theme'=>array(),'sms'=>array(),'tpl'=>array(),'barcode'=>array(),'models'=>array(),'societe'=>array(),'hooks'=>array(),'dir'=>array(), 'syslog' =>array()); public $modules_parts = array(
'css' => array(),
'js' => array(),
'tabs' => array(),
'triggers' => array(),
'login' => array(),
'substitutions' => array(),
'menus' => array(),
'theme' => array(),
'sms' => array(),
'tpl' => array(),
'barcode' => array(),
'models' => array(),
'societe' => array(),
'hooks' => array(),
'dir' => array(),
'syslog' => array(),
);
public $logbuffer = array(); public $logbuffer = array();
@ -83,7 +100,7 @@ class Conf
/** /**
* Constructor * Constructor
*/ */
function __construct() public function __construct()
{ {
// Properly declare multi-modules objects. // Properly declare multi-modules objects.
$this->file = new stdClass(); $this->file = new stdClass();
@ -130,7 +147,7 @@ class Conf
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @return int < 0 if KO, >= 0 if OK * @return int < 0 if KO, >= 0 if OK
*/ */
function setValues($db) public function setValues($db)
{ {
global $conf; global $conf;

View File

@ -39,7 +39,7 @@ class CoreObject extends CommonObject
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct(DoliDB &$db) public function __construct(DoliDB &$db)
{ {
$this->db = $db; $this->db = $db;
} }

View File

@ -21,12 +21,6 @@
* \brief This file is a CRUD class file (Create/Read/Update/Delete) for c_departements dictionary * \brief This file is a CRUD class file (Create/Read/Update/Delete) for c_departements dictionary
*/ */
// Put here all includes required by your class file
//require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
//require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
//require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
/** /**
* Class to manage dictionary States (used by imports) * Class to manage dictionary States (used by imports)
*/ */
@ -79,7 +73,7 @@ class Cstate // extends CommonObject
* *
* @param DoliDb $db Database handler * @param DoliDb $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
@ -92,7 +86,7 @@ class Cstate // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, Id of created object if OK * @return int <0 if KO, Id of created object if OK
*/ */
function create($user, $notrigger = 0) public function create($user, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@ -124,12 +118,10 @@ class Cstate // extends CommonObject
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error) if (! $error) {
{
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_departements"); $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_departements");
if (! $notrigger) //if (! $notrigger) {
{
// Uncomment this and change MYOBJECT to your own tag if you // Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger. // want this action call a trigger.
@ -139,7 +131,7 @@ class Cstate // extends CommonObject
//$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf); //$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; } //if ($result < 0) { $error++; $this->errors=$interface->errors; }
//// End call triggers //// End call triggers
} //}
} }
// Commit or rollback // Commit or rollback
@ -168,7 +160,7 @@ class Cstate // extends CommonObject
* @param string $code Code * @param string $code Code
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id, $code = '') public function fetch($id, $code = '')
{ {
global $langs; global $langs;
$sql = "SELECT"; $sql = "SELECT";
@ -212,7 +204,7 @@ class Cstate // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user = null, $notrigger = 0) public function update($user = null, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@ -239,10 +231,10 @@ class Cstate // extends CommonObject
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error) //if (! $error)
{ //{
if (! $notrigger) // if (! $notrigger)
{ // {
// Uncomment this and change MYOBJECT to your own tag if you // Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger. // want this action call a trigger.
@ -252,8 +244,8 @@ class Cstate // extends CommonObject
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf); //$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; } //if ($result < 0) { $error++; $this->errors=$interface->errors; }
//// End call triggers //// End call triggers
} // }
} //}
// Commit or rollback // Commit or rollback
if ($error) if ($error)
@ -281,7 +273,7 @@ class Cstate // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($user, $notrigger = 0) public function delete($user, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@ -295,10 +287,10 @@ class Cstate // extends CommonObject
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error) //if (! $error)
{ //{
if (! $notrigger) // if (! $notrigger)
{ // {
// Uncomment this and change MYOBJECT to your own tag if you // Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger. // want this action call a trigger.
@ -308,8 +300,8 @@ class Cstate // extends CommonObject
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf); //$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; } //if ($result < 0) { $error++; $this->errors=$interface->errors; }
//// End call triggers //// End call triggers
} // }
} //}
// Commit or rollback // Commit or rollback
if ($error) if ($error)

View File

@ -63,7 +63,7 @@ class Ctypent // extends CommonObject
* *
* @param DoliDb $db Database handler * @param DoliDb $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
@ -76,7 +76,7 @@ class Ctypent // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, Id of created object if OK * @return int <0 if KO, Id of created object if OK
*/ */
function create($user, $notrigger = 0) public function create($user, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@ -166,7 +166,7 @@ class Ctypent // extends CommonObject
* @param string $label Label * @param string $label Label
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id, $code = '', $label = '') public function fetch($id, $code = '', $label = '')
{ {
global $langs; global $langs;
$sql = "SELECT"; $sql = "SELECT";
@ -214,7 +214,7 @@ class Ctypent // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user = null, $notrigger = 0) public function update($user = null, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@ -285,7 +285,7 @@ class Ctypent // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($user, $notrigger = 0) public function delete($user, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@ -299,10 +299,10 @@ class Ctypent // extends CommonObject
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error) //if (! $error)
{ //{
if (! $notrigger) // if (! $notrigger)
{ // {
// Uncomment this and change MYOBJECT to your own tag if you // Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger. // want this action call a trigger.
@ -312,8 +312,8 @@ class Ctypent // extends CommonObject
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf); //$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; } //if ($result < 0) { $error++; $this->errors=$interface->errors; }
//// End call triggers //// End call triggers
} // }
} //}
// Commit or rollback // Commit or rollback
if ($error) if ($error)

View File

@ -66,7 +66,7 @@ class CUnits // extends CommonObject
* *
* @param DoliDb $db Database handler * @param DoliDb $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
@ -79,7 +79,7 @@ class CUnits // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, Id of created object if OK * @return int <0 if KO, Id of created object if OK
*/ */
function create($user, $notrigger = 0) public function create($user, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@ -170,7 +170,7 @@ class CUnits // extends CommonObject
* @param string $unit_type unit type * @param string $unit_type unit type
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id, $code = '', $short_label = '', $unit_type = '') public function fetch($id, $code = '', $short_label = '', $unit_type = '')
{ {
global $langs; global $langs;
@ -310,7 +310,7 @@ class CUnits // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user = null, $notrigger = 0) public function update($user = null, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@ -383,7 +383,7 @@ class CUnits // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($user, $notrigger = 0) public function delete($user, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -60,7 +60,8 @@ class DiscountAbsolute
public $multicurrency_amount_ht; public $multicurrency_amount_ht;
public $multicurrency_amount_tva; public $multicurrency_amount_tva;
public $multicurrency_amount_ttc; public $multicurrency_amount_ttc;
public $tva_tx; // Vat rate // Vat rate
public $tva_tx;
/** /**
* @var int User ID Id utilisateur qui accorde la remise * @var int User ID Id utilisateur qui accorde la remise
@ -98,7 +99,7 @@ class DiscountAbsolute
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
@ -112,7 +113,7 @@ class DiscountAbsolute
* @param int $fk_invoice_supplier_source fk_invoice_supplier_source * @param int $fk_invoice_supplier_source fk_invoice_supplier_source
* @return int <0 if KO, =0 if not found, >0 if OK * @return int <0 if KO, =0 if not found, >0 if OK
*/ */
function fetch($rowid, $fk_facture_source = 0, $fk_invoice_supplier_source = 0) public function fetch($rowid, $fk_facture_source = 0, $fk_invoice_supplier_source = 0)
{ {
global $conf; global $conf;
@ -194,7 +195,7 @@ class DiscountAbsolute
* @param User $user User that create * @param User $user User that create
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function create($user) public function create($user)
{ {
global $conf, $langs; global $conf, $langs;
@ -256,7 +257,7 @@ class DiscountAbsolute
* @param User $user Object of user asking to delete * @param User $user Object of user asking to delete
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($user) public function delete($user)
{ {
global $conf, $langs; global $conf, $langs;
@ -389,7 +390,7 @@ class DiscountAbsolute
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Link the discount to a particular invoice line or a particular invoice. * Link the discount to a particular invoice line or a particular invoice.
* When discount is a global discount used as an invoice line, we link using rowidline. * When discount is a global discount used as an invoice line, we link using rowidline.
@ -399,7 +400,7 @@ class DiscountAbsolute
* @param int $rowidinvoice Invoice id (To use discount as a credit note to reduc payment of invoice) * @param int $rowidinvoice Invoice id (To use discount as a credit note to reduc payment of invoice)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function link_to_invoice($rowidline, $rowidinvoice) public function link_to_invoice($rowidline, $rowidinvoice)
{ {
// phpcs:enable // phpcs:enable
// Check parameters // Check parameters
@ -445,18 +446,18 @@ class DiscountAbsolute
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Link the discount to a particular invoice line or a particular invoice. * Link the discount to a particular invoice line or a particular invoice.
* Do not call this if discount is linked to a reconcialiated invoice * Do not call this if discount is linked to a reconcialiated invoice
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function unlink_invoice() public function unlink_invoice()
{ {
// phpcs:enable // phpcs:enable
$sql ="UPDATE ".MAIN_DB_PREFIX."societe_remise_except"; $sql ="UPDATE ".MAIN_DB_PREFIX."societe_remise_except";
if(! empty($this->discount_type)) { if (! empty($this->discount_type)) {
$sql.=" SET fk_invoice_supplier_line = NULL, fk_invoice_supplier = NULL"; $sql.=" SET fk_invoice_supplier_line = NULL, fk_invoice_supplier = NULL";
} else { } else {
$sql.=" SET fk_facture_line = NULL, fk_facture = NULL"; $sql.=" SET fk_facture_line = NULL, fk_facture = NULL";
@ -487,7 +488,7 @@ class DiscountAbsolute
* @param int $discount_type 0 => customer discount, 1 => supplier discount * @param int $discount_type 0 => customer discount, 1 => supplier discount
* @return int <0 if KO, amount otherwise * @return int <0 if KO, amount otherwise
*/ */
function getAvailableDiscounts($company = '', $user = '', $filter = '', $maxvalue = 0, $discount_type = 0) public function getAvailableDiscounts($company = '', $user = '', $filter = '', $maxvalue = 0, $discount_type = 0)
{ {
global $conf; global $conf;
@ -530,7 +531,7 @@ class DiscountAbsolute
* @param int $multicurrency Return multicurrency_amount instead of amount * @param int $multicurrency Return multicurrency_amount instead of amount
* @return int <0 if KO, Sum of credit notes and deposits amount otherwise * @return int <0 if KO, Sum of credit notes and deposits amount otherwise
*/ */
function getSumDepositsUsed($invoice, $multicurrency = 0) public function getSumDepositsUsed($invoice, $multicurrency = 0)
{ {
dol_syslog(get_class($this)."::getSumDepositsUsed", LOG_DEBUG); dol_syslog(get_class($this)."::getSumDepositsUsed", LOG_DEBUG);
@ -576,7 +577,7 @@ class DiscountAbsolute
* @param int $multicurrency Return multicurrency_amount instead of amount * @param int $multicurrency Return multicurrency_amount instead of amount
* @return int <0 if KO, Sum of credit notes and excess received amount otherwise * @return int <0 if KO, Sum of credit notes and excess received amount otherwise
*/ */
function getSumCreditNotesUsed($invoice, $multicurrency = 0) public function getSumCreditNotesUsed($invoice, $multicurrency = 0)
{ {
dol_syslog(get_class($this)."::getSumCreditNotesUsed", LOG_DEBUG); dol_syslog(get_class($this)."::getSumCreditNotesUsed", LOG_DEBUG);
@ -622,7 +623,7 @@ class DiscountAbsolute
* @param string $option Where to link to ('invoice' or 'discount') * @param string $option Where to link to ('invoice' or 'discount')
* @return string String with URL * @return string String with URL
*/ */
function getNomUrl($withpicto, $option = 'invoice') public function getNomUrl($withpicto, $option = 'invoice')
{ {
global $langs; global $langs;
@ -660,7 +661,7 @@ class DiscountAbsolute
* *
* @return void * @return void
*/ */
function initAsSpecimen() public function initAsSpecimen()
{ {
global $user,$langs,$conf; global $user,$langs,$conf;

View File

@ -28,21 +28,21 @@
*/ */
class DolEditor class DolEditor
{ {
var $tool; // Store the selected tool public $tool; // Store the selected tool
// If using fckeditor // If using fckeditor
var $editor; public $editor;
// If not using fckeditor // If not using fckeditor
var $content; public $content;
var $htmlname; public $htmlname;
var $toolbarname; public $toolbarname;
var $toolbarstartexpanded; public $toolbarstartexpanded;
var $rows; public $rows;
var $cols; public $cols;
var $height; public $height;
var $width; public $width;
var $readonly; public $readonly;
/** /**
@ -64,7 +64,7 @@ class DolEditor
* @param string $cols Size of cols for textarea tool (textarea number of cols '70' or percent 'x%') * @param string $cols Size of cols for textarea tool (textarea number of cols '70' or percent 'x%')
* @param int $readonly 0=Read/Edit, 1=Read only * @param int $readonly 0=Read/Edit, 1=Read only
*/ */
function __construct($htmlname, $content, $width = '', $height = 200, $toolbarname = 'Basic', $toolbarlocation = 'In', $toolbarstartexpanded = false, $uselocalbrowser = true, $okforextendededitor = true, $rows = 0, $cols = 0, $readonly = 0) public function __construct($htmlname, $content, $width = '', $height = 200, $toolbarname = 'Basic', $toolbarlocation = 'In', $toolbarstartexpanded = false, $uselocalbrowser = true, $okforextendededitor = true, $rows = 0, $cols = 0, $readonly = 0)
{ {
global $conf,$langs; global $conf,$langs;
@ -137,7 +137,7 @@ class DolEditor
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Output edit area inside the HTML stream. * Output edit area inside the HTML stream.
* Output depends on this->tool (fckeditor, ckeditor, textarea, ...) * Output depends on this->tool (fckeditor, ckeditor, textarea, ...)
@ -149,7 +149,7 @@ class DolEditor
* @param string $option For ACE editor, set the source language ('html', 'php', 'javascript', ...) * @param string $option For ACE editor, set the source language ('html', 'php', 'javascript', ...)
* @return void|string * @return void|string
*/ */
function Create($noprint = 0, $morejs = '', $disallowAnyContent = true, $titlecontent = '', $option = '') public function Create($noprint = 0, $morejs = '', $disallowAnyContent = true, $titlecontent = '', $option = '')
{ {
// phpcs:enable // phpcs:enable
global $conf,$langs; global $conf,$langs;

View File

@ -30,7 +30,7 @@ class DolException extends Exception
/** /**
* Constructor * Constructor
*/ */
function __construct() public function __construct()
{ {
} }
} }

View File

@ -33,7 +33,7 @@
*/ */
class DolGeoIP class DolGeoIP
{ {
var $gi; public $gi;
/** /**
* Constructor * Constructor
@ -41,7 +41,7 @@ class DolGeoIP
* @param string $type 'country' or 'city' * @param string $type 'country' or 'city'
* @param string $datfile Data file * @param string $datfile Data file
*/ */
function __construct($type, $datfile) public function __construct($type, $datfile)
{ {
if ($type == 'country') if ($type == 'country')
{ {
@ -88,7 +88,7 @@ class DolGeoIP
* @param string $ip IP to scan * @param string $ip IP to scan
* @return string Country code (two letters) * @return string Country code (two letters)
*/ */
function getCountryCodeFromIP($ip) public function getCountryCodeFromIP($ip)
{ {
if (empty($this->gi)) if (empty($this->gi))
{ {
@ -112,7 +112,7 @@ class DolGeoIP
* @param string $name FQN of host (example: myserver.xyz.com) * @param string $name FQN of host (example: myserver.xyz.com)
* @return string Country code (two letters) * @return string Country code (two letters)
*/ */
function getCountryCodeFromName($name) public function getCountryCodeFromName($name)
{ {
if (empty($this->gi)) if (empty($this->gi))
{ {
@ -126,7 +126,7 @@ class DolGeoIP
* *
* @return string Version of datafile * @return string Version of datafile
*/ */
function getVersion() public function getVersion()
{ {
if ($this->gi == 'NOGI') return geoip_database_info(); if ($this->gi == 'NOGI') return geoip_database_info();
return 'Not available (not using PHP internal geo functions)'; return 'Not available (not using PHP internal geo functions)';
@ -137,10 +137,10 @@ class DolGeoIP
* *
* @return void * @return void
*/ */
function close() public function close()
{
if (function_exists('geoip_close')) // With some geoip with PEAR, geoip_close function may not exists
{ {
if (function_exists('geoip_close')) {
// With some geoip with PEAR, geoip_close function may not exists
geoip_close($this->gi); geoip_close($this->gi);
} }
} }

View File

@ -88,7 +88,7 @@ class DolGraph
* *
* @param string $library 'jflot' (default) or 'artichow' (no more supported) * @param string $library 'jflot' (default) or 'artichow' (no more supported)
*/ */
function __construct($library = 'jflot') public function __construct($library = 'jflot')
{ {
global $conf; global $conf;
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
@ -128,130 +128,130 @@ class DolGraph
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set Y precision * Set Y precision
* *
* @param float $which_prec Precision * @param float $which_prec Precision
* @return boolean * @return boolean
*/ */
function SetPrecisionY($which_prec) public function SetPrecisionY($which_prec)
{ {
// phpcs:enable // phpcs:enable
$this->PrecisionY = $which_prec; $this->PrecisionY = $which_prec;
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2 * Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2
* *
* @param float $xi Xi * @param float $xi Xi
* @return boolean True * @return boolean True
*/ */
function SetHorizTickIncrement($xi) public function SetHorizTickIncrement($xi)
{ {
// phpcs:enable // phpcs:enable
$this->horizTickIncrement = $xi; $this->horizTickIncrement = $xi;
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2 * Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2
* *
* @param float $xt Xt * @param float $xt Xt
* @return boolean True * @return boolean True
*/ */
function SetNumXTicks($xt) public function SetNumXTicks($xt)
{ {
// phpcs:enable // phpcs:enable
$this->SetNumXTicks = $xt; $this->SetNumXTicks = $xt;
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set label interval to reduce number of labels * Set label interval to reduce number of labels
* *
* @param float $x Label interval * @param float $x Label interval
* @return boolean True * @return boolean True
*/ */
function SetLabelInterval($x) public function SetLabelInterval($x)
{ {
// phpcs:enable // phpcs:enable
$this->labelInterval = $x; $this->labelInterval = $x;
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Hide X grid * Hide X grid
* *
* @param boolean $bool XGrid or not * @param boolean $bool XGrid or not
* @return boolean true * @return boolean true
*/ */
function SetHideXGrid($bool) public function SetHideXGrid($bool)
{ {
// phpcs:enable // phpcs:enable
$this->hideXGrid = $bool; $this->hideXGrid = $bool;
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Hide Y grid * Hide Y grid
* *
* @param boolean $bool YGrid or not * @param boolean $bool YGrid or not
* @return boolean true * @return boolean true
*/ */
function SetHideYGrid($bool) public function SetHideYGrid($bool)
{ {
// phpcs:enable // phpcs:enable
$this->hideYGrid = $bool; $this->hideYGrid = $bool;
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set y label * Set y label
* *
* @param string $label Y label * @param string $label Y label
* @return boolean|null True * @return boolean|null True
*/ */
function SetYLabel($label) public function SetYLabel($label)
{ {
// phpcs:enable // phpcs:enable
$this->YLabel = $label; $this->YLabel = $label;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set width * Set width
* *
* @param int $w Width * @param int $w Width
* @return boolean|null True * @return boolean|null True
*/ */
function SetWidth($w) public function SetWidth($w)
{ {
// phpcs:enable // phpcs:enable
$this->width = $w; $this->width = $w;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set title * Set title
* *
* @param string $title Title * @param string $title Title
* @return void * @return void
*/ */
function SetTitle($title) public function SetTitle($title)
{ {
// phpcs:enable // phpcs:enable
$this->title = $title; $this->title = $title;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set data * Set data
* *
@ -259,172 +259,172 @@ class DolGraph
* @return void * @return void
* @see draw_jflot for syntax of data array * @see draw_jflot for syntax of data array
*/ */
function SetData($data) public function SetData($data)
{ {
// phpcs:enable // phpcs:enable
$this->data = $data; $this->data = $data;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set data * Set data
* *
* @param array $datacolor Data color array(array(R,G,B),array(R,G,B)...) * @param array $datacolor Data color array(array(R,G,B),array(R,G,B)...)
* @return void * @return void
*/ */
function SetDataColor($datacolor) public function SetDataColor($datacolor)
{ {
// phpcs:enable // phpcs:enable
$this->datacolor = $datacolor; $this->datacolor = $datacolor;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set type * Set type
* *
* @param array $type Array with type for each serie. Example: array('pie'), array('lines',...,'bars') * @param array $type Array with type for each serie. Example: array('pie'), array('lines',...,'bars')
* @return void * @return void
*/ */
function SetType($type) public function SetType($type)
{ {
// phpcs:enable // phpcs:enable
$this->type = $type; $this->type = $type;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set legend * Set legend
* *
* @param array $legend Legend. Example: array('seriename1','seriname2',...) * @param array $legend Legend. Example: array('seriename1','seriname2',...)
* @return void * @return void
*/ */
function SetLegend($legend) public function SetLegend($legend)
{ {
// phpcs:enable // phpcs:enable
$this->Legend = $legend; $this->Legend = $legend;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set min width * Set min width
* *
* @param int $legendwidthmin Min width * @param int $legendwidthmin Min width
* @return void * @return void
*/ */
function SetLegendWidthMin($legendwidthmin) public function SetLegendWidthMin($legendwidthmin)
{ {
// phpcs:enable // phpcs:enable
$this->LegendWidthMin = $legendwidthmin; $this->LegendWidthMin = $legendwidthmin;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set max value * Set max value
* *
* @param int $max Max value * @param int $max Max value
* @return void * @return void
*/ */
function SetMaxValue($max) public function SetMaxValue($max)
{ {
// phpcs:enable // phpcs:enable
$this->MaxValue = $max; $this->MaxValue = $max;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Get max value * Get max value
* *
* @return int Max value * @return int Max value
*/ */
function GetMaxValue() public function GetMaxValue()
{ {
// phpcs:enable // phpcs:enable
return $this->MaxValue; return $this->MaxValue;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set min value * Set min value
* *
* @param int $min Min value * @param int $min Min value
* @return void * @return void
*/ */
function SetMinValue($min) public function SetMinValue($min)
{ {
// phpcs:enable // phpcs:enable
$this->MinValue = $min; $this->MinValue = $min;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Get min value * Get min value
* *
* @return int Max value * @return int Max value
*/ */
function GetMinValue() public function GetMinValue()
{ {
// phpcs:enable // phpcs:enable
return $this->MinValue; return $this->MinValue;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set height * Set height
* *
* @param int $h Height * @param int $h Height
* @return void * @return void
*/ */
function SetHeight($h) public function SetHeight($h)
{ {
// phpcs:enable // phpcs:enable
$this->height = $h; $this->height = $h;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set shading * Set shading
* *
* @param string $s Shading * @param string $s Shading
* @return void * @return void
*/ */
function SetShading($s) public function SetShading($s)
{ {
// phpcs:enable // phpcs:enable
$this->SetShading = $s; $this->SetShading = $s;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set shading * Set shading
* *
* @param string $s Shading * @param string $s Shading
* @return void * @return void
*/ */
function SetCssPrefix($s) public function SetCssPrefix($s)
{ {
// phpcs:enable // phpcs:enable
$this->cssprefix = $s; $this->cssprefix = $s;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Reset bg color * Reset bg color
* *
* @return void * @return void
*/ */
function ResetBgColor() public function ResetBgColor()
{ {
// phpcs:enable // phpcs:enable
unset($this->bgcolor); unset($this->bgcolor);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Reset bgcolorgrid * Reset bgcolorgrid
* *
* @return void * @return void
*/ */
function ResetBgColorGrid() public function ResetBgColorGrid()
{ {
// phpcs:enable // phpcs:enable
unset($this->bgcolorgrid); unset($this->bgcolorgrid);
@ -435,7 +435,7 @@ class DolGraph
* *
* @return string Error * @return string Error
*/ */
function isGraphKo() public function isGraphKo()
{ {
return $this->error; return $this->error;
} }
@ -446,7 +446,7 @@ class DolGraph
* @param int $showlegend 1=Show legend (default), 0=Hide legend * @param int $showlegend 1=Show legend (default), 0=Hide legend
* @return void * @return void
*/ */
function setShowLegend($showlegend) public function setShowLegend($showlegend)
{ {
$this->showlegend=$showlegend; $this->showlegend=$showlegend;
} }
@ -457,7 +457,7 @@ class DolGraph
* @param int $showpointvalue 1=Show value for each point, as tooltip or inline (default), 0=Hide value * @param int $showpointvalue 1=Show value for each point, as tooltip or inline (default), 0=Hide value
* @return void * @return void
*/ */
function setShowPointValue($showpointvalue) public function setShowPointValue($showpointvalue)
{ {
$this->showpointvalue=$showpointvalue; $this->showpointvalue=$showpointvalue;
} }
@ -468,21 +468,21 @@ class DolGraph
* @param int $showpercent 1=Show percent for each point, as tooltip or inline, 0=Hide percent (default) * @param int $showpercent 1=Show percent for each point, as tooltip or inline, 0=Hide percent (default)
* @return void * @return void
*/ */
function setShowPercent($showpercent) public function setShowPercent($showpercent)
{ {
$this->showpercent=$showpercent; $this->showpercent=$showpercent;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Define background color of complete image * Define background color of complete image
* *
* @param array $bg_color array(R,G,B) ou 'onglet' ou 'default' * @param array $bg_color array(R,G,B) ou 'onglet' ou 'default'
* @return void * @return void
*/ */
function SetBgColor($bg_color = array(255,255,255)) public function SetBgColor($bg_color = array(255,255,255))
{ {
// phpcs:enable // phpcs:enable
global $theme_bgcolor,$theme_bgcoloronglet; global $theme_bgcolor,$theme_bgcoloronglet;
@ -505,14 +505,14 @@ class DolGraph
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Define background color of grid * Define background color of grid
* *
* @param array $bg_colorgrid array(R,G,B) ou 'onglet' ou 'default' * @param array $bg_colorgrid array(R,G,B) ou 'onglet' ou 'default'
* @return void * @return void
*/ */
function SetBgColorGrid($bg_colorgrid = array(255,255,255)) public function SetBgColorGrid($bg_colorgrid = array(255,255,255))
{ {
// phpcs:enable // phpcs:enable
global $theme_bgcolor,$theme_bgcoloronglet; global $theme_bgcolor,$theme_bgcoloronglet;
@ -535,25 +535,25 @@ class DolGraph
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Reset data color * Reset data color
* *
* @return void * @return void
*/ */
function ResetDataColor() public function ResetDataColor()
{ {
// phpcs:enable // phpcs:enable
unset($this->datacolor); unset($this->datacolor);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Get max value * Get max value
* *
* @return int Max value * @return int Max value
*/ */
function GetMaxValueInData() public function GetMaxValueInData()
{ {
// phpcs:enable // phpcs:enable
$k = 0; $k = 0;
@ -574,13 +574,13 @@ class DolGraph
return $vals[0]; return $vals[0];
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return min value of all data * Return min value of all data
* *
* @return int Min value of all data * @return int Min value of all data
*/ */
function GetMinValueInData() public function GetMinValueInData()
{ {
// phpcs:enable // phpcs:enable
$k = 0; $k = 0;
@ -601,13 +601,13 @@ class DolGraph
return $vals[0]; return $vals[0];
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return max value of all data * Return max value of all data
* *
* @return int Max value of all data * @return int Max value of all data
*/ */
function GetCeilMaxValue() public function GetCeilMaxValue()
{ {
// phpcs:enable // phpcs:enable
$max = $this->GetMaxValueInData(); $max = $this->GetMaxValueInData();
@ -626,13 +626,13 @@ class DolGraph
return $res; return $res;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return min value of all data * Return min value of all data
* *
* @return double Max value of all data * @return double Max value of all data
*/ */
function GetFloorMinValue() public function GetFloorMinValue()
{ {
// phpcs:enable // phpcs:enable
$min = $this->GetMinValueInData(); $min = $this->GetMinValueInData();
@ -658,7 +658,7 @@ class DolGraph
* @param string $fileurl Url path to show image if saved onto disk * @param string $fileurl Url path to show image if saved onto disk
* @return integer|null * @return integer|null
*/ */
function draw($file, $fileurl = '') public function draw($file, $fileurl = '')
{ {
if (empty($file)) if (empty($file))
{ {
@ -1127,7 +1127,7 @@ class DolGraph
* @param int $shownographyet Show graph to say there is not enough data * @param int $shownographyet Show graph to say there is not enough data
* @return string HTML string to show graph * @return string HTML string to show graph
*/ */
function show($shownographyet = 0) public function show($shownographyet = 0)
{ {
global $langs; global $langs;
@ -1149,7 +1149,7 @@ class DolGraph
* @param string $defaultsize Value we want as default size * @param string $defaultsize Value we want as default size
* @return int Value of width or height to use by default * @return int Value of width or height to use by default
*/ */
static function getDefaultGraphSizeForStats($direction, $defaultsize = '') public static function getDefaultGraphSizeForStats($direction, $defaultsize = '')
{ {
global $conf; global $conf;

View File

@ -111,9 +111,9 @@ class dolReceiptPrinter extends Escpos
*/ */
public $db; public $db;
var $tags; public $tags;
var $printer; public $printer;
var $template; public $template;
/** /**
* @var string Error code (or message) * @var string Error code (or message)
@ -132,7 +132,7 @@ class dolReceiptPrinter extends Escpos
* *
* @param DoliDB $db database * @param DoliDB $db database
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db=$db; $this->db=$db;
$this->tags = array( $this->tags = array(
@ -211,7 +211,7 @@ class dolReceiptPrinter extends Escpos
* *
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
function listPrinters() public function listPrinters()
{ {
global $conf; global $conf;
$error = 0; $error = 0;
@ -279,7 +279,7 @@ class dolReceiptPrinter extends Escpos
* *
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
function listPrintersTemplates() public function listPrintersTemplates()
{ {
global $conf; global $conf;
$error = 0; $error = 0;
@ -311,7 +311,7 @@ class dolReceiptPrinter extends Escpos
* @param string $htmlname select html name * @param string $htmlname select html name
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
function selectTypePrinter($selected = '', $htmlname = 'printertypeid') public function selectTypePrinter($selected = '', $htmlname = 'printertypeid')
{ {
global $langs; global $langs;
@ -335,7 +335,7 @@ class dolReceiptPrinter extends Escpos
* @param string $htmlname select html name * @param string $htmlname select html name
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
function selectProfilePrinter($selected = '', $htmlname = 'printerprofileid') public function selectProfilePrinter($selected = '', $htmlname = 'printerprofileid')
{ {
global $langs; global $langs;
@ -352,7 +352,6 @@ class dolReceiptPrinter extends Escpos
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to Add a printer in db * Function to Add a printer in db
* *
@ -362,9 +361,8 @@ class dolReceiptPrinter extends Escpos
* @param string $parameter Printer parameter * @param string $parameter Printer parameter
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
function AddPrinter($name, $type, $profile, $parameter) public function addPrinter($name, $type, $profile, $parameter)
{ {
// phpcs:enable
global $conf; global $conf;
$error = 0; $error = 0;
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt'; $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt';
@ -378,7 +376,6 @@ class dolReceiptPrinter extends Escpos
return $error; return $error;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to Update a printer in db * Function to Update a printer in db
* *
@ -389,9 +386,8 @@ class dolReceiptPrinter extends Escpos
* @param int $printerid Printer id * @param int $printerid Printer id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
function UpdatePrinter($name, $type, $profile, $parameter, $printerid) public function updatePrinter($name, $type, $profile, $parameter, $printerid)
{ {
// phpcs:enable
global $conf; global $conf;
$error = 0; $error = 0;
$sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt'; $sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt';
@ -408,16 +404,14 @@ class dolReceiptPrinter extends Escpos
return $error; return $error;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to Delete a printer from db * Function to Delete a printer from db
* *
* @param int $printerid Printer id * @param int $printerid Printer id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
function DeletePrinter($printerid) public function deletePrinter($printerid)
{ {
// phpcs:enable
global $conf; global $conf;
$error = 0; $error = 0;
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'printer_receipt'; $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'printer_receipt';
@ -430,7 +424,6 @@ class dolReceiptPrinter extends Escpos
return $error; return $error;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to Update a printer template in db * Function to Update a printer template in db
* *
@ -439,9 +432,8 @@ class dolReceiptPrinter extends Escpos
* @param int $templateid Template id * @param int $templateid Template id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
function UpdateTemplate($name, $template, $templateid) public function updateTemplate($name, $template, $templateid)
{ {
// phpcs:enable
global $conf; global $conf;
$error = 0; $error = 0;
$sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt_template'; $sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt_template';
@ -457,20 +449,18 @@ class dolReceiptPrinter extends Escpos
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to Send Test page to Printer * Function to Send Test page to Printer
* *
* @param int $printerid Printer id * @param int $printerid Printer id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
function SendTestToPrinter($printerid) public function sendTestToPrinter($printerid)
{ {
// phpcs:enable
global $conf; global $conf;
$error = 0; $error = 0;
$img = new EscposImage(DOL_DOCUMENT_ROOT .'/theme/common/dolibarr_logo_bw.png'); $img = new EscposImage(DOL_DOCUMENT_ROOT .'/theme/common/dolibarr_logo_bw.png');
$ret = $this->InitPrinter($printerid); $ret = $this->initPrinter($printerid);
if ($ret>0) { if ($ret>0) {
setEventMessages($this->error, $this->errors, 'errors'); setEventMessages($this->error, $this->errors, 'errors');
} else { } else {
@ -492,7 +482,6 @@ class dolReceiptPrinter extends Escpos
return $error; return $error;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to Print Receipt Ticket * Function to Print Receipt Ticket
* *
@ -501,9 +490,8 @@ class dolReceiptPrinter extends Escpos
* @param int $printerid Printer id * @param int $printerid Printer id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
function SendToPrinter($object, $templateid, $printerid) public function sendToPrinter($object, $templateid, $printerid)
{ {
// phpcs:enable
global $conf; global $conf;
$error = 0; $error = 0;
$ret = $this->loadTemplate($templateid); $ret = $this->loadTemplate($templateid);
@ -542,15 +530,12 @@ class dolReceiptPrinter extends Escpos
// print ticket // print ticket
$level = 0; $level = 0;
$html = '<table border="1" style="width:210px"><pre>'; $html = '<table border="1" style="width:210px"><pre>';
$ret = $this->InitPrinter($printerid); $ret = $this->initPrinter($printerid);
if ($ret>0) { if ($ret>0) {
setEventMessages($this->error, $this->errors, 'errors'); setEventMessages($this->error, $this->errors, 'errors');
} } else {
else
{
$nboflines = count($vals); $nboflines = count($vals);
for ($line=0; $line < $nboflines; $line++) for ($line=0; $line < $nboflines; $line++) {
{
switch ($vals[$line]['tag']) { switch ($vals[$line]['tag']) {
case 'DOL_ALIGN_CENTER': case 'DOL_ALIGN_CENTER':
$this->printer->setJustification(Escpos::JUSTIFY_CENTER); $this->printer->setJustification(Escpos::JUSTIFY_CENTER);
@ -630,7 +615,7 @@ class dolReceiptPrinter extends Escpos
* @param int $templateid Template id * @param int $templateid Template id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
function loadTemplate($templateid) public function loadTemplate($templateid)
{ {
global $conf; global $conf;
$error = 0; $error = 0;
@ -656,16 +641,14 @@ class dolReceiptPrinter extends Escpos
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function Init Printer * Function Init Printer
* *
* @param int $printerid Printer id * @param int $printerid Printer id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
function InitPrinter($printerid) public function initPrinter($printerid)
{ {
// phpcs:enable
global $conf; global $conf;
$error=0; $error=0;
$sql = 'SELECT rowid, name, fk_type, fk_profile, parameter'; $sql = 'SELECT rowid, name, fk_type, fk_profile, parameter';

View File

@ -277,7 +277,7 @@ class EmailSenderProfile extends CommonObject
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
* @return string String with URL * @return string String with URL
*/ */
function getNomUrl($withpicto = 0) public function getNomUrl($withpicto = 0)
{ {
global $db, $conf, $langs; global $db, $conf, $langs;
global $dolibarr_main_authentication, $dolibarr_main_demo; global $dolibarr_main_authentication, $dolibarr_main_demo;
@ -294,8 +294,7 @@ class EmailSenderProfile extends CommonObject
$linkstart = ''; $linkstart = '';
$linkend=''; $linkend='';
if ($withpicto) if ($withpicto) {
{
$result.=($linkstart.img_object($label, 'label', 'class="classfortooltip"').$linkend); $result.=($linkstart.img_object($label, 'label', 'class="classfortooltip"').$linkend);
if ($withpicto != 2) $result.=' '; if ($withpicto != 2) $result.=' ';
} }
@ -309,12 +308,12 @@ class EmailSenderProfile extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label of status * @return string Label of status
*/ */
function getLibStatut($mode = 0) public function getLibStatut($mode = 0)
{ {
return $this->LibStatut($this->status, $mode); return $this->LibStatut($this->status, $mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return the status * Return the status
* *
@ -322,39 +321,39 @@ class EmailSenderProfile extends CommonObject
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Label of status * @return string Label of status
*/ */
static function LibStatut($status, $mode = 0) public static function LibStatut($status, $mode = 0)
{ {
global $langs; global $langs;
if ($mode == 0 || $mode == 1) if ($mode == 0 || $mode == 1)
{ {
if ($status == 1) return $langs->trans('Enabled'); if ($status == 1) return $langs->trans('Enabled');
if ($status == 0) return $langs->trans('Disabled'); elseif ($status == 0) return $langs->trans('Disabled');
} }
elseif ($mode == 2) elseif ($mode == 2)
{ {
if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled'); if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled');
if ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled'); elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
} }
elseif ($mode == 3) elseif ($mode == 3)
{ {
if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4'); if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4');
if ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5'); elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5');
} }
elseif ($mode == 4) elseif ($mode == 4)
{ {
if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled'); if ($status == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled');
if ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled'); elseif ($status == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
} }
elseif ($mode == 5) elseif ($mode == 5)
{ {
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4'); if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4');
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5'); elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5');
} }
elseif ($mode == 6) elseif ($mode == 6)
{ {
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4'); if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4');
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5'); elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5');
} }
} }
@ -364,7 +363,7 @@ class EmailSenderProfile extends CommonObject
* @param int $id Id of order * @param int $id Id of order
* @return void * @return void
*/ */
function info($id) public function info($id)
{ {
$sql = 'SELECT rowid, date_creation as datec, tms as datem,'; $sql = 'SELECT rowid, date_creation as datec, tms as datem,';
$sql.= ' fk_user_creat, fk_user_modif'; $sql.= ' fk_user_creat, fk_user_modif';

View File

@ -119,7 +119,7 @@ class Events // extends CommonObject
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
@ -131,7 +131,7 @@ class Events // extends CommonObject
* @param User $user User that create * @param User $user User that create
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function create($user) public function create($user)
{ {
global $conf, $langs; global $conf, $langs;
@ -183,7 +183,7 @@ class Events // extends CommonObject
* @param int $notrigger 0=no, 1=yes (no update trigger) * @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user = null, $notrigger = 0) public function update($user = null, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
@ -220,7 +220,7 @@ class Events // extends CommonObject
* @param User $user User that load * @param User $user User that load
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id, $user = null) public function fetch($id, $user = null)
{ {
global $langs; global $langs;
@ -271,7 +271,7 @@ class Events // extends CommonObject
* @param User $user User that delete * @param User $user User that delete
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($user) public function delete($user)
{ {
global $conf, $langs; global $conf, $langs;
@ -297,7 +297,7 @@ class Events // extends CommonObject
* *
* @return void * @return void
*/ */
function initAsSpecimen() public function initAsSpecimen()
{ {
$this->id=0; $this->id=0;

View File

@ -182,7 +182,7 @@ class ExtraFields
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->error = ''; $this->error = '';
@ -226,7 +226,7 @@ class ExtraFields
* @param string $enabled Condition to have the field enabled or not * @param string $enabled Condition to have the field enabled or not
* @return int <=0 if KO, >0 if OK * @return int <=0 if KO, >0 if OK
*/ */
function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique = 0, $required = 0, $default_value = '', $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $computed = '', $entity = '', $langfile = '', $enabled = '1') public function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique = 0, $required = 0, $default_value = '', $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $computed = '', $entity = '', $langfile = '', $enabled = '1')
{ {
if (empty($attrname)) return -1; if (empty($attrname)) return -1;
if (empty($label)) return -1; if (empty($label)) return -1;
@ -469,7 +469,7 @@ class ExtraFields
* @param string $elementtype Element type ('member', 'product', 'thirdparty', 'contact', ...) * @param string $elementtype Element type ('member', 'product', 'thirdparty', 'contact', ...)
* @return int < 0 if KO, 0 if nothing is done, 1 if OK * @return int < 0 if KO, 0 if nothing is done, 1 if OK
*/ */
function delete($attrname, $elementtype = 'member') public function delete($attrname, $elementtype = 'member')
{ {
if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'thirdparty') $elementtype='societe';
if ($elementtype == 'contact') $elementtype='socpeople'; if ($elementtype == 'contact') $elementtype='socpeople';
@ -586,7 +586,7 @@ class ExtraFields
* @param int $totalizable Is extrafield totalizable on list * @param int $totalizable Is extrafield totalizable on list
* @return int >0 if OK, <=0 if KO * @return int >0 if OK, <=0 if KO
*/ */
function update($attrname, $label, $type, $length, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0) public function update($attrname, $label, $type, $length, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0)
{ {
if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'thirdparty') $elementtype='societe';
if ($elementtype == 'contact') $elementtype='socpeople'; if ($elementtype == 'contact') $elementtype='socpeople';
@ -819,7 +819,7 @@ class ExtraFields
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Load array this->attributes, or old this->attribute_xxx like attribute_label, attribute_type, ... * Load array this->attributes, or old this->attribute_xxx like attribute_label, attribute_type, ...
* *
@ -827,7 +827,7 @@ class ExtraFields
* @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED. Deprecated. Should not be required. * @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED. Deprecated. Should not be required.
* @return array Array of attributes keys+label for all extra fields. * @return array Array of attributes keys+label for all extra fields.
*/ */
function fetch_name_optionals_label($elementtype, $forceload = false) public function fetch_name_optionals_label($elementtype, $forceload = false)
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;
@ -950,7 +950,7 @@ class ExtraFields
* @param string $extrafieldsobjectkey If defined (for example $object->table_element), use the new method to get extrafields data * @param string $extrafieldsobjectkey If defined (for example $object->table_element), use the new method to get extrafields data
* @return string * @return string
*/ */
function showInputField($key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '', $objectid = 0, $extrafieldsobjectkey = '') public function showInputField($key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '', $objectid = 0, $extrafieldsobjectkey = '')
{ {
global $conf,$langs,$form; global $conf,$langs,$form;
@ -1565,7 +1565,7 @@ class ExtraFields
* @param string $extrafieldsobjectkey If defined (for example $object->table_element), use the new method to get extrafields data * @param string $extrafieldsobjectkey If defined (for example $object->table_element), use the new method to get extrafields data
* @return string Formated value * @return string Formated value
*/ */
function showOutputField($key, $value, $moreparam = '', $extrafieldsobjectkey = '') public function showOutputField($key, $value, $moreparam = '', $extrafieldsobjectkey = '')
{ {
global $conf,$langs; global $conf,$langs;
@ -1877,7 +1877,7 @@ class ExtraFields
* @param string $extrafieldsobjectkey If defined, use the new method to get extrafields data * @param string $extrafieldsobjectkey If defined, use the new method to get extrafields data
* @return string Formated value * @return string Formated value
*/ */
function getAlignFlag($key, $extrafieldsobjectkey = '') public function getAlignFlag($key, $extrafieldsobjectkey = '')
{ {
global $conf,$langs; global $conf,$langs;
@ -1929,7 +1929,7 @@ class ExtraFields
* @param string $object Object * @param string $object Object
* @return string HTML code with line for separator * @return string HTML code with line for separator
*/ */
function showSeparator($key, $object) public function showSeparator($key, $object)
{ {
global $langs; global $langs;
@ -1947,7 +1947,7 @@ class ExtraFields
* @param string $onlykey Only following key is filled. When we make update of only one extrafield ($action = 'update_extras'), calling page must must set this to avoid to have other extrafields being reset. * @param string $onlykey Only following key is filled. When we make update of only one extrafield ($action = 'update_extras'), calling page must must set this to avoid to have other extrafields being reset.
* @return int 1 if array_options set, 0 if no value, -1 if error (field required missing for example) * @return int 1 if array_options set, 0 if no value, -1 if error (field required missing for example)
*/ */
function setOptionalsFromPost($extralabels, &$object, $onlykey = '') public function setOptionalsFromPost($extralabels, &$object, $onlykey = '')
{ {
global $_POST, $langs; global $_POST, $langs;
$nofillrequired='';// For error when required field left blank $nofillrequired='';// For error when required field left blank
@ -2046,7 +2046,7 @@ class ExtraFields
* @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names) * @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names)
* @return array|int array_options set or 0 if no value * @return array|int array_options set or 0 if no value
*/ */
function getOptionalsFromPost($extrafieldsobjectkey, $keyprefix = '', $keysuffix = '') public function getOptionalsFromPost($extrafieldsobjectkey, $keyprefix = '', $keysuffix = '')
{ {
global $_POST; global $_POST;

View File

@ -34,7 +34,7 @@ class GenericObject extends CommonObject
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db=$db; $this->db=$db;
} }

View File

@ -46,13 +46,13 @@ class FormCompany
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of labels (translated) of third parties type * Return list of labels (translated) of third parties type
* *
@ -60,7 +60,7 @@ class FormCompany
* @param string $filter Add a SQL filter to select * @param string $filter Add a SQL filter to select
* @return array Array of types * @return array Array of types
*/ */
function typent_array($mode = 0, $filter = '') public function typent_array($mode = 0, $filter = '')
{ {
// phpcs:enable // phpcs:enable
global $langs,$mysoc; global $langs,$mysoc;
@ -95,7 +95,7 @@ class FormCompany
return $effs; return $effs;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Renvoie la liste des types d'effectifs possibles (pas de traduction car nombre) * Renvoie la liste des types d'effectifs possibles (pas de traduction car nombre)
* *
@ -103,7 +103,7 @@ class FormCompany
* @param string $filter Add a SQL filter to select * @param string $filter Add a SQL filter to select
* @return array Array of types d'effectifs * @return array Array of types d'effectifs
*/ */
function effectif_array($mode = 0, $filter = '') public function effectif_array($mode = 0, $filter = '')
{ {
// phpcs:enable // phpcs:enable
$effs = array(); $effs = array();
@ -135,7 +135,7 @@ class FormCompany
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Affiche formulaire de selection des modes de reglement * Affiche formulaire de selection des modes de reglement
* *
@ -145,7 +145,7 @@ class FormCompany
* @param int $empty Add empty value in list * @param int $empty Add empty value in list
* @return void * @return void
*/ */
function form_prospect_level($page, $selected = '', $htmlname = 'prospect_level_id', $empty = 0) public function form_prospect_level($page, $selected = '', $htmlname = 'prospect_level_id', $empty = 0)
{ {
// phpcs:enable // phpcs:enable
global $user, $langs; global $user, $langs;
@ -186,7 +186,7 @@ class FormCompany
print '</form>'; print '</form>';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Returns the drop-down list of departments/provinces/cantons for all countries or for a given country. * Returns the drop-down list of departments/provinces/cantons for all countries or for a given country.
* In the case of an all-country list, the display breaks on the country. * In the case of an all-country list, the display breaks on the country.
@ -198,13 +198,13 @@ class FormCompany
* @param string $htmlname Id of department * @param string $htmlname Id of department
* @return void * @return void
*/ */
function select_departement($selected = '', $country_codeid = 0, $htmlname = 'state_id') public function select_departement($selected = '', $country_codeid = 0, $htmlname = 'state_id')
{ {
// phpcs:enable // phpcs:enable
print $this->select_state($selected, $country_codeid, $htmlname); print $this->select_state($selected, $country_codeid, $htmlname);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Returns the drop-down list of departments/provinces/cantons for all countries or for a given country. * Returns the drop-down list of departments/provinces/cantons for all countries or for a given country.
* In the case of an all-country list, the display breaks on the country. * In the case of an all-country list, the display breaks on the country.
@ -217,7 +217,7 @@ class FormCompany
* @return string String with HTML select * @return string String with HTML select
* @see select_country * @see select_country
*/ */
function select_state($selected = '', $country_codeid = 0, $htmlname = 'state_id') public function select_state($selected = '', $country_codeid = 0, $htmlname = 'state_id')
{ {
// phpcs:enable // phpcs:enable
global $conf,$langs,$user; global $conf,$langs,$user;
@ -319,7 +319,7 @@ class FormCompany
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Retourne la liste deroulante des regions actives dont le pays est actif * Retourne la liste deroulante des regions actives dont le pays est actif
* La cle de la liste est le code (il peut y avoir plusieurs entree pour * La cle de la liste est le code (il peut y avoir plusieurs entree pour
@ -330,7 +330,7 @@ class FormCompany
* @param string $htmlname Name of HTML select field * @param string $htmlname Name of HTML select field
* @return void * @return void
*/ */
function select_region($selected = '', $htmlname = 'region_id') public function select_region($selected = '', $htmlname = 'region_id')
{ {
// phpcs:enable // phpcs:enable
global $conf,$langs; global $conf,$langs;
@ -387,7 +387,7 @@ class FormCompany
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return combo list with people title * Return combo list with people title
* *
@ -396,7 +396,7 @@ class FormCompany
* @param string $morecss Add more css on SELECT element * @param string $morecss Add more css on SELECT element
* @return string String with HTML select * @return string String with HTML select
*/ */
function select_civility($selected = '', $htmlname = 'civility_id', $morecss = 'maxwidth100') public function select_civility($selected = '', $htmlname = 'civility_id', $morecss = 'maxwidth100')
{ {
// phpcs:enable // phpcs:enable
global $conf,$langs,$user; global $conf,$langs,$user;
@ -445,7 +445,7 @@ class FormCompany
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne. * Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne.
* Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays. * Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays.
@ -457,13 +457,13 @@ class FormCompany
* @deprecated Use print xxx->select_juridicalstatus instead * @deprecated Use print xxx->select_juridicalstatus instead
* @see select_juridicalstatus() * @see select_juridicalstatus()
*/ */
function select_forme_juridique($selected = '', $country_codeid = 0, $filter = '') public function select_forme_juridique($selected = '', $country_codeid = 0, $filter = '')
{ {
// phpcs:enable // phpcs:enable
print $this->select_juridicalstatus($selected, $country_codeid, $filter); print $this->select_juridicalstatus($selected, $country_codeid, $filter);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne. * Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne.
* Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays * Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays
@ -474,7 +474,7 @@ class FormCompany
* @param string $htmlname HTML name of select * @param string $htmlname HTML name of select
* @return string String with HTML select * @return string String with HTML select
*/ */
function select_juridicalstatus($selected = '', $country_codeid = 0, $filter = '', $htmlname = 'forme_juridique_code') public function select_juridicalstatus($selected = '', $country_codeid = 0, $filter = '', $htmlname = 'forme_juridique_code')
{ {
// phpcs:enable // phpcs:enable
global $conf,$langs,$user; global $conf,$langs,$user;
@ -579,7 +579,7 @@ class FormCompany
* @param string $morecss More CSS on select component * @param string $morecss More CSS on select component
* @return int The selected third party ID * @return int The selected third party ID
*/ */
function selectCompaniesForNewContact($object, $var_id, $selected = '', $htmlname = 'newcompany', $limitto = '', $forceid = 0, $moreparam = '', $morecss = '') public function selectCompaniesForNewContact($object, $var_id, $selected = '', $htmlname = 'newcompany', $limitto = '', $forceid = 0, $moreparam = '', $morecss = '')
{ {
global $conf, $langs; global $conf, $langs;
@ -738,7 +738,7 @@ class FormCompany
* @param string $morecss Add more css to select component * @param string $morecss Add more css to select component
* @return void * @return void
*/ */
function selectTypeContact($object, $selected, $htmlname = 'type', $source = 'internal', $sortorder = 'position', $showempty = 0, $morecss = '') public function selectTypeContact($object, $selected, $htmlname = 'type', $source = 'internal', $sortorder = 'position', $showempty = 0, $morecss = '')
{ {
global $user, $langs; global $user, $langs;
@ -762,7 +762,7 @@ class FormCompany
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return a select list with zip codes and their town * Return a select list with zip codes and their town
* *
@ -775,7 +775,7 @@ class FormCompany
* @param string $morecss More css * @param string $morecss More css
* @return string * @return string
*/ */
function select_ziptown($selected = '', $htmlname = 'zipcode', $fields = '', $fieldsize = 0, $disableautocomplete = 0, $moreattrib = '', $morecss = '') public function select_ziptown($selected = '', $htmlname = 'zipcode', $fields = '', $fieldsize = 0, $disableautocomplete = 0, $moreattrib = '', $morecss = '')
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;
@ -795,7 +795,7 @@ class FormCompany
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return HTML string to use as input of professional id into a HTML page (siren, siret, etc...) * Return HTML string to use as input of professional id into a HTML page (siren, siret, etc...)
* *
@ -806,7 +806,7 @@ class FormCompany
* @param string $morecss More css * @param string $morecss More css
* @return string HTML string with prof id * @return string HTML string with prof id
*/ */
function get_input_id_prof($idprof, $htmlname, $preselected, $country_code, $morecss = 'maxwidth100onsmartphone quatrevingtpercent') public function get_input_id_prof($idprof, $htmlname, $preselected, $country_code, $morecss = 'maxwidth100onsmartphone quatrevingtpercent')
{ {
// phpcs:enable // phpcs:enable
global $conf,$langs; global $conf,$langs;
@ -847,7 +847,7 @@ class FormCompany
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return a HTML select with localtax values for thirdparties * Return a HTML select with localtax values for thirdparties
* *
@ -856,7 +856,7 @@ class FormCompany
* @param string $htmlname HTML select name * @param string $htmlname HTML select name
* @return void * @return void
*/ */
function select_localtax($local, $selected, $htmlname) public function select_localtax($local, $selected, $htmlname)
{ {
// phpcs:enable // phpcs:enable
$tax=get_localtax_by_third($local); $tax=get_localtax_by_third($local);
@ -900,7 +900,7 @@ class FormCompany
* @param string $morecss More css * @param string $morecss More css
* @return string HTML string * @return string HTML string
*/ */
function selectProspectCustomerType($selected, $htmlname = 'client', $htmlidname = 'customerprospect', $typeinput = 'form', $morecss = '') public function selectProspectCustomerType($selected, $htmlname = 'client', $htmlidname = 'customerprospect', $typeinput = 'form', $morecss = '')
{ {
global $conf,$langs; global $conf,$langs;

View File

@ -49,7 +49,7 @@ class FormContract
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Show a combo list with contracts qualified for a third party * Show a combo list with contracts qualified for a third party
* *
@ -60,7 +60,7 @@ class FormContract
* @param int $showempty Show empty line * @param int $showempty Show empty line
* @return int Nbr of project if OK, <0 if KO * @return int Nbr of project if OK, <0 if KO
*/ */
function select_contract($socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1) public function select_contract($socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1)
{ {
// phpcs:enable // phpcs:enable
global $db,$user,$conf,$langs; global $db,$user,$conf,$langs;
@ -177,7 +177,7 @@ class FormContract
* @param int $showempty Show empty line * @param int $showempty Show empty line
* @return int Nbr of project if OK, <0 if KO * @return int Nbr of project if OK, <0 if KO
*/ */
function formSelectContract($page, $socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1) public function formSelectContract($page, $socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1)
{ {
global $langs; global $langs;

View File

@ -51,14 +51,14 @@ class FormFile
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numoffiles=0; $this->numoffiles=0;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Show form to upload a new file. * Show form to upload a new file.
* *
@ -79,7 +79,7 @@ class FormFile
* @param string $sectiondir If upload must be done inside a particular directory (is sectiondir defined, sectionid must not be) * @param string $sectiondir If upload must be done inside a particular directory (is sectiondir defined, sectionid must not be)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function form_attach_new_file($url, $title = '', $addcancel = 0, $sectionid = 0, $perm = 1, $size = 50, $object = '', $options = '', $useajax = 1, $savingdocmask = '', $linkfiles = 1, $htmlname = 'formuserfile', $accept = '', $sectiondir = '') public function form_attach_new_file($url, $title = '', $addcancel = 0, $sectionid = 0, $perm = 1, $size = 50, $object = '', $options = '', $useajax = 1, $savingdocmask = '', $linkfiles = 1, $htmlname = 'formuserfile', $accept = '', $sectiondir = '')
{ {
// phpcs:enable // phpcs:enable
global $conf,$langs, $hookmanager; global $conf,$langs, $hookmanager;
@ -238,7 +238,7 @@ class FormFile
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Show the box with list of available documents for object * Show the box with list of available documents for object
* *
@ -261,7 +261,7 @@ class FormFile
* @return int <0 if KO, number of shown files if OK * @return int <0 if KO, number of shown files if OK
* @deprecated Use print xxx->showdocuments() instead. * @deprecated Use print xxx->showdocuments() instead.
*/ */
function show_documents($modulepart, $modulesubdir, $filedir, $urlsource, $genallowed, $delallowed = 0, $modelselected = '', $allowgenifempty = 1, $forcenomultilang = 0, $iconPDF = 0, $notused = 0, $noform = 0, $param = '', $title = '', $buttonlabel = '', $codelang = '') public function show_documents($modulepart, $modulesubdir, $filedir, $urlsource, $genallowed, $delallowed = 0, $modelselected = '', $allowgenifempty = 1, $forcenomultilang = 0, $iconPDF = 0, $notused = 0, $noform = 0, $param = '', $title = '', $buttonlabel = '', $codelang = '')
{ {
// phpcs:enable // phpcs:enable
$this->numoffiles=0; $this->numoffiles=0;
@ -294,7 +294,7 @@ class FormFile
* @param int $hideifempty Hide section of generated files if there is no file * @param int $hideifempty Hide section of generated files if there is no file
* @return string Output string with HTML array of documents (might be empty string) * @return string Output string with HTML array of documents (might be empty string)
*/ */
function showdocuments($modulepart, $modulesubdir, $filedir, $urlsource, $genallowed, $delallowed = 0, $modelselected = '', $allowgenifempty = 1, $forcenomultilang = 0, $iconPDF = 0, $notused = 0, $noform = 0, $param = '', $title = '', $buttonlabel = '', $codelang = '', $morepicto = '', $object = null, $hideifempty = 0) public function showdocuments($modulepart, $modulesubdir, $filedir, $urlsource, $genallowed, $delallowed = 0, $modelselected = '', $allowgenifempty = 1, $forcenomultilang = 0, $iconPDF = 0, $notused = 0, $noform = 0, $param = '', $title = '', $buttonlabel = '', $codelang = '', $morepicto = '', $object = null, $hideifempty = 0)
{ {
// Deprecation warning // Deprecation warning
if (! empty($iconPDF)) { if (! empty($iconPDF)) {
@ -893,7 +893,7 @@ class FormFile
* @param string $filter Filter filenames on this regex string (Example: '\.pdf$') * @param string $filter Filter filenames on this regex string (Example: '\.pdf$')
* @return string Output string with HTML link of documents (might be empty string). This also fill the array ->infofiles * @return string Output string with HTML link of documents (might be empty string). This also fill the array ->infofiles
*/ */
function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter = '') public function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter = '')
{ {
global $conf, $langs; global $conf, $langs;
@ -996,7 +996,7 @@ class FormFile
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Show list of documents in $filearray (may be they are all in same directory but may not) * Show list of documents in $filearray (may be they are all in same directory but may not)
* This also sync database if $upload_dir is defined. * This also sync database if $upload_dir is defined.
@ -1028,7 +1028,7 @@ class FormFile
* @return int <0 if KO, nb of files shown if OK * @return int <0 if KO, nb of files shown if OK
* @see list_of_autoecmfiles * @see list_of_autoecmfiles
*/ */
function list_of_documents($filearray, $object, $modulepart, $param = '', $forcedownload = 0, $relativepath = '', $permonobject = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $title = '', $url = '', $showrelpart = 0, $permtoeditline = -1, $upload_dir = '', $sortfield = '', $sortorder = 'ASC', $disablemove = 1, $addfilterfields = 0) public function list_of_documents($filearray, $object, $modulepart, $param = '', $forcedownload = 0, $relativepath = '', $permonobject = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $title = '', $url = '', $showrelpart = 0, $permtoeditline = -1, $upload_dir = '', $sortfield = '', $sortorder = 'ASC', $disablemove = 1, $addfilterfields = 0)
{ {
// phpcs:enable // phpcs:enable
global $user, $conf, $langs, $hookmanager; global $user, $conf, $langs, $hookmanager;
@ -1397,7 +1397,7 @@ class FormFile
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Show list of documents in a directory * Show list of documents in a directory
* *
@ -1416,7 +1416,7 @@ class FormFile
* @return int <0 if KO, nb of files shown if OK * @return int <0 if KO, nb of files shown if OK
* @see list_of_documents * @see list_of_documents
*/ */
function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload = 0, $relativepath = '', $permtodelete = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $url = '', $addfilterfields = 0) public function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload = 0, $relativepath = '', $permtodelete = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $url = '', $addfilterfields = 0)
{ {
// phpcs:enable // phpcs:enable
global $user, $conf, $langs, $form; global $user, $conf, $langs, $form;

View File

@ -49,7 +49,7 @@ class FormIntervention
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Show a combo list with contracts qualified for a third party * Show a combo list with contracts qualified for a third party
* *
@ -60,7 +60,7 @@ class FormIntervention
* @param int $showempty Show empty line * @param int $showempty Show empty line
* @return int Nbre of project if OK, <0 if KO * @return int Nbre of project if OK, <0 if KO
*/ */
function select_interventions($socid = -1, $selected = '', $htmlname = 'interventionid', $maxlength = 16, $showempty = 1) public function select_interventions($socid = -1, $selected = '', $htmlname = 'interventionid', $maxlength = 16, $showempty = 1)
{ {
// phpcs:enable // phpcs:enable
global $db,$user,$conf,$langs; global $db,$user,$conf,$langs;

View File

@ -121,7 +121,7 @@ class FormMail extends Form
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
@ -151,13 +151,13 @@ class FormMail extends Form
$this->withfckeditor=-1; // -1 = Auto $this->withfckeditor=-1; // -1 = Auto
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Clear list of attached files in send mail form (also stored in session) * Clear list of attached files in send mail form (also stored in session)
* *
* @return void * @return void
*/ */
function clear_attached_files() public function clear_attached_files()
{ {
// phpcs:enable // phpcs:enable
global $conf,$user; global $conf,$user;
@ -174,7 +174,7 @@ class FormMail extends Form
unset($_SESSION["listofmimes".$keytoavoidconflict]); unset($_SESSION["listofmimes".$keytoavoidconflict]);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Add a file into the list of attached files (stored in SECTION array) * Add a file into the list of attached files (stored in SECTION array)
* *
@ -183,7 +183,7 @@ class FormMail extends Form
* @param string $type Mime type (can be dol_mimetype($file)) * @param string $type Mime type (can be dol_mimetype($file))
* @return void * @return void
*/ */
function add_attached_files($path, $file = '', $type = '') public function add_attached_files($path, $file = '', $type = '')
{ {
// phpcs:enable // phpcs:enable
$listofpaths=array(); $listofpaths=array();
@ -208,14 +208,14 @@ class FormMail extends Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Remove a file from the list of attached files (stored in SECTION array) * Remove a file from the list of attached files (stored in SECTION array)
* *
* @param string $keytodelete Key in file array (0, 1, 2, ...) * @param string $keytodelete Key in file array (0, 1, 2, ...)
* @return void * @return void
*/ */
function remove_attached_files($keytodelete) public function remove_attached_files($keytodelete)
{ {
// phpcs:enable // phpcs:enable
$listofpaths=array(); $listofpaths=array();
@ -238,13 +238,13 @@ class FormMail extends Form
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of attached files (stored in SECTION array) * Return list of attached files (stored in SECTION array)
* *
* @return array array('paths'=> ,'names'=>, 'mimes'=> ) * @return array array('paths'=> ,'names'=>, 'mimes'=> )
*/ */
function get_attached_files() public function get_attached_files()
{ {
// phpcs:enable // phpcs:enable
$listofpaths=array(); $listofpaths=array();
@ -258,7 +258,7 @@ class FormMail extends Form
return array('paths'=>$listofpaths, 'names'=>$listofnames, 'mimes'=>$listofmimes); return array('paths'=>$listofpaths, 'names'=>$listofnames, 'mimes'=>$listofmimes);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Show the form to input an email * Show the form to input an email
* this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files * this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files
@ -268,13 +268,13 @@ class FormMail extends Form
* @param string $removefileaction Name of action when removing file attachments * @param string $removefileaction Name of action when removing file attachments
* @return void * @return void
*/ */
function show_form($addfileaction = 'addfile', $removefileaction = 'removefile') public function show_form($addfileaction = 'addfile', $removefileaction = 'removefile')
{ {
// phpcs:enable // phpcs:enable
print $this->get_form($addfileaction, $removefileaction); print $this->get_form($addfileaction, $removefileaction);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Get the form to input an email * Get the form to input an email
* this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files * this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files
@ -285,7 +285,7 @@ class FormMail extends Form
* @param string $removefileaction Name of action when removing file attachments * @param string $removefileaction Name of action when removing file attachments
* @return string Form to show * @return string Form to show
*/ */
function get_form($addfileaction = 'addfile', $removefileaction = 'removefile') public function get_form($addfileaction = 'addfile', $removefileaction = 'removefile')
{ {
// phpcs:enable // phpcs:enable
global $conf, $langs, $user, $hookmanager, $form; global $conf, $langs, $user, $hookmanager, $form;
@ -1146,8 +1146,7 @@ class FormMail extends Form
{ {
$ret = new ModelMail(); $ret = new ModelMail();
if ($id == -2 && empty($label)) if ($id == -2 && empty($label)) {
{
$this->error = 'LabelIsMandatoryWhenIdIs-2'; $this->error = 'LabelIsMandatoryWhenIdIs-2';
return -1; return -1;
} }
@ -1320,7 +1319,7 @@ class FormMail extends Form
* @return void * @return void
* @see getCommonSubstitutionArray * @see getCommonSubstitutionArray
*/ */
function setSubstitFromObject($object, $outputlangs) public function setSubstitFromObject($object, $outputlangs)
{ {
global $conf, $user; global $conf, $user;
@ -1377,7 +1376,7 @@ class FormMail extends Form
* @param Object $object Object if applicable * @param Object $object Object if applicable
* @return array Array of substitution values for emails. * @return array Array of substitution values for emails.
*/ */
static function getAvailableSubstitKey($mode = 'formemail', $object = null) public static function getAvailableSubstitKey($mode = 'formemail', $object = null)
{ {
global $conf, $langs; global $conf, $langs;

View File

@ -44,7 +44,7 @@ class FormMargin
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
@ -59,7 +59,7 @@ class FormMargin
* @param boolean $force_price True of not * @param boolean $force_price True of not
* @return array Array with info * @return array Array with info
*/ */
function getMarginInfosArray($object, $force_price = false) public function getMarginInfosArray($object, $force_price = false)
{ {
global $conf, $db; global $conf, $db;
@ -191,7 +191,7 @@ class FormMargin
* @param boolean $force_price Force price * @param boolean $force_price Force price
* @return void * @return void
*/ */
function displayMarginInfos($object, $force_price = false) public function displayMarginInfos($object, $force_price = false)
{ {
global $langs, $conf, $user; global $langs, $conf, $user;

View File

@ -50,13 +50,13 @@ class FormOther
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return HTML select list of export models * Return HTML select list of export models
* *
@ -67,7 +67,7 @@ class FormOther
* @param int $fk_user Utilisateur créant le modèle * @param int $fk_user Utilisateur créant le modèle
* @return void * @return void
*/ */
function select_export_model($selected = '', $htmlname = 'exportmodelid', $type = '', $useempty = 0, $fk_user = null) public function select_export_model($selected = '', $htmlname = 'exportmodelid', $type = '', $useempty = 0, $fk_user = null)
{ {
// phpcs:enable // phpcs:enable
$sql = "SELECT rowid, label"; $sql = "SELECT rowid, label";
@ -109,7 +109,7 @@ class FormOther
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of export models * Return list of export models
* *
@ -119,7 +119,7 @@ class FormOther
* @param int $useempty Affiche valeur vide dans liste * @param int $useempty Affiche valeur vide dans liste
* @return void * @return void
*/ */
function select_import_model($selected = '', $htmlname = 'importmodelid', $type = '', $useempty = 0) public function select_import_model($selected = '', $htmlname = 'importmodelid', $type = '', $useempty = 0)
{ {
// phpcs:enable // phpcs:enable
$sql = "SELECT rowid, label"; $sql = "SELECT rowid, label";
@ -160,7 +160,7 @@ class FormOther
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of ecotaxes with label * Return list of ecotaxes with label
* *
@ -168,7 +168,7 @@ class FormOther
* @param string $htmlname Name of combo list * @param string $htmlname Name of combo list
* @return integer * @return integer
*/ */
function select_ecotaxes($selected = '', $htmlname = 'ecotaxe_id') public function select_ecotaxes($selected = '', $htmlname = 'ecotaxe_id')
{ {
// phpcs:enable // phpcs:enable
global $langs; global $langs;
@ -218,7 +218,7 @@ class FormOther
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of revenue stamp for country * Return list of revenue stamp for country
* *
@ -227,7 +227,7 @@ class FormOther
* @param string $country_code Country Code * @param string $country_code Country Code
* @return string HTML select list * @return string HTML select list
*/ */
function select_revenue_stamp($selected = '', $htmlname = 'revenuestamp', $country_code = '') public function select_revenue_stamp($selected = '', $htmlname = 'revenuestamp', $country_code = '')
{ {
// phpcs:enable // phpcs:enable
global $langs; global $langs;
@ -277,7 +277,7 @@ class FormOther
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return a HTML select list to select a percent * Return a HTML select list to select a percent
* *
@ -290,7 +290,7 @@ class FormOther
* @param int $showempty Add also an empty line * @param int $showempty Add also an empty line
* @return string HTML select string * @return string HTML select string
*/ */
function select_percent($selected = 0, $htmlname = 'percent', $disabled = 0, $increment = 5, $start = 0, $end = 100, $showempty = 0) public function select_percent($selected = 0, $htmlname = 'percent', $disabled = 0, $increment = 5, $start = 0, $end = 100, $showempty = 0)
{ {
// phpcs:enable // phpcs:enable
$return = '<select class="flat" name="'.$htmlname.'" '.($disabled?'disabled':'').'>'; $return = '<select class="flat" name="'.$htmlname.'" '.($disabled?'disabled':'').'>';
@ -315,7 +315,7 @@ class FormOther
return $return; return $return;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return select list for categories (to use in form search selectors) * Return select list for categories (to use in form search selectors)
* *
@ -328,7 +328,7 @@ class FormOther
* @return string Html combo list code * @return string Html combo list code
* @see select_all_categories * @see select_all_categories
*/ */
function select_categories($type, $selected = 0, $htmlname = 'search_categ', $nocateg = 0, $showempty = 1, $morecss = '') public function select_categories($type, $selected = 0, $htmlname = 'search_categ', $nocateg = 0, $showempty = 1, $morecss = '')
{ {
// phpcs:enable // phpcs:enable
global $conf, $langs; global $conf, $langs;
@ -377,7 +377,7 @@ class FormOther
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return select list for categories (to use in form search selectors) * Return select list for categories (to use in form search selectors)
* *
@ -389,7 +389,7 @@ class FormOther
* @param string $morecss More CSS * @param string $morecss More CSS
* @return string Html combo list code * @return string Html combo list code
*/ */
function select_salesrepresentatives($selected, $htmlname, $user, $showstatus = 0, $showempty = 1, $morecss = '') public function select_salesrepresentatives($selected, $htmlname, $user, $showstatus = 0, $showempty = 1, $morecss = '')
{ {
// phpcs:enable // phpcs:enable
global $conf,$langs; global $conf,$langs;
@ -490,7 +490,7 @@ class FormOther
* @param string $morecss More css * @param string $morecss More css
* @return void * @return void
*/ */
function selectProjectTasks($selectedtask = '', $projectid = 0, $htmlname = 'task_parent', $modeproject = 0, $modetask = 0, $mode = 0, $useempty = 0, $disablechildoftaskid = 0, $filteronprojstatus = '', $morecss = '') public function selectProjectTasks($selectedtask = '', $projectid = 0, $htmlname = 'task_parent', $modeproject = 0, $modetask = 0, $mode = 0, $useempty = 0, $disablechildoftaskid = 0, $filteronprojstatus = '', $morecss = '')
{ {
global $user, $langs; global $user, $langs;
@ -535,10 +535,8 @@ class FormOther
$lastprojectid=0; $lastprojectid=0;
$numlines=count($lines); $numlines=count($lines);
for ($i = 0 ; $i < $numlines ; $i++) for ($i = 0 ; $i < $numlines ; $i++) {
{ if ($lines[$i]->fk_parent == $parent) {
if ($lines[$i]->fk_parent == $parent)
{
$var = !$var; $var = !$var;
//var_dump($selectedproject."--".$selectedtask."--".$lines[$i]->fk_project."_".$lines[$i]->id); // $lines[$i]->id may be empty if project has no lines //var_dump($selectedproject."--".$selectedtask."--".$lines[$i]->fk_project."_".$lines[$i]->id); // $lines[$i]->id may be empty if project has no lines
@ -621,7 +619,7 @@ class FormOther
* @return string HTML code for color thumb * @return string HTML code for color thumb
* @see selectColor * @see selectColor
*/ */
static function showColor($color, $textifnotdefined = '') public static function showColor($color, $textifnotdefined = '')
{ {
$textcolor='FFF'; $textcolor='FFF';
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
@ -633,7 +631,7 @@ class FormOther
else print $textifnotdefined; else print $textifnotdefined;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Output a HTML code to select a color * Output a HTML code to select a color
* *
@ -646,7 +644,7 @@ class FormOther
* @deprecated Use instead selectColor * @deprecated Use instead selectColor
* @see selectColor() * @see selectColor()
*/ */
function select_color($set_color = '', $prefix = 'f_color', $form_name = '', $showcolorbox = 1, $arrayofcolors = '') public function select_color($set_color = '', $prefix = 'f_color', $form_name = '', $showcolorbox = 1, $arrayofcolors = '')
{ {
// phpcs:enable // phpcs:enable
print $this->selectColor($set_color, $prefix, $form_name, $showcolorbox, $arrayofcolors); print $this->selectColor($set_color, $prefix, $form_name, $showcolorbox, $arrayofcolors);
@ -664,7 +662,7 @@ class FormOther
* @return string * @return string
* @see showColor * @see showColor
*/ */
static function selectColor($set_color = '', $prefix = 'f_color', $form_name = '', $showcolorbox = 1, $arrayofcolors = '', $morecss = '') public static function selectColor($set_color = '', $prefix = 'f_color', $form_name = '', $showcolorbox = 1, $arrayofcolors = '', $morecss = '')
{ {
// Deprecation warning // Deprecation warning
if ($form_name) { if ($form_name) {
@ -752,7 +750,7 @@ class FormOther
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Creation d'un icone de couleur * Creation d'un icone de couleur
* *
@ -763,7 +761,7 @@ class FormOther
* @param int $y Hauteur de l'image en pixels * @param int $y Hauteur de l'image en pixels
* @return void * @return void
*/ */
function CreateColorIcon($color, $module, $name, $x = '12', $y = '12') public function CreateColorIcon($color, $module, $name, $x = '12', $y = '12')
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;
@ -793,7 +791,7 @@ class FormOther
ImageDestroy($image); ImageDestroy($image);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return HTML combo list of week * Return HTML combo list of week
* *
@ -802,7 +800,7 @@ class FormOther
* @param int $useempty Affiche valeur vide dans liste * @param int $useempty Affiche valeur vide dans liste
* @return string * @return string
*/ */
function select_dayofweek($selected = '', $htmlname = 'weekid', $useempty = 0) public function select_dayofweek($selected = '', $htmlname = 'weekid', $useempty = 0)
{ {
// phpcs:enable // phpcs:enable
global $langs; global $langs;
@ -839,7 +837,7 @@ class FormOther
return $select_week; return $select_week;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return HTML combo list of month * Return HTML combo list of month
* *
@ -850,7 +848,7 @@ class FormOther
* @param string $morecss More Css * @param string $morecss More Css
* @return string * @return string
*/ */
function select_month($selected = '', $htmlname = 'monthid', $useempty = 0, $longlabel = 0, $morecss = '') public function select_month($selected = '', $htmlname = 'monthid', $useempty = 0, $longlabel = 0, $morecss = '')
{ {
// phpcs:enable // phpcs:enable
global $langs; global $langs;
@ -882,7 +880,7 @@ class FormOther
return $select_month; return $select_month;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return HTML combo list of years * Return HTML combo list of years
* *
@ -897,7 +895,7 @@ class FormOther
* @param string $morecss More CSS * @param string $morecss More CSS
* @return string * @return string
*/ */
function select_year($selected = '', $htmlname = 'yearid', $useempty = 0, $min_year = 10, $max_year = 5, $offset = 0, $invert = 0, $option = '', $morecss = 'valignmiddle widthauto') public function select_year($selected = '', $htmlname = 'yearid', $useempty = 0, $min_year = 10, $max_year = 5, $offset = 0, $invert = 0, $option = '', $morecss = 'valignmiddle widthauto')
{ {
// phpcs:enable // phpcs:enable
print $this->selectyear($selected, $htmlname, $useempty, $min_year, $max_year, $offset, $invert, $option, $morecss); print $this->selectyear($selected, $htmlname, $useempty, $min_year, $max_year, $offset, $invert, $option, $morecss);
@ -917,7 +915,7 @@ class FormOther
* @param string $morecss More css * @param string $morecss More css
* @return string * @return string
*/ */
function selectyear($selected = '', $htmlname = 'yearid', $useempty = 0, $min_year = 10, $max_year = 5, $offset = 0, $invert = 0, $option = '', $morecss = 'valignmiddle widthauto') public function selectyear($selected = '', $htmlname = 'yearid', $useempty = 0, $min_year = 10, $max_year = 5, $offset = 0, $invert = 0, $option = '', $morecss = 'valignmiddle widthauto')
{ {
$out=''; $out='';
@ -965,7 +963,7 @@ class FormOther
* @param String $areacode Code of area for pages ('0'=value for Home page) * @param String $areacode Code of area for pages ('0'=value for Home page)
* @return array array('selectboxlist'=>, 'boxactivated'=>, 'boxlista'=>, 'boxlistb'=>) * @return array array('selectboxlist'=>, 'boxactivated'=>, 'boxlista'=>, 'boxlistb'=>)
*/ */
static function getBoxesArea($user, $areacode) public static function getBoxesArea($user, $areacode)
{ {
global $conf,$langs,$db; global $conf,$langs,$db;
@ -1172,7 +1170,7 @@ class FormOther
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return a HTML select list of a dictionary * Return a HTML select list of a dictionary
* *
@ -1185,7 +1183,7 @@ class FormOther
* @param string $moreattrib More attributes on HTML select tag * @param string $moreattrib More attributes on HTML select tag
* @return void * @return void
*/ */
function select_dictionary($htmlname, $dictionarytable, $keyfield = 'code', $labelfield = 'label', $selected = '', $useempty = 0, $moreattrib = '') public function select_dictionary($htmlname, $dictionarytable, $keyfield = 'code', $labelfield = 'label', $selected = '', $useempty = 0, $moreattrib = '')
{ {
// phpcs:enable // phpcs:enable
global $langs, $conf; global $langs, $conf;
@ -1226,9 +1224,7 @@ class FormOther
$i++; $i++;
} }
print "</select>"; print "</select>";
} } else {
else
{
print $langs->trans("DictionaryEmpty"); print $langs->trans("DictionaryEmpty");
} }
} }

View File

@ -45,12 +45,12 @@ class FormProjets
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Output a combo list with projects qualified for a third party / user * Output a combo list with projects qualified for a third party / user
* *
@ -71,7 +71,7 @@ class FormProjets
* @param int $htmlid Html id to use instead of htmlname * @param int $htmlid Html id to use instead of htmlname
* @return string Return html content * @return string Return html content
*/ */
function select_projects($socid = -1, $selected = '', $htmlname = 'projectid', $maxlength = 16, $option_only = 0, $show_empty = 1, $discard_closed = 0, $forcefocus = 0, $disabled = 0, $mode = 0, $filterkey = '', $nooutput = 0, $forceaddid = 0, $morecss = '', $htmlid = '') public function select_projects($socid = -1, $selected = '', $htmlname = 'projectid', $maxlength = 16, $option_only = 0, $show_empty = 1, $discard_closed = 0, $forcefocus = 0, $disabled = 0, $mode = 0, $filterkey = '', $nooutput = 0, $forceaddid = 0, $morecss = '', $htmlid = '')
{ {
// phpcs:enable // phpcs:enable
global $langs,$conf,$form; global $langs,$conf,$form;
@ -90,10 +90,10 @@ class FormProjets
$selected_input_value=$project->ref; $selected_input_value=$project->ref;
} }
$urloption='socid='.$socid.'&htmlname='.$htmlname.'&discardclosed='.$discard_closed; $urloption='socid='.$socid.'&htmlname='.$htmlname.'&discardclosed='.$discard_closed;
$out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array( $out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array(
// 'update' => array( // 'update' => array(
// 'projectid' => 'id' // 'projectid' => 'id'
// ) // )
)); ));
$out.='<input type="text" class="minwidth200'.($morecss?' '.$morecss:'').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />'; $out.='<input type="text" class="minwidth200'.($morecss?' '.$morecss:'').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
@ -119,7 +119,7 @@ $out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projec
else return $out; else return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Returns an array with projects qualified for a third party * Returns an array with projects qualified for a third party
* *
@ -140,7 +140,7 @@ $out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projec
* @param string $morecss More CSS * @param string $morecss More CSS
* @return int Nb of project if OK, <0 if KO * @return int Nb of project if OK, <0 if KO
*/ */
function select_projects_list($socid = -1, $selected = '', $htmlname = 'projectid', $maxlength = 24, $option_only = 0, $show_empty = 1, $discard_closed = 0, $forcefocus = 0, $disabled = 0, $mode = 0, $filterkey = '', $nooutput = 0, $forceaddid = 0, $htmlid = '', $morecss = 'maxwidth500') public function select_projects_list($socid = -1, $selected = '', $htmlname = 'projectid', $maxlength = 24, $option_only = 0, $show_empty = 1, $discard_closed = 0, $forcefocus = 0, $disabled = 0, $mode = 0, $filterkey = '', $nooutput = 0, $forceaddid = 0, $htmlid = '', $morecss = 'maxwidth500')
{ {
// phpcs:enable // phpcs:enable
global $user,$conf,$langs; global $user,$conf,$langs;
@ -320,7 +320,7 @@ $out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projec
* @param User $usertofilter User object to use for filtering * @param User $usertofilter User object to use for filtering
* @return int Nbr of project if OK, <0 if KO * @return int Nbr of project if OK, <0 if KO
*/ */
function selectTasks($socid = -1, $selected = '', $htmlname = 'taskid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500', $projectsListId = '', $showproject = 'all', $usertofilter = null) public function selectTasks($socid = -1, $selected = '', $htmlname = 'taskid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500', $projectsListId = '', $showproject = 'all', $usertofilter = null)
{ {
global $user,$conf,$langs; global $user,$conf,$langs;
@ -477,7 +477,7 @@ $out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projec
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Build a HTML select list of element of same thirdparty to suggest to link them to project * Build a HTML select list of element of same thirdparty to suggest to link them to project
* *
@ -488,7 +488,7 @@ $out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projec
* @param string $projectkey Equivalent key to fk_projet for actual table_element * @param string $projectkey Equivalent key to fk_projet for actual table_element
* @return int|string The HTML select list of element or '' if nothing or -1 if KO * @return int|string The HTML select list of element or '' if nothing or -1 if KO
*/ */
function select_element($table_element, $socid = 0, $morecss = '', $limitonstatus = -2, $projectkey = "fk_projet") public function select_element($table_element, $socid = 0, $morecss = '', $limitonstatus = -2, $projectkey = "fk_projet")
{ {
// phpcs:enable // phpcs:enable
global $conf, $langs; global $conf, $langs;
@ -618,7 +618,7 @@ $out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projec
* @param string $morecss Add more css * @param string $morecss Add more css
* @return int|string The HTML select list of element or '' if nothing or -1 if KO * @return int|string The HTML select list of element or '' if nothing or -1 if KO
*/ */
function selectOpportunityStatus($htmlname, $preselected = '-1', $showempty = 1, $useshortlabel = 0, $showallnone = 0, $showpercent = 0, $morecss = '') public function selectOpportunityStatus($htmlname, $preselected = '-1', $showempty = 1, $useshortlabel = 0, $showallnone = 0, $showpercent = 0, $morecss = '')
{ {
global $conf, $langs; global $conf, $langs;

View File

@ -60,14 +60,13 @@ class FormPropal
* @param string $htmlname Name of select field * @param string $htmlname Name of select field
* @return void * @return void
*/ */
function selectProposalStatus($selected = '', $short = 0, $excludedraft = 0, $showempty = 1, $mode = 'customer', $htmlname = 'propal_statut') public function selectProposalStatus($selected = '', $short = 0, $excludedraft = 0, $showempty = 1, $mode = 'customer', $htmlname = 'propal_statut')
{ {
global $langs; global $langs;
$prefix=''; $prefix='';
$listofstatus=array(); $listofstatus=array();
if ($mode == 'supplier') if ($mode == 'supplier') {
{
$prefix='SupplierProposalStatus'; $prefix='SupplierProposalStatus';
$langs->load("supplier_proposal"); $langs->load("supplier_proposal");
@ -78,9 +77,7 @@ class FormPropal
3=>array('id'=>3, 'code'=>'PR_NOTSIGNED'), 3=>array('id'=>3, 'code'=>'PR_NOTSIGNED'),
4=>array('id'=>4, 'code'=>'PR_CLOSED') 4=>array('id'=>4, 'code'=>'PR_CLOSED')
); );
} } else {
else
{
$prefix="PropalStatus"; $prefix="PropalStatus";
$sql = "SELECT id, code, label, active FROM ".MAIN_DB_PREFIX."c_propalst"; $sql = "SELECT id, code, label, active FROM ".MAIN_DB_PREFIX."c_propalst";

View File

@ -48,7 +48,7 @@ class FormSocialContrib
$this->db = $db; $this->db = $db;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of social contributions. * Return list of social contributions.
* Use mysoc->country_id or mysoc->country_code so they must be defined. * Use mysoc->country_id or mysoc->country_code so they must be defined.
@ -61,7 +61,7 @@ class FormSocialContrib
* @param string $morecss Add more CSS on select * @param string $morecss Add more CSS on select
* @return void * @return void
*/ */
function select_type_socialcontrib($selected = '', $htmlname = 'actioncode', $useempty = 0, $maxlen = 40, $help = 1, $morecss = 'minwidth300') public function select_type_socialcontrib($selected = '', $htmlname = 'actioncode', $useempty = 0, $maxlen = 40, $help = 1, $morecss = 'minwidth300')
{ {
// phpcs:enable // phpcs:enable
global $conf,$db,$langs,$user,$mysoc; global $conf,$db,$langs,$user,$mysoc;

View File

@ -40,7 +40,7 @@ class FormWebsite
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
@ -54,7 +54,7 @@ class FormWebsite
* @param int $useempty Show empty value or not * @param int $useempty Show empty value or not
* @return string Html component * @return string Html component
*/ */
function selectWebsite($selected = '', $htmlname = 'exportmodelid', $useempty = 0) public function selectWebsite($selected = '', $htmlname = 'exportmodelid', $useempty = 0)
{ {
$out=''; $out='';
@ -107,7 +107,7 @@ class FormWebsite
* @param string $moreattrib More attributes on HTML select tag * @param string $moreattrib More attributes on HTML select tag
* @return void * @return void
*/ */
function selectTypeOfContainer($htmlname, $selected = '', $useempty = 0, $moreattrib = '') public function selectTypeOfContainer($htmlname, $selected = '', $useempty = 0, $moreattrib = '')
{ {
global $langs, $conf, $user; global $langs, $conf, $user;
@ -170,7 +170,7 @@ class FormWebsite
* @param string $moreattrib More attributes on HTML select tag * @param string $moreattrib More attributes on HTML select tag
* @return void * @return void
*/ */
function selectSampleOfContainer($htmlname, $selected = '', $useempty = 0, $moreattrib = '') public function selectSampleOfContainer($htmlname, $selected = '', $useempty = 0, $moreattrib = '')
{ {
global $langs, $conf, $user; global $langs, $conf, $user;

View File

@ -691,7 +691,7 @@ class Cronjob extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($user, $notrigger = 0) public function delete($user, $notrigger = 0)
{ {
$error=0; $error=0;
@ -1109,8 +1109,7 @@ class Cronjob extends CommonObject
} }
} }
if($this->jobtype == 'function') if ($this->jobtype == 'function') {
{
//load lib //load lib
$libpath = '/' . strtolower($this->module_name) . '/lib/' . $this->libname; $libpath = '/' . strtolower($this->module_name) . '/lib/' . $this->libname;
$ret = dol_include_once($libpath); $ret = dol_include_once($libpath);