* Copyright (C) 2004 Laurent Destailleur * * 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$ * $Source$ * */ /*! \file htdocs/projet/fiche.php \ingroup projet \brief Fiche projet \version $Revision$ */ require("./pre.inc.php"); require("../propal.class.php"); require("../facture.class.php"); require("../commande/commande.class.php"); $langs->load("projects"); $user->getrights('projet'); if (!$user->rights->projet->lire) accessforbidden(); if ($_POST["action"] == 'add' && $user->rights->projet->creer) { $pro = new Project($db); $pro->socidp = $_GET["socidp"]; $pro->ref = $_POST["ref"]; $pro->title = $_POST["title"]; $pro_id = $pro->create( $user->id); if ($pro_id) { Header("Location:fiche.php?id=$pro_id"); } } if ($_POST["action"] == 'update' && $user->rights->projet->creer) { $projet = new Project($db); $projet->id = $_POST["id"]; $projet->ref = $_POST["ref"]; $projet->title = $_POST["title"]; $projet->update(); $_GET["id"]=$projet->id; // On retourne sur la fiche projet } if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == yes) { $projet = new Project($db); $projet->id = $_GET["id"]; $projet->delete(); Header("Location: index.php"); } llxHeader("","Projet","Projet"); if ($_GET["action"] == 'delete') { print '
'; print ''; print ''; print ''; print '\n"; print ''; print '
Supprimer le projet
Etes-vous sur de vouloir supprimer ce projet ?'; $htmls = new Form($db); $htmls->selectyesno("confirm","no"); print "
'; print "
\n"; } if ($_GET["action"] == 'create' && $user->rights->projet->creer) { print_titre("Nouveau projet"); print '
'; ?> '; ?>
Société fetch($_GET["socidp"]); print $societe->nom_url; ?>
Créateur'.$user->fullname.'
trans("Ref") ?>
Titre
">
fetch($_GET["id"]); $projet->societe->fetch($projet->societe->id); $h=0; $head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id; $head[$h][1] = 'Fiche projet'; $hselected=$h; $h++; if ($conf->propal->enabled) { $head[$h][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$projet->id; $head[$h][1] = 'Prop. Commerciales'; $h++; } if ($conf->commande->enabled) { $head[$h][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id; $head[$h][1] = 'Commandes'; $h++; } if ($conf->facture->enabled) { $head[$h][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id; $head[$h][1] = 'Factures'; $h++; } dolibarr_fiche_head($head, $hselected); if ($_GET["action"] == 'edit') { print '
'; print ''; print ''; print ''; print ''; print ''; print ''; print '
Société'.$projet->societe->nom.'
'.$langs->trans("Title").'
'.$langs->trans("Ref").'
'; print '

'; print '
'; } else { print ''; print ''; print ''; print ''; print '
'.$langs->trans("Title").''.$projet->title.''.$langs->trans("Ref").''.$projet->ref.'
Société'.$projet->societe->nom_url.'
'; print '
'; } print ''; if ($user->rights->projet->creer == 1) { print '
'; if ($_GET["action"] == "edit") { print ''.$langs->trans("Cancel").''; } else { print ''.$langs->trans("Edit").''; } print ''.$langs->trans("Delete").''; print "
"; } } $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?>