Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-05-21 20:18:32 +02:00
commit 2b0cfb04af
16 changed files with 184 additions and 62 deletions

View File

@ -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>';

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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();
?>

View File

@ -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
{

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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