From de458fa62615ecfecb6bf5a1b39972a73d009e5c Mon Sep 17 00:00:00 2001 From: eldy Date: Sat, 16 Mar 2013 12:22:37 +0100 Subject: [PATCH] Qual: Move option at better place --- htdocs/admin/pdf.php | 54 +++++++++++++++++++++++++++++++++++---- htdocs/admin/security.php | 44 ------------------------------- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index fc384046256..2734bacea2a 100755 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -68,6 +68,20 @@ if ($action == 'update') exit; } +if ($action == 'activate_pdfsecurity') +{ + dolibarr_set_const($db, "PDF_SECURITY_ENCRYPTION", "1",'chaine',0,'',$conf->entity); + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); + exit; +} +else if ($action == 'disable_pdfsecurity') +{ + dolibarr_del_const($db, "PDF_SECURITY_ENCRYPTION",$conf->entity); + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); + exit; +} + + /* * View @@ -366,31 +380,61 @@ else // Show print_fiche_titre($langs->trans("Other"),'','').'
'; $var=true; print ''; - print ''; + print ''; + // Hide any PDF informations $var=!$var; - print ''; + + // Encrypt and protect PDF + $var=!$var; + print ""; + print ''; + print ''; + print '"; + + print ""; + print ''; + if ($conf->global->MAIN_FEATURES_LEVEL > 1) { //Desc $var=!$var; - print ''; //Ref $var=!$var; - print ''; //Details $var=!$var; - print ''; } diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index a78d2354141..9c4bfc67af4 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -154,19 +154,6 @@ else if ($action == 'disable_encryptdbpassconf') } } -if ($action == 'activate_pdfsecurity') -{ - dolibarr_set_const($db, "PDF_SECURITY_ENCRYPTION", "1",'chaine',0,'',$conf->entity); - header("Location: security.php"); - exit; -} -else if ($action == 'disable_pdfsecurity') -{ - dolibarr_del_const($db, "PDF_SECURITY_ENCRYPTION",$conf->entity); - header("Location: security.php"); - exit; -} - if ($action == 'activate_MAIN_SECURITY_DISABLEFORGETPASSLINK') { dolibarr_set_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK", '1','chaine',0,'',$conf->entity); @@ -364,37 +351,6 @@ print ""; print ""; print ''; -// Encryption et protection des PDF -$var=!$var; -print ""; -print ''; -print ''; - -print '"; - -print ""; -print ''; - - // Disable link "Forget password" on logon $var=!$var;
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("HideAnyVATInformationOnPDF").''; + print '
'.$langs->trans("HideAnyVATInformationOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT,1); print '
'; + $text = $langs->trans("ProtectAndEncryptPdfFiles"); + $desc = $form->textwithpicto($text,$langs->transnoentities("ProtectAndEncryptPdfFilesDesc"),1); + print $desc; + print ''; + if($conf->global->PDF_SECURITY_ENCRYPTION == 1) + { + print img_picto($langs->trans("Active"),'tick'); + } + print ''; + if ($conf->global->PDF_SECURITY_ENCRYPTION == 0) + { + print ''.$langs->trans("Activate").''; + } + if($conf->global->PDF_SECURITY_ENCRYPTION == 1) + { + print ''.$langs->trans("Disable").''; + } + print "
'.$langs->trans("HideDescOnPDF").''; + print '
'.$langs->trans("HideDescOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC,1); print '
'.$langs->trans("HideRefOnPDF").''; + print '
'.$langs->trans("HideRefOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF,1); print '
'.$langs->trans("HideDetailsOnPDF").''; + print '
'.$langs->trans("HideDetailsOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1); print '
'; -$text = $langs->trans("ProtectAndEncryptPdfFiles"); -$desc = $form->textwithpicto($text,$langs->transnoentities("ProtectAndEncryptPdfFilesDesc"),1); -print $desc; -print ''; -if($conf->global->PDF_SECURITY_ENCRYPTION == 1) -{ - print img_picto($langs->trans("Active"),'tick'); -} - -print ''; -if ($conf->global->PDF_SECURITY_ENCRYPTION == 0) -{ - print ''.$langs->trans("Activate").''; -} -if($conf->global->PDF_SECURITY_ENCRYPTION == 1) -{ - print ''.$langs->trans("Disable").''; -} -print "