2
0
forked from Wavyzz/dolibarr

New: Add hidden option MAIN_DISABLE_PDF_COMPRESSION

This commit is contained in:
Laurent Destailleur
2009-01-18 17:07:27 +00:00
parent 9affdb5b07
commit 1036eabd42
19 changed files with 79 additions and 53 deletions

View File

@@ -18,6 +18,7 @@ For users:
- New: Add VAT number in export fields.
- New: Upgrade FPDF to 1.6
- New: Added keywords in PDF
- New: Add hidden option MAIN_DISABLE_PDF_COMPRESSION.
- Fix: Author, title and topic are correctly encoded i nPDF.
- Fix: Now HTML output is always UTF8, this solve bad PDF encoding on old users.
- Fix: Save new model when changed on interventions.

View File

@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2007-2008 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2007-2009 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@@ -44,9 +44,10 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update')
}
else
{
dolibarr_set_const($db, "MAIN_MAX_DECIMALS_UNIT", $_POST["MAIN_MAX_DECIMALS_UNIT"]);
dolibarr_set_const($db, "MAIN_MAX_DECIMALS_TOT", $_POST["MAIN_MAX_DECIMALS_TOT"]);
dolibarr_set_const($db, "MAIN_MAX_DECIMALS_SHOWN", $_POST["MAIN_MAX_DECIMALS_SHOWN"]);
dolibarr_set_const($db, "MAIN_MAX_DECIMALS_UNIT", $_POST["MAIN_MAX_DECIMALS_UNIT"]);
dolibarr_set_const($db, "MAIN_MAX_DECIMALS_TOT", $_POST["MAIN_MAX_DECIMALS_TOT"]);
dolibarr_set_const($db, "MAIN_MAX_DECIMALS_SHOWN", $_POST["MAIN_MAX_DECIMALS_SHOWN"]);
dolibarr_set_const($db, "MAIN_DISABLE_PDF_COMPRESSION", $_POST["MAIN_DISABLE_PDF_COMPRESSION"]);
Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
exit;
@@ -90,7 +91,12 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").'</td><td><input class="flat" name="MAIN_MAX_DECIMALS_SHOWN" size="3" value="' . $conf->global->MAIN_MAX_DECIMALS_SHOWN . '"></td></tr>';
/*
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("MAIN_DISABLE_PDF_COMPRESSION").'</td><td>';
print $html->selectyesno('MAIN_DISABLE_PDF_COMPRESSION',$conf->global->MAIN_DISABLE_PDF_COMPRESSION);
print '</td></tr>';
*/
print '</table>';
@@ -121,7 +127,12 @@ else
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").'</td><td align="right">'.$conf->global->MAIN_MAX_DECIMALS_SHOWN.'</td></tr>';
print '</table><br>';
/*
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("MAIN_DISABLE_PDF_COMPRESSION").'</td><td align="right">'.yn($conf->global->MAIN_DISABLE_PDF_COMPRESSION).'</td></tr>';
*/
print '</table>';
print '<div class="tabsAction">';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';

View File

@@ -2421,7 +2421,7 @@ class Form
* \param value Valeur pr<70>-s<>lectionn<6E>e
* \param option 0 retourne yes/no, 1 retourne 1/0
*/
function selectyesno($name,$value='',$option=0)
function selectyesno($htmlname,$value='',$option=0)
{
global $langs;
@@ -2433,7 +2433,7 @@ class Form
$no="0";
}
$resultyesno = '<select class="flat" name="'.$name.'">'."\n";
$resultyesno = '<select class="flat" name="'.$htmlname.'">'."\n";
if (("$value" == 'yes') || ($value == 1))
{
$resultyesno .= '<option value="'.$yes.'" selected="true">'.$langs->trans("yes").'</option>'."\n";

View File

@@ -134,8 +134,8 @@ class MenuLeft {
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/delais.php",$langs->trans("Alerts"));
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/perms.php", $langs->trans("Security"));
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/mails.php", $langs->trans("Emails"));
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/limits.php", $langs->trans("MenuLimits"));
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/mails.php", $langs->trans("Emails"));
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/dict.php", $langs->trans("DictionnarySetup"));
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/const.php", $langs->trans("OtherSetup"));

View File

@@ -136,8 +136,8 @@ class MenuLeft {
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/delais.php",$langs->trans("Alerts"));
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/perms.php", $langs->trans("Security"));
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/mails.php", $langs->trans("Emails"));
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/limits.php", $langs->trans("Limits"));
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/mails.php", $langs->trans("Emails"));
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/dict.php", $langs->trans("DictionnarySetup"));
if ($leftmenu=="setup") $newmenu->add_submenu(DOL_URL_ROOT."/admin/const.php", $langs->trans("OtherSetup"));

View File

@@ -160,6 +160,7 @@ class pdf_edison extends ModelePDFCommandes
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($com->ref)." ".$outputlangs->transnoentities("Order"));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);

View File

@@ -182,6 +182,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($com->ref)." ".$outputlangs->transnoentities("Order"));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);

View File

@@ -164,6 +164,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($this->expe->ref)." ".$outputlangs->transnoentities("Sending"));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins(10, 10, 10);
$pdf->SetAutoPageBreak(1,0);

View File

@@ -179,6 +179,7 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($fac->ref)." ".$outputlangs->transnoentities("Sending"));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);

View File

@@ -184,6 +184,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($fac->ref)." ".$outputlangs->transnoentities("Invoice"));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);

View File

@@ -162,6 +162,7 @@ class pdf_huitre extends ModelePDFFactures
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($fac->ref)." ".$outputlangs->transnoentities("Invoice"));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins(10, 10, 10);
$pdf->SetAutoPageBreak(1,0);

View File

@@ -172,6 +172,7 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($fac->ref)." ".$outputlangs->transnoentities("Invoice"));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins(10, 10, 10);
$pdf->SetAutoPageBreak(1,0);

View File

@@ -154,6 +154,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($delivery->ref)." ".$outputlangs->transnoentities("DeliveryOrder"));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$this->_pagehead($pdf, $delivery, $outputlangs);

View File

@@ -182,6 +182,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($delivery->ref)." ".$outputlangs->transnoentities("DeliveryOrder"));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);

View File

@@ -184,6 +184,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($propale->ref)." ".$outputlangs->transnoentities("CommercialProposal"));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);

View File

@@ -163,6 +163,7 @@ class pdf_propale_jaune extends ModelePDFPropales
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($propale->ref)." ".$outputlangs->transnoentities("CommercialProposal"));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);

View File

@@ -186,6 +186,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname));
$pdf->SetKeyWords($outputlangs->convToOutputCharset($com->ref)." ".$outputlangs->transnoentities("Order"));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);

View File

@@ -604,10 +604,11 @@ ConstDesc=This page allows you to edit all other parameters not available in pre
OnceSetupFinishedCreateUsers=Warning, you are a Dolibarr administrator user. Administrator users are used to setup Dolibarr. For a usual usage of Dolibarr, it is recommended to use a non administrator user created from Users & Groups menu.
MiscellanousDesc=Define here all other parameters related to security.
LimitsSetup=Limits/Precision setup
LimitsDesc=You can define limits and precision used by Dolibarr here
LimitsDesc=You can define limits, precisions and optimisations used by Dolibarr here
MAIN_MAX_DECIMALS_UNIT=Max decimals for unit prices
MAIN_MAX_DECIMALS_TOT=Max decimals for total prices
MAIN_MAX_DECIMALS_SHOWN=Max decimals for prices shown on screen (Add <b>...</b> after this number if you want to see <b>...</b> when number is truncated when shown on screen)
MAIN_DISABLE_PDF_COMPRESSION=Use PDF compression for generated PDF files.
ParameterActiveForNextInputOnly=Parameter effective for next input only
NoEventOrNoAuditSetup=No security event has been recorded yet. This can be normal if audit has not been enabled on "setup - security - audit" page.
NoEventFoundWithCriteria=No security event has been found for such search criterias.

View File

@@ -603,10 +603,11 @@ ConstDesc=Cet
OnceSetupFinishedCreateUsers=Attention, vous <20>tes sous un compte administrateur de Dolibarr. Les administrateurs sont utilis<69>s pour configurer Dolibarr. Pour une utilisation courante de Dolibarr, il est recommand<6E> d'utiliser un compte non administrateur cr<63><72> depuis le menu "Utilisateurs & Groupes".
MiscellanousDesc=D<>finissez ici les autres param<61>tres en rapport avec la s<>curit<69>.
LimitsSetup=Configuration des limites et precisions
LimitsDesc=Vous pouvez d<>finir ici les limites et pr<70>cisions utilis<69>es par Dolibarr
LimitsDesc=Vous pouvez d<>finir ici les limites, pr<70>cisions et optimisations utilis<69>es par Dolibarr
MAIN_MAX_DECIMALS_UNIT=Nombre de d<>cimals maximum pour les prix unitaires
MAIN_MAX_DECIMALS_TOT=Nombre de d<>cimals maximum pour les prix totaux
MAIN_MAX_DECIMALS_SHOWN=Nombre de d<>cimals maximum pour les montant affich<63>s <20> l'<27>cran (Mettre <b>...</b> apr<70>s ce nombre max si vous voulez voir <b>...</b> quand le nombre est tronqu<71> <20> l'affichage <20>cran)
MAIN_DISABLE_PDF_COMPRESSION=Utiliser la compression PDF pour les fichiers PDF g<>n<EFBFBD>r<EFBFBD>s.
ParameterActiveForNextInputOnly=Parametre effectif pour les prochaines saisies uniquement
NoEventOrNoAuditSetup=Aucun <20>venement d'audit de s<>curit<69> n'a <20>t<EFBFBD> enregistr<74>. Ceci peut etre normal si l'audit n'a pas <20>t<EFBFBD> activ<69> dans la configuration - s<>curit<69> - audit.
NoEventFoundWithCriteria=Aucun <20>venement d'audit de s<>curit<69> trouv<75> avec ces crit<69>res.