* * 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. */ /** * \file htdocs/projet/contact.php * \ingroup project * \brief Onglet de gestion des contacts du projet * \version $Id$ */ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php"); require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php"); require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); $langs->load("projects"); $langs->load("companies"); $projectid = isset($_GET["id"])?$_GET["id"]:''; // Security check if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'projet', $projectid); /* * Actions */ // Add new contact if ($_POST["action"] == 'addcontact' && $user->rights->projet->creer) { $result = 0; $project = new Project($db); $result = $project->fetch($projectid); if ($result > 0 && $projectid > 0) { $result = $project->add_contact($_POST["contactid"], $_POST["type"], $_POST["source"]); } if ($result >= 0) { Header("Location: contact.php?id=".$project->id); exit; } else { if ($project->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); $mesg = '
| '.$langs->trans('Ref').' | '; print $html->showrefnav($project,'ref',$linkback,1,'ref','ref',''); print ' | ||
| '.$langs->trans("Label").' | '.$project->title.' | ||
| ".$langs->trans("Company")." | "; print ''; if ($project->societe->id > 0) print $project->societe->getNomUrl(1); else print ' '; print ' | ||
| '.$langs->trans("Visibility").' | '; if ($project->public) print $langs->trans('SharedProject'); else print $langs->trans('PrivateProject'); print ' | ||
| '.$langs->trans("Status").' | '.$project->getLibStatut(4).' | ||
| '.$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("User"); if ($tab[$i]['source']=='external') print $langs->trans("ThirdPartyContact"); print ' | '; // Societe print ''; if ($tab[$i]['socid'] > 0) { $companystatic->fetch($tab[$i]['socid']); print $companystatic->getNomUrl(1); } 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 ($project->statut >= 0 && $userAccess) print 'id.'&action=swapstatut&ligne='.$tab[$i]['rowid'].'">'; print $contactstatic->LibStatut($tab[$i]['status'],3); if ($project->statut >= 0 && $userAccess) print ''; print ' | '; // Icon update et delete print ''; if ($user->rights->projet->creer && $userAccess) { print ' '; print 'id.'&action=deleteline&lineid='.$tab[$i]['rowid'].'">'; print img_delete(); print ''; } print ' | '; print "|