Fix: register_globals

Fix: [bugs #9910]
Trad: Traductions pour module projet
Norm: Mise aux normes des onglets et tableaux module projet.
This commit is contained in:
Laurent Destailleur 2004-08-07 01:25:00 +00:00
parent 876b2bea44
commit e98d3574c7
5 changed files with 137 additions and 78 deletions

View File

@ -30,20 +30,31 @@ llxHeader("","../");
$projet = new Project($db); $projet = new Project($db);
$projet->fetch($_GET["id"]); $projet->fetch($_GET["id"]);
$h=0; $h=0;
$head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id; $head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id;
$head[$h][1] = 'Fiche projet'; $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; if ($conf->commande->enabled) {
$head[$h+1][1] = 'Prop. Commerciales'; $head[$h][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id;
$head[$h][1] = 'Commandes';
$head[$h+2][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id; $hselected=$h;
$head[$h+2][1] = 'Commandes'; $h++;
}
$head[$h+3][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id;
$head[$h+3][1] = 'Factures'; if ($conf->facture->enabled) {
$head[$h][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id;
dolibarr_fiche_head($head, 2); $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); $projet->societe->fetch($projet->societe->id);
print '<table class="border" border="1" cellpadding="4" cellspacing="0" width="100%">'; print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
print '<tr><td width="20%">Titre</td><td>'.$projet->title.'</td>'; print '<tr><td width="20%">Titre</td><td>'.$projet->title.'</td>';
print '<td width="20%">Réf</td><td>'.$projet->ref.'</td></tr>'; print '<td width="20%">'.$langs->trans("Ref").'</td><td>'.$projet->ref.'</td></tr>';
print '<tr><td>Société</td><td colspan="3"><a href="../comm/fiche.php?socid='.$projet->societe->id.'">'.$projet->societe->nom.'</a></td></tr>'; print '<tr><td>Société</td><td colspan="3"><a href="../comm/fiche.php?socid='.$projet->societe->id.'">'.$projet->societe->nom.'</a></td></tr>';
print '</table><br>'; print '</table><br>';
@ -69,7 +80,7 @@ if (sizeof($commandes)>0 && is_array($commandes))
print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">'; print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';
print '<TR class="liste_titre">'; print '<TR class="liste_titre">';
print '<td width="15%">Réf</td><td width="25%">Date</td><td align="right">Montant</td><td>&nbsp;</td></tr>'; print '<td width="15%">'.$langs->trans("Ref").'</td><td width="25%">Date</td><td align="right">Montant</td><td>&nbsp;</td></tr>';
for ($i = 0; $i<sizeof($commandes);$i++) for ($i = 0; $i<sizeof($commandes);$i++)
{ {

View File

@ -1,5 +1,6 @@
<?PHP <?PHP
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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"); require("../commande/commande.class.php");
$user->getrights('projet'); $user->getrights('projet');
if (!$user->rights->projet->lire) if (!$user->rights->projet->lire)
accessforbidden(); accessforbidden();
@ -33,20 +35,31 @@ llxHeader("","../");
$projet = new Project($db); $projet = new Project($db);
$projet->fetch($_GET["id"]); $projet->fetch($_GET["id"]);
$h=0; $h=0;
$head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id; $head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id;
$head[$h][1] = 'Fiche projet'; $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; if ($conf->commande->enabled) {
$head[$h+1][1] = 'Prop. Commerciales'; $head[$h][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id;
$head[$h][1] = 'Commandes';
$head[$h+2][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id; $h++;
$head[$h+2][1] = 'Commandes'; }
$head[$h+3][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id; if ($conf->facture->enabled) {
$head[$h+3][1] = 'Factures'; $head[$h][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id;
$head[$h][1] = 'Factures';
dolibarr_fiche_head($head, 3); $hselected=$h;
$h++;
}
dolibarr_fiche_head($head, $hselected);
/* /*
* *
* *
@ -54,9 +67,9 @@ dolibarr_fiche_head($head, 3);
*/ */
$projet->societe->fetch($projet->societe->id); $projet->societe->fetch($projet->societe->id);
print '<table class="border" border="1" cellpadding="4" cellspacing="0" width="100%">'; print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
print '<tr><td width="20%">Titre</td><td>'.$projet->title.'</td>'; print '<tr><td width="20%">Titre</td><td>'.$projet->title.'</td>';
print '<td width="20%">Réf</td><td>'.$projet->ref.'</td></tr>'; print '<td width="20%">'.$langs->trans("Ref").'</td><td>'.$projet->ref.'</td></tr>';
print '<tr><td>Société</td><td colspan="3"><a href="../comm/fiche.php?socid='.$projet->societe->id.'">'.$projet->societe->nom.'</a></td></tr>'; print '<tr><td>Société</td><td colspan="3"><a href="../comm/fiche.php?socid='.$projet->societe->id.'">'.$projet->societe->nom.'</a></td></tr>';
print '</table><br>'; print '</table><br>';
@ -70,10 +83,10 @@ print '</table><br>';
if (sizeof($factures)>0 && is_array($factures)) if (sizeof($factures)>0 && is_array($factures))
{ {
print_titre('Listes des factures associées au projet'); print_titre('Listes des factures associées au projet');
print '<table border="0" width="100%" cellspacing="0" cellpadding="4">'; print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="15%">Réf</td><td width="25%">Date</td><td align="right">Montant</td><td>&nbsp;</td></tr>'; print '<td width="15%">'.$langs->trans("Ref").'</td><td width="25%">Date</td><td align="right">Montant</td><td>&nbsp;</td></tr>';
for ($i = 0; $i<sizeof($factures);$i++) for ($i = 0; $i<sizeof($factures);$i++)
{ {

View File

@ -25,10 +25,14 @@ require("../propal.class.php");
require("../facture.class.php"); require("../facture.class.php");
require("../commande/commande.class.php"); require("../commande/commande.class.php");
$langs->load("projects");
$user->getrights('projet'); $user->getrights('projet');
if (!$user->rights->projet->lire) if (!$user->rights->projet->lire)
accessforbidden(); accessforbidden();
if ($_POST["action"] == 'add' && $user->rights->projet->creer) if ($_POST["action"] == 'add' && $user->rights->projet->creer)
{ {
$pro = new Project($db); $pro = new Project($db);
@ -46,28 +50,31 @@ if ($_POST["action"] == 'add' && $user->rights->projet->creer)
if ($_POST["action"] == 'update' && $user->rights->projet->creer) if ($_POST["action"] == 'update' && $user->rights->projet->creer)
{ {
$projet = new Project($db); $projet = new Project($db);
$projet->id = $id; $projet->id = $_POST["id"];
$projet->ref = $_POST["ref"]; $projet->ref = $_POST["ref"];
$projet->title = $_POST["title"]; $projet->title = $_POST["title"];
$projet->update(); $projet->update();
$_GET["id"]=$projet->id; // On retourne sur la fiche projet
} }
if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == yes) if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == yes)
{ {
$projet = new Project($db); $projet = new Project($db);
$projet->id = $id; $projet->id = $_POST["id"];
$projet->delete(); $projet->delete();
Header("Location: index.php"); Header("Location: index.php");
} }
llxHeader("","Projet","Projet"); llxHeader("","Projet","Projet");
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
print '<form method="post" action="fiche.php?id='.$_GET["id"].'">'; print '<form method="post" action="fiche.php?id='.$_GET["id"].'">';
print '<input type="hidden" name="action" value="confirm_delete">'; print '<input type="hidden" name="action" value="confirm_delete">';
print '<table id="actions" cellspacing="0" border="1" width="100%" cellpadding="3">'; print '<table class="border" id="actions" cellspacing="0" width="100%" cellpadding="3">';
print '<tr><td colspan="3">Supprimer le projet</td></tr>'; print '<tr><td colspan="3">Supprimer le projet</td></tr>';
@ -88,7 +95,7 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
print '<form action="fiche.php?socidp='.$_GET["socidp"].'" method="post">'; print '<form action="fiche.php?socidp='.$_GET["socidp"].'" method="post">';
?> ?>
<table class="border" border="1" cellpadding="4" cellspacing="0"> <table class="border" cellpadding="3" cellspacing="0">
<input type="hidden" name="action" value="add"> <input type="hidden" name="action" value="add">
<tr><td>Société</td><td> <tr><td>Société</td><td>
<?PHP <?PHP
@ -101,7 +108,7 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
<?PHP <?PHP
print '<tr><td>Créateur</td><td>'.$user->fullname.'</td></tr>'; print '<tr><td>Créateur</td><td>'.$user->fullname.'</td></tr>';
?> ?>
<tr><td>Référence</td><td><input size="10" type="text" name="ref"></td></tr> <tr><td><?php echo $langs->trans("Ref") ?></td><td><input size="10" type="text" name="ref"></td></tr>
<tr><td>Titre</td><td><input size="30" type="text" name="title"></td></tr> <tr><td>Titre</td><td><input size="30" type="text" name="title"></td></tr>
<tr><td colspan="2"><input type="submit" value="Enregistrer"></td></tr> <tr><td colspan="2"><input type="submit" value="Enregistrer"></td></tr>
</table> </table>
@ -110,8 +117,7 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
} else { } else {
/* /*
* * Fiche projet en mode visu
*
* *
*/ */
@ -122,36 +128,51 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
$h=0; $h=0;
$head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id; $head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id;
$head[$h][1] = 'Fiche projet'; $head[$h][1] = 'Fiche projet';
$hselected=$h;
$h++;
$head[$h+1][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$projet->id; if ($conf->propal->enabled) {
$head[$h+1][1] = 'Prop. Commerciales'; $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++;
}
$head[$h+2][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id; if ($conf->facture->enabled) {
$head[$h+2][1] = 'Commandes'; $head[$h][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id;
$head[$h][1] = 'Factures';
$head[$h+3][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id; $h++;
$head[$h+3][1] = 'Factures'; }
dolibarr_fiche_head($head, 0); dolibarr_fiche_head($head, $hselected);
if ($_GET["action"] == 'edit') if ($_GET["action"] == 'edit')
{ {
print '<form method="post" action="fiche.php?id='.$id.'">'; print '<form method="post" action="fiche.php">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<table class="border" border="1" cellpadding="4" cellspacing="0">'; print '<input type="hidden" name="id" value="'.$_GET["id"].'">';
print '<table class="border" cellpadding="3" cellspacing="0" width="50%">';
print '<tr><td>Société</td><td>'.$projet->societe->nom.'</td></tr>'; print '<tr><td>Société</td><td>'.$projet->societe->nom.'</td></tr>';
print '<tr><td>Ref</td><td><input name="ref" value="'.$projet->ref.'"></td></tr>'; print '<tr><td>'.$langs->trans("Title").'</td><td><input name="title" value="'.$projet->title.'"></td></tr>';
print '<tr><td>'.$langs->trans("Ref").'</td><td><input name="ref" value="'.$projet->ref.'"></td></tr>';
print '</table><input type="submit" Value="Enregistrer"></form>'; print '</table>';
print '<p><input type="submit" Value="'.$langs->trans("Modify").'"></p>';
print '</form>';
} }
else else
{ {
print '<table class="border" border="1" cellpadding="4" cellspacing="0" width="100%">'; print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
print '<tr><td width="20%">'.$langs->trans("Title").'</td><td>'.$projet->title.'</td>';
print '<tr><td width="20%">Titre</td><td>'.$projet->title.'</td>'; print '<td width="20%">'.$langs->trans("Ref").'</td><td>'.$projet->ref.'</td></tr>';
print '<td width="20%">Réf</td><td>'.$projet->ref.'</td></tr>';
print '<tr><td>Société</td><td colspan="3">'.$projet->societe->nom_url.'</a></td></tr>'; print '<tr><td>Société</td><td colspan="3">'.$projet->societe->nom_url.'</a></td></tr>';
print '</table>'; print '</table>';
print '<br>';
} }
print '</div>'; print '</div>';
@ -161,7 +182,7 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer)
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($_GET["action"] == "edit") if ($_GET["action"] == "edit")
{ {
print '<a class="tabAction" href="fiche.php?id='.$projet->id.'">Annuler</a>'; print '<a class="tabAction" href="fiche.php?id='.$projet->id.'">'.$langs->trans("Cancel").'</a>';
} }
else else
{ {

View File

@ -22,6 +22,8 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
$langs->load("projects");
/* /*
* Sécurité accés client * Sécurité accés client
*/ */
@ -63,10 +65,10 @@ $pagenext = $page + 1;
* *
*/ */
print '<br>'; print '<br>';
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; print '<table class="noborder" width="100%" cellspacing="0" cellpadding="3">';
print '<tr class="liste_titre"><td>'; print '<tr class="liste_titre"><td>';
print_liste_field_titre("Titre","index.php","p.title"); print_liste_field_titre("Titre","index.php","p.title");
print "</td><td>Réf</td><td>"; print '</td><td>'.$langs->trans("Ref").'</td><td>';
print_liste_field_titre("Société","index.php","s.nom"); print_liste_field_titre("Société","index.php","s.nom");
print "</td></tr>\n"; print "</td></tr>\n";
@ -81,6 +83,7 @@ if ($socidp)
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset); $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset);
$var=true;
if ( $db->query($sql) ) if ( $db->query($sql) )
{ {
$num = $db->num_rows(); $num = $db->num_rows();

View File

@ -30,20 +30,31 @@ llxHeader("","../");
$projet = new Project($db); $projet = new Project($db);
$projet->fetch($_GET["id"]); $projet->fetch($_GET["id"]);
$h=0; $h=0;
$head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id; $head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id;
$head[$h][1] = 'Fiche projet'; $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';
$hselected=$h;
$h++;
}
$head[$h+1][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$projet->id; if ($conf->commande->enabled) {
$head[$h+1][1] = 'Prop. Commerciales'; $head[$h][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id;
$head[$h][1] = 'Commandes';
$head[$h+2][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id; $h++;
$head[$h+2][1] = 'Commandes'; }
$head[$h+3][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id; if ($conf->facture->enabled) {
$head[$h+3][1] = 'Factures'; $head[$h][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id;
$head[$h][1] = 'Factures';
dolibarr_fiche_head($head, 1); $h++;
}
dolibarr_fiche_head($head, $hselected);
/* /*
* *
* *
@ -53,9 +64,9 @@ $propales = array();
$projet->societe->fetch($projet->societe->id); $projet->societe->fetch($projet->societe->id);
print '<table class="border" border="1" cellpadding="4" cellspacing="0" width="100%">'; print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
print '<tr><td width="20%">Titre</td><td>'.$projet->title.'</td>'; print '<tr><td width="20%">Titre</td><td>'.$projet->title.'</td>';
print '<td width="20%">Réf</td><td>'.$projet->ref.'</td></tr>'; print '<td width="20%">'.$langs->trans("Ref").'</td><td>'.$projet->ref.'</td></tr>';
print '<tr><td>Société</td><td colspan="3"><a href="../comm/fiche.php?socid='.$projet->societe->id.'">'.$projet->societe->nom.'</a></td></tr>'; print '<tr><td>Société</td><td colspan="3"><a href="../comm/fiche.php?socid='.$projet->societe->id.'">'.$projet->societe->nom.'</a></td></tr>';
print '</table><br>'; print '</table><br>';
@ -64,10 +75,10 @@ $propales = $projet->get_propal_list();
if (sizeof($propales)>0 && is_array($propales)) if (sizeof($propales)>0 && is_array($propales))
{ {
print_titre('Listes des propositions commerciales associées au projet'); print_titre('Listes des propositions commerciales associées au projet');
print '<table border="0" width="100%" cellspacing="0" cellpadding="4">'; print '<table class="noborder" width="100%" cellspacing="0" cellpadding="3">';
print '<TR class="liste_titre">'; print '<tr class="liste_titre">';
print '<td width="15%">Réf</td><td width="25%">Date</td><td align="right">Montant</td><td>&nbsp;</td></tr>'; print '<td width="15%">'.$langs->trans("Ref").'</td><td width="25%">Date</td><td align="right">Montant</td><td>&nbsp;</td></tr>';
for ($i = 0; $i<sizeof($propales);$i++) for ($i = 0; $i<sizeof($propales);$i++)
{ {