Qual: Fix multiple phan notices

# Qual: Fix multiple phan notices

Fix multiple phan notices
This commit is contained in:
MDW 2025-01-19 02:30:36 +01:00
parent 2483c4ec58
commit e5c385999d
No known key found for this signature in database
19 changed files with 187 additions and 171 deletions

View File

@ -19,7 +19,7 @@
* Copyright (C) 2022 OpenDSI <support@open-dsi.fr>
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2023 William Mead <william.mead@manchenumerique.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -146,23 +146,23 @@ class Propal extends CommonObject
/**
* @var int|''
* @deprecated
* @deprecated Use $date_validation
* @see $date_validation
*/
public $datev;
/**
* @var integer|'' $date_validation;
* @var int|''
*/
public $date_validation;
/**
* @var integer|'' $date_signature;
* @var int|''
*/
public $date_signature;
/**
* @var User $user_signature
* @var User
*/
public $user_signature;
@ -715,7 +715,7 @@ class Propal extends CommonObject
if ($qty < $product->packaging) {
$qty = $product->packaging;
} else {
if (!empty($product->packaging) && (fmod((float) $qty, $product->packaging) > 0.000001)) {
if (!empty($product->packaging) && (fmod((float) $qty, (float) $product->packaging) > 0.000001)) {
$coeff = intval((float) $qty / $product->packaging) + 1;
$qty = (float) $product->packaging * $coeff;
setEventMessages($langs->trans('QtyRecalculatedWithPackaging'), null, 'mesgs');
@ -772,7 +772,7 @@ class Propal extends CommonObject
$this->line->fk_propal = $this->id;
$this->line->label = $label;
$this->line->desc = $desc;
$this->line->qty = $qty;
$this->line->qty = (float) $qty;
$this->line->vat_src_code = $vat_src_code;
$this->line->tva_tx = $txtva;

View File

@ -13,7 +13,7 @@
* Copyright (C) 2016-2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2021-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -1637,10 +1637,10 @@ class Commande extends CommonOrder
if (getDolGlobalString('PRODUCT_USE_CUSTOMER_PACKAGING')) {
$product = new Product($this->db);
$result = $product->fetch($fk_product);
if ($qty < $product->packaging) {
if ($qty < (float) $product->packaging) {
$qty = $product->packaging;
} else {
if (!empty($product->packaging) && (fmod((float) $qty, $product->packaging) > 0.000001)) {
if (!empty($product->packaging) && (fmod((float) $qty, (float) $product->packaging) > 0.000001)) {
$coeff = intval((float) $qty / $product->packaging) + 1;
$qty = (float) $product->packaging * $coeff;
setEventMessages($langs->trans('QtyRecalculatedWithPackaging'), null, 'mesgs');
@ -1703,7 +1703,7 @@ class Commande extends CommonOrder
$this->line->fk_commande = $this->id;
$this->line->label = $label;
$this->line->desc = $desc;
$this->line->qty = $qty;
$this->line->qty = (float) $qty;
$this->line->ref_ext = $ref_ext;
$this->line->vat_src_code = $vat_src_code;
@ -1863,21 +1863,21 @@ class Commande extends CommonOrder
$this->lines[] = $line;
/** POUR AJOUTER AUTOMATIQUEMENT LES SOUSPRODUITS a LA COMMANDE
if (getDolGlobalString('PRODUIT_SOUSPRODUITS')) {
$prod = new Product($this->db);
$prod->fetch($idproduct);
$prod -> get_sousproduits_arbo();
$prods_arbo = $prod->get_arbo_each_prod();
if(count($prods_arbo) > 0)
{
foreach($prods_arbo as $key => $value)
{
// print "id : ".$value[1].' :qty: '.$value[0].'<br>';
if not in lines {
$this->add_product($value[1], $value[0]);
}
}
}
* if (getDolGlobalString('PRODUIT_SOUSPRODUITS')) {
* $prod = new Product($this->db);
* $prod->fetch($idproduct);
* $prod -> get_sousproduits_arbo();
* $prods_arbo = $prod->get_arbo_each_prod();
* if(count($prods_arbo) > 0)
* {
* foreach($prods_arbo as $key => $value)
* {
* // print "id : ".$value[1].' :qty: '.$value[0].'<br>';
* if not in lines {
* $this->add_product($value[1], $value[0]);
* }
* }
* }
**/
}
}

View File

@ -20,7 +20,7 @@
* Copyright (C) 2022 Sylvain Legrand <contact@infras.fr>
* Copyright (C) 2023 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2023 Nick Fragoulis
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -174,7 +174,6 @@ class Facture extends CommonInvoice
public $resteapayer;
/**
*
* @var int<0,1> 1 if invoice paid COMPLETELY, 0 otherwise
* @deprecated * Use statut and close_code)
*/
@ -4002,10 +4001,10 @@ class Facture extends CommonInvoice
if (getDolGlobalString('PRODUCT_USE_CUSTOMER_PACKAGING')) {
$product = new Product($this->db);
$result = $product->fetch($fk_product);
if ($qty < $product->packaging) {
if ($qty < (float) $product->packaging) {
$qty = $product->packaging;
} else {
if (!empty($product->packaging) && (fmod((float) $qty, $product->packaging) > 0.000001)) {
if (!empty($product->packaging) && (fmod((float) $qty, (float) $product->packaging) > 0.000001)) {
$coeff = intval((float) $qty / $product->packaging) + 1;
$qty = (float) $product->packaging * $coeff;
setEventMessages($langs->trans('QtyRecalculatedWithPackaging'), null, 'mesgs');

View File

@ -107,9 +107,9 @@ class Form
* @param object $object Object (on the page we show)
* @param int<0,1> $perm Permission to allow button to edit parameter. Set it to 0 to have a not edited field.
* @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datehourpicker' 'checkbox:ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...)
* @param string $moreparam More param to add on a href URL.
* @param int $fieldrequired 1 if we want to show field as mandatory using the "fieldrequired" CSS.
* @param int<0,3> $notabletag 1=Do not output table tags but output a ':', 2=Do not output table tags and no ':', 3=Do not output table tags but output a ' '
* @param string $moreparam More param to add on a href URL.
* @param int<0,1> $fieldrequired 1 if we want to show field as mandatory using the "fieldrequired" CSS.
* @param int<0,3> $notabletag 1=Do not output table tags but output a ':', 2=Do not output table tags and no ':', 3=Do not output table tags but output a ' '
* @param string $paramid Key of parameter for id ('id', 'socid')
* @param string $help Tooltip help
* @return string HTML edit field
@ -624,19 +624,19 @@ class Form
* Show a text and picto with tooltip on text or picto.
* Can be called by an instancied $form->textwithtooltip or by a static call Form::textwithtooltip
*
* @param string $text Text to show
* @param string $htmltext HTML content of tooltip. Must be HTML/UTF8 encoded.
* @param int $tooltipon 1=tooltip on text, 2=tooltip on image, 3=tooltip on both
* @param int $direction -1=image is before, 0=no image, 1=image is after
* @param string $img Html code for image (use img_xxx() function to get it)
* @param string $extracss Add a CSS style to td tags
* @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span
* @param string $incbefore Include code before the text
* @param int $noencodehtmltext Do not encode into html entity the htmltext
* @param string $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key)
* @param int $forcenowrap Force no wrap between text and picto (works with notabs=2 only)
* @return string Code html du tooltip (texte+picto)
* @see textwithpicto() Use textwithpicto() instead of textwithtooltip if you can.
* @param string $text Text to show
* @param string $htmltext HTML content of tooltip. Must be HTML/UTF8 encoded.
* @param int<0,3> $tooltipon 1=tooltip on text, 2=tooltip on image, 3=tooltip on both
* @param int<-1,1> $direction -1=image is before, 0=no image, 1=image is after
* @param string $img Html code for image (use img_xxx() function to get it)
* @param string $extracss Add a CSS style to td tags
* @param int<0,3> $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span
* @param string $incbefore Include code before the text
* @param int<0,1> $noencodehtmltext Do not encode into html entity the htmltext
* @param string $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key)
* @param int<0,1> $forcenowrap Force no wrap between text and picto (works with notabs=2 only)
* @return string Code html du tooltip (texte+picto)
* @see textwithpicto() Use textwithpicto() instead of textwithtooltip if you can.
*/
public function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 3, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0)
{
@ -5645,9 +5645,9 @@ class Form
* @param string $title Title
* @param string $question Question
* @param string $action Action
* @param array<array{name:string,value:string,values:string[],default:string,label:string,type:string,size:string,morecss:string,moreattr:string,style:string,inputko?:int<0,1>}>|string|null $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , 'size'=>, 'morecss'=>, 'moreattr'=>'autofocus' or 'style=...'))
* 'type' can be 'text', 'password', 'checkbox', 'radio', 'date', 'datetime', 'select', 'multiselect', 'morecss',
* 'other', 'onecolumn' or 'hidden'...
* @param array<array{name:string,value:string,values?:string[],default?:string,label:string,type:string,size?:string,morecss?:string,moreattr?:string,style?:string,inputko?:int<0,1>}>|string|null $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , 'size'=>, 'morecss'=>, 'moreattr'=>'autofocus' or 'style=...'))
* 'type' can be 'text', 'password', 'checkbox', 'radio', 'date', 'datetime', 'select', 'multiselect', 'morecss',
* 'other', 'onecolumn' or 'hidden'...
* @param int<0,1>|''|'no'|'yes'|'1'|'0' $selectedchoice '' or 'no', or 'yes' or '1', 1, '0' or 0
* @param int<0,2>|string $useajax 0=No, 1=Yes use Ajax to show the popup, 2=Yes and also submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx
* @param int|string $height Force height of box (0 = auto)

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2008-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -85,7 +86,7 @@ $ecmdir = new EcmDirectory($db);
if ($module == 'ecm') {
// $section should be an int except if it is dir not yet created into EcmDirectory
$result = $ecmdir->fetch($section);
$result = preg_match('/^\d+$/', $section) ? $ecmdir->fetch((int) $section) : 0;
if ($result > 0) {
$relativepath = $ecmdir->getRelativePath();
$upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
@ -199,6 +200,7 @@ if ($action == 'confirm_deletedir' && $confirm == 'yes' && $permissiontoupload)
// Update dirname or description
if ($action == 'update' && !GETPOST('cancel', 'alpha') && $permissiontoadd) {
$error = 0;
$oldlabel = '';
if ($module == 'ecm') {
$oldlabel = $ecmdir->label;

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2008-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -109,10 +110,11 @@ $permissiontodeletedir = $user->hasRight('ecm', 'setup');
//$backtopage = $_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid; // used after a confirm_deletefile into actions_linkedfiles.inc.php
//include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
$relativepath = '';
// Upload file (code similar but different than actions_linkedfiles.inc.php)
if (GETPOST("sendit", 'alphanohtml') && getDolGlobalString('MAIN_UPLOAD_DOC') && $permissiontocreate) {
// Define relativepath and upload_dir
$relativepath = '';
if ($ecmdir->id) {
$relativepath = $ecmdir->getRelativePath();
} else {
@ -277,11 +279,11 @@ if ($action == 'refreshmanual' && $permissiontoread) {
//print $ecmdirtmp->cachenbofdoc."<br>\n";exit;
$id = $ecmdirtmp->create($user);
if ($id > 0) {
$newdirsql = array('id'=>$id,
'id_mere'=>$ecmdirtmp->fk_parent,
'label'=>$ecmdirtmp->label,
'description'=>$ecmdirtmp->description,
'fullrelativename'=>$relativepathmissing);
$newdirsql = array('id' => $id,
'id_mere' => $ecmdirtmp->fk_parent,
'label' => $ecmdirtmp->label,
'description' => $ecmdirtmp->description,
'fullrelativename' => $relativepathmissing);
$sqltree[] = $newdirsql; // We complete fulltree for following loops
//var_dump($sqltree);
$adirwascreated = 1;

View File

@ -3,7 +3,7 @@
* Copyright (C) 2021 Florian Henry <florian.henry@scopen.fr>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -187,7 +187,7 @@ $help_url = 'EN:Module_Event_Organization';
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-eventorganization page-card');
if ($action == 'create') {
$result = $projectstatic->fetch(GETPOST('fk_project'));
$result = $projectstatic->fetch(GETPOSTINT('fk_project'));
} else {
$result = $projectstatic->fetch($object->fk_project);
}
@ -351,7 +351,7 @@ if (!empty($withproject)) {
$htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
print '</td><td class="valuefield">';
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', null, 0, '', 0, '', 'projectid');
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', null, null, '', 0, '', 'projectid');
print "</td></tr>";
print '<tr><td class="valuefield">';
@ -359,7 +359,7 @@ if (!empty($withproject)) {
$htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp");
print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
print '</td><td class="valuefield">';
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', null, 0, '', 0, '', 'projectid');
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', null, null, '', 0, '', 'projectid');
print "</td></tr>";
print '<tr><td class="valuefield">';
@ -377,7 +377,7 @@ if (!empty($withproject)) {
print '<tr><td class="titlefield">';
print $form->editfieldkey($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', '', $projectstatic, $permissiontoadd, 'integer:3', '', 0, 0, 'projectid');
print '</td><td class="valuefield">';
print $form->editfieldval($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', $projectstatic->max_attendees, $projectstatic, $permissiontoadd, 'integer:3', '', null, 0, '', 0, '', 'projectid');
print $form->editfieldval($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', $projectstatic->max_attendees, $projectstatic, $permissiontoadd, 'integer:3', '', null, null, '', 0, '', 'projectid');
print "</td></tr>";
print '<tr><td class="titlefield valignmiddle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';

View File

@ -3,6 +3,7 @@
* Copyright (C) 2021 Florian Henry <florian.henry@scopen.fr>
* Copyright (C) 2023-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -880,7 +881,7 @@ foreach ($object->fields as $key => $val) {
} elseif ($key == 'lang') {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($db);
print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth100imp maxwidth125', 2);
print $formadmin->select_language($search[$key], 'search_lang', 0, array(), 1, 0, 0, 'minwidth100imp maxwidth125', 2);
} else {
print '<input type="text" class="flat maxwidth'.($val['type'] == 'integer' ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
}
@ -1032,7 +1033,7 @@ while ($i < $imaxinloop) {
if (!empty($arrayfields['t.'.$key]['checked'])) {
print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
if (preg_match('/tdoverflow/', $cssforfield) && !is_numeric($object->$key)) {
print ' title="'.dol_escape_htmltag($object->$key).'"';
print ' title="'.dol_escape_htmltag((string) $object->$key).'"';
}
print '>';
if ($key == 'status') {
@ -1040,7 +1041,7 @@ while ($i < $imaxinloop) {
} elseif ($key == 'ref') {
print $object->getNomUrl(1, 0, '', (($projectid > 0) ? 'withproject' : ''));
} else {
print $object->showOutputField($val, $key, $object->$key, '');
print $object->showOutputField($val, $key, (string) $object->$key, '');
}
print '</td>';
if (!$i) {

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -75,6 +75,8 @@ $diroutputmassaction = $conf->eventorganization->dir_output.'/temp/massgeneratio
$hookmanager->initHooks(array('conferenceorboothattendeecard', 'globalcard')); // Note that conf->hooks_modules contains array
$confOrBooth = null;
if ($conf_or_booth_id > 0) {
$confOrBooth = new ConferenceOrBooth($db);
$result = $confOrBooth->fetch($id > 0 ? $id : $conf_or_booth_id);
@ -221,7 +223,7 @@ $help_url = 'EN:Module_Event_Organization';
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-eventorganization page-attendee-card');
$result = $projectstatic->fetch(empty($confOrBooth->fk_project) ? $fk_project : $confOrBooth->fk_project);
$result = $projectstatic->fetch(($confOrBooth === null || empty($confOrBooth->fk_project)) ? $fk_project : $confOrBooth->fk_project);
if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
$projectstatic->fetchComments();
}
@ -357,7 +359,7 @@ if (!empty($withproject)) {
$htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
print '</td><td>';
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', null, 0, '', 0, '', 'projectid');
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', null, null, '', 0, '', 'projectid');
print "</td></tr>";
print '<tr><td>';
@ -365,7 +367,7 @@ if (!empty($withproject)) {
$htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp");
print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
print '</td><td>';
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', null, 0, '', 0, '', 'projectid');
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', null, null, '', 0, '', 'projectid');
print "</td></tr>";
print '<tr><td>';
@ -377,7 +379,7 @@ if (!empty($withproject)) {
print '<tr><td>';
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
print '</td><td>';
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', null, 0, '', 0, '', 'projectid');
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', null, null, '', 0, '', 'projectid');
print "</td></tr>";
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
@ -439,7 +441,7 @@ if (!empty($withproject)) {
}
// Part to create
if ($action == 'create') {
if ($action == 'create' && $confOrBooth !== null) {
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("ConferenceOrBoothAttendee")), '', 'object_'.$object->picto);
@ -484,7 +486,7 @@ if ($action == 'create') {
}
// Part to edit record
if (($id || $ref) && $action == 'edit') {
if (($id || $ref) && $action == 'edit' && $confOrBooth !== null) {
print load_fiche_titre($langs->trans("ConferenceOrBoothAttendee"), '', 'object_'.$object->picto);
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
@ -527,7 +529,7 @@ if (($id || $ref) && $action == 'edit') {
}
// Part to show record
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
if ($confOrBooth !== null && $object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
$object->fetch_optionals();
$moreparam = '';

View File

@ -3,6 +3,7 @@
* Copyright (C) 2021 Florian Henry <florian.henry@scopen.fr>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -564,7 +565,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
$htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', $projectstatic->accept_conference_suggestions ? 1 : 0, $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
print '</td><td>';
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', $projectstatic->accept_conference_suggestions ? 1 : 0, $projectstatic, 0, $typeofdata, '', null, 0, '', 0, '', 'projectid');
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', $projectstatic->accept_conference_suggestions ? 1 : 0, $projectstatic, 0, $typeofdata, '', null, null, '', 0, '', 'projectid');
print "</td></tr>";
print '<tr><td>';
@ -572,39 +573,39 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
$htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp");
print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', $projectstatic->accept_booth_suggestions ? 1 : 0, $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
print '</td><td>';
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', $projectstatic->accept_booth_suggestions ? 1 : 0, $projectstatic, 0, $typeofdata, '', null, 0, '', 0, '', 'projectid');
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', $projectstatic->accept_booth_suggestions ? 1 : 0, $projectstatic, 0, $typeofdata, '', null, null, '', 0, '', 'projectid');
print "</td></tr>";
print '<tr><td>';
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
print '</td><td>';
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', null, 0, '', 0, '', 'projectid');
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfBooth'), $langs->trans("PriceOfBoothHelp")), 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', null, null, '', 0, '', 'projectid');
print "</td></tr>";
print '<tr><td>';
print $form->editfieldkey($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
print '</td><td>';
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', null, 0, '', 0, '', 'projectid');
print $form->editfieldval($form->textwithpicto($langs->trans('PriceOfRegistration'), $langs->trans("PriceOfRegistrationHelp")), 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', null, null, '', 0, '', 'projectid');
print "</td></tr>";
print '<tr><td class="titlefield">';
print $form->editfieldkey($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', '', $projectstatic, $permissiontoadd, 'integer:3', '&withproject=1', 0, 0, 'projectid');
print '</td><td class="valuefield">';
print $form->editfieldval($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', $projectstatic->max_attendees, $projectstatic, $permissiontoadd, 'integer:3', '', null, 0, '&withproject=1', 0, '', 'projectid');
print $form->editfieldval($form->textwithpicto($langs->trans('MaxNbOfAttendees'), ''), 'max_attendees', $projectstatic->max_attendees, $projectstatic, $permissiontoadd, 'integer:3', '', null, null, '&withproject=1', 0, '', 'projectid');
print "</td></tr>";
// Link to ICS for the event
print '<tr><td class="titlefield valignmiddle">'.$langs->trans("EventOrganizationICSLinkProject").'</td><td class="valuefield">';
// Link to ICS for the event
print '<tr><td class="titlefield valignmiddle">'.$langs->trans("EventOrganizationICSLinkProject").'</td><td class="valuefield">';
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
// Show message
$message = '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
$message .= '&exportkey='.urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY', '...'));
$message .= "&project=".$projectid.'&module='.urlencode('project@eventorganization').'&output=file">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').'</a>';
print $message;
print "</td></tr>";
// Show message
$message = '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
$message .= '&exportkey='.urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY', '...'));
$message .= "&project=".$projectid.'&module='.urlencode('project@eventorganization').'&output=file">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').'</a>';
print $message;
print "</td></tr>";
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
// Define $urlwithroot
@ -870,7 +871,7 @@ foreach ($object->fields as $key => $val) {
} elseif ($key == 'lang') {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($db);
print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth100imp maxwidth125', 2);
print $formadmin->select_language($search[$key], 'search_lang', 0, array(), 1, 0, 0, 'minwidth100imp maxwidth125', 2);
} else {
print '<input type="text" class="flat maxwidth'.($val['type'] == 'integer' ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
}
@ -1021,7 +1022,7 @@ while ($i < $imaxinloop) {
if (!empty($arrayfields['t.'.$key]['checked'])) {
print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
if (preg_match('/tdoverflow/', $cssforfield) && !is_numeric($object->$key)) {
print ' title="'.dol_escape_htmltag($object->$key).'"';
print ' title="'.dol_escape_htmltag((string) $object->$key).'"';
}
print '>';
if ($key == 'status') {
@ -1033,7 +1034,7 @@ while ($i < $imaxinloop) {
}
print $object->getNomUrl(1, $optionLink);
} else {
print $object->showOutputField($val, $key, $object->$key, '');
print $object->showOutputField($val, $key, (string) $object->$key, '');
}
print '</td>';
if (!$i) {

View File

@ -14,7 +14,7 @@
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2020 Lenin Rivas <lenin@leninrivas.com>
* Copyright (C) 2022 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -388,7 +388,7 @@ if (empty($reshook)) {
}
// Extrafields
$array_options[$i] = $extrafields->getOptionalsFromPost($object->table_element_line, $i);
$array_options[$i] = $extrafields->getOptionalsFromPost($object->table_element_line, (string) $i);
// Unset extrafield
if (isset($extrafields->attributes[$object->table_element_line]['label']) && is_array($extrafields->attributes[$object->table_element_line]['label'])) {
// Get extra fields
@ -528,7 +528,7 @@ if (empty($reshook)) {
}
} elseif ($action == 'confirm_cancel' && $confirm == 'yes' && $user->hasRight('expedition', 'supprimer')) {
$also_update_stock = (GETPOST('alsoUpdateStock', 'alpha') ? 1 : 0);
$result = $object->cancel(0, $also_update_stock);
$result = $object->cancel(0, (bool) $also_update_stock);
if ($result > 0) {
$result = $object->setStatut(-1);
} else {
@ -536,7 +536,7 @@ if (empty($reshook)) {
}
} elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('expedition', 'supprimer')) {
$also_update_stock = (GETPOST('alsoUpdateStock', 'alpha') ? 1 : 0);
$result = $object->delete($user, 0, $also_update_stock);
$result = $object->delete($user, 0, (bool) $also_update_stock);
if ($result > 0) {
header("Location: ".DOL_URL_ROOT.'/expedition/index.php');
exit;
@ -1035,7 +1035,7 @@ if ($action == 'create') {
print '<tr>';
print '<td>'.$langs->trans("Project").'</td><td colspan="2">';
print img_picto('', 'project', 'class="pictofixedwidth"');
$numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
$numprojet = $formproject->select_projects($soc->id, (string) $projectid, 'projectid', 0);
print ' <a class="paddingleft" href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle"></span></a>';
print '</td>';
print '</tr>';
@ -1081,7 +1081,7 @@ if ($action == 'create') {
print '</td><td colspan="3">';
print img_picto('', 'fa-balance-scale', 'class="pictofixedwidth"');
print '<input name="weight" size="4" value="'.GETPOSTINT('weight').'"> ';
$text = $formproduct->selectMeasuringUnits("weight_units", "weight", GETPOSTINT('weight_units'), 0, 2);
$text = $formproduct->selectMeasuringUnits("weight_units", "weight", (string) GETPOSTINT('weight_units'), 0, 2);
$htmltext = $langs->trans("KeepEmptyForAutoCalculation");
print $form->textwithpicto($text, $htmltext);
print '</td></tr>';
@ -1094,7 +1094,7 @@ if ($action == 'create') {
print ' x <input name="sizeH" size="4" value="'.GETPOSTINT('sizeH').'">';
print ' x <input name="sizeS" size="4" value="'.GETPOSTINT('sizeS').'">';
print ' ';
$text = $formproduct->selectMeasuringUnits("size_units", "size", GETPOSTINT('size_units'), 0, 2);
$text = $formproduct->selectMeasuringUnits("size_units", "size", (string) GETPOSTINT('size_units'), 0, 2);
$htmltext = $langs->trans("KeepEmptyForAutoCalculation");
print $form->textwithpicto($text, $htmltext);
print '</td></tr>';
@ -1277,7 +1277,7 @@ if ($action == 'create') {
$text .= ' - '.(!empty($line->label) ? $line->label : $line->product_label);
$description = ($showdescinproductdesc ? '' : dol_htmlentitiesbr($line->desc));
print $form->textwithtooltip($text, $description, 3, 0, '', $i);
print $form->textwithtooltip($text, $description, 3, 0, '', (string) $i);
// Show range
print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end));
@ -1298,7 +1298,7 @@ if ($action == 'create') {
if (!empty($line->label)) {
$text .= ' <strong>'.$line->label.'</strong>';
print $form->textwithtooltip($text, $line->desc, 3, 0, '', $i);
print $form->textwithtooltip($text, $line->desc, 3, 0, '', (string) $i);
} else {
print $text.' '.nl2br($line->desc);
}
@ -1856,7 +1856,7 @@ if ($action == 'create') {
$expLine->array_options = array_merge($expLine->array_options, $srcLine->array_options);
print $expLine->showOptionals($extrafields, 'edit', array('style' => 'class="drag drop oddeven"', 'colspan' => $colspan), $indiceAsked, '', 1);
print $expLine->showOptionals($extrafields, 'edit', array('style' => 'class="drag drop oddeven"', 'colspan' => $colspan), (string) $indiceAsked, '', '1');
}
}
@ -2003,7 +2003,7 @@ if ($action == 'create') {
if ($action != 'classify') {
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, (string) $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($objectsrc) && !empty($objectsrc->fk_project)) {
$proj = new Project($db);
@ -2107,13 +2107,13 @@ if ($action == 'create') {
print '<input name="id" value="'.$object->id.'" type="hidden">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input id="trueWeight" name="trueWeight" value="'.$object->trueWeight.'" type="text" class="width50 valignmiddle">';
print $formproduct->selectMeasuringUnits("weight_units", "weight", $object->weight_units, 0, 2, 'maxwidth125 valignmiddle');
print $formproduct->selectMeasuringUnits("weight_units", "weight", (string) $object->weight_units, 0, 2, 'maxwidth125 valignmiddle');
print ' <input class="button smallpaddingimp valignmiddle" name="modify" value="'.$langs->trans("Modify").'" type="submit">';
print ' <input class="button button-cancel smallpaddingimp valignmiddle" name="cancel" value="'.$langs->trans("Cancel").'" type="submit">';
print '</form>';
} else {
print $object->trueWeight;
print ($object->trueWeight && $object->weight_units != '') ? ' '.measuringUnitString(0, "weight", $object->weight_units) : '';
print ($object->trueWeight && $object->weight_units != '') ? ' '.measuringUnitString(0, "weight", (string) $object->weight_units) : '';
}
// Calculated
@ -2228,7 +2228,7 @@ if ($action == 'create') {
} else {
if ($object->shipping_method_id > 0) {
// Get code using getLabelFromKey
$code = $langs->getLabelFromKey($db, $object->shipping_method_id, 'c_shipment_mode', 'rowid', 'code');
$code = $langs->getLabelFromKey($db, (string) $object->shipping_method_id, 'c_shipment_mode', 'rowid', 'code');
print $langs->trans("SendingMethod".strtoupper($code));
}
}
@ -2462,7 +2462,7 @@ if ($action == 'create') {
$text = $product_static->getNomUrl(1);
$text .= ' - '.$label;
$description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($lines[$i]->description));
print $form->textwithtooltip($text, $description, 3, 0, '', $i);
print $form->textwithtooltip($text, $description, 3, 0, '', (string) $i);
print_date_range(!empty($lines[$i]->date_start) ? $lines[$i]->date_start : '', !empty($lines[$i]->date_end) ? $lines[$i]->date_end : '');
if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) {
print (!empty($lines[$i]->description) && $lines[$i]->description != $lines[$i]->product) ? '<br>'.dol_htmlentitiesbr($lines[$i]->description) : '';
@ -2478,7 +2478,7 @@ if ($action == 'create') {
if (!empty($lines[$i]->label)) {
$text .= ' <strong>'.$lines[$i]->label.'</strong>';
print $form->textwithtooltip($text, $lines[$i]->description, 3, 0, '', $i);
print $form->textwithtooltip($text, $lines[$i]->description, 3, 0, '', (string) $i);
} else {
print $text.' '.nl2br($lines[$i]->description);
}
@ -2489,7 +2489,7 @@ if ($action == 'create') {
$unit_order = '';
if (getDolGlobalString('PRODUCT_USE_UNITS')) {
$unit_order = measuringUnitString($lines[$i]->fk_unit);
$unit_order = measuringUnitString((int) $lines[$i]->fk_unit);
}
// Qty ordered
@ -2529,7 +2529,7 @@ if ($action == 'create') {
}
}
}
print $form->textwithpicto($qtyalreadysent, $htmltooltip, 1, 'info', '', 0, 3, 'tooltip'.$lines[$i]->id);
print $form->textwithpicto((string) $qtyalreadysent, $htmltooltip, 1, 'info', '', 0, 3, 'tooltip'.$lines[$i]->id);
print '</td>';
}
@ -2738,9 +2738,9 @@ if ($action == 'create') {
// TODO Show all in same line by setting $display_type = 'line'
if ($action == 'editline' && $line->id == $line_id) {
print $lines[$i]->showOptionals($extrafields, 'edit', array('colspan' => $colspan), !empty($indiceAsked) ? $indiceAsked : '', '', 0, 'card');
print $lines[$i]->showOptionals($extrafields, 'edit', array('colspan' => $colspan), !empty($indiceAsked) ? $indiceAsked : '', '', '', 'card');
} else {
print $lines[$i]->showOptionals($extrafields, 'view', array('colspan' => $colspan), !empty($indiceAsked) ? $indiceAsked : '', '', 0, 'card');
print $lines[$i]->showOptionals($extrafields, 'view', array('colspan' => $colspan), !empty($indiceAsked) ? $indiceAsked : '', '', '', 'card');
}
}
}

View File

@ -13,7 +13,7 @@
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2020 Lenin Rivas <lenin@leninrivas.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -306,7 +306,6 @@ class Expedition extends CommonObject
* Closed status
* -> parcel was received by customer / end of process
* prev status : validated or shipment_in_progress
*
*/
const STATUS_CLOSED = 2;
@ -1476,10 +1475,10 @@ class Expedition extends CommonObject
* Delete shipment.
* Warning, do not delete a shipment if a delivery is linked to (with table llx_element_element)
*
* @param User $user User making the deletion
* @param int $notrigger Disable triggers
* @param bool $also_update_stock true if the stock should be increased back (false by default)
* @return int >0 if OK, 0 if deletion done but failed to delete files, <0 if KO
* @param ?User $user User making the deletion
* @param int<0,1> $notrigger Disable triggers
* @param bool $also_update_stock true if the stock should be increased back (false by default)
* @return int >0 if OK, 0 if deletion done but failed to delete files, <0 if KO
*/
public function delete($user = null, $notrigger = 0, $also_update_stock = false)
{
@ -2437,7 +2436,6 @@ class Expedition extends CommonObject
* @param string $labelmovement Label of movement
* @return int Return integer <0 if KO, >0 if OK
* @throws Exception
*
*/
private function manageStockMvtOnEvt($user, $labelmovement = 'ShipmentClassifyClosedInDolibarr')
{

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2023 Christian Foellmann <christian@foellmann.de>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -52,6 +53,7 @@ $id = GETPOSTINT('id');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$typeobject = null;
$object = new Expedition($db);
if ($id > 0 || !empty($ref)) {
$object->fetch($id, $ref);
@ -85,7 +87,7 @@ $result = restrictedArea($user, 'expedition', $object->id, '');
* Actions
*/
$parameters = array('id'=>$id);
$parameters = array('id' => $id);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@ -172,7 +174,7 @@ if ($id > 0 || !empty($ref)) {
if ($action != 'classify') {
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, (string) $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($objectsrc) && !empty($objectsrc->fk_project)) {
$proj = new Project($db);

View File

@ -9,7 +9,7 @@
* Copyright (C) 2017-2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2019-2020 Christophe Battarel <christophe@altairis.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -141,6 +141,7 @@ if ($action == 'updatelines' && $usercancreate) {
$reg = array();
if (preg_match('/^product_.*([0-9]+)_([0-9]+)$/i', $key, $reg)) {
$pos++;
$modebatch = null;
if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) {
$modebatch = "barcode";
} elseif (preg_match('/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg)) { // With batchmode enabled
@ -156,7 +157,7 @@ if ($action == 'updatelines' && $usercancreate) {
$qty = "qty_".$reg[1].'_'.$reg[2];
$ent = "entrepot_".$reg[1].'_'.$reg[2];
$fk_commandedet = "fk_commandedet_".$reg[1].'_'.$reg[2];
$idline = GETPOST("idline_".$reg[1].'_'.$reg[2]);
$idline = GETPOSTINT("idline_".$reg[1].'_'.$reg[2]);
$warehouse_id = GETPOSTINT($ent);
$prod_id = GETPOSTINT($prod);
//$pu = "pu_".$reg[1].'_'.$reg[2]; // This is unit price including discount
@ -245,6 +246,7 @@ if ($action == 'updatelines' && $usercancreate) {
$sqlsearchdet .= " AND batch = '".$db->escape($lot)."'";
$resqlsearchdet = $db->query($sqlsearchdet);
$objsearchdet = null;
if ($resqlsearchdet) {
$objsearchdet = $db->fetch_object($resqlsearchdet);
} else {
@ -384,6 +386,7 @@ $warehouse_static = new Entrepot($db);
$title = $object->ref." - ".$langs->trans('ShipmentDistribution');
$help_url = 'EN:Module_Shipments|FR:Module_Expéditions|ES:M&oacute;dulo_Expediciones|DE:Modul_Lieferungen';
$morejs = array('/expedition/js/lib_dispatch.js.php');
$typeobject = null;
llxHeader('', $title, $help_url, '', 0, 0, $morejs, '', '', 'mod-expedition page-card_dispatch');
@ -459,7 +462,7 @@ if ($object->id > 0 || !empty($object->ref)) {
if ($action != 'classify' && $permissiontoadd) {
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $object->socid : -1), (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($objectsrc) && !empty($objectsrc->fk_project)) {
$proj = new Project($db);
@ -546,6 +549,11 @@ if ($object->id > 0 || !empty($object->ref)) {
$entrepot = new Entrepot($db);
$listwarehouses = $entrepot->list_array(1);
$nbfreeproduct = 0; // Nb of lines of free products/services
$nbproduct = 0; // Nb of predefined product lines to dispatch (already done or not) if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is off (default)
// or nb of line that remain to dispatch if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is on.
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
@ -683,10 +691,6 @@ if ($object->id > 0 || !empty($object->ref)) {
print "</tr>\n";
}
$nbfreeproduct = 0; // Nb of lines of free products/services
$nbproduct = 0; // Nb of predefined product lines to dispatch (already done or not) if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is off (default)
// or nb of line that remain to dispatch if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is on.
$conf->cache['product'] = array();
// Loop on each line of origin order

View File

@ -6,6 +6,7 @@
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -79,6 +80,7 @@ if ($id > 0 || !empty($ref)) {
$object->fetch($id, $ref);
$object->fetch_thirdparty();
$typeobject = null;
if (!empty($object->origin)) {
$typeobject = $object->origin;
$origin = $object->origin;
@ -159,7 +161,7 @@ if ($id > 0 || !empty($ref)) {
if ($action != 'classify') {
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, (string) $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($objectsrc->fk_project)) {
$proj = new Project($db);

View File

@ -6,7 +6,7 @@
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2023 Christophe Battarel <christophe@altairis.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Benjamin Falière <benjamin.faliere@altairis.fr>
* Copyright (C) 2024 Vincent Maury <vmaury@timgroup.fr>
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
@ -557,9 +557,6 @@ if (empty($reshook)) {
if ($search_company) {
$param .= "&search_company=".urlencode($search_company);
}
if ($search_shipping_method_id) {
$param .= "&amp;search_shipping_method_id=".urlencode($search_shipping_method_id);
}
if ($search_tracking) {
$param .= "&search_tracking=".urlencode($search_tracking);
}
@ -1089,7 +1086,7 @@ if ($massaction == 'createbills') {
print $langs->trans('DateInvoice');
print '</td>';
print '<td>';
print $form->selectDate('', '', '', '', '', '', 1, 1);
print $form->selectDate('', '', 0, 0, 0, '', 1, 1);
print '</td>';
print '</tr>';
print '<tr>';
@ -1106,7 +1103,7 @@ if ($massaction == 'createbills') {
print '</td>';
print '<td>';
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
print $form->selectyesno('validate_invoices', 0, 1, 1);
print $form->selectyesno('validate_invoices', 0, 1, true);
$langs->load("errors");
print ' ('.$langs->trans("WarningAutoValNotPossibleWhenStockIsDecreasedOnInvoiceVal").')';
} else {
@ -1152,7 +1149,7 @@ if ($user->hasRight('user', 'user', 'lire')) {
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('LinkedToSpecificUsers');
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"');
$moreforfilter .= $form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter .= $form->select_dolusers($search_user, 'search_user', $tmptitle, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter .= '</div>';
}
// If the user can view prospects other than his'
@ -1190,7 +1187,7 @@ if (!empty($moreforfilter)) {
}
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // @phan-suppress-current-line PhanTypeMismatchArgument
if ($massactionbutton) {
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1); // This also change content of $arrayfields
}
@ -1223,7 +1220,7 @@ if (!empty($arrayfields['e.ref_customer']['checked'])) {
// Thirdparty
if (!empty($arrayfields['s.nom']['checked'])) {
print '<td class="liste_titre left">';
print '<input class="flat" type="text" size="8" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
print '<input class="flat" type="text" size="8" name="search_company" value="'.dol_escape_htmltag((string) $search_company).'">';
print '</td>';
}
// Town
@ -1353,7 +1350,7 @@ if (!empty($arrayfields['e.signed_status']['checked'])) {
// Status billed
if (!empty($arrayfields['e.billed']['checked'])) {
print '<td class="liste_titre maxwidthonsmartphone center">';
print $form->selectyesno('search_billed', $search_billed, 1, 0, 1);
print $form->selectyesno('search_billed', $search_billed, 1, false, 1);
print '</td>';
}
// Action column
@ -1649,7 +1646,7 @@ while ($i < $imaxinloop) {
}
if (!empty($arrayfields['e.fk_shipping_method']['checked'])) {
// Get code using getLabelFromKey
$code = $langs->getLabelFromKey($db, $object->shipping_method_id, 'c_shipment_mode', 'rowid', 'code');
$code = $langs->getLabelFromKey($db, (string) $object->shipping_method_id, 'c_shipment_mode', 'rowid', 'code');
print '<td class="center tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans("SendingMethod".strtoupper($code))).'">';
if ($object->shipping_method_id > 0) {
print $langs->trans("SendingMethod".strtoupper($code));

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -54,6 +55,7 @@ if ($id > 0 || !empty($ref)) {
$object->fetch($id, $ref);
$object->fetch_thirdparty();
$typeobject = null;
if (!empty($object->origin)) {
$typeobject = $object->origin;
$origin = $object->origin;
@ -128,7 +130,7 @@ if ($id > 0 || !empty($ref)) {
if ($action != 'classify') {
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, (string) $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($objectsrc) && !empty($objectsrc->fk_project)) {
$proj = new Project($db);

View File

@ -5,7 +5,7 @@
* Copyright (C) 2012-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2018-2022 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -146,7 +146,7 @@ if (empty($reshook)) {
if ($action == 'setavailability' && $permissiontoadd) {
$object->fetch($id);
$result = $object->availability(GETPOST('availability_id'));
$result = $object->availability(GETPOSTINT('availability_id'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
@ -154,7 +154,7 @@ if (empty($reshook)) {
if ($action == 'setdemandreason' && $permissiontoadd) {
$object->fetch($id);
$result = $object->demand_reason(GETPOST('demand_reason_id'));
$result = $object->demand_reason(GETPOSTINT('demand_reason_id'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
@ -301,7 +301,7 @@ if ($id > 0 || !empty($ref)) {
if ($action != 'classify') {
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
}
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, (string) $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($objectsrc) && !empty($objectsrc->fk_project)) {
$proj = new Project($db);
@ -336,8 +336,8 @@ if ($id > 0 || !empty($ref)) {
print '<tr><td class="titlefield">'.$langs->trans('Discounts').'</td><td colspan="2">';
$absolute_discount = $soc->getAvailableDiscounts('', $filterabsolutediscount);
$absolute_creditnote = $soc->getAvailableDiscounts('', $filtercreditnote);
$absolute_discount = $soc->getAvailableDiscounts(null, $filterabsolutediscount);
$absolute_creditnote = $soc->getAvailableDiscounts(null, $filtercreditnote);
$absolute_discount = price2num($absolute_discount, 'MT');
$absolute_creditnote = price2num($absolute_creditnote, 'MT');
@ -396,9 +396,9 @@ if ($id > 0 || !empty($ref)) {
print '</tr></table>';
print '</td><td colspan="2">';
if ($action == 'editavailability') {
$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'availability_id', 1);
$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'availability_id', 1);
} else {
$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'none', 1);
$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'none', 1);
}
print '</td></tr>';
@ -413,9 +413,9 @@ if ($id > 0 || !empty($ref)) {
print '</tr></table>';
print '</td><td colspan="2">';
if ($action == 'editshippingmethod') {
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, $object->shipping_method_id, 'shipping_method_id', 1);
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
} else {
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, $object->shipping_method_id, 'none');
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'none');
}
print '</td>';
print '</tr>';
@ -453,9 +453,9 @@ if ($id > 0 || !empty($ref)) {
print '</tr></table>';
print '</td><td colspan="2">';
if ($action == 'editdemandreason') {
$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'demand_reason_id', 1);
$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
} else {
$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'none');
$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'none');
}
// Terms of payment
@ -620,6 +620,9 @@ if ($id > 0 || !empty($ref)) {
$sql .= " WHERE cd.fk_commande = ".((int) $object->id);
$sql .= " ORDER BY cd.rang, cd.rowid";
$toBeShipped = array();
$toBeShippedTotal = 0;
//print $sql;
dol_syslog("shipment.php", LOG_DEBUG);
$resql = $db->query($sql);
@ -643,8 +646,6 @@ if ($id > 0 || !empty($ref)) {
print "</tr>\n";
print '</thead>';
$toBeShipped = array();
$toBeShippedTotal = 0;
while ($i < $num) {
$objp = $db->fetch_object($resql);
@ -733,7 +734,7 @@ if ($id > 0 || !empty($ref)) {
$text .= ' - '.$label;
$description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($objp->description)).'<br>';
$description .= $product_static->show_photos('product', $conf->product->multidir_output[$product_static->entity], 1, 1, 0, 0, 0, 80);
print $form->textwithtooltip($text, $description, 3, '', '', $i);
print $form->textwithtooltip($text, $description, 3, '', 0, (string) $i);
// Show range
print_date_range($db->jdate($objp->date_start), $db->jdate($objp->date_end));
@ -754,7 +755,7 @@ if ($id > 0 || !empty($ref)) {
if (!empty($objp->label)) {
$text .= ' <strong>'.$objp->label.'</strong>';
print $form->textwithtooltip($text, $objp->description, 3, '', '', $i);
print $form->textwithtooltip($text, $objp->description, 3, 0, '', (string) $i);
} else {
print $text.' '.nl2br($objp->description);
}

View File

@ -5,7 +5,7 @@
* Copyright (C) 2015-2023 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -234,6 +234,7 @@ if (empty($reshook)) {
// Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd) {
// @phan-suppress-next-line PhanPluginBothLiteralsBinaryOp
if (1 == 0 && !GETPOST('clone_content', 'alpha') && !GETPOST('clone_receivers', 'alpha')) {
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
} else {
@ -1358,7 +1359,7 @@ if (empty($reshook)) {
if (!$error) {
// TODO Use update method of ExpenseReportLine
$result = $object->updateline($rowid, $type_fees_id, $projet_id, $vatrate, $comments, $qty, $value_unit, $date, $id, $fk_c_exp_tax_cat, $fk_ecm_files);
$result = $object->updateline($rowid, $type_fees_id, $projet_id, $vatrate, $comments, (float) $qty, (float) $value_unit, $date, $id, $fk_c_exp_tax_cat, $fk_ecm_files);
if ($result >= 0) {
if ($result > 0) {
// Define output language
@ -1431,6 +1432,7 @@ $paymentexpensereportstatic = new PaymentExpenseReport($db);
$bankaccountstatic = new Account($db);
$ecmfilesstatic = new EcmFiles($db);
$formexpensereport = new FormExpenseReport($db);
$remaintopay = 0;
// Create
if ($action == 'create') {
@ -1474,7 +1476,7 @@ if ($action == 'create') {
if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('expensereport', 'writeall_advance')) {
$include_users = array();
}
$s = $form->select_dolusers($defaultselectuser, "fk_user_author", 0, "", 0, $include_users, '', '0,'.$conf->entity);
$s = $form->select_dolusers($defaultselectuser, "fk_user_author", 0, null, 0, $include_users, '', '0,'.$conf->entity);
print $s;
print '</td>';
print '</tr>';
@ -1495,7 +1497,7 @@ if ($action == 'create') {
if (GETPOSTINT('fk_user_validator') > 0) {
$defaultselectuser = GETPOSTINT('fk_user_validator');
}
$s = $form->select_dolusers($defaultselectuser, "fk_user_validator", 1, "", ((empty($defaultselectuser) || !getDolGlobalString('EXPENSEREPORT_DEFAULT_VALIDATOR_UNCHANGEABLE')) ? 0 : 1), $include_users);
$s = $form->select_dolusers($defaultselectuser, "fk_user_validator", 1, null, ((empty($defaultselectuser) || !getDolGlobalString('EXPENSEREPORT_DEFAULT_VALIDATOR_UNCHANGEABLE')) ? 0 : 1), $include_users);
print $form->textwithpicto($s, $langs->trans("AnyOtherInThisListCanValidate"));
}
print '</td>';
@ -1552,6 +1554,7 @@ if ($action == 'create') {
print '</form>';
} elseif ($id > 0 || $ref) {
$userauthor = null;
$result = $object->fetch($id, $ref);
if ($result > 0) {
@ -1624,7 +1627,7 @@ if ($action == 'create') {
print '<tr>';
print '<td>'.$langs->trans("ModePaiement").'</td>';
print '<td>';
$form->select_types_paiements($object->fk_c_paiement, 'fk_c_paiement');
$form->select_types_paiements((string) $object->fk_c_paiement, 'fk_c_paiement');
print '</td>';
print '</tr>';
}
@ -1634,7 +1637,7 @@ if ($action == 'create') {
print '<td>'.$langs->trans("VALIDATOR").'</td>'; // Approbator
print '<td>';
$include_users = $object->fetch_users_approver_expensereport();
$s = $form->select_dolusers($object->fk_user_validator, "fk_user_validator", 1, "", 0, $include_users);
$s = $form->select_dolusers($object->fk_user_validator, "fk_user_validator", 1, null, 0, $include_users);
print $form->textwithpicto($s, $langs->trans("AnyOtherInThisListCanValidate"));
print '</td>';
print '</tr>';
@ -2225,7 +2228,7 @@ if ($action == 'create') {
print '<td class="right linecolunitttc">'.price($line->value_unit).'</td>';
print '<td class="right linecolqty">'.dol_escape_htmltag($line->qty).'</td>';
print '<td class="right linecolqty">'.dol_escape_htmltag((string) $line->qty).'</td>';
if ($action != 'editline') {
print '<td class="right linecoltotalht">'.price($line->total_ht).'</td>';
@ -2400,7 +2403,7 @@ if ($action == 'create') {
// Select project
if (isModEnabled('project')) {
print '<td>';
$formproject->select_projects(-1, $line->fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300');
$formproject->select_projects(-1, (string) $line->fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300');
print '</td>';
}
@ -2412,7 +2415,7 @@ if ($action == 'create') {
if (getDolGlobalString('MAIN_USE_EXPENSE_IK')) {
print '<td class="fk_c_exp_tax_cat">';
$params = array('fk_expense' => $object->id, 'fk_expense_det' => $line->id, 'date' => $line->date);
print $form->selectExpenseCategories($line->fk_c_exp_tax_cat, 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', $userauthor->default_c_exp_tax_cat, $params);
print $form->selectExpenseCategories($line->fk_c_exp_tax_cat, 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', (string) $userauthor->default_c_exp_tax_cat, $params);
print '</td>';
}
@ -2424,7 +2427,7 @@ if ($action == 'create') {
// VAT
$selectedvat = price2num($line->vatrate).(!empty($line->vat_src_code) ? ' ('.$line->vat_src_code.')' : '');
print '<td class="right">';
print $form->load_tva('vatrate', (GETPOSTISSET("vatrate") ? GETPOST("vatrate") : $selectedvat), $mysoc, '', 0, 0, '', false, 1, 2);
print $form->load_tva('vatrate', (GETPOSTISSET("vatrate") ? GETPOST("vatrate") : $selectedvat), $mysoc, null, 0, 0, '', false, 1, 2);
print '</td>';
// Unit price
@ -2439,7 +2442,7 @@ if ($action == 'create') {
// Quantity
print '<td class="right">';
print '<input type="text" min="0" class="input_qty right maxwidth50" name="qty" value="'.dol_escape_htmltag($line->qty).'" />'; // We must be able to enter decimal qty
print '<input type="text" min="0" class="input_qty right maxwidth50" name="qty" value="'.dol_escape_htmltag((string) $line->qty).'" />'; // We must be able to enter decimal qty
print '</td>';
//print '<td class="right">'.$langs->trans('AmountHT').'</td>';
@ -2455,7 +2458,7 @@ if ($action == 'create') {
print '<td>';
print '<input type="hidden" name="rowid" value="'.$line->rowid.'">';
print $form->buttonsSaveCancel('Save', 'Cancel', array(), 0, 'small');
print $form->buttonsSaveCancel('Save', 'Cancel', array(), false, 'small');
print '</td>';
print '</tr>';
@ -2582,7 +2585,7 @@ if ($action == 'create') {
// Select project
if (isModEnabled('project')) {
print '<td class="inputproject">';
$formproject->select_projects(-1, !empty($fk_project) ? $fk_project : 0, 'fk_project', 0, 0, $projectRequired ? 0 : 1, -1, 0, 0, 0, '', 0, 0, 'maxwidth300');
$formproject->select_projects(-1, !empty($fk_project) ? (string) $fk_project : '0', 'fk_project', 0, 0, $projectRequired ? 0 : 1, -1, 0, 0, 0, '', 0, 0, 'maxwidth300');
print '</td>';
}
@ -2610,7 +2613,7 @@ if ($action == 'create') {
// If option to have no default VAT on expense report is on, we force MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS
$conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS = 'none';
}
print $form->load_tva('vatrate', (!empty($vatrate) ? $vatrate : $defaultvat), $mysoc, '', 0, 0, '', false, 1);
print $form->load_tva('vatrate', (!empty($vatrate) ? $vatrate : $defaultvat), $mysoc, null, 0, 0, '', false, 1);
print '</td>';
// Unit price net
@ -2638,7 +2641,7 @@ if ($action == 'create') {
}
print '<td class="center inputbuttons">';
print $form->buttonsSaveCancel("Add", '', '', 1, 'reposition');
print $form->buttonsSaveCancel("Add", '', array(), true, 'reposition');
print '</td>';
print '</tr>';
@ -2938,7 +2941,7 @@ if ($action != 'presend') {
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'expensereport', null);
$somethingshown = $formactions->showactions($object, 'expensereport', 0);
print '</div></div>';
}