From 7695e4350cdfabea5e5ffd8f27cd6ad5e3058c56 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 13 Jul 2004 17:40:42 +0000 Subject: [PATCH] Suppression du PHP_SELF --- htdocs/comm/action/index.php | 9 +- htdocs/comm/action/rapport/index.php | 2 +- htdocs/comm/bookmark.php | 2 +- htdocs/comm/clients.php | 16 ++-- htdocs/comm/contact.php | 68 ++++++++------- htdocs/comm/fiche.php | 2 +- htdocs/comm/propal.php | 118 +++++++++++++-------------- 7 files changed, 109 insertions(+), 108 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index bbc7e4a5d47..610c0e43223 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -69,21 +69,16 @@ if ($action=='add_action') } $actioncomm->type = $actionid; $actioncomm->contact = $contactid; - $actioncomm->societe = $socid; $actioncomm->note = $note; - $actioncomm->add($user); $societe = new Societe($db); $societe->fetch($socid); - $todo = new TodoComm($db); $todo->date = mktime(12,0,0,$remonth, $reday, $reyear); - $todo->libelle = $todo_label; - $todo->societe = $societe->id; $todo->contact = $contactid; @@ -157,11 +152,11 @@ if ( $db->query($sql) ) $societe = new Societe($db); $societe->fetch($socid); - print_barre_liste("Liste des actions commerciales réalisées ou à faire sur " . $societe->nom, $page, $PHP_SELF,'',$sortfield,$sortorder,'',$num); + print_barre_liste("Liste des actions commerciales réalisées ou à faire sur " . $societe->nom, $page, "index.php",'',$sortfield,$sortorder,'',$num); } else { - print_barre_liste("Liste des actions commerciales réalisées ou à faire", $page, $PHP_SELF,'',$sortfield,$sortorder,'',$num); + print_barre_liste("Liste des actions commerciales réalisées ou à faire", $page, "index.php",'',$sortfield,$sortorder,'',$num); } $i = 0; print ""; diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 3a3f434b699..6a7666b2e33 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -144,7 +144,7 @@ if ( $db->query($sql) ) { $num = $db->num_rows(); - print_barre_liste("Liste des actions commerciales réalisées ou à faire", $page, $PHP_SELF,'',$sortfield,$sortorder,'',$num); + print_barre_liste("Liste des actions commerciales réalisées ou à faire", $page, "index.php",'',$sortfield,$sortorder,'',$num); $i = 0; print '
'; diff --git a/htdocs/comm/bookmark.php b/htdocs/comm/bookmark.php index 4d5869476ea..80a29b6b064 100644 --- a/htdocs/comm/bookmark.php +++ b/htdocs/comm/bookmark.php @@ -115,7 +115,7 @@ if ( $db->query($sql) ) print "\n"; print "\n"; print ""; - print "\n"; + print "\n"; print "\n"; $i++; } diff --git a/htdocs/comm/clients.php b/htdocs/comm/clients.php index 847c38999ce..d23e6d41bf3 100644 --- a/htdocs/comm/clients.php +++ b/htdocs/comm/clients.php @@ -44,9 +44,9 @@ if ($user->societe_id > 0) if ($page == -1) { $page = 0 ; } -$offset = $conf->liste_limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; +$offset = $conf->liste_limit * $_GET["page"] ; +$pageprev = $_GET["page"] - 1; +$pagenext = $_GET["page"] + 1; /* * Mode Liste @@ -106,13 +106,13 @@ if ($result) } - print_barre_liste("Liste des clients", $page, $PHP_SELF,"",$sortfield,$sortorder,'',$num); + print_barre_liste("Liste des clients", $page, "clients.php","",$sortfield,$sortorder,'',$num); print '
'; - print "| *\n| "; + print "| *\n| "; for ($ij = 65 ; $ij < 91; $ij++) { - print ""; + print ""; if ($_GET["begin"] == chr($ij) ) { @@ -140,9 +140,9 @@ if ($result) print '
$obj->stcomm$obj->author".strftime("%d %b %Y %H:%M", $obj->dateb) ."[bid\">Delete][bid\">Delete]
'; print ''; print ""; print "\n"; $var=True; diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index 0e9a30feea1..08536b802a1 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2001-2004 Rodolphe Quiedeville * Copyright (C) 2003 Éric Seigne * Copyright (C) 2004 Laurent Destailleur * @@ -48,23 +48,23 @@ if ($sortfield == "") { $sortfield="p.name"; } - +$page=$_GET["page"]; if ($page == -1) { $page = 0 ; } $limit = $conf->liste_limit; $offset = $limit * $page ; if ($type == "c") { - $label = " clients"; - $urlfiche="fiche.php"; + $label = " clients"; + $urlfiche="fiche.php"; } if ($type == "p") { - $label = " prospects"; - $urlfiche="prospect/fiche.php"; + $label = " prospects"; + $urlfiche="prospect/fiche.php"; } if ($type == "f") { - $label = " fournisseurs"; - $urlfiche="fiche.php"; + $label = " fournisseurs"; + $urlfiche="fiche.php"; } @@ -114,39 +114,45 @@ $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset); $result = $db->query($sql); if ($result) - { +{ $num = $db->num_rows(); - - print_barre_liste("Liste des contacts $label",$page, $PHP_SELF, "",$sortfield,$sortorder,"",$num); + + print_barre_liste("Liste des contacts $label",$page, "contact.php", "",$sortfield,$sortorder,"",$num); print "
"; - print "| *\n| "; + print "| *\n| "; for ($i = 65 ; $i < 91; $i++) { - print ""; + print ""; - if ($begin == chr($i) ) { - print "->" . chr($i) . "<-" ; - } else { - print chr($i) ; - } + if ($begin == chr($i) ) + { + print "->" . chr($i) . "<-" ; + } + else + { + print chr($i) ; + } print " | "; } print "
"; - if ($sortorder == "DESC") { - $sortorder="ASC"; - } else { - $sortorder="DESC"; + if ($sortorder == "DESC") + { + $sortorder="ASC"; + } + else + { + $sortorder="DESC"; } print '
"; - print_liste_field_titre("Société",$PHP_SELF,"s.nom"); + print_liste_field_titre("Société","clients.php","s.nom"); print ""; - print_liste_field_titre("Ville",$PHP_SELF,"s.ville"); + print_liste_field_titre("Ville","clients.php","s.ville"); print "
'; print '"; print ''; print "\n"; @@ -160,7 +166,7 @@ if ($result) print ""; print ''; + print ' '.$obj->name.''; print ""; print ''; - print ''; + print ''; print "\n"; $i++; } print "
'; - print_liste_field_titre("Nom",$PHP_SELF,"lower(p.name)", $begin); + print_liste_field_titre("Nom","contact.php","lower(p.name)", $begin); print ""; - print_liste_field_titre("Prénom",$PHP_SELF,"lower(p.firstname)", $begin); + print_liste_field_titre("Prénom","contact.php","lower(p.firstname)", $begin); print ""; - print_liste_field_titre("Société",$PHP_SELF,"lower(s.nom)", $begin); + print_liste_field_titre("Société","contact.php","lower(s.nom)", $begin); print "emailTéléphone
'.img_file(); - print ' '.$obj->name.'$obj->firstnamefiltrer '; @@ -168,16 +174,18 @@ if ($result) print ''.$obj->email.' '.$obj->phone.' '.dolibarr_print_phone($obj->phone).' 

"; $db->free(); -} else { - print_barre_liste("Liste des contacts $label",$page, $PHP_SELF); - +} +else +{ + print_barre_liste("Liste des contacts $label",$page, "contact.php"); + print $db->error(); } diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index c6248f96f92..3d4c15f47ca 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -215,7 +215,7 @@ if ($_GET["socid"] > 0) } else { - print "[id&action=attribute_prefix\">Attribuer]"; + print "[id&action=attribute_prefix\">Attribuer]"; } print ""; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index ab3e6f4f1c6..b73ae9d54aa 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -54,7 +54,7 @@ if ($user->societe_id > 0) /* Actions */ /******************************************************************************/ -if ($HTTP_POST_VARS["action"] == 'confirm_delete' && $HTTP_POST_VARS["confirm"] == yes) +if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == yes) { if ($user->rights->propale->supprimer ) { @@ -68,24 +68,24 @@ if ($HTTP_POST_VARS["action"] == 'confirm_delete' && $HTTP_POST_VARS["confirm"] } -if ($HTTP_POST_VARS["action"] == 'add') +if ($_POST["action"] == 'add') { $propal = new Propal($db, $_GET["socidp"]); $propal->datep = mktime(12, 1 , 1, - $HTTP_POST_VARS["remonth"], - $HTTP_POST_VARS["reday"], - $HTTP_POST_VARS["reyear"]); + $_POST["remonth"], + $_POST["reday"], + $_POST["reyear"]); - $propal->duree_validite = $HTTP_POST_VARS["duree_validite"]; + $propal->duree_validite = $_POST["duree_validite"]; - $propal->contactid = $HTTP_POST_VARS["contactidp"]; - $propal->projetidp = $HTTP_POST_VARS["projetidp"]; - $propal->modelpdf = $HTTP_POST_VARS["modelpdf"]; + $propal->contactid = $_POST["contactidp"]; + $propal->projetidp = $_POST["projetidp"]; + $propal->modelpdf = $_POST["modelpdf"]; $propal->author = $user->id; - $propal->note = $HTTP_POST_VARS["note"]; + $propal->note = $_POST["note"]; - $propal->ref = $HTTP_POST_VARS["ref"]; + $propal->ref = $_POST["ref"]; for ($i = 1 ; $i <= PROPALE_NEW_FORM_NB_PRODUCT ; $i++) { @@ -93,7 +93,7 @@ if ($HTTP_POST_VARS["action"] == 'add') $xqty = "qty".$i; $xremise = "remise".$i; - $propal->add_product($HTTP_POST_VARS[$xid],$HTTP_POST_VARS[$xqty],$HTTP_POST_VARS[$xremise]); + $propal->add_product($_POST[$xid],$_POST[$xqty],$_POST[$xremise]); } $id = $propal->create(); @@ -103,7 +103,7 @@ if ($HTTP_POST_VARS["action"] == 'add') */ if ($id) { - propale_pdf_create($db, $id, $HTTP_POST_VARS["modelpdf"]); + propale_pdf_create($db, $id, $_POST["modelpdf"]); $_GET["propalid"] = $id; } } @@ -115,14 +115,14 @@ if ($action == 'pdf') propale_pdf_create($db, $propalid, $propal->modelpdf); } -if ($HTTP_POST_VARS["action"] == 'setstatut' && $user->rights->propale->cloturer) +if ($_POST["action"] == 'setstatut' && $user->rights->propale->cloturer) { /* * Cloture de la propale */ $propal = new Propal($db); $propal->fetch($_GET["propalid"]); - $propal->cloture($user, $HTTP_POST_VARS["statut"], $HTTP_POST_VARS["note"]); + $propal->cloture($user, $_POST["statut"], $_POST["note"]); } if ($_GET["action"] == 'commande') @@ -147,53 +147,53 @@ if ($action == 'modif' && $user->rights->propale->creer) } -if ($HTTP_POST_VARS["addligne"] == 'Ajouter' && $user->rights->propale->creer) +if ($_POST["addligne"] == 'Ajouter' && $user->rights->propale->creer) { /* * Ajout d'une ligne produit dans la propale */ - if ($HTTP_POST_VARS["idprod"]) + if ($_POST["idprod"]) { $propal = new Propal($db); $propal->fetch($propalid); - $propal->insert_product($HTTP_POST_VARS["idprod"], $HTTP_POST_VARS["qty"], $HTTP_POST_VARS["remise"]); + $propal->insert_product($_POST["idprod"], $_POST["qty"], $_POST["remise"]); propale_pdf_create($db, $_GET["propalid"], $propal->modelpdf); } } -if ($HTTP_POST_VARS["addproduct"] == 'Ajouter' && $user->rights->propale->creer) +if ($_POST["addproduct"] == 'Ajouter' && $user->rights->propale->creer) { /* * Ajout d'une ligne produit dans la propale */ - if (strlen($HTTP_POST_VARS["np_desc"]) && - strlen($HTTP_POST_VARS["np_price"])) + if (strlen($_POST["np_desc"]) && + strlen($_POST["np_price"])) { $propal = new Propal($db); $propal->fetch($propalid); - $propal->insert_product_generic($HTTP_POST_VARS["np_desc"], - $HTTP_POST_VARS["np_price"], - $HTTP_POST_VARS["np_qty"], - $HTTP_POST_VARS["np_tva_tx"], - $HTTP_POST_VARS["np_remise"]); + $propal->insert_product_generic($_POST["np_desc"], + $_POST["np_price"], + $_POST["np_qty"], + $_POST["np_tva_tx"], + $_POST["np_remise"]); } } -if ($HTTP_POST_VARS["action"] == 'setremise' && $user->rights->propale->creer) +if ($_POST["action"] == 'setremise' && $user->rights->propale->creer) { $propal = new Propal($db); - $propal->fetch($propalid); - $propal->set_remise($user, $HTTP_POST_VARS["remise"]); + $propal->fetch($_GET["propalid"]); + $propal->set_remise($user, $_POST["remise"]); propale_pdf_create($db, $_GET["propalid"], $propal->modelpdf); } -if ($HTTP_POST_VARS["action"] == 'setpdfmodel' && $user->rights->propale->creer) +if ($_POST["action"] == 'setpdfmodel' && $user->rights->propale->creer) { - $propal = new Propal($db, 0, $propalid); - $propal->set_pdf_model($user, $HTTP_POST_VARS["modelpdf"]); - propale_pdf_create($db, $propalid, $HTTP_POST_VARS["modelpdf"]); + $propal = new Propal($db, 0, $_GET["propalid"]); + $propal->set_pdf_model($user, $_POST["modelpdf"]); + propale_pdf_create($db, $_GET["propalid"], $_POST["modelpdf"]); } @@ -246,7 +246,7 @@ if ($_GET["propalid"]) $head[$h][0] = DOL_URL_ROOT.'/comm/propal/note.php?propalid='.$propal->id; $head[$h][1] = "Note"; - dolibarr_fiche_head($head, $a); + dolibarr_fiche_head($head, $a, $societe->nom); /* * Confirmation de la suppression de la propale @@ -254,7 +254,7 @@ if ($_GET["propalid"]) */ if ($action == 'delete') { - $html->form_confirm("$PHP_SELF?propalid=$propal->id","Supprimer la proposition","Etes-vous sûr de vouloir supprimer cette proposition ?","confirm_delete"); + $html->form_confirm("propal.php?propalid=$propal->id","Supprimer la proposition","Etes-vous sûr de vouloir supprimer cette proposition ?","confirm_delete"); } /* * @@ -307,7 +307,7 @@ if ($_GET["propalid"]) print "Destinataire$obj->firstname $obj->name <$obj->email>"; - print 'Note :
'. nl2br($propal->note).""; + print 'Note :
'. nl2br($propal->note).""; if ($propal->projet_id) { @@ -342,7 +342,7 @@ if ($_GET["propalid"]) if ($_GET["action"] == 'statut') { - print "
id\" method=\"post\">"; + print "id\" method=\"post\">"; print '
'; print '
Clôturer comme : '; print "
"; print '
'; - if ($propal->brouillon == 1) + if ($propal->brouillon == 1 && $user->rights->propale->creer) { print '
'; print ''; @@ -518,7 +518,7 @@ if ($_GET["propalid"]) { if ($user->rights->propale->supprimer) { - print "id&action=delete\">Supprimer"; + print "id&action=delete\">Supprimer"; } } @@ -526,7 +526,7 @@ if ($_GET["propalid"]) { if ($propal->statut == 1 && $user->rights->propale->cloturer) { - print "id&action=statut\">Cloturer"; + print "id&action=statut\">Cloturer"; } } @@ -535,10 +535,8 @@ if ($_GET["propalid"]) */ if ($propal->statut < 2 && $user->rights->propale->creer) { - print 'id&action=pdf\">Générer"; - } - - + print 'Générer'; + } /* * */ @@ -549,7 +547,7 @@ if ($_GET["propalid"]) { if ($user->rights->propale->envoyer) { - print "id&action=presend\">Envoyer la proposition"; + print "id&action=presend\">Envoyer la proposition"; } } @@ -561,7 +559,7 @@ if ($_GET["propalid"]) { if ($user->rights->propale->valider) { - print "id&valid=1\">Valider"; + print "id&valid=1\">Valider"; } } @@ -569,7 +567,7 @@ if ($_GET["propalid"]) { if ($user->rights->propale->creer) { - print "id&action=modif\">Modifier"; + print "id&action=modif\">Modifier"; } } @@ -654,7 +652,7 @@ if ($_GET["propalid"]) */ - if ($propal->brouillon == 1) + if ($propal->brouillon == 1 && $user->rights->propale->creer) { print "Modèle"; $html = new Form($db); @@ -681,7 +679,7 @@ if ($_GET["propalid"]) } print ""; } - // print 'Générer"; + // print 'Générer"; /* * */ @@ -746,7 +744,7 @@ if ($_GET["propalid"]) $message = "Veuillez trouver ci-joint notre proposition commerciale $propal->ref\n\nCordialement\n\n"; - print "id&action=send\">\n"; + print "id&action=send\">\n"; print "\n"; print "\n"; print ''; @@ -802,7 +800,7 @@ if ($_GET["propalid"]) } else { - print '

Voir le suivi des actions '; + print '

Voir le suivi des actions '; } } @@ -863,9 +861,9 @@ if ($_GET["propalid"]) $sql .= " AND date_format(p.datep, '%Y') = $year"; } - if (strlen($HTTP_POST_VARS["sf_ref"]) > 0) + if (strlen($_POST["sf_ref"]) > 0) { - $sql .= " AND p.ref like '%".$HTTP_POST_VARS["sf_ref"] . "%'"; + $sql .= " AND p.ref like '%".$_POST["sf_ref"] . "%'"; } $sql .= " ORDER BY $sortfield $sortorder"; @@ -874,7 +872,7 @@ if ($_GET["propalid"]) if ( $db->query($sql) ) { $num = $db->num_rows(); - print_barre_liste("Propositions commerciales", $_GET["page"], $PHP_SELF,"&socidp=$socidp",$sortfield,$sortorder,'',$num); + print_barre_liste("Propositions commerciales", $_GET["page"],"propal.php","&socidp=$socidp",$sortfield,$sortorder,'',$num); $i = 0; @@ -882,14 +880,14 @@ if ($_GET["propalid"]) print ''; - print_liste_field_titre_new ("Réf",$PHP_SELF,"p.ref","","&socidp=$socidp",'width="15%"',$sortfield); + print_liste_field_titre_new ("Réf","propal.php","p.ref","","&socidp=$socidp",'width="15%"',$sortfield); - print_liste_field_titre_new ("Société",$PHP_SELF,"s.nom","","&socidp=$socidp",'width="30%"',$sortfield); + print_liste_field_titre_new ("Société","propal.php","s.nom","","&socidp=$socidp",'width="30%"',$sortfield); - print_liste_field_titre_new ("Date",$PHP_SELF,"p.datep","","&socidp=$socidp", 'width="25%" align="right" colspan="2"',$sortfield); - print_liste_field_titre_new ("Prix",$PHP_SELF,"p.price","","&socidp=$socidp", ' width="20%" align="right"',$sortfield); + print_liste_field_titre_new ("Date","propal.php","p.datep","","&socidp=$socidp", 'width="25%" align="right" colspan="2"',$sortfield); + print_liste_field_titre_new ("Prix","propal.php","p.price","","&socidp=$socidp", ' width="20%" align="right"',$sortfield); - print_liste_field_titre_new ("Statut",$PHP_SELF,"p.fk_statut","","&socidp=$socidp",'width="10%" align="center"',$sortfield); + print_liste_field_titre_new ("Statut","propal.php","p.fk_statut","","&socidp=$socidp",'width="10%" align="center"',$sortfield); print "\n"; $var=True; @@ -901,7 +899,7 @@ if ($_GET["propalid"]) print ""; print ''; print img_file(); - print " propalid\">$objp->ref\n"; + print " propalid\">$objp->ref\n"; if ($objp->client == 1) { $url ='fiche.php?socid='.$objp->idp;