diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php
index 9a900952baa..350a0600219 100644
--- a/htdocs/admin/security.php
+++ b/htdocs/admin/security.php
@@ -165,7 +165,7 @@ dolibarr_fiche_head($head, $hselected, $langs->trans("Security"));
$var=false;
-$form = new Form($db);
+$html = new Form($db);
// Choix du gestionnaire du générateur de mot de passe
@@ -318,7 +318,11 @@ print '';
// Encryption et protection des PDF
$var=!$var;
print "
";
-print '| '.$langs->trans("ProtectAndEncryptPdfFiles").' | ';
+print '';
+$text = $langs->trans("ProtectAndEncryptPdfFiles");
+$desc = $html->textwithwarning($text,$langs->transnoentities("ProtectAndEncryptPdfFilesDesc"),1);
+print $desc;
+print ' | ';
print '';
if($conf->global->PDF_SECURITY_ENCRYPTION == 1)
{
@@ -327,18 +331,16 @@ if($conf->global->PDF_SECURITY_ENCRYPTION == 1)
print ' | ';
+print '';
if ($conf->global->PDF_SECURITY_ENCRYPTION == 0)
{
- print ' | ';
print ''.$langs->trans("Activate").'';
- print " | ";
}
if($conf->global->PDF_SECURITY_ENCRYPTION == 1)
{
- print '';
print ''.$langs->trans("Disable").'';
- print " | ";
}
+print "";
print "";
print '
';
diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php
index 89308228d40..8c64d70f1c1 100644
--- a/htdocs/html.form.class.php
+++ b/htdocs/html.form.class.php
@@ -106,6 +106,48 @@ class Form
return $s;
}
+ /**
+ \brief Affiche un texte avec picto alert qui affiche un tooltip
+ \param text Texte à afficher
+ \param htmltooltip Contenu html du tooltip
+ \param direction 1=Le picto est après, -1=le picto est avant
+ \return string Code html du texte,picto
+ */
+ function textwithwarning($text,$htmltext,$direction=1)
+ {
+ global $conf;
+
+ if (! $htmltext)
+ {
+ return $text;
+ }
+
+ $s="";
+
+ // Sanitize tooltip
+ $paramfortooltip ='';
+ if ($conf->use_javascript)
+ {
+ $htmltext=ereg_replace("'","\'",$htmltext);
+ $paramfortooltip.=' onmouseover="showtip(\''.$htmltext.'\')"';
+ $paramfortooltip.=' onMouseout="hidetip()"';
+ }
+
+ $s.='';
+ if ($direction > 0)
+ {
+ if ($text) $s.='| '.$text.' | ';
+ $s.=''.img_warning("default").' | ';
+ }
+ else
+ {
+ $s.=''.img_warning("default").' | ';
+ if ($text) $s.=' '.$text.' | ';
+ }
+ $s.='
';
+ return $s;
+ }
+
/**
* \brief Retourne la liste déroulante des départements/province/cantons tout pays confondu ou pour un pays donné.
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index b2c1a6062c9..5072201766f 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -96,6 +96,7 @@ DoNotStoreClearPassword=Do no store clear passwords in database
MainDbPasswordFileConfEncrypted=Password of the database encrypted in conf.php
ConfigFileIsInReadOnly=The file conf.php is in read only, check the rights.
ProtectAndEncryptPdfFiles=Protection and encryption of the pdf generated
+ProtectAndEncryptPdfFilesDesc=protecting a document requires to encrypt it, which increases the processing time a lot.
This can cause a PHP time-out in some cases, especially if the document contains images or fonts.
You can solve this problem by increasing the variable memory_limit with 16M in the php.ini, or if you do not have access to the php.ini, create a .htaccess in root of the site and add this line:
php_value memory_limit 16M
Feature=Feature
DolibarrLicense=License
DolibarrProjectLeader=Project leader
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index 9e64b2f8161..9d508e686bb 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -96,6 +96,7 @@ DoNotStoreClearPassword=Ne pas stocker de mot de passe en clair dans la base
MainDbPasswordFileConfEncrypted=Encrypter le mot de passe de la base dans le fichier conf.php
ConfigFileIsInReadOnly=Le fichier conf.php est lecture seule, vérifiez les droits d'écriture.
ProtectAndEncryptPdfFiles=Protection et encryption des pdf générés
+ProtectAndEncryptPdfFilesDesc=La protection d'un document pdf exige son encryption, ce qui peut augmenter la durée de la transformation. Ceci peut causer un arrêt de PHP dans certains cas, particulièrement si le document contient des images ou des polices.
Vous pouvez résoudre ce problème en augmentant la variable memory_limit à 16M dans php.ini ou, si vous n'avez pas accès au php.ini, créer un .htaccess à la racine du site et ajouter cette ligne :
php_value memory_limit 16M
Feature=Fonction
DolibarrLicense=Licence
DolibarrProjectLeader=Chef de projet