Merge remote-tracking branch 'origin/fix-resource-phpstan' into fix-resource-phpstan

# Conflicts:
#	htdocs/resource/class/html.formresource.class.php
This commit is contained in:
William Mead
2024-01-15 09:43:41 +01:00
1085 changed files with 6282 additions and 6028 deletions

View File

@@ -112,7 +112,7 @@ if (empty($reshook)) {
if ($result > 0) {
// Creation OK
setEventMessages($langs->trans('ResourceCreatedWithSuccess'), null, 'mesgs');
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
} else {
// Creation KO
@@ -121,7 +121,7 @@ if (empty($reshook)) {
}
}
} else {
Header("Location: list.php");
header("Location: list.php");
exit;
}
}
@@ -150,7 +150,7 @@ if (empty($reshook)) {
$result = $object->update($user);
if ($result > 0) {
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
} else {
setEventMessages($object->error, $object->errors, 'errors');

View File

@@ -98,7 +98,7 @@ class Dolresource extends CommonObject
/**
* Constructor
*
* @param DoliDb $db Database handler
* @param DoliDB $db Database handler
*/
public function __construct($db)
{
@@ -669,13 +669,13 @@ class Dolresource extends CommonObject
* @param string $element Element
* @param int $element_id Id
* @param string $resource_type Type
* @return array Aray of resources
* @return array Array of resources
*/
public function getElementResources($element, $element_id, $resource_type = '')
{
$resources = array();
// Links beetween objects are stored in this table
// Links between objects are stored in this table
$sql = 'SELECT rowid, resource_id, resource_type, busy, mandatory';
$sql .= ' FROM '.MAIN_DB_PREFIX.'element_resources';
$sql .= " WHERE element_id=".((int) $element_id)." AND element_type='".$this->db->escape($element)."'";
@@ -799,7 +799,7 @@ class Dolresource extends CommonObject
*
* @param int $withpicto Add picto into link
* @param string $option Where point the link ('compta', 'expedition', 'document', ...)
* @param string $get_params Parametres added to url
* @param string $get_params Parameters added to url
* @param int $notooltip 1=Disable tooltip
* @param string $morecss Add more css on link
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
@@ -904,7 +904,7 @@ class Dolresource extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Charge indicateurs this->nb de tableau de bord
* Load indicators this->nb for state board
*
* @return int Return integer <0 if KO, >0 if OK
*/

View File

@@ -164,7 +164,7 @@ class FormResource
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return html list of tickets type // TODO translate PHPDoc to english
* Return html list of tickets type
*
* @param string $selected Id du type pre-selectionne
* @param string $htmlname Nom de la zone select

View File

@@ -192,7 +192,7 @@ if (empty($reshook)) {
}
}
// Update ressource
// Update resource
if ($action == 'update_linked_resource' && $user->hasRight('resource', 'write') && !GETPOST('cancel', 'alpha')) {
$res = $object->fetch_element_resource($lineid);
if ($res) {