Qual: Fix phan notices (htdocs/compta) (#33427)

This commit is contained in:
MDW 2025-03-12 20:41:50 +01:00 committed by GitHub
parent 890b24b17a
commit d64298f6c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 113 additions and 131 deletions

View file

@ -9,14 +9,14 @@
*/
return [
// # Issue statistics:
// PhanTypeMismatchArgument : 660+ occurrences
// PhanTypeMismatchArgument : 600+ occurrences
// PhanUndeclaredProperty : 460+ occurrences
// PhanTypeMismatchArgumentNullable : 200+ occurrences
// PhanTypeMismatchArgumentNullable : 190+ occurrences
// PhanTypeMismatchProperty : 140+ occurrences
// PhanUndeclaredGlobalVariable : 100+ occurrences
// PhanTypeExpectedObjectPropAccess : 20+ occurrences
// PhanTypeInvalidDimOffset : 20+ occurrences
// PhanTypeMismatchDimFetch : 20+ occurrences
// PhanTypeMismatchDimFetch : 15+ occurrences
// PhanUndeclaredConstant : 15+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 10+ occurrences
// PhanUndeclaredMethod : 9 occurrences
@ -28,13 +28,10 @@ return [
// PhanPluginUndeclaredVariableIsset : 5 occurrences
// PhanParamTooMany : 4 occurrences
// PhanPluginDuplicateArrayKey : 4 occurrences
// PhanPluginSuspiciousParamPosition : 2 occurrences
// PhanTypeMismatchDimAssignment : 2 occurrences
// PhanTypeMismatchReturn : 2 occurrences
// PhanTypeSuspiciousStringExpression : 2 occurrences
// PhanPluginBothLiteralsBinaryOp : 1 occurrence
// PhanPluginDuplicateExpressionAssignmentOperation : 1 occurrence
// PhanPluginUnknownArrayPropertyType : 1 occurrence
// PhanPossiblyUndeclaredVariable : 1 occurrence
// PhanTypeExpectedObjectPropAccessButGotNull : 1 occurrence
@ -93,7 +90,6 @@ return [
'htdocs/admin/mails_ticket.php' => ['PhanTypeMismatchArgumentNullable'],
'htdocs/admin/menus/index.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/multicurrency.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/pdf_other.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/receiptprinter.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/system/filecheck.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/system/modules.php' => ['PhanTypeMismatchArgument'],
@ -132,27 +128,16 @@ return [
'htdocs/categories/photos.php' => ['PhanTypeMismatchArgument'],
'htdocs/categories/viewcat.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
'htdocs/collab/index.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/action/card.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
'htdocs/comm/action/class/actioncomm.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
'htdocs/comm/action/class/cactioncomm.class.php' => ['PhanPluginUnknownArrayPropertyType'],
'htdocs/comm/action/document.php' => ['PhanTypeMismatchArgument'],
'htdocs/comm/action/index.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty'],
'htdocs/comm/action/info.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
'htdocs/comm/action/list.php' => ['PhanTypeMismatchArgument'],
'htdocs/comm/action/index.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
'htdocs/comm/action/info.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/action/pertype.php' => ['PhanTypeComparisonFromArray', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchDimFetch'],
'htdocs/comm/action/peruser.php' => ['PhanTypeComparisonFromArray', 'PhanTypeMismatchArgument'],
'htdocs/comm/action/rapport/index.php' => ['PhanTypeMismatchArgument'],
'htdocs/comm/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
'htdocs/comm/mailing/card.php' => ['PhanPluginSuspiciousParamPosition', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
'htdocs/comm/mailing/cibles.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
'htdocs/comm/mailing/class/advtargetemailing.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
'htdocs/comm/card.php' => ['PhanTypeMismatchArgument'],
'htdocs/comm/mailing/cibles.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/mailing/index.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/multiprix.php' => ['PhanTypeMismatchArgument'],
'htdocs/comm/propal/card.php' => ['PhanTypeMismatchProperty'],
'htdocs/comm/propal/list.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/propal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/remise.php' => ['PhanTypeMismatchArgument'],
'htdocs/comm/remx.php' => ['PhanTypeMismatchArgument'],
'htdocs/commande/card.php' => ['PhanTypeMismatchArgument'],
'htdocs/commande/class/api_orders.class.php' => ['PhanTypeMismatchArgument'],
'htdocs/commande/class/commande.class.php' => ['PhanUndeclaredProperty'],

View file

@ -285,6 +285,7 @@ if (empty($reshook) && $action == 'classin' && ($user->hasRight('agenda', 'allac
// Action clone object
if (empty($reshook) && $action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) {
// @phan-suppress-next-line PhanPluginBothLiteralsBinaryOp
if (1 == 0 && !GETPOST('clone_content') && !GETPOST('clone_receivers')) {
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
} else {
@ -859,7 +860,7 @@ if (empty($reshook) && $action == 'update' && $usercancreate) {
$object->fetch($id);
$object->fetch_optionals();
$object->fetch_userassigned();
$object->oldcopy = dol_clone($object, 2);
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
// Clean parameters
if ($fulldayevent) {
@ -1138,7 +1139,7 @@ if (empty($reshook) && $action == 'confirm_delete' && GETPOST("confirm") == 'yes
$object->fetch($id);
$object->fetch_optionals();
$object->fetch_userassigned();
$object->oldcopy = dol_clone($object, 2);
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
if ($user->hasRight('agenda', 'myactions', 'delete')
|| $user->hasRight('agenda', 'allactions', 'delete')) {
@ -1547,7 +1548,7 @@ if ($action == 'create') {
}
}
print '<!-- list of user to assign --><div class="assignedtouser">';
print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, array(), 0, '', array(), 0, 0, 0, 'u.statut:<>:0', 1, $listofuserid, $listofcontactid, $listofotherid);
print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, array(), 0, '', array(), '0', 0, 0, 'u.statut:<>:0', 1, $listofuserid, $listofcontactid, $listofotherid);
print '</div>';
print '</td></tr>';
@ -1588,7 +1589,7 @@ if ($action == 'create') {
}
}
print '<div class="assignedtoresource">';
print $form->select_dolresources_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtoresource', 1, array(), 0, '', array(), 0, 0, 0, 'AND u.statut != 0', 1, $listofresourceid);
print $form->select_dolresources_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtoresource', 1, array(), 0, '', array(), '0', 0, 0, 'AND u.statut != 0', 1, $listofresourceid);
print '</div>';
print '</td></tr>';
}
@ -2169,7 +2170,7 @@ if ($id > 0) {
print '<tr><td class="tdtop nowrap fieldrequired">'.$langs->trans("ActionAssignedTo").'</td><td colspan="3">';
print '<div class="assignedtouser">';
print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, array(), 0, '', array(), 0, 0, 0, 'u.statut:<>:0', 1, $listofuserid, $listofcontactid, $listofotherid, $caneditdateorowner);
print $form->select_dolusers_forevent(($action == 'create' ? 'add' : 'update'), 'assignedtouser', 1, array(), 0, '', array(), '0', 0, 0, 'u.statut:<>:0', 1, $listofuserid, $listofcontactid, $listofotherid, (int) $caneditdateorowner);
print '</div>';
/*if (in_array($user->id,array_keys($listofuserid)))
{
@ -2187,7 +2188,7 @@ if ($id > 0) {
// Status
print '<tr><td class="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="3">';
$percent = GETPOSTISSET("percentage") ? GETPOSTINT("percentage") : $object->percentage;
$formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200');
$formactions->form_select_status_action('formaction', (string) $percent, 1, 'complete', 0, 0, 'maxwidth200');
print '</td></tr>';
// Tags-Categories
@ -2384,7 +2385,7 @@ if ($id > 0) {
// Mail Model
if (getDolGlobalString('AGENDA_REMINDER_EMAIL')) {
print '<tr '.$hide.'><td class="titlefieldcreate nowrap">'.$langs->trans("EMailTemplates").'</td><td colspan="3">';
print $form->selectModelMail('actioncommsend', 'actioncomm_send', 1, 1, $actionCommReminder->fk_email_template);
print $form->selectModelMail('actioncommsend', 'actioncomm_send', 1, 1, (string) $actionCommReminder->fk_email_template);
print '</td></tr>';
}
@ -2530,7 +2531,7 @@ if ($id > 0) {
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, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($object->fk_project)) {
$proj = new Project($db);
@ -2648,7 +2649,7 @@ if ($id > 0) {
$listofcontactid = array(); // not used yet
$listofotherid = array(); // not used yet
print '<div class="assignedtouser">';
print $form->select_dolusers_forevent('view', 'assignedtouser', 1, array(), 0, '', array(), 0, 0, 0, '', ($object->datep != $object->datef) ? 1 : 0, $listofuserid, $listofcontactid, $listofotherid);
print $form->select_dolusers_forevent('view', 'assignedtouser', 1, array(), 0, '', array(), '0', 0, 0, '', ($object->datep != $object->datef) ? 1 : 0, $listofuserid, $listofcontactid, $listofotherid);
print '</div>';
/*
if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid)))
@ -2861,7 +2862,7 @@ if ($id > 0) {
$delallowed = $user->hasRight('agenda', 'myactions', 'create');
print $formfile->showdocuments('actions', $object->id, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 0, 0, '', '', '', $langs->getDefaultLang());
print $formfile->showdocuments('actions', (string) $object->id, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 0, 0, '', '', '', $langs->getDefaultLang());
print '</div><div class="fichehalfright">';

View file

@ -6,7 +6,7 @@
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018-2025 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>
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -72,7 +72,7 @@ class ActionComm extends CommonObject
public $id;
/**
* @var string Id of the event. Use $id as possible
* @var string Id of the event. Use as possible
*/
public $ref;
@ -382,7 +382,7 @@ class ActionComm extends CommonObject
public $recurid;
/** @var string Rule of recurring */
public $recurrule;
/** @var string Repeat until this date */
/** @var int|'' Repeat until this date */
public $recurdateend;
/** @var int Duration of phone call when the event is a phone call */
@ -579,7 +579,7 @@ class ActionComm extends CommonObject
$sql .= "'".$this->db->idate($now)."', "; // date creation
$sql .= "'".$this->db->idate($this->datep)."', "; // date start event
$sql .= (strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : "null").", ";
$sql .= ((isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '') ? "'".$this->db->escape($this->durationp)."'" : "null").", "; // deprecated
$sql .= ((isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '') ? "'".$this->db->escape((string) $this->durationp)."'" : "null").", "; // deprecated
$sql .= (isset($this->type_id) ? $this->type_id : "null").",";
$sql .= ($code ? ("'".$this->db->escape($code)."'") : "null").", ";
$sql .= (!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "null").", ";
@ -590,14 +590,14 @@ class ActionComm extends CommonObject
$sql .= (isset($user->id) && $user->id > 0 ? $user->id : "null").", ";
$sql .= ($userownerid > 0 ? $userownerid : "null").", ";
$sql .= "'".$this->db->escape($this->label)."', ";
$sql .= "'".$this->db->escape($this->percentage)."', ";
$sql .= "'".$this->db->escape($this->priority)."', ";
$sql .= "'".$this->db->escape($this->fulldayevent)."', ";
$sql .= "'".$this->db->escape((string) $this->percentage)."', ";
$sql .= "'".$this->db->escape((string) $this->priority)."', ";
$sql .= "'".$this->db->escape((string) $this->fulldayevent)."', ";
$sql .= "'".$this->db->escape($this->location)."', ";
$sql .= "'".$this->db->escape($this->transparency)."', ";
$sql .= "'".$this->db->escape((string) $this->transparency)."', ";
$sql .= (!empty($this->elementid) ? ((int) $this->elementid) : "null").", ";
$sql .= (!empty($this->elementtype) ? "'".$this->db->escape($this->elementtype)."'" : "null").", ";
$sql .= (!empty($this->fk_bookcal_calendar) ? "'".$this->db->escape($this->fk_bookcal_calendar)."'" : "null").", ";
$sql .= (!empty($this->fk_bookcal_calendar) ? "'".$this->db->escape((string) $this->fk_bookcal_calendar)."'" : "null").", ";
$sql .= ((int) $conf->entity).",";
$sql .= (!empty($extraparams) ? "'".$this->db->escape($extraparams)."'" : "null").", ";
// Fields emails
@ -1184,21 +1184,21 @@ class ActionComm extends CommonObject
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm";
$sql .= " SET percent = '".$this->db->escape($this->percentage)."'";
$sql .= " SET percent = '".$this->db->escape((string) $this->percentage)."'";
$sql .= ", fk_action = ".(int) $this->type_id;
$sql .= ", code = " . ($code ? "'".$this->db->escape($code)."'" : "null");
$sql .= ", label = ".($this->label ? "'".$this->db->escape($this->label)."'" : "null");
$sql .= ", datep = ".(strval($this->datep) != '' ? "'".$this->db->idate($this->datep)."'" : 'null');
$sql .= ", datep2 = ".(strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : 'null');
$sql .= ", durationp = ".(isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '' ? "'".$this->db->escape($this->durationp)."'" : "null"); // deprecated
$sql .= ", durationp = ".(isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '' ? "'".$this->db->escape((string) $this->durationp)."'" : "null"); // deprecated
$sql .= ", note = '".$this->db->escape($this->note_private)."'";
$sql .= ", fk_project =".($this->fk_project > 0 ? ((int) $this->fk_project) : "null");
$sql .= ", fk_soc =".($socid > 0 ? ((int) $socid) : "null");
$sql .= ", fk_contact =".($contactid > 0 ? ((int) $contactid) : "null");
$sql .= ", priority = '".$this->db->escape($this->priority)."'";
$sql .= ", fulldayevent = '".$this->db->escape($this->fulldayevent)."'";
$sql .= ", priority = '".$this->db->escape((string) $this->priority)."'";
$sql .= ", fulldayevent = '".$this->db->escape((string) $this->fulldayevent)."'";
$sql .= ", location = ".($this->location ? "'".$this->db->escape($this->location)."'" : "null");
$sql .= ", transparency = '".$this->db->escape($this->transparency)."'";
$sql .= ", transparency = '".$this->db->escape((string) $this->transparency)."'";
$sql .= ", fk_user_mod = ".((int) $user->id);
$sql .= ", fk_user_action = ".($userownerid > 0 ? ((int) $userownerid) : "null");
if (!empty($this->fk_element)) {
@ -2761,7 +2761,7 @@ class ActionComm extends CommonObject
$errors_to = getDolGlobalString('MAIN_MAIL_ERRORS_TO');
// Mail Creation
$cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, array(), array(), array(), '', "", 0, 1, $errors_to, '', '', '', '', '');
$cMailFile = new CMailFile($sendTopic, (string) $to, $from, $sendContent, array(), array(), array(), '', "", 0, 1, $errors_to, '', '', '', '', '');
// Sending Mail
if ($cMailFile->sendfile()) {

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* 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
@ -81,12 +81,6 @@ class CActionComm
*/
public $picto;
/**
* @var array array of type_actions // TODO: Remove or explain
*/
public $type_actions = array();
/**
* @var array{id:array<int,string>,code:array<string,string>,all:array<string,array{id:string,label:string,type:string,color:mixed,picto:string}>} Used to return value by some methods
*/

View file

@ -6,7 +6,7 @@
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* 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
@ -208,7 +208,7 @@ if ($object->id > 0) {
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, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($object->fk_project)) {
$proj = new Project($db);
@ -299,7 +299,7 @@ if ($object->id > 0) {
$listofcontactid = array(); // not used yet
$listofotherid = array(); // not used yet
print '<div class="assignedtouser">';
print $form->select_dolusers_forevent('view', 'assignedtouser', 1, array(), 0, '', array(), 0, 0, 0, '', ($object->datep != $object->datef) ? 1 : 0, $listofuserid, $listofcontactid, $listofotherid);
print $form->select_dolusers_forevent('view', 'assignedtouser', 1, array(), 0, '', array(), '0', 0, 0, '', ($object->datep != $object->datef) ? 1 : 0, $listofuserid, $listofcontactid, $listofotherid);
print '</div>';
/*if (in_array($user->id,array_keys($listofuserid)))
{

View file

@ -109,7 +109,7 @@ $mode = GETPOST('mode', 'aZ09');
if (empty($mode) && preg_match('/show_/', $action)) {
$mode = $action; // For backward compatibility
}
$resourceid = GETPOST("search_resourceid", 'int');
$resourceid = GETPOSTINT("search_resourceid");
$year = GETPOSTINT("year") ? GETPOSTINT("year") : date("Y");
$month = GETPOSTINT("month") ? GETPOSTINT("month") : date("m");
$week = GETPOSTINT("week") ? GETPOSTINT("week") : date("W");
@ -920,7 +920,7 @@ if ($resql) {
$event = new ActionComm($db);
$event->id = $obj->id;
$event->ref = $event->id;
$event->ref = (string) $event->id;
$event->fulldayevent = $obj->fulldayevent;
@ -1076,7 +1076,7 @@ if ($showbirthday) {
$event = new ActionComm($db);
$event->id = $obj->rowid; // We put contact id in action id for birthdays events
$event->ref = $event->id;
$event->ref = (string) $event->id;
$datebirth = dol_stringtotime($obj->birthday, 1);
//print 'ee'.$obj->birthday.'-'.$datebirth;
@ -1159,7 +1159,7 @@ if ($user->hasRight("holiday", "read")) {
// Need the id of the leave object for link to it
$event->id = $obj->rowid;
$event->ref = $event->id;
$event->ref = (string) $event->id;
$event->type_code = 'HOLIDAY';
$event->type_label = '';
@ -1420,7 +1420,7 @@ if (count($listofextcals)) {
if ($addevent) {
$event->id = $icalevent['UID'];
$event->ref = $event->id;
$event->ref = (string) $event->id;
$userId = $userstatic->findUserIdByEmail($namecal);
if (!empty($userId) && $userId > 0) {
$event->userassigned[$userId] = $userId;
@ -1861,7 +1861,7 @@ $db->close();
* @param int $showinfo Add extended information (used by day and week view)
* @param int $minheight Minimum height for each event. 60px by default.
* @param int<-1,1> $nonew 0=Add "new entry button", 1=No "new entry button", -1=Only "new entry button"
* @param array{}|array{0:array{0:int,1:int,2:int},1:array{0:int,1:int,2:int},2:array{0:int,1:int,2:int}} $bookcalcalendarsarray Used for Bookcal module array of calendar of bookcal
* @param array{}|array{help:'toreporttype',0:array{0:int,1:int,2:int},1:array{0:int,1:int,2:int},2:array{0:int,1:int,2:int}} $bookcalcalendarsarray Used for Bookcal module array of calendar of bookcal
* @return void
*/
function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint = 0, $maxnbofchar = 16, $newparam = '', $showinfo = 0, $minheight = 60, $nonew = 0, $bookcalcalendarsarray = array())

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2023 Laurent Destailleur <eldy@users.sourceforge.net>
* 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
@ -130,7 +131,7 @@ if (isModEnabled('project')) {
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, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
} else {
if (!empty($object->fk_project)) {
$proj = new Project($db);

View file

@ -6,7 +6,7 @@
* Copyright (C) 2017 Open-DSI <support@open-dsi.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
*
* This program is free software; you can redistribute it and/or modify
@ -167,26 +167,25 @@ if (!$user->hasRight('agenda', 'allactions', 'read') || $filter == 'mine') { //
}
$arrayfields = array(
'a.id' => array('label' => "Ref", 'checked' => 1),
'owner' => array('label' => "Owner", 'checked' => 1),
'c.libelle' => array('label' => "Type", 'checked' => 1),
'a.label' => array('label' => "Title", 'checked' => 1),
'a.note' => array('label' => 'Description', 'checked' => 0),
'a.datep' => array('label' => "DateStart", 'checked' => 1),
'a.datep2' => array('label' => "DateEnd", 'checked' => 1),
's.nom' => array('label' => "ThirdParty", 'checked' => 1),
'a.fk_contact' => array('label' => "Contact", 'checked' => 0),
'a.fk_element' => array('label' => "LinkedObject", 'checked' => 1, 'enabled' => (getDolGlobalString('AGENDA_SHOW_LINKED_OBJECT'))),
'a.datec' => array('label' => 'DateCreation', 'checked' => 0, 'position' => 510),
'a.tms' => array('label' => 'DateModification', 'checked' => 0, 'position' => 520),
'a.percent' => array('label' => "Status", 'checked' => 1, 'position' => 1000)
'a.id' => array('label' => "Ref", 'checked' => '1'),
'owner' => array('label' => "Owner", 'checked' => '1'),
'c.libelle' => array('label' => "Type", 'checked' => '1'),
'a.label' => array('label' => "Title", 'checked' => '1'),
'a.note' => array('label' => 'Description', 'checked' => '0'),
'a.datep' => array('label' => "DateStart", 'checked' => '1'),
'a.datep2' => array('label' => "DateEnd", 'checked' => '1'),
's.nom' => array('label' => "ThirdParty", 'checked' => '1'),
'a.fk_contact' => array('label' => "Contact", 'checked' => '0'),
'a.fk_element' => array('label' => "LinkedObject", 'checked' => '1', 'enabled' => (getDolGlobalString('AGENDA_SHOW_LINKED_OBJECT'))),
'a.datec' => array('label' => 'DateCreation', 'checked' => '0', 'position' => 510),
'a.tms' => array('label' => 'DateModification', 'checked' => '0', 'position' => 520),
'a.percent' => array('label' => "Status", 'checked' => '1', 'position' => 1000)
);
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
$result = restrictedArea($user, 'agenda', 0, '', 'myactions');
if ($user->socid && $socid) {

View file

@ -821,7 +821,7 @@ if ($search_categ_cus != -1) {
if ($search_categ_cus == -2) {
$sql .= " AND NOT EXISTS (SELECT ca.fk_actioncomm FROM ".MAIN_DB_PREFIX."categorie_actioncomm as ca WHERE ca.fk_actioncomm = a.id)";
} elseif ($search_categ_cus > 0) {
$sql .= " AND EXISTS (SELECT ca.fk_actioncomm FROM ".MAIN_DB_PREFIX."categorie_actioncomm as ca WHERE ca.fk_actioncomm = a.id AND ca.fk_categorie IN (".$db->sanitize($search_categ_cus)."))";
$sql .= " AND EXISTS (SELECT ca.fk_actioncomm FROM ".MAIN_DB_PREFIX."categorie_actioncomm as ca WHERE ca.fk_actioncomm = a.id AND ca.fk_categorie IN (".$db->sanitize((string) $search_categ_cus)."))";
}
}
// Sort on date

View file

@ -11,7 +11,7 @@
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2020 Open-Dsi <support@open-dsi.fr>
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.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
@ -219,7 +219,7 @@ if (empty($reshook)) {
// Transport mode
if ($action == 'settransportmode' && $user->hasRight('societe', 'creer')) {
$object->fetch($id);
$result = $object->setTransportMode(GETPOST('transport_mode_id', 'alpha'));
$result = $object->setTransportMode(GETPOSTINT('transport_mode_id'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
@ -304,7 +304,7 @@ if (empty($reshook)) {
if ($action == 'update_extras' && $user->hasRight('societe', 'creer')) {
$object->fetch($id);
$object->oldcopy = dol_clone($object, 2);
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
// Fill array 'array_options' with data from update form
$ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
@ -470,9 +470,9 @@ if ($object->id > 0) {
print '</tr></table>';
print '</td><td>';
if ($action == 'editconditions') {
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id', 1, '', 1, $object->deposit_percent);
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 1, '', 1, $object->deposit_percent);
} else {
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->cond_reglement_id, 'none', 0, '', 1, $object->deposit_percent);
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, (string) $object->cond_reglement_id, 'none', 0, '', 1, $object->deposit_percent);
}
print "</td>";
print '</tr>';
@ -488,9 +488,9 @@ if ($object->id > 0) {
print '</tr></table>';
print '</td><td>';
if ($action == 'editmode') {
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
} else {
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->mode_reglement_id, 'none');
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, (string) $object->mode_reglement_id, 'none');
}
print "</td>";
print '</tr>';
@ -507,9 +507,9 @@ if ($object->id > 0) {
print '</tr></table>';
print '</td><td>';
if ($action == 'editbankaccount') {
$form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_account, 'fk_account', 1);
$form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id, (string) $object->fk_account, 'fk_account', 1);
} else {
$form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_account, 'none');
$form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id, (string) $object->fk_account, 'none');
}
print "</td>";
print '</tr>';
@ -634,9 +634,9 @@ if ($object->id > 0) {
print '</tr></table>';
print '</td><td>';
if ($action == 'editshipping') {
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->shipping_method_id, 'shipping_method_id', 1);
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?socid='.$object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
} else {
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->shipping_method_id, 'none');
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?socid='.$object->id, (string) $object->shipping_method_id, 'none');
}
print "</td>";
print '</tr>';
@ -717,7 +717,7 @@ if ($object->id > 0) {
print '</tr></table>';
print '</td><td>';
if ($action == 'editlevel') {
$formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_prospectlevel, 'prospect_level_id', 1);
$formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$object->id, (int) $object->fk_prospectlevel, 'prospect_level_id', 1);
} else {
print $object->getLibProspLevel();
}

View file

@ -3,7 +3,7 @@
* Copyright (C) 2005-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2021 Waël Almoman <info@almoman.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
@ -153,7 +153,7 @@ if (empty($reshook)) {
if (!GETPOST("clone_content", 'alpha') && !GETPOST("clone_receivers", 'alpha')) {
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
} else {
$result = $object->createFromClone($user, $object->id, GETPOST("clone_content", 'alpha'), GETPOST("clone_receivers", 'alpha'));
$result = $object->createFromClone($user, $object->id, GETPOSTINT("clone_content"), GETPOSTINT("clone_receivers"));
if ($result > 0) {
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
exit;
@ -452,14 +452,14 @@ if (empty($reshook)) {
// Loop finished, set global statut of mail
if ($nbko > 0) {
$statut = 2; // Status 'sent partially' (because at least one error)
setEventMessages($langs->transnoentitiesnoconv("EMailSentToNRecipients", $nbok), null, 'mesgs');
setEventMessages($langs->transnoentitiesnoconv("EMailSentToNRecipients", (string) $nbok), null, 'mesgs');
} else {
if ($nbok >= $num) {
$statut = 3; // Send to everybody
} else {
$statut = 2; // Status 'sent partially' (because not send to everybody)
}
setEventMessages($langs->transnoentitiesnoconv("EMailSentToNRecipients", $nbok), null, 'mesgs');
setEventMessages($langs->transnoentitiesnoconv("EMailSentToNRecipients", (string) $nbok), null, 'mesgs');
}
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing SET statut=".((int) $statut)." WHERE rowid = ".((int) $object->id);
@ -640,18 +640,18 @@ if (empty($reshook)) {
}
// Action of file remove
if (GETPOST("removedfile") && $permissiontocreate) {
if (GETPOSTINT("removedfile") && $permissiontocreate) {
$upload_dir = $conf->mailing->dir_output."/".get_exdir($object->id, 2, 0, 1, $object, 'mailing');
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
dol_remove_file_process(GETPOST('removedfile'), 0, 0); // We really delete file linked to mailing
dol_remove_file_process(GETPOSTINT('removedfile'), 0, 0); // We really delete file linked to mailing
$action = "edit";
}
// Action of emailing update
if ($action == 'update' && !GETPOST("removedfile") && !$cancel && $permissiontocreate) {
if ($action == 'update' && !GETPOSTINT("removedfile") && !$cancel && $permissiontocreate) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$isupload = 0;
@ -1030,7 +1030,7 @@ if ($action == 'create') { // aaa
// From
print '<tr><td class="titlefield">';
print $form->editfieldkey("MailFrom", 'email_from', $object->email_from, $object, $user->hasRight('mailing', 'creer') && $object->status < $object::STATUS_SENTCOMPLETELY, 'string');
print $form->editfieldkey("MailFrom", 'email_from', $object->email_from, $object, (int) ($user->hasRight('mailing', 'creer') && $object->status < $object::STATUS_SENTCOMPLETELY), 'string');
print '</td><td>';
print $form->editfieldval("MailFrom", 'email_from', $object->email_from, $object, $user->hasRight('mailing', 'creer') && $object->status < $object::STATUS_SENTCOMPLETELY, 'string');
$email = CMailFile::getValidAddress($object->email_from, 2);
@ -1047,13 +1047,13 @@ if ($action == 'create') { // aaa
// Errors to
if ($object->messtype != 'sms') {
print '<tr><td>';
print $form->editfieldkey("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->hasRight('mailing', 'creer') && $object->status < $object::STATUS_SENTCOMPLETELY, 'string');
print $form->editfieldkey("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, (int) ($user->hasRight('mailing', 'creer') && $object->status < $object::STATUS_SENTCOMPLETELY), 'string');
print '</td><td>';
print $form->editfieldval("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->hasRight('mailing', 'creer') && $object->status < $object::STATUS_SENTCOMPLETELY, 'string');
$emailarray = CMailFile::getArrayAddress($object->email_errorsto);
foreach ($emailarray as $email => $name) {
if ($name != $email) {
print dol_escape_htmltag($name).' &lt;'.$email;
print dol_escape_htmltag((string) $name).' &lt;'.$email;
print '&gt;';
if ($email && !isValidEmail($email)) {
$langs->load("errors");
@ -1072,7 +1072,7 @@ if ($action == 'create') { // aaa
// Reply to
if ($object->messtype != 'sms') {
print '<tr><td>';
print $form->editfieldkey("MailReply", 'email_replyto', $object->email_replyto, $object, $user->hasRight('mailing', 'creer') && $object->status < $object::STATUS_SENTCOMPLETELY, 'string');
print $form->editfieldkey("MailReply", 'email_replyto', $object->email_replyto, $object, (int) ($user->hasRight('mailing', 'creer') && $object->status < $object::STATUS_SENTCOMPLETELY), 'string');
print '</td><td>';
print $form->editfieldval("MailReply", 'email_replyto', $object->email_replyto, $object, $user->hasRight('mailing', 'creer') && $object->status < $object::STATUS_SENTCOMPLETELY, 'string');
$email = CMailFile::getValidAddress($object->email_replyto, 2);
@ -1102,19 +1102,19 @@ if ($action == 'create') { // aaa
print '</td><td>';
$nbemail = ($object->nbemail ? $object->nbemail : 0);
if (is_numeric($nbemail)) {
$text = '';
$htmltooltip = '';
if ((getDolGlobalString('MAILING_LIMIT_SENDBYWEB') && getDolGlobalInt('MAILING_LIMIT_SENDBYWEB') < $nbemail) && ($object->status == 1 || ($object->status == 2 && $nbtry < $nbemail))) {
if (getDolGlobalInt('MAILING_LIMIT_SENDBYWEB') > 0) {
$text .= $langs->trans('LimitSendingEmailing', getDolGlobalString('MAILING_LIMIT_SENDBYWEB'));
$htmltooltip .= $langs->trans('LimitSendingEmailing', getDolGlobalString('MAILING_LIMIT_SENDBYWEB'));
} else {
$text .= $langs->trans('SendingFromWebInterfaceIsNotAllowed');
$htmltooltip .= $langs->trans('SendingFromWebInterfaceIsNotAllowed');
}
}
if (empty($nbemail)) {
$nbemail .= ' '.img_warning('').' <span class="warning">'.$langs->trans("NoTargetYet").'</span>';
}
if ($text) {
print $form->textwithpicto($nbemail, $text, 1, 'warning');
if ($htmltooltip) {
print $form->textwithpicto($nbemail, $htmltooltip, 1, 'warning');
} else {
print $nbemail;
}
@ -1410,19 +1410,19 @@ if ($action == 'create') { // aaa
print '</td><td>';
$nbemail = ($object->nbemail ? $object->nbemail : 0);
if (is_numeric($nbemail)) {
$text = '';
$htmltooltip = '';
if ((getDolGlobalString('MAILING_LIMIT_SENDBYWEB') && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) && ($object->status == 1 || $object->status == 2)) {
if (getDolGlobalInt('MAILING_LIMIT_SENDBYWEB') > 0) {
$text .= $langs->trans('LimitSendingEmailing', getDolGlobalString('MAILING_LIMIT_SENDBYWEB'));
$htmltooltip .= $langs->trans('LimitSendingEmailing', getDolGlobalString('MAILING_LIMIT_SENDBYWEB'));
} else {
$text .= $langs->trans('SendingFromWebInterfaceIsNotAllowed');
$htmltooltip .= $langs->trans('SendingFromWebInterfaceIsNotAllowed');
}
}
if (empty($nbemail)) {
$nbemail .= ' '.img_warning('').' <span class="warning">'.$langs->trans("NoTargetYet").'</span>';
}
if ($text) {
print $form->textwithpicto($nbemail, $text, 1, 'warning');
if ($htmltooltip) {
print $form->textwithpicto($nbemail, $htmltooltip, 1, 'warning');
} else {
print $nbemail;
}

View file

@ -3,7 +3,7 @@
* Copyright (C) 2005-2024 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* 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
@ -393,7 +393,7 @@ if ($object->fetch($id) >= 0) {
$emailarray = CMailFile::getArrayAddress($object->email_errorsto);
foreach ($emailarray as $email => $name) {
if ($name != $email) {
print dol_escape_htmltag($name).' &lt;'.$email;
print dol_escape_htmltag((string) $name).' &lt;'.$email;
print '&gt;';
if ($email && !isValidEmail($email)) {
$langs->load("errors");
@ -412,7 +412,7 @@ if ($object->fetch($id) >= 0) {
// Reply to
if ($object->messtype != 'sms') {
print '<tr><td>';
print $form->editfieldkey("MailReply", 'email_replyto', $object->email_replyto, $object, $user->hasRight('mailing', 'creer') && $object->status < $object::STATUS_SENTCOMPLETELY, 'string');
print $form->editfieldkey("MailReply", 'email_replyto', $object->email_replyto, $object, (int) ($user->hasRight('mailing', 'creer') && $object->status < $object::STATUS_SENTCOMPLETELY), 'string');
print '</td><td>';
print $form->editfieldval("MailReply", 'email_replyto', $object->email_replyto, $object, $user->hasRight('mailing', 'creer') && $object->status < $object::STATUS_SENTCOMPLETELY, 'string');
$email = CMailFile::getValidAddress($object->email_replyto, 2);

View file

@ -2,7 +2,7 @@
/* Advance Targeting Emailing for mass emailing module
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* 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
@ -186,7 +186,7 @@ class AdvanceTargetingMailing extends CommonObject
$sql .= ") VALUES (";
$sql .= " ".(!isset($this->name) ? 'NULL' : "'".$this->db->escape($this->name)."'").",";
$sql .= " ".((int) $conf->entity).",";
$sql .= " ".(!isset($this->fk_element) ? 'NULL' : "'".$this->db->escape($this->fk_element)."'").",";
$sql .= " ".(!isset($this->fk_element) ? 'NULL' : "'".$this->db->escape((string) $this->fk_element)."'").",";
$sql .= " ".(!isset($this->type_element) ? 'NULL' : "'".$this->db->escape($this->type_element)."'").",";
$sql .= " ".(!isset($this->filtervalue) ? 'NULL' : "'".$this->db->escape($this->filtervalue)."'").",";
$sql .= " ".((int) $user->id).",";
@ -734,7 +734,7 @@ class AdvanceTargetingMailing extends CommonObject
if (!empty($arrayquery['contact_no_email'])) {
$tmpwhere .= "(t.email IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE t.entity IN (".getEntity('mailing').") AND email = '".$this->db->escape($arrayquery['contact_no_email'])."'))";
} else {
$tmpwhere .= "(t.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE t.entity IN (".getEntity('mailing').") AND email = '".$this->db->escape($arrayquery['contact_no_email'])."'))";
$tmpwhere .= "(t.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE t.entity IN (".getEntity('mailing').") AND email = '".$this->db->escape((string) $arrayquery['contact_no_email'])."'))";
}
$sqlwhere[] = $tmpwhere;
}

View file

@ -3,6 +3,7 @@
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* 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
@ -68,7 +69,7 @@ $result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid
if ($action == 'setpricelevel' && $user->hasRight('societe', 'creer')) {
$soc = new Societe($db);
$soc->fetch($id);
$soc->setPriceLevel(GETPOST("price_level"), $user);
$soc->setPriceLevel(GETPOSTINT("price_level"), $user);
header("Location: multiprix.php?id=".$id);
exit;

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2021 Laurent Destailleur <eldy@users.sourceforge.net>
* 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
@ -78,9 +79,9 @@ if ($action == 'setremise' && $user->hasRight('societe', 'lire')) {
$discount_type = GETPOSTINT('discount_type');
if (!empty($discount_type)) {
$result = $object->set_remise_supplier(price2num(GETPOST("remise")), GETPOST("note", "alphanohtml"), $user);
$result = $object->set_remise_supplier((float) price2num(GETPOST("remise")), GETPOST("note", "alphanohtml"), $user);
} else {
$result = $object->set_remise_client(price2num(GETPOST("remise")), GETPOST("note", "alphanohtml"), $user);
$result = $object->set_remise_client((float) price2num(GETPOST("remise")), GETPOST("note", "alphanohtml"), $user);
}
if ($result > 0) {

View file

@ -3,7 +3,7 @@
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2019-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 @@ if ($action == 'setremise' && $permissiontocreate) {
if (!$error) {
$soc = new Societe($db);
$soc->fetch($id);
$discountid = $soc->set_remise_except($amount, $user, $desc, $tva_tx, $discount_type, $price_base_type);
$discountid = $soc->set_remise_except((float) $amount, $user, $desc, $tva_tx, $discount_type, $price_base_type);
if ($discountid > 0) {
if (!empty($backtopage)) {
@ -388,7 +388,7 @@ if ($socid > 0) {
// VAT
print '<tr><td>'.$langs->trans("VAT").'</td>';
print '<td>';
print $form->load_tva('tva_tx', (GETPOSTISSET('tva_tx') ? GETPOST('tva_tx', 'alpha') : getDolGlobalString('MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS', 0)), $mysoc, $object, 0, 0, '', 0, 1);
print $form->load_tva('tva_tx', (GETPOSTISSET('tva_tx') ? GETPOST('tva_tx', 'alpha') : getDolGlobalString('MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS', 0)), $mysoc, $object, 0, 0, '', false, 1);
print '</td></tr>';
print '<tr><td class="fieldrequired" >'.$langs->trans("NoteReason").'</td>';
print '<td><input type="text" class="quatrevingtpercent" name="desc" value="'.GETPOST('desc', 'alphanohtml').'"></td></tr>';

View file

@ -10664,7 +10664,7 @@ class Form
/**
* Return select list of user groups
*
* @param int|object|object[] $selected Id group or group(s) preselected
* @param int|object|array<int|object> $selected Id group or group(s) preselected
* @param string $htmlname Field name in form
* @param int<0,1> $show_empty 0=liste sans valeur nulle, 1=ajoute valeur inconnue
* @param string|int[] $exclude Array list of groups id to exclude

View file

@ -142,7 +142,7 @@ class FormCompany extends Form
/**
* Affiche formulaire de selection des modes de reglement
*
* @param int $page Page
* @param string $page Page
* @param int $selected Id or code preselected
* @param string $htmlname Nom du formulaire select
* @param int $empty Add empty value in list
@ -194,7 +194,7 @@ class FormCompany extends Form
/**
* Affiche formulaire de selection des niveau de prospection pour les contacts
*
* @param int $page Page
* @param string $page Page
* @param int $selected Id or code preselected
* @param string $htmlname Nom du formulaire select
* @param int $empty Add empty value in list

View file

@ -2351,7 +2351,7 @@ class FormFile
/**
* Show detail icon with link for preview
*
* @param array{name:string,path:string,level1name:string,relativename:string,fullname:string,date:string,size:int,perm:int,type:string} $file Array with data of file. Example: array('name'=>...)
* @param array{name:string,path?:string,level1name?:string,relativename?:string,fullname:string,date?:string,size?:int,perm?:int,type?:string} $file Array with data of file. Example: array('name'=>...)
* @param string $modulepart propal, facture, facture_fourn, ...
* @param string $relativepath Relative path of docs
* @param int<min,1> $ruleforpicto Rule for picto: 0=Use the generic preview picto, 1=Use the picto of mime type of file). Use a negative value to show a generic picto even if preview not available.

View file

@ -44,8 +44,8 @@
* @param string $action Action string
* @param array<array{type:string,sr:string,name:string,offsettz:int,color:string,default:string,buggedfile:string}>|int<-1,-1> $showextcals Array with list of external calendars (used to show links to select calendar), or -1 to show no legend
* @param string|string[] $actioncode Preselected value(s) of actioncode for filter on event type
* @param int $usergroupid Id of group to filter on users
* @param string $excludetype A type to exclude ('systemauto', 'system', '')
* @param int|int[] $usergroupid Id of group to filter on users
* @param ''|'systemauto'|'system' $excludetype A type to exclude ('systemauto', 'system', '')
* @param int $resourceid Preselected value of resource for filter on resource
* @param int $search_categ_cus Tag id
* @return void