diff --git a/htdocs/projet/commandes.php b/htdocs/projet/commandes.php
index fd7f46f2b74..803543d8c8b 100644
--- a/htdocs/projet/commandes.php
+++ b/htdocs/projet/commandes.php
@@ -30,20 +30,31 @@ llxHeader("","../");
$projet = new Project($db);
$projet->fetch($_GET["id"]);
-$h=0;
-$head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id;
-$head[$h][1] = 'Fiche projet';
+ $h=0;
+ $head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id;
+ $head[$h][1] = 'Fiche projet';
+ $h++;
+
+ if ($conf->propal->enabled) {
+ $head[$h][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$projet->id;
+ $head[$h][1] = 'Prop. Commerciales';
+ $h++;
+ }
-$head[$h+1][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$projet->id;
-$head[$h+1][1] = 'Prop. Commerciales';
-
-$head[$h+2][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id;
-$head[$h+2][1] = 'Commandes';
-
-$head[$h+3][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id;
-$head[$h+3][1] = 'Factures';
-
-dolibarr_fiche_head($head, 2);
+ if ($conf->commande->enabled) {
+ $head[$h][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id;
+ $head[$h][1] = 'Commandes';
+ $hselected=$h;
+ $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);
/*
*
*
@@ -51,9 +62,9 @@ dolibarr_fiche_head($head, 2);
*/
$projet->societe->fetch($projet->societe->id);
-print '
';
+print '';
print '| Titre | '.$projet->title.' | ';
-print 'Réf | '.$projet->ref.' |
';
+print ''.$langs->trans("Ref").' | '.$projet->ref.' | ';
print '| Société | '.$projet->societe->nom.' |
';
print '
';
@@ -69,7 +80,7 @@ if (sizeof($commandes)>0 && is_array($commandes))
print '';
print '';
- print '| Réf | Date | Montant | |
';
+ print ''.$langs->trans("Ref").' | Date | Montant | | ';
for ($i = 0; $i
+ * 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
@@ -25,6 +26,7 @@ require("../facture.class.php");
require("../commande/commande.class.php");
$user->getrights('projet');
+
if (!$user->rights->projet->lire)
accessforbidden();
@@ -33,20 +35,31 @@ llxHeader("","../");
$projet = new Project($db);
$projet->fetch($_GET["id"]);
-$h=0;
-$head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id;
-$head[$h][1] = 'Fiche projet';
+ $h=0;
+ $head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id;
+ $head[$h][1] = 'Fiche projet';
+ $h++;
+
+ if ($conf->propal->enabled) {
+ $head[$h][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$projet->id;
+ $head[$h][1] = 'Prop. Commerciales';
+ $h++;
+ }
-$head[$h+1][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$projet->id;
-$head[$h+1][1] = 'Prop. Commerciales';
-
-$head[$h+2][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id;
-$head[$h+2][1] = 'Commandes';
-
-$head[$h+3][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id;
-$head[$h+3][1] = 'Factures';
-
-dolibarr_fiche_head($head, 3);
+ 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';
+ $hselected=$h;
+ $h++;
+ }
+
+dolibarr_fiche_head($head, $hselected);
/*
*
*
@@ -54,9 +67,9 @@ dolibarr_fiche_head($head, 3);
*/
$projet->societe->fetch($projet->societe->id);
-print '';
+print '';
print '| Titre | '.$projet->title.' | ';
-print 'Réf | '.$projet->ref.' |
';
+print ''.$langs->trans("Ref").' | '.$projet->ref.' | ';
print '| Société | '.$projet->societe->nom.' |
';
print '
';
@@ -70,10 +83,10 @@ print '
';
if (sizeof($factures)>0 && is_array($factures))
{
print_titre('Listes des factures associées au projet');
- print '';
+ print '';
print '';
- print '| Réf | Date | Montant | |
';
+ print ''.$langs->trans("Ref").' | Date | Montant | | ';
for ($i = 0; $iload("projects");
+
$user->getrights('projet');
+
if (!$user->rights->projet->lire)
accessforbidden();
+
if ($_POST["action"] == 'add' && $user->rights->projet->creer)
{
$pro = new Project($db);
@@ -46,28 +50,31 @@ if ($_POST["action"] == 'add' && $user->rights->projet->creer)
if ($_POST["action"] == 'update' && $user->rights->projet->creer)
{
$projet = new Project($db);
- $projet->id = $id;
+ $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 = $id;
+ $projet->id = $_POST["id"];
$projet->delete();
Header("Location: index.php");
}
llxHeader("","Projet","Projet");
+
if ($_GET["action"] == 'delete')
{
print '