diff --git a/htdocs/resource/contact.php b/htdocs/resource/contact.php index aca47d49743..12ee8b6ff03 100644 --- a/htdocs/resource/contact.php +++ b/htdocs/resource/contact.php @@ -1,10 +1,13 @@ * Copyright (C) 2007-2009 Laurent Destailleur * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2016 Gilles Poirier - * + */ + +/** * 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 @@ -22,7 +25,7 @@ /** * \file htdocs/resource/contact.php * \ingroup resource - * \brief Onglet de gestion des contacts des resources + * \brief Contacts management tab for resources */ require '../main.inc.php'; @@ -32,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/resource.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; // Load translation files required by the page -$langs->loadLangs(array('resource', 'sendings', 'companies')); +$langs->loadLangs(array('companies', 'resource', 'sendings')); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); @@ -41,7 +44,7 @@ $action = GETPOST('action', 'aZ09'); $object = new DolResource($db); // Load object -include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Security check if ($user->socid) { @@ -55,10 +58,12 @@ if (!$user->rights->resource->read) { } + /* - * Add a new contact + * Actions */ +// Add a new contact if ($action == 'addcontact' && $user->rights->resource->write) { if ($result > 0 && $id > 0) { $contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); @@ -80,10 +85,12 @@ if ($action == 'addcontact' && $user->rights->resource->write) { setEventMessages($mesg, null, 'errors'); } } elseif ($action == 'swapstatut' && $user->rights->resource->write) { - // Toggle the status of a contact + +// Toggle the status of a contact $result = $object->swapContactStatus(GETPOST('ligne', 'int')); } elseif ($action == 'deletecontact' && $user->rights->resource->write) { - // Erase a contact + +// Erase a contact $result = $object->delete_contact(GETPOST('lineid', 'int')); if ($result >= 0) { @@ -106,7 +113,7 @@ $userstatic = new User($db); llxHeader('', $langs->trans("Resource")); -// Mode vue et edition +// View and edit mode if ($id > 0 || !empty($ref)) { $soc = new Societe($db);