* * 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 2 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, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ */ /** \file htdocs/fichinter/contact.php \ingroup fichinter \brief Onglet de gestion des contacts de fiche d'intervention \version $Revision$ */ require ("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/fichinter/fichinter.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/fichinter.lib.php"); $langs->load("interventions"); $langs->load("sendings"); $langs->load("companies"); $fichinterid = isset($_GET["id"])?$_GET["id"]:''; // Sécurité d'accès client et commerciaux $socid = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter'); /* * Ajout d'un nouveau contact */ if ($_POST["action"] == 'addcontact' && $user->rights->ficheinter->creer) { $result = 0; $fichinter = new Fichinter($db); $result = $fichinter->fetch($_GET["id"]); if ($result > 0 && $_GET["id"] > 0) { $result = $fichinter->add_contact($_POST["contactid"], $_POST["type"], $_POST["source"]); } if ($result >= 0) { Header("Location: contact.php?id=".$fichinter->id); exit; } else { $mesg = '
| '.$langs->trans("Ref").' | '; print $fichinter->ref; print " | ||
| ".$langs->trans("Company")." | "; print ''.$fichinter->client->getNomUrl(1).' | ||
| '.$langs->trans("Source").' | '; print ''.$langs->trans("Company").' | '; print ''.$langs->trans("Contacts").' | '; print ''.$langs->trans("ContactType").' | '; print ''; print " | ||
| '.$langs->trans("Source").' | '; print ''.$langs->trans("Company").' | '; print ''.$langs->trans("Contacts").' | '; print ''.$langs->trans("ContactType").' | '; print ''.$langs->trans("Status").' | '; print ''; print " | |
| '; if ($tab[$i]['source']=='internal') print $langs->trans("Internal"); if ($tab[$i]['source']=='external') print $langs->trans("External"); print ' | '; // Societe print ''; if ($tab[$i]['socid'] > 0) { print ''; print img_object($langs->trans("ShowCompany"),"company").' '.$societe->get_nom($tab[$i]['socid']); print ''; } if ($tab[$i]['socid'] < 0) { print $conf->global->MAIN_INFO_SOCIETE_NOM; } if (! $tab[$i]['socid']) { print ' '; } print ' | '; // Contact print ''; if ($tab[$i]['source']=='internal') { print ''; print img_object($langs->trans("ShowUser"),"user").' '.$tab[$i]['nom'].''; } if ($tab[$i]['source']=='external') { print ''; print img_object($langs->trans("ShowContact"),"contact").' '.$tab[$i]['nom'].''; } print ' | '; // Type de contact print ''.$tab[$i]['libelle'].' | '; // Statut print ''; // Activation desativation du contact if ($fichinter->statut >= 0) print ''; print $contactstatic->LibStatut($tab[$i]['status'],3); if ($fichinter->statut >= 0) print ''; print ' | '; // Icon update et delete print ''; if ($fichinter->statut < 5 && $user->rights->ficheinter->creer) { print ' '; print ''; print img_delete(); print ''; } print ' | '; print "|