From 5116337e0bcd2f47958157ab982b3e3ef10ad5dd Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Mon, 21 Dec 2020 13:29:44 +0100 Subject: [PATCH] FIX : stickler feedbacks --- htdocs/admin/workstation.php | 2 +- htdocs/core/modules/modWorkstation.class.php | 2 +- .../workstation/mod_workstation_advanced.php | 1 + .../workstation/mod_workstation_standard.php | 1 + .../workstation/modules_workstation.php | 1 + .../llx_workstation_workstation.key.sql | 2 +- .../tables/llx_workstation_workstation.sql | 2 +- .../llx_workstation_workstation_resource.sql | 2 +- ...llx_workstation_workstation_user_group.sql | 2 +- .../class/html.formresource.class.php | 1 + .../workstation/class/workstation.class.php | 8 ++--- .../class/workstationresource.class.php | 36 +++++++++++++++++++ .../class/workstationusergroup.class.php | 36 +++++++++++++++++++ htdocs/workstation/lib/workstation.lib.php | 2 +- .../lib/workstation_workstation.lib.php | 2 +- htdocs/workstation/workstation_agenda.php | 2 +- htdocs/workstation/workstation_card.php | 4 +-- htdocs/workstation/workstation_document.php | 2 +- htdocs/workstation/workstation_list.php | 2 +- htdocs/workstation/workstation_note.php | 2 +- 20 files changed, 94 insertions(+), 18 deletions(-) diff --git a/htdocs/admin/workstation.php b/htdocs/admin/workstation.php index 8f9ee369d4f..502a573e98b 100755 --- a/htdocs/admin/workstation.php +++ b/htdocs/admin/workstation.php @@ -1,6 +1,6 @@ - * Copyright (C) 2020 SuperAdmin + * Copyright (C) 2020 Gauthier VERDOL * * 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 diff --git a/htdocs/core/modules/modWorkstation.class.php b/htdocs/core/modules/modWorkstation.class.php index 216d591670a..499dcc5de48 100755 --- a/htdocs/core/modules/modWorkstation.class.php +++ b/htdocs/core/modules/modWorkstation.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2018-2019 Nicolas ZABOURI * Copyright (C) 2019-2020 Frédéric France - * Copyright (C) 2020 SuperAdmin + * Copyright (C) 2020 Gauthier VERDOL * * 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 diff --git a/htdocs/core/modules/workstation/mod_workstation_advanced.php b/htdocs/core/modules/workstation/mod_workstation_advanced.php index d9133b4063c..cf9a1247e2b 100755 --- a/htdocs/core/modules/workstation/mod_workstation_advanced.php +++ b/htdocs/core/modules/workstation/mod_workstation_advanced.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2019 Frédéric France + * Copyright (C) 2020 Gauthier VERDOL * * 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 diff --git a/htdocs/core/modules/workstation/mod_workstation_standard.php b/htdocs/core/modules/workstation/mod_workstation_standard.php index 87e94233c88..0e793953f46 100755 --- a/htdocs/core/modules/workstation/mod_workstation_standard.php +++ b/htdocs/core/modules/workstation/mod_workstation_standard.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2020 Gauthier VERDOL * * 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 diff --git a/htdocs/core/modules/workstation/modules_workstation.php b/htdocs/core/modules/workstation/modules_workstation.php index bfd0f6c95ea..ec6c2fc945b 100755 --- a/htdocs/core/modules/workstation/modules_workstation.php +++ b/htdocs/core/modules/workstation/modules_workstation.php @@ -6,6 +6,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2014 Marcos García + * Copyright (C) 2020 Gauthier VERDOL * * 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 diff --git a/htdocs/install/mysql/tables/llx_workstation_workstation.key.sql b/htdocs/install/mysql/tables/llx_workstation_workstation.key.sql index 2e013ee0128..6bdf16aa6d7 100755 --- a/htdocs/install/mysql/tables/llx_workstation_workstation.key.sql +++ b/htdocs/install/mysql/tables/llx_workstation_workstation.key.sql @@ -1,4 +1,4 @@ --- Copyright (C) ---Put here your own copyright and developer email--- +-- Copyright (C) 2020 Gauthier VERDOL -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_workstation_workstation.sql b/htdocs/install/mysql/tables/llx_workstation_workstation.sql index 5c141ed59df..a4d9fd4dbc8 100755 --- a/htdocs/install/mysql/tables/llx_workstation_workstation.sql +++ b/htdocs/install/mysql/tables/llx_workstation_workstation.sql @@ -1,4 +1,4 @@ --- Copyright (C) ---Put here your own copyright and developer email--- +-- Copyright (C) 2020 Gauthier VERDOL -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_workstation_workstation_resource.sql b/htdocs/install/mysql/tables/llx_workstation_workstation_resource.sql index 1ab019f4385..92463ade696 100755 --- a/htdocs/install/mysql/tables/llx_workstation_workstation_resource.sql +++ b/htdocs/install/mysql/tables/llx_workstation_workstation_resource.sql @@ -1,4 +1,4 @@ --- Copyright (C) ---Put here your own copyright and developer email--- +-- Copyright (C) 2020 Gauthier VERDOL -- -- 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 diff --git a/htdocs/install/mysql/tables/llx_workstation_workstation_user_group.sql b/htdocs/install/mysql/tables/llx_workstation_workstation_user_group.sql index 9bffb4f30c9..9ecccc88d82 100755 --- a/htdocs/install/mysql/tables/llx_workstation_workstation_user_group.sql +++ b/htdocs/install/mysql/tables/llx_workstation_workstation_user_group.sql @@ -1,4 +1,4 @@ --- Copyright (C) ---Put here your own copyright and developer email--- +-- Copyright (C) 2020 Gauthier VERDOL -- -- 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 diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 4a9b467c32c..30d7a13a194 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -75,6 +75,7 @@ class FormResource * @param int $outputmode 0=HTML select string, 1=Array, 2=without form tag * @param int $limit Limit number of answers * @param string $morecss More css + * @param bool $multiple add [] in the name of element and add 'multiple' attribut * @return string HTML string with */ public function select_resource_list($selected = '', $htmlname = 'fk_resource', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $event = array(), $filterkey = '', $outputmode = 0, $limit = 20, $morecss = '', $multiple = false) diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index 42533c4100f..31497cbc919 100755 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -1,6 +1,6 @@ - * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2020 Gauthier VERDOL * * 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 @@ -667,7 +667,7 @@ class Workstation extends CommonObject /** * Set draft status * - * @param User $user Object user that modify + * @param int $status New status to set * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers * @return int <0 if KO, >0 if OK */ @@ -677,8 +677,8 @@ class Workstation extends CommonObject $this->status = $status; - if (empty($status)) $this->setDisabled($user, $notrigger); - else $this->setEnabled($user, $notrigger); + if (empty($status)) return $this->setDisabled($user, $notrigger); + else return $this->setEnabled($user, $notrigger); } diff --git a/htdocs/workstation/class/workstationresource.class.php b/htdocs/workstation/class/workstationresource.class.php index b9897b6f541..cfb6706058d 100644 --- a/htdocs/workstation/class/workstationresource.class.php +++ b/htdocs/workstation/class/workstationresource.class.php @@ -1,4 +1,30 @@ + * Copyright (C) 2020 Gauthier VERDOL + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file class/workstationresource.class.php + * \ingroup workstation + * \brief This file is a CRUD class file for WorkstationResource (Create/Read/Update/Delete) + */ + +/** + * Class for WorkstationResource + */ class WorkstationResource extends CommonObject { @@ -46,6 +72,11 @@ class WorkstationResource extends CommonObject } } + /** + * Function used to get an array with all resources linked to a workstation + * @param int $fk_workstation id of workstation we need to get linked resources + * @return array + */ static public function getAllResourcesOfWorkstation($fk_workstation) { @@ -65,6 +96,11 @@ class WorkstationResource extends CommonObject return $TRes; } + /** + * Function used to remove all resources linked to a workstation + * @param int $fk_workstation id of workstation we need to remove linked resources + * @return int + */ static public function deleteAllResourcesOfWorkstation($fk_workstation) { diff --git a/htdocs/workstation/class/workstationusergroup.class.php b/htdocs/workstation/class/workstationusergroup.class.php index 1221476203c..6b6bcb5cb4c 100644 --- a/htdocs/workstation/class/workstationusergroup.class.php +++ b/htdocs/workstation/class/workstationusergroup.class.php @@ -1,4 +1,30 @@ + * Copyright (C) 2020 Gauthier VERDOL + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file class/workstationusergroup.class.php + * \ingroup workstation + * \brief This file is a CRUD class file for WorkstationUserGroup (Create/Read/Update/Delete) + */ + +/** + * Class for WorkstationUserGroup + */ class WorkstationUserGroup extends CommonObject { @@ -46,6 +72,11 @@ class WorkstationUserGroup extends CommonObject } } + /** + * Function used to get an array with all usergroups linked to a workstation + * @param int $fk_workstation id of workstation we need to get linked usergroups + * @return array + */ static public function getAllGroupsOfWorkstation($fk_workstation) { @@ -65,6 +96,11 @@ class WorkstationUserGroup extends CommonObject return $TRes; } + /** + * Function used to remove all usergroups linked to a workstation + * @param int $fk_workstation id of workstation we need to remove linked usergroups + * @return int + */ static public function deleteAllGroupsOfWorkstation($fk_workstation) { diff --git a/htdocs/workstation/lib/workstation.lib.php b/htdocs/workstation/lib/workstation.lib.php index 526323ec45d..18307d0cd3a 100755 --- a/htdocs/workstation/lib/workstation.lib.php +++ b/htdocs/workstation/lib/workstation.lib.php @@ -1,5 +1,5 @@ * * 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 diff --git a/htdocs/workstation/lib/workstation_workstation.lib.php b/htdocs/workstation/lib/workstation_workstation.lib.php index 1c6b7492f0c..cc7fcc58f89 100755 --- a/htdocs/workstation/lib/workstation_workstation.lib.php +++ b/htdocs/workstation/lib/workstation_workstation.lib.php @@ -1,5 +1,5 @@ * * 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 diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php index 132acc02bee..e2951554488 100755 --- a/htdocs/workstation/workstation_agenda.php +++ b/htdocs/workstation/workstation_agenda.php @@ -1,6 +1,6 @@ - * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2020 Gauthier VERDOL * * 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 diff --git a/htdocs/workstation/workstation_card.php b/htdocs/workstation/workstation_card.php index d28aecce67d..e5d51b20c84 100755 --- a/htdocs/workstation/workstation_card.php +++ b/htdocs/workstation/workstation_card.php @@ -422,7 +422,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea foreach ($object->usergroups as $id_group) { $g = new UserGroup($db); $g->fetch($id_group); - $toprint[] = '
  • ' . $g->getNomUrl(1) . '
  • '; + $toprint[] = '
  • ' . $g->getNomUrl(1) . '
  • '; } print '' . $langs->trans('Groups') . ''; print '
      ' . implode(' ', $toprint) . '
    '; @@ -435,7 +435,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea foreach ($object->resources as $id_resource) { $r = new Dolresource($db); $r->fetch($id_resource); - $toprint[] = '
  • ' . $r->getNomUrl(1) . '
  • '; + $toprint[] = '
  • ' . $r->getNomUrl(1) . '
  • '; } print '' . $langs->trans('Machines') . ''; print '
      ' . implode(' ', $toprint) . '
    '; diff --git a/htdocs/workstation/workstation_document.php b/htdocs/workstation/workstation_document.php index 104ea93c4db..89a34f55549 100755 --- a/htdocs/workstation/workstation_document.php +++ b/htdocs/workstation/workstation_document.php @@ -1,6 +1,6 @@ - * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2020 Gauthier VERDOL * * 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 diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index c544446aabb..d4da9bd246f 100755 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -1,6 +1,6 @@ - * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2020 Gauthier VERDOL * * 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 diff --git a/htdocs/workstation/workstation_note.php b/htdocs/workstation/workstation_note.php index b8e85ddaf6f..a9d8a7f3fc2 100755 --- a/htdocs/workstation/workstation_note.php +++ b/htdocs/workstation/workstation_note.php @@ -1,6 +1,6 @@ - * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2020 Gauthier VERDOL * * 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