diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index ebfade40d1a..bbfc151a82b 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -224,7 +224,7 @@ if ($_POST['action'] == 'updateligne' && $user->rights->fournisseur->commande->c } } -if ($_REQUEST['action'] == 'confirm_deleteproductline' && ($_POST['confirm'] == 'yes' || empty($conf->global->PRODUIT_CONFIRM_DELETE_LINE))) +if ($_REQUEST['action'] == 'confirm_deleteproductline' && ($_REQUEST['confirm'] == 'yes' || empty($conf->global->PRODUIT_CONFIRM_DELETE_LINE))) { if ($user->rights->fournisseur->commande->creer) { @@ -262,21 +262,21 @@ if ($_REQUEST['action'] == 'confirm_valid' && $_REQUEST['confirm'] == 'yes' && $ } } -if ($_POST['action'] == 'confirm_approve' && $_POST["confirm"] == 'yes' && $user->rights->fournisseur->commande->approuver) +if ($_REQUEST['action'] == 'confirm_approve' && $_REQUEST["confirm"] == 'yes' && $user->rights->fournisseur->commande->approuver) { $commande = new CommandeFournisseur($db); $commande->fetch($id); $result = $commande->approve($user); } -if ($_POST['action'] == 'confirm_refuse' && $_POST['confirm'] == 'yes' && $user->rights->fournisseur->commande->approuver) +if ($_REQUEST['action'] == 'confirm_refuse' && $_REQUEST['confirm'] == 'yes' && $user->rights->fournisseur->commande->approuver) { $commande = new CommandeFournisseur($db); $commande->fetch($id); $result = $commande->refuse($user); } -if ($_POST['action'] == 'confirm_commande' && $_POST['confirm'] == 'yes' && $user->rights->fournisseur->commande->commander) +if ($_REQUEST['action'] == 'confirm_commande' && $_REQUEST['confirm'] == 'yes' && $user->rights->fournisseur->commande->commander) { $commande = new CommandeFournisseur($db); $commande->fetch($id); @@ -284,7 +284,7 @@ if ($_POST['action'] == 'confirm_commande' && $_POST['confirm'] == 'yes' && $use } -if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes' && $user->rights->fournisseur->commande->creer) +if ($_REQUEST['action'] == 'confirm_delete' && $_REQUEST['confirm'] == 'yes' && $user->rights->fournisseur->commande->creer) { $commande = new CommandeFournisseur($db); $commande->id = $id; @@ -320,13 +320,20 @@ if ($_POST["action"] == 'livraison' && $user->rights->fournisseur->commande->rec } } -if ($_POST["action"] == 'confirm_cancel' && $_POST["confirm"] == yes && $user->rights->fournisseur->commande->annuler) +if ($_REQUEST["action"] == 'confirm_cancel' && $_REQUEST["confirm"] == 'yes' && $user->rights->fournisseur->commande->annuler) { $commande = new CommandeFournisseur($db); $commande->fetch($id); $result = $commande->cancel($user); - Header("Location: fiche.php?id=".$id); - exit; + if ($result > 0) + { + Header("Location: fiche.php?id=".$id); + exit; + } + else + { + $mesg=$commande->error; + } } /* @@ -501,7 +508,7 @@ if ($id > 0 || ! empty($ref)) */ if ($_GET['action'] == 'delete') { - $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete'); + $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 2); if ($ret == 'html') print '
'; } @@ -525,7 +532,7 @@ if ($id > 0 || ! empty($ref)) $text.=$notify->confirmMessage(3,$commande->socid); } - $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('ValidateOrder'), $text, 'confirm_valid'); + $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, ($conf->notification->enabled?0:1)); if ($ret == 'html') print '
'; } /* @@ -534,7 +541,7 @@ if ($id > 0 || ! empty($ref)) */ if ($_GET['action'] == 'approve') { - $ret=$html->form_confirm("fiche.php?id=$commande->id",$langs->trans("ApproveThisOrder"),$langs->trans("ConfirmApproveThisOrder"),"confirm_approve"); + $ret=$html->form_confirm("fiche.php?id=$commande->id",$langs->trans("ApproveThisOrder"),$langs->trans("ConfirmApproveThisOrder"),"confirm_approve", '', 1, 1); if ($ret == 'html') print '
'; } /* @@ -543,7 +550,7 @@ if ($id > 0 || ! empty($ref)) */ if ($_GET['action'] == 'refuse') { - $ret=$html->form_confirm("fiche.php?id=$commande->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder"),"confirm_refuse"); + $ret=$html->form_confirm("fiche.php?id=$commande->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder"),"confirm_refuse", '', 0, 1); if ($ret == 'html') print '
'; } /* @@ -551,7 +558,7 @@ if ($id > 0 || ! empty($ref)) */ if ($_GET['action'] == 'cancel') { - $ret=$html->form_confirm("fiche.php?id=$commande->id",$langs->trans("Cancel"),$langs->trans("ConfirmCancelThisOrder"),"confirm_cancel"); + $ret=$html->form_confirm("fiche.php?id=$commande->id",$langs->trans("Cancel"),$langs->trans("ConfirmCancelThisOrder"),"confirm_cancel", '', 0, 1); if ($ret == 'html') print '
'; } @@ -571,7 +578,7 @@ if ($id > 0 || ! empty($ref)) */ if ($_GET['action'] == 'delete_product_line' && ! empty($conf->global->PRODUIT_CONFIRM_DELETE_LINE)) { - $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$commande->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline'); + $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$commande->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline','',0,2); if ($ret == 'html') print '
'; } diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 0ae4bda7cdf..202342b8274 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -55,7 +55,7 @@ $action=isset($_GET['action'])?$_GET['action']:$_POST['action']; */ // Action clone object -if ($_POST["action"] == 'confirm_clone' && $_POST['confirm'] == 'yes') +if ($_REQUEST["action"] == 'confirm_clone' && $_REQUEST['confirm'] == 'yes') { if (1==0 && empty($_REQUEST["clone_content"]) && empty($_REQUEST["clone_receivers"])) { @@ -87,7 +87,7 @@ if ($_REQUEST['action'] == 'confirm_valid' && $_REQUEST['confirm'] == 'yes' && $ $result = $facturefourn->set_valid($user); } -if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes') +if ($_REQUEST['action'] == 'confirm_delete' && $_REQUEST['confirm'] == 'yes') { if ($user->rights->fournisseur->facture->supprimer ) { @@ -577,7 +577,7 @@ else // Confirmation de la suppression d'une ligne produit if ($_GET['action'] == 'confirm_delete_line') { - $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&ligne_id='.$_GET["ligne_id"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline'); + $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&ligne_id='.$_GET["ligne_id"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline', '', 0, 0); if ($ret == 'html') print '
'; } @@ -590,21 +590,21 @@ else //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) ); // Paiement incomplet. On demande si motif = escompte ou autre - $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$fac->ref),'confirm_clone',$formquestion,'yes'); + $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$fac->ref),'confirm_clone',$formquestion,'yes', 1); if ($ret == 'html') print '
'; } // Confirmation de la validation if ($_GET['action'] == 'valid') { - $ret=$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('ValidateBill'), $langs->trans('ConfirmValidateBill', $fac->ref), 'confirm_valid'); + $ret=$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('ValidateBill'), $langs->trans('ConfirmValidateBill', $fac->ref), 'confirm_valid', '', 0, 1); if ($ret == 'html') print '
'; } - // Confirmation de la validation + // Confirmation set payed if ($_GET['action'] == 'payed') { - $ret=$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('ClassifyPayed'), $langs->trans('ConfirmClassifyPayedBill', $fac->ref), 'confirm_payed'); + $ret=$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('ClassifyPayed'), $langs->trans('ConfirmClassifyPayedBill', $fac->ref), 'confirm_payed', '', 0, 1); if ($ret == 'html') print '
'; } @@ -613,7 +613,7 @@ else */ if ($_GET['action'] == 'delete') { - $ret=$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete'); + $ret=$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1); if ($ret == 'html') print '
'; } diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 7a4ccd5b1f6..0a9cfdd3c51 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -88,8 +88,8 @@ if ($action == 'add_paiement') // d'un paiement if (! $_POST['accountid']) { - $mesg = '
'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')).'
'; - $error++; + $mesg = '
'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')).'
'; + $error++; } } @@ -191,10 +191,7 @@ llxHeader(); $html=new Form($db); -if ($mesg) -{ - print ''.$mesg.''; -} +if ($mesg) print $mesg; if ($action == 'create' || $action == 'add_paiement') { @@ -222,6 +219,7 @@ if ($action == 'create' || $action == 'add_paiement') $total = $obj->total; print_fiche_titre($langs->trans('DoPayment')); + print '
'; print ''; print ''; diff --git a/htdocs/fourn/fournisseur.commande.class.php b/htdocs/fourn/fournisseur.commande.class.php index 0428e3ca02a..003dbffc4c1 100644 --- a/htdocs/fourn/fournisseur.commande.class.php +++ b/htdocs/fourn/fournisseur.commande.class.php @@ -80,7 +80,7 @@ class CommandeFournisseur extends Commande function fetch($id,$ref='') { global $conf; - + $sql = "SELECT c.rowid, c.ref, c.date_creation, c.fk_soc, c.fk_user_author, c.fk_statut, c.amount_ht, c.total_ht, c.total_ttc, c.tva,"; $sql.= " ".$this->db->pdate("c.date_commande")." as date_commande, c.fk_projet as fk_project, c.remise_percent, c.source, c.fk_methode_commande,"; $sql.= " c.note, c.note_public, c.model_pdf,"; @@ -119,7 +119,7 @@ class CommandeFournisseur extends Commande $this->note = $obj->note; $this->note_public = $obj->note_public; $this->modelpdf = $obj->model_pdf; - + $this->next_prev_filter = 'fk_soc = s.rowid AND s.entity = '.$conf->entity; $this->db->free(); @@ -322,8 +322,8 @@ class CommandeFournisseur extends Commande $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur SET fk_statut = ".$statut; - $sql .= " WHERE rowid = ".$this->id." AND fk_statut = 1"; - + $sql .= " WHERE rowid = ".$this->id; + dol_syslog("CommandeFournisseur::Cancel sql=".$sql); if ($this->db->query($sql)) { $result = 0; @@ -350,9 +350,9 @@ class CommandeFournisseur extends Commande } else { - dol_syslog("CommandeFournisseur::Cancel Error -1"); $this->db->rollback(); $this->error=$this->db->lasterror(); + dol_syslog("CommandeFournisseur::Cancel ".$this->error); return -1; } } @@ -1240,7 +1240,7 @@ class CommandeFournisseur extends Commande function ReadApprobators() { global $conf; - + $this->approbs = array(); $sql = "SELECT u.name, u.firstname, u.email"; @@ -1379,13 +1379,13 @@ class CommandeFournisseur extends Commande // Charge tableau des id de societe socids $socids = array(); - + $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe"; $sql.= " WHERE fournisseur=1"; $sql.= " AND entity = ".$conf->entity; $sql.= " LIMIT 10"; - + $resql = $this->db->query($sql); if ($resql) { @@ -1402,12 +1402,12 @@ class CommandeFournisseur extends Commande // Charge tableau des produits prodids $prodids = array(); - + $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; $sql.= " WHERE envente = 1"; $sql.= " AND entity = ".$conf->entity; - + $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index ff1ba4a36a1..e2ad045c35d 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -273,7 +273,7 @@ if ($_GET["action"] == 'clone' && $user->rights->produit->creer) /* * Suppression d'un produit/service pas encore affect */ -if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes' && $user->rights->produit->supprimer) +if ($_REQUEST['action'] == 'confirm_delete' && $_REQUEST['confirm'] == 'yes' && $user->rights->produit->supprimer) { $product = new Product($db); $product->fetch($_GET['id']); @@ -806,7 +806,7 @@ if ($_GET["id"] || $_GET["ref"]) // Confirmation de la suppression de la facture if ($_GET["action"] == 'delete') { - $ret=$html->form_confirm("fiche.php?id=".$product->id,$langs->trans("DeleteProduct"),$langs->trans("ConfirmDeleteProduct"),"confirm_delete"); + $ret=$html->form_confirm("fiche.php?id=".$product->id,$langs->trans("DeleteProduct"),$langs->trans("ConfirmDeleteProduct"),"confirm_delete",'',0,2); if ($ret == 'html') print '
'; } diff --git a/htdocs/product/photos.php b/htdocs/product/photos.php index 5ac565f4844..30e54e214d0 100644 --- a/htdocs/product/photos.php +++ b/htdocs/product/photos.php @@ -20,11 +20,11 @@ */ /** - \file htdocs/product/photos.php - \ingroup product - \brief Onglet photos de la fiche produit - \version $Id$ -*/ + \file htdocs/product/photos.php + \ingroup product + \brief Onglet photos de la fiche produit + \version $Id$ + */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/product.lib.php"); @@ -52,32 +52,29 @@ $mesg = ''; if ($_FILES['userfile']['size'] > 0 && $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC)) { - if ($_GET["id"]) - { - $product = new Product($db); - $result = $product->fetch($_GET["id"]); + if ($_GET["id"]) + { + $product = new Product($db); + $result = $product->fetch($_GET["id"]); - // if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],1) > 0) + // if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],1) > 0) - // var_dump($_FILES); + // var_dump($_FILES); - $product->add_photo($conf->produit->dir_output, $_FILES['userfile']); - } + $product->add_photo($conf->produit->dir_output, $_FILES['userfile']); + } } -if ($_REQUEST["action"] == 'confirm_delete' && $_GET["file"] && $_REQUEST['confirm'] == 'yes') +if ($_REQUEST["action"] == 'confirm_delete' && $_GET["file"] && $_REQUEST['confirm'] == 'yes' && $user->rights->produit->creer) { - if ($user->rights->produit->creer) - { - $product = new Product($db); - $product->delete_photo($conf->produit->dir_output."/".$_GET["file"]); - } + $product = new Product($db); + $product->delete_photo($conf->produit->dir_output."/".$_GET["file"]); } if ($_GET["action"] == 'addthumb' && $_GET["file"]) { $product = new Product($db); - $product->add_thumb($conf->produit->dir_output."/".$_GET["file"]); + $product->add_thumb($conf->produit->dir_output."/".$_GET["file"]); } @@ -90,187 +87,187 @@ $html = new Form($db); if ($_GET["id"] || $_GET["ref"]) { - $product = new Product($db); - if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); - if ($_GET["id"]) $result = $product->fetch($_GET["id"]); + $product = new Product($db); + if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); + if ($_GET["id"]) $result = $product->fetch($_GET["id"]); - llxHeader("","",$langs->trans("CardProduct".$product->type)); + llxHeader("","",$langs->trans("CardProduct".$product->type)); - if ($result) - { - /* - * En mode visu - */ - $head=product_prepare_head($product, $user); - $titre=$langs->trans("CardProduct".$product->type); - dol_fiche_head($head, 'photos', $titre); + if ($result) + { + /* + * En mode visu + */ + $head=product_prepare_head($product, $user); + $titre=$langs->trans("CardProduct".$product->type); + dol_fiche_head($head, 'photos', $titre); - /* - * Confirmation de la suppression de photo - */ - if ($_GET['action'] == 'delete') - { - $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$product->id.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete'); - if ($ret == 'html') print '
'; - } + /* + * Confirmation de la suppression de photo + */ + if ($_GET['action'] == 'delete') + { + $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$product->id.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1); + if ($ret == 'html') print '
'; + } - print($mesg); + print($mesg); - print ''; + print '
'; - // Reference - print ''; - print ''; - print ''; + // Reference + print ''; + print ''; + print ''; - // Libelle - print ''; - print ''; + // Libelle + print ''; + print ''; - // Prix - print ''; + // Prix + print ''; - // Statut - print ''; + // Statut + print ''; - print "
'.$langs->trans("Ref").''; - print $html->showrefnav($product,'ref','',1,'ref'); - print '
'.$langs->trans("Ref").''; + print $html->showrefnav($product,'ref','',1,'ref'); + print '
'.$langs->trans("Label").''.$product->libelle.'
'.$langs->trans("Label").''.$product->libelle.'
'.$langs->trans("SellingPrice").''; - if ($product->price_base_type == 'TTC') - { - print price($product->price_ttc).' '.$langs->trans($product->price_base_type); - } - else - { - print price($product->price).' '.$langs->trans($product->price_base_type); - } - print '
'.$langs->trans("SellingPrice").''; + if ($product->price_base_type == 'TTC') + { + print price($product->price_ttc).' '.$langs->trans($product->price_base_type); + } + else + { + print price($product->price).' '.$langs->trans($product->price_base_type); + } + print '
'.$langs->trans("Status").''; - print $product->getLibStatut(2); - print '
'.$langs->trans("Status").''; + print $product->getLibStatut(2); + print '
\n"; + print "\n"; - print "\n"; + print "\n"; - /* ************************************************************************** */ - /* */ - /* Barre d'action */ - /* */ - /* ************************************************************************** */ + /* ************************************************************************** */ + /* */ + /* Barre d'action */ + /* */ + /* ************************************************************************** */ - print "\n
\n"; + print "\n
\n"; - if ($_GET["action"] != 'ajout_photo' && $user->rights->produit->creer) - { - if (! empty($conf->global->MAIN_UPLOAD_DOC)) - { - print ''; - print $langs->trans("AddPhoto").''; - } - else - { - print 'e'; - print $langs->trans("AddPhoto").''; - } - } + if ($_GET["action"] != 'ajout_photo' && $user->rights->produit->creer) + { + if (! empty($conf->global->MAIN_UPLOAD_DOC)) + { + print ''; + print $langs->trans("AddPhoto").''; + } + else + { + print 'e'; + print $langs->trans("AddPhoto").''; + } + } - print "\n
\n"; + print "\n
\n"; - /* - * Ajouter une photo - */ - if ($_GET["action"] == 'ajout_photo' && $user->rights->produit->creer && ! empty($conf->global->MAIN_UPLOAD_DOC)) - { - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/product/photos.php?id='.$product->id,$langs->trans("AddPhoto"),1); - } + /* + * Ajouter une photo + */ + if ($_GET["action"] == 'ajout_photo' && $user->rights->produit->creer && ! empty($conf->global->MAIN_UPLOAD_DOC)) + { + // Affiche formulaire upload + $formfile=new FormFile($db); + $formfile->form_attach_new_file(DOL_URL_ROOT.'/product/photos.php?id='.$product->id,$langs->trans("AddPhoto"),1); + } - // Affiche photos - if ($_GET["action"] != 'ajout_photo') - { - $nbphoto=0; - $nbbyrow=5; + // Affiche photos + if ($_GET["action"] != 'ajout_photo') + { + $nbphoto=0; + $nbbyrow=5; - $maxWidth = 160; - $maxHeight = 120; + $maxWidth = 160; + $maxHeight = 120; - $pdir = get_exdir($product->id,2) . $product->id ."/photos/"; - $dir = $conf->produit->dir_output . '/'. $pdir; + $pdir = get_exdir($product->id,2) . $product->id ."/photos/"; + $dir = $conf->produit->dir_output . '/'. $pdir; - print '
'; - print ''; + print '
'; + print '
'; - foreach ($product->liste_photos($dir) as $key => $obj) - { - $nbphoto++; + foreach ($product->liste_photos($dir) as $key => $obj) + { + $nbphoto++; -// if ($nbbyrow && $nbphoto == 1) print '
'; + // if ($nbbyrow && $nbphoto == 1) print '
'; - if ($nbbyrow && ($nbphoto % $nbbyrow == 1)) print ''; - if ($nbbyrow) print ''; + if ($nbbyrow) print ''; - if ($nbbyrow && ($nbphoto % $nbbyrow == 0)) print ''; - } + } + if ($nbbyrow) print ''; + if ($nbbyrow && ($nbphoto % $nbbyrow == 0)) print ''; + } - // Ferme tableau - while ($nbphoto % $nbbyrow) - { - print ''; - $nbphoto++; - } + // Ferme tableau + while ($nbphoto % $nbbyrow) + { + print ''; + $nbphoto++; + } - if ($nbphoto < 1) - { - print ''; - } + if ($nbphoto < 1) + { + print ''; + } - print '
'; + if ($nbbyrow && ($nbphoto % $nbbyrow == 1)) print '
'; - print ''; + print ''; - // Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine - if ($obj['photo_vignette']) - { - $filename='thumbs/'.$obj['photo_vignette']; - } - else - { - $filename=$obj['photo']; - } + // Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine + if ($obj['photo_vignette']) + { + $filename='thumbs/'.$obj['photo_vignette']; + } + else + { + $filename=$obj['photo']; + } - // Nom affiché - $viewfilename=$obj['photo']; + // Nom affiché + $viewfilename=$obj['photo']; - // Taille de l'image - $product->get_image_size($dir.$filename); - $imgWidth = ($product->imgWidth < $maxWidth) ? $product->imgWidth : $maxWidth; - $imgHeight = ($product->imgHeight < $maxHeight) ? $product->imgHeight : $maxHeight; + // Taille de l'image + $product->get_image_size($dir.$filename); + $imgWidth = ($product->imgWidth < $maxWidth) ? $product->imgWidth : $maxWidth; + $imgHeight = ($product->imgHeight < $maxHeight) ? $product->imgHeight : $maxHeight; - print ''; + print ''; - print ''; - print '
'.$viewfilename; - print '
'; + print ''; + print '
'.$viewfilename; + print '
'; - // On propose la génération de la vignette si elle n'existe pas et si la taille est supérieure aux limites - if (!$obj['photo_vignette'] && eregi('(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$',$obj['photo']) && ($product->imgWidth > $maxWidth || $product->imgHeight > $maxHeight)) - { - print ''.img_refresh($langs->trans('GenerateThumb')).'  '; - } - if ($user->rights->produit->creer) - { + // On propose la génération de la vignette si elle n'existe pas et si la taille est supérieure aux limites + if (!$obj['photo_vignette'] && eregi('(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$',$obj['photo']) && ($product->imgWidth > $maxWidth || $product->imgHeight > $maxHeight)) + { + print ''.img_refresh($langs->trans('GenerateThumb')).'  '; + } + if ($user->rights->produit->creer) + { print ''; print img_delete().''; - } - if ($nbbyrow) print '
  
'; - print "
".$langs->trans("NoPhotoYet")."

"; - print '
'; + print "
".$langs->trans("NoPhotoYet")."

"; + print '
'; - } - } + print ''; + } + } } else { - print $langs->trans("ErrorUnknown"); + print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/soc.php b/htdocs/soc.php index e619ee79925..f94d7fc20a2 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -955,7 +955,7 @@ else dol_fiche_head($head, 'company', $langs->trans("ThirdParty")); - // Confirmation de la suppression de la facture + // Confirm delete third party if ($_GET["action"] == 'delete') { $html = new Form($db); @@ -981,7 +981,8 @@ else print ''.$langs->trans('Prefix').''.$soc->prefix_comm.''; - if ($soc->client) { + if ($soc->client) + { print ''; print $langs->trans('CustomerCode').''; print $soc->code_client; diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 7b275b383f3..6a0a9f0d85a 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -98,7 +98,7 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC)) } // Suppression fichier -if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes') +if ($_REQUEST['action'] == 'confirm_deletefile' && $_REQUEST['confirm'] == 'yes') { $file = $upload_dir . "/" . urldecode($_GET["urlfile"]); dol_delete_file($file); @@ -157,11 +157,11 @@ if ($socid > 0) if ($mesg) { print "$mesg
"; } /* - * Confirmation de la suppression d'une ligne produit + * Confirmation suppression fichier */ if ($_GET['action'] == 'delete') { - $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?socid='.$_GET["id"].'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); + $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?socid='.$_GET["id"].'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); if ($ret == 'html') print '
'; } diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 17ae5f43db4..ef8c4c470c3 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -80,7 +80,7 @@ if ($_GET["subaction"] == 'delrights' && $caneditperms) $edituser->delrights($_GET["rights"]); } -if ($_POST["action"] == 'confirm_disable' && $_POST["confirm"] == "yes") +if ($_REQUEST["action"] == 'confirm_disable' && $_REQUEST["confirm"] == "yes") { if ($_GET["id"] <> $user->id) { @@ -92,7 +92,7 @@ if ($_POST["action"] == 'confirm_disable' && $_POST["confirm"] == "yes") exit; } } -if ($_POST["action"] == 'confirm_enable' && $_POST["confirm"] == "yes") +if ($_REQUEST["action"] == 'confirm_enable' && $_REQUEST["confirm"] == "yes") { if ($_GET["id"] <> $user->id) { @@ -105,7 +105,7 @@ if ($_POST["action"] == 'confirm_enable' && $_POST["confirm"] == "yes") } } -if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes") +if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == "yes") { if ($_GET["id"] <> $user->id) { @@ -299,8 +299,8 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"] && $caneditfield) } // Action modif mot de passe -if ((($_POST["action"] == 'confirm_password' && $_POST["confirm"] == 'yes') -|| $_POST["action"] == 'confirm_passwordsend') && $caneditpassword) +if ((($_REQUEST["action"] == 'confirm_password' && $_REQUEST["confirm"] == 'yes') +|| ($_REQUEST["action"] == 'confirm_passwordsend' && $_REQUEST["confirm"] == 'yes')) && $caneditpassword) { $edituser = new User($db, $_GET["id"]); $edituser->fetch(); @@ -314,7 +314,7 @@ if ((($_POST["action"] == 'confirm_password' && $_POST["confirm"] == 'yes') else { // Succes - if ($_POST["action"] == 'confirm_passwordsend') + if ($_REQUEST["action"] == 'confirm_passwordsend' && $_REQUEST["confirm"] == 'yes') { if ($edituser->send_password($user,$newpassword) > 0) { @@ -764,7 +764,7 @@ else */ if ($action == 'password') { - $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("ReinitPassword"),$langs->trans("ConfirmReinitPassword",$fuser->login),"confirm_password"); + $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("ReinitPassword"),$langs->trans("ConfirmReinitPassword",$fuser->login),"confirm_password", '', 0, 1); if ($ret == 'html') print '
'; } @@ -773,7 +773,7 @@ else */ if ($action == 'passwordsend') { - $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("SendNewPassword"),$langs->trans("ConfirmSendNewPassword",$fuser->login),"confirm_passwordsend"); + $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("SendNewPassword"),$langs->trans("ConfirmSendNewPassword",$fuser->login),"confirm_passwordsend", '', 0, 1); if ($ret == 'html') print '
'; } @@ -782,7 +782,7 @@ else */ if ($action == 'disable') { - $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("DisableAUser"),$langs->trans("ConfirmDisableUser",$fuser->login),"confirm_disable"); + $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("DisableAUser"),$langs->trans("ConfirmDisableUser",$fuser->login),"confirm_disable", '', 0, 1); if ($ret == 'html') print '
'; } @@ -791,7 +791,7 @@ else */ if ($action == 'enable') { - $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("EnableAUser"),$langs->trans("ConfirmEnableUser",$fuser->login),"confirm_enable"); + $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("EnableAUser"),$langs->trans("ConfirmEnableUser",$fuser->login),"confirm_enable", '', 0, 1); if ($ret == 'html') print '
'; } @@ -800,7 +800,7 @@ else */ if ($action == 'delete') { - $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("DeleteAUser"),$langs->trans("ConfirmDeleteUser",$fuser->login),"confirm_delete"); + $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("DeleteAUser"),$langs->trans("ConfirmDeleteUser",$fuser->login),"confirm_delete", '', 0, 1); if ($ret == 'html') print '
'; } diff --git a/htdocs/user/group/fiche.php b/htdocs/user/group/fiche.php index 4eb6e9c8e24..802b8c5aaa6 100644 --- a/htdocs/user/group/fiche.php +++ b/htdocs/user/group/fiche.php @@ -45,14 +45,17 @@ $action=isset($_GET["action"])?$_GET["action"]:$_POST["action"]; /** * Action suppression groupe */ -if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes") +if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == "yes") { - if($caneditperms){ + if ($caneditperms) + { $editgroup = new Usergroup($db, $_GET["id"]); $editgroup->fetch($_GET["id"]); $editgroup->delete(); Header("Location: index.php"); - }else{ + } + else + { $message = '
'.$langs->trans('ErrorForbidden').'
'; } } @@ -62,14 +65,17 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes") */ if ($_POST["action"] == 'add') { - if($caneditperms){ + if($caneditperms) + { $message=""; - if (! $_POST["nom"]) { + if (! $_POST["nom"]) + { $message='
'.$langs->trans("NameNotDefined").'
'; $action="create"; // Go back to create page } - if (! $message) { + if (! $message) + { $editgroup = new UserGroup($db,0); $editgroup->nom = trim($_POST["nom"]); @@ -226,7 +232,7 @@ else */ if ($action == 'delete') { - $ret=$html->form_confirm("fiche.php?id=$group->id",$langs->trans("DeleteAGroup"),$langs->trans("ConfirmDeleteGroup",$group->name),"confirm_delete"); + $ret=$html->form_confirm("fiche.php?id=".$group->id,$langs->trans("DeleteAGroup"),$langs->trans("ConfirmDeleteGroup",$group->name),"confirm_delete", '',0,1); if ($ret == 'html') print '
'; }