diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index e3c698af0c5adf530c36fc1fca6a4466210e5250..84fcc06d462578415beabb41f7a1b5ef7f15a461 100755 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> + * Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es> * * 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 @@ -54,7 +55,14 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", $_POST["MAIN_PROFID3_IN_ADDRESS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", $_POST["MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"],'chaine',0,'',$conf->entity); - + + if ($conf->global->MAIN_FEATURES_LEVEL > 1) + { + dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DESC"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity); + } + Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; } @@ -200,6 +208,27 @@ if ($action == 'edit') // Edit print '<tr '.$bc[$var].'><td>'.$langs->trans("HideAnyVATInformationOnPDF").'</td><td>'; print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))?$conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT:0,1); print '</td></tr>'; + + if ($conf->global->MAIN_FEATURES_LEVEL > 1) + { + //Desc + $var=!$var; + print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDescOnPDF").'</td><td>'; + print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC:0,1); + print '</td></tr>'; + + //Ref + $var=!$var; + print '<tr '.$bc[$var].'><td>'.$langs->trans("HideRefOnPDF").'</td><td>'; + print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_REF',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF:0,1); + print '</td></tr>'; + + //Details + $var=!$var; + print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDetailsOnPDF").'</td><td>'; + print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1); + print '</td></tr>'; + } print '</table>'; @@ -341,6 +370,27 @@ else // Show print '<tr '.$bc[$var].'><td>'.$langs->trans("HideAnyVATInformationOnPDF").'</td><td>'; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT,1); print '</td></tr>'; + + if ($conf->global->MAIN_FEATURES_LEVEL > 1) + { + //Desc + $var=!$var; + print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDescOnPDF").'</td><td>'; + print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC,1); + print '</td></tr>'; + + //Ref + $var=!$var; + print '<tr '.$bc[$var].'><td>'.$langs->trans("HideRefOnPDF").'</td><td>'; + print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF,1); + print '</td></tr>'; + + //Details + $var=!$var; + print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDetailsOnPDF").'</td><td>'; + print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1); + print '</td></tr>'; + } print '</table>'; diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index 2a6e437c765876184950feee43a6858f63a4e523..4a7ceaf36c3302cbf6fda6aba26fdc77d5a2276d 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -39,6 +39,7 @@ $type = GETPOST('type'); $mesg = GETPOST('mesg'); $removecat = GETPOST('removecat','int'); +$catMere=GETPOST('catMere','int'); $dbtablename = ''; @@ -121,7 +122,7 @@ if ($removecat > 0) } // Add object into a category -if (isset($_REQUEST["catMere"]) && $_REQUEST["catMere"]>=0) +if ($catMere > 0) { if ($type==0 && ($user->rights->produit->creer || $user->rights->service->creer)) { @@ -150,7 +151,7 @@ if (isset($_REQUEST["catMere"]) && $_REQUEST["catMere"]>=0) $elementtype = 'member'; } $cat = new Categorie($db); - $result=$cat->fetch($_REQUEST["catMere"]); + $result=$cat->fetch($catMere); $result=$cat->add_type($object,$elementtype); if ($result >= 0) @@ -162,7 +163,6 @@ if (isset($_REQUEST["catMere"]) && $_REQUEST["catMere"]>=0) if ($cat->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') $mesg='<div class="error">'.$langs->trans("ObjectAlreadyLinkedToCategory").'</div>'; else $mesg=$langs->trans("Error").' '.$cat->error; } - } diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index ad11b066e8b3b57b4ca97a74b23bc07037cd82ef..3a31f6b0e7fbcd1b6a6626e216061462a3c9124f 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -579,7 +579,8 @@ class Categorie $cats = array (); while ($rec = $this->db->fetch_array($res)) { - $cat = new Categorie($this->db, $rec['fk_categorie_fille']); + $cat = new self($this->db); + $cat->fetch($rec['fk_categorie_fille']); $cats[] = $cat; } return $cats; @@ -826,9 +827,10 @@ class Categorie if ($res) { $cats = array (); - while ($record = $this->db->fetch_array($res)) + while ($rec = $this->db->fetch_array($res)) { - $cat = new Categorie($this->db, $record['rowid']); + $cat = new self($this->db); + $cat->fetch($rec['rowid']); $cats[$record['rowid']] = $cat; } return $cats; @@ -1059,9 +1061,11 @@ class Categorie if ($res) { - while ($cat = $this->db->fetch_array($res)) + while ($rec = $this->db->fetch_array($res)) { - $meres[] = new Categorie($this->db, $cat['fk_categorie_mere']); + $cat = new self($this->db); + $cat->fetch($rec['fk_categorie_mere']); + $meres[] = $cat; } return $meres; } @@ -1125,9 +1129,11 @@ class Categorie $res = $this->db->query($sql); if ($res) { - while ($cat = $this->db->fetch_array($res)) + while ($rec = $this->db->fetch_array($res)) { - $cats[] = new Categorie($this->db, $cat['fk_categorie']); + $cat = new self($this->db); + $cat->fetch($rec['fk_categorie']); + $cats[] = $cat; } return $cats; @@ -1174,9 +1180,11 @@ class Categorie $res = $this->db->query($sql); if ($res) { - while ($id = $this->db->fetch_array($res)) + while ($rec = $this->db->fetch_array($res)) { - $cats[] = new Categorie($this->db, $id['rowid']); + $cat = new self($this->db); + $cat->fetch($rec['rowid']); + $cats[] = $cat; } return $cats; diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 015b964d452e1832be18e84696375d2bfc86a18a..76b38f296815d1600d6bcd16f77979f5ecf4bafb 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -108,7 +108,9 @@ print_fiche_titre($langs->trans("ModifCat")); dol_htmloutput_errors($mesg); -$categorie = new Categorie($db, $id); +$object = new Categorie($db); +$object->fetch($id); + $form = new Form($db); print '<table class="notopnoleft" border="0" width="100%">'; @@ -119,7 +121,7 @@ print "\n"; print '<form method="post" action="'.$_SERVER['PHP_SELF'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="action" value="update">'; -print '<input type="hidden" name="id" value="'.$categorie->id.'">'; +print '<input type="hidden" name="id" value="'.$object->id.'">'; print '<input type="hidden" name="type" value="'.$type.'">'; print '<table class="border" width="100%">'; @@ -127,7 +129,7 @@ print '<table class="border" width="100%">'; // Ref print '<tr><td class="fieldrequired">'; print $langs->trans("Ref").'</td>'; -print '<td><input type="text" size="25" id="nom" name ="nom" value="'.$categorie->label.'" />'; +print '<td><input type="text" size="25" id="nom" name ="nom" value="'.$object->label.'" />'; print '</tr>'; // Description @@ -135,13 +137,13 @@ print '<tr>'; print '<td width="25%">'.$langs->trans("Description").'</td>'; print '<td>'; require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); -$doleditor=new DolEditor('description',$categorie->description,'',200,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,ROWS_6,50); +$doleditor=new DolEditor('description',$object->description,'',200,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,ROWS_6,50); $doleditor->Create(); print '</td></tr>'; // Parent category print '<tr><td>'.$langs->trans("In").'</td><td>'; -print $form->select_all_categories($type,$categorie->id_mere,'catMere',64,$categorie->id); +print $form->select_all_categories($type,$object->id_mere,'catMere',64,$object->id); print '</td></tr>'; print '</table>'; @@ -154,7 +156,7 @@ print '</form>'; print '</td></tr></table>'; -$db->close(); llxFooter(); +$db->close(); ?> diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 0b642de04cef0ce8099cbd1d13ec1569d71792db..ff13527b06a2699e11879cf5a3b55f602d8e4492 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -127,10 +127,26 @@ if ($action == 'delete') $sql="DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles where rowid=".$id; $resql=$db->query($sql); if ($resql) - { - $classname = "MailingTargets"; - $obj = new $classname($db); - $obj->update_nb($id); + { //on récurpére l'id du mailing + $id = GETPOST('id','int'); + + if (!empty($id)) + { + $file = $dirmod."/modules_mailings.php"; + $classname = "MailingTargets"; + require_once($file); + + $obj = new $classname($db); + $obj->update_nb($id); + + Header("Location: cibles.php?id=".$id); + exit; + } + else + { + Header("Location: liste.php"); + exit; + } } else { diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index eedf29026ddd7085805e4179b966ae760cf29778..c6b4a607520bd74064a8b216004e85390ea41344 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -5,7 +5,7 @@ * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> - * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> + * Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * @@ -64,6 +64,11 @@ $mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg")); $year=GETPOST("year"); $month=GETPOST("month"); +//PDF +$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); +$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); +$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); + // Nombre de ligne pour choix de produit/service predefinis $NBLINES=4; @@ -172,7 +177,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights-> if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); @@ -201,7 +206,7 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->pr if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } } else @@ -383,7 +388,7 @@ else if ($action == 'add' && $user->rights->propale->creer) $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); exit; @@ -652,7 +657,7 @@ if ($action == 'modif' && $user->rights->propale->creer) $outputlangs->setDefaultLang($newlang); } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } else if ($action == "setabsolutediscount" && $user->rights->propale->creer) @@ -826,7 +831,7 @@ else if ($action == "addline" && $user->rights->propale->creer) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } unset($_POST['qty']); @@ -912,7 +917,7 @@ else if ($action == 'updateligne' && $user->rights->propale->creer && $_POST["sa if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } } } @@ -938,7 +943,7 @@ else if ($action == 'builddoc' && $user->rights->propale->creer) $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - $result=propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + $result=propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); if ($result <= 0) { dol_print_error($db,$result); @@ -1018,7 +1023,7 @@ else if ($action == 'up' && $user->rights->propale->creer) $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); exit; @@ -1040,7 +1045,7 @@ else if ($action == 'down' && $user->rights->propale->creer) $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); exit; @@ -1782,7 +1787,7 @@ if ($action == 'presend') $outputlangs->setDefaultLang($newlang); } - $result=propale_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + $result=propale_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); if ($result <= 0) { dol_print_error($db,$result); diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 8dd59e31e15d3c6030d3b7cf6e5a2cb09635f163..3008771d34048597a7b0bc016a3e7e0dc374bc6a 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -4,7 +4,7 @@ * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> - * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> + * Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * @@ -58,6 +58,11 @@ $confirm = GETPOST('confirm'); $lineid = GETPOST('lineid'); $mesg = GETPOST('mesg'); +//PDF +$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); +$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); +$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); + // Security check if ($user->societe_id) $socid=$user->societe_id; $result=restrictedArea($user,'commande',$id,''); @@ -171,7 +176,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes') if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $ret=$object->fetch($id); // Reload to get new records - commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } } else @@ -489,7 +494,7 @@ else if ($action == 'setconditions' && $user->rights->commande->creer) } $ret=$object->fetch($id); // Reload to get new records - commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } } } @@ -684,7 +689,7 @@ else if ($action == 'addline' && $user->rights->commande->creer) } $ret=$object->fetch($id); // Reload to get new records - commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } unset($_POST['qty']); @@ -797,7 +802,7 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && $_POST['s if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $ret=$object->fetch($id); // Reload to get new records - commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } } else @@ -847,7 +852,7 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->co $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } } } @@ -889,7 +894,7 @@ else if ($action == 'confirm_modif' && $user->rights->commande->creer) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $ret=$object->fetch($id); // Reload to get new records - commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } } } @@ -949,7 +954,7 @@ else if ($action == 'up' && $user->rights->commande->creer) $outputlangs->setDefaultLang($newlang); } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.$_GET['rowid']); exit; @@ -971,7 +976,7 @@ else if ($action == 'down' && $user->rights->commande->creer) $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.$_GET['rowid']); exit; @@ -1003,7 +1008,7 @@ else if ($action == 'builddoc') // In get or post $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - $result=commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + $result=commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); if ($result <= 0) { dol_print_error($db,$result); @@ -2282,7 +2287,7 @@ else $outputlangs->setDefaultLang($newlang); } - $result=commande_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + $result=commande_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); if ($result <= 0) { dol_print_error($db,$result); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 5f3ee6d12f892c5f110b18015bff41f56f2a2b27..6d30f8c34d44eb1e469c7a64fc2e56d9a878bbe6 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -5,7 +5,7 @@ * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> - * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> + * Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * * This program is free software; you can redistribute it and/or modify @@ -69,6 +69,11 @@ $search_societe=GETPOST('search_societe','alpha'); $search_montant_ht=GETPOST('search_montant_ht','alpha'); $search_montant_ttc=GETPOST('search_montant_ttc','alpha'); +//PDF +$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); +$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); +$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); + // Security check $fieldid = (! empty($ref)?'facnumber':'rowid'); if ($user->societe_id) $socid=$user->societe_id; @@ -185,7 +190,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights-> if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $ret=$object->fetch($id); // Reload to get new records - $result=facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + $result=facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } if ($result >= 0) { @@ -374,7 +379,7 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $ret=$object->fetch($id); // Reload to get new records - facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } } else @@ -451,7 +456,7 @@ else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_ if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $ret=$object->fetch($id); // Reload to get new records - facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } } } @@ -1120,7 +1125,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $ret=$object->fetch($id); // Reload to get new records - facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } unset($_POST['qty']); unset($_POST['type']); @@ -1222,7 +1227,7 @@ else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['sa if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $ret=$object->fetch($id); // Reload to get new records - facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } } } @@ -1250,7 +1255,7 @@ else if ($action == 'up' && $user->rights->facture->creer) $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$object->id.'#'.$_GET['rowid']); exit; @@ -1272,7 +1277,7 @@ else if ($action == 'down' && $user->rights->facture->creer) $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$object->id.'#'.$_GET['rowid']); exit; @@ -1506,7 +1511,7 @@ else if ($action == 'builddoc') // En get ou en post $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - $result=facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + $result=facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); if ($result <= 0) { dol_print_error($db,$result); @@ -3210,7 +3215,7 @@ else $outputlangs->setDefaultLang($newlang); } - $result=facture_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + $result=facture_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); if ($result <= 0) { dol_print_error($db,$result); diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 5d3903e54714f6b7e747c8195fed293d7a0d874a..ac45f0db7f35e2916aded452d2d8de3d58d3c33b 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -60,6 +60,11 @@ $result=restrictedArea($user,$origin,$origin_id); $action = GETPOST('action','alpha'); $confirm = GETPOST('confirm','alpha'); +//PDF +$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); +$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); +$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); + $object = new Expedition($db); /* @@ -1379,7 +1384,7 @@ else $outputlangs->setDefaultLang($newlang); } - $result=expedition_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + $result=expedition_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); if ($result <= 0) { dol_print_error($db,$result); diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 22a0bdc4946de16461f696d7d055cca2df86f892..9d79d66863813eb3f58583eaaf123e6d47727a84 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -50,6 +50,11 @@ $action = GETPOST('action','alpha'); $confirm = GETPOST('confirm','alpha'); $mesg = GETPOST('msg','alpha'); +//PDF +$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); +$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); +$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); + // Security check if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'ficheinter', $id, 'fichinter'); @@ -1253,7 +1258,7 @@ else if ($id > 0 || ! empty($ref)) $outputlangs->setDefaultLang($newlang); } - $result=fichinter_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + $result=fichinter_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); if ($result <= 0) { dol_print_error($db,$result); diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 5fc31efe69f3b3f74b0bfe02a11159f3d7076747..e8fd1a83ef3077edbee329bb66080cc169c58d1e 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr> - * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> + * Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com> * * This program is free software; you can redistribute it and/or modify @@ -54,9 +54,12 @@ $confirm = GETPOST('confirm','alpha'); $comclientid = GETPOST('comid','int'); $socid = GETPOST('socid','int'); $projectid = GETPOST('projectid','int'); -$hidedetails = GETPOST('hidedetails','alpha'); -$hidedesc = GETPOST('hidedesc','alpha'); -$hideref = GETPOST('hideref','alpha'); + +//PDF +$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); +$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); +$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); + // Security check if ($user->societe_id) $socid=$user->societe_id; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 1840291be738bffca5354482f0045cce6487ac8e..be0b0acd31bd139f9eddea2282da36db73595938 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -46,6 +46,11 @@ $id = (GETPOST('facid','int') ? GETPOST('facid','int') : GETPOST('id','int')); $action = GETPOST("action"); $confirm = GETPOST("confirm"); +//PDF +$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); +$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); +$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); + // Security check if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture'); @@ -402,6 +407,7 @@ elseif ($action == 'update_line') if ($_REQUEST['etat'] == '1' && ! $_REQUEST['cancel']) // si on valide la modification { $object->fetch($id); + $object->fetch_thirdparty(); if ($_POST['puht']) { @@ -1921,7 +1927,7 @@ else $outputlangs->setDefaultLang($newlang); } - $result=supplier_invoice_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); + $result=supplier_invoice_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); if ($result <= 0) { dol_print_error($db,$result); diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index 65f5d9bb2c9f0587a8e9f35755967c3d1359f78a..36bd248dc94b582c81f7592ab2e2b79698d1ff01 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -321,6 +321,9 @@ PDF=PDF PDFDesc=Podeu definir aquí les opcions globals per a la generació dels PDF PDFAddressForging=Regles de visualització d'adreces HideAnyVATInformationOnPDF=Amagar tota la informació relacionada amb l'IVA en la generació dels PDF +HideDescOnPDF=Amagar descripció dels productes en la generació dels PDF +HideRefOnPDF=Amagar referència dels productes en la generació dels PDF +HideDetailsOnPDF=Amagar detalls de les línies de productes en la generació dels PDF UrlGenerationParameters=Seguretat de les URL SecurityTokenIsUnique=Fer servir un paràmetre securekey únic per a cada URL? EnterRefToBuildUrl=Introduïu la referència de l'objecte %s diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0fa4d7677de191910b9d72f6f147a483e86fea49..d9505beb391527a7ddc171fa3a29ab3922984220 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -320,6 +320,9 @@ PDF=PDF PDFDesc=You can set each global options related to the PDF generation PDFAddressForging=Rules to forge address boxes HideAnyVATInformationOnPDF=Hide all information related to VAT on generated PDF +HideDescOnPDF=Hide products description on generated PDF +HideRefOnPDF=Hide products ref. on generated PDF +HideDetailsOnPDF=Hide products lines details on generated PDF UrlGenerationParameters=Parameters to secure URLs SecurityTokenIsUnique=Use a unique securekey parameter for each URL EnterRefToBuildUrl=Enter reference for object %s diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 69c762db639aa4f9ca91b01b545326179b7c7d4e..6558c66b19ef2b70c195d77d913e20890d19cf16 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -321,6 +321,9 @@ PDF=PDF PDFDesc=Puede definir aquí las opciones globales para la generación de los PDF PDFAddressForging=Reglas de visualización de direcciones HideAnyVATInformationOnPDF=Ocultar toda la información relacionada con el IVA en la generación de los PDF +HideDescOnPDF=Ocultar descripción de los productos en la generación de los PDF +HideRefOnPDF=Ocultar referencia de los productos en la generación de los PDF +HideDetailsOnPDF=Ocultar detalles de las líneas de productos en la generación de los PDF UrlGenerationParameters=Seguridad de las URLs SecurityTokenIsUnique=¿Usar un parámetro securekey único para cada URL? EnterRefToBuildUrl=Introduzca la referencia del objeto %s diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index eddd2abff01e3fbfd39debef3a247b928e724c6f..06cad77935545ea0d9beacf4792132f91d23fde1 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -321,6 +321,9 @@ PDF=PDF PDFDesc=Vous pouvez définir ici des options globales sur la génération des PDF PDFAddressForging=Règle de fabrication des zones adresses HideAnyVATInformationOnPDF=Cacher toutes les informations en rapport avec la TVA sur les PDF générés +HideDescOnPDF=Cacher la description des produits sur les PDF généres +HideRefOnPDF=Cacher la référence des produits sur les PDF généres +HideDetailsOnPDF=Cacher les détails des lignes de produits sur les PDF générés UrlGenerationParameters=Sécurisation des URLs SecurityTokenIsUnique=Utiliser un paramètre securekey unique pour chaque URL ? EnterRefToBuildUrl=Entrez la référence pour l'objet %s