diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php
index bbb97e293fe..99bbb6d9cb1 100644
--- a/htdocs/admin/supplier_invoice.php
+++ b/htdocs/admin/supplier_invoice.php
@@ -38,9 +38,11 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
// Load translation files required by the page
$langs->loadLangs(array("admin", "other", "orders"));
+$action = GETPOST('action', 'aZ09');
+
$type = GETPOST('type', 'alpha');
$value = GETPOST('value', 'alpha');
-$action = GETPOST('action', 'aZ09');
+$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
$label = GETPOST('label', 'alpha');
$scandir = GETPOST('scan_dir', 'alpha');
@@ -98,7 +100,9 @@ if ($action == 'specimen') { // For invoices
$facture->thirdparty = $specimenthirdparty; // Define who should has build the invoice (so the supplier)
// Search template files
- $file = ''; $classname = ''; $filefound = 0;
+ $file = '';
+ $classname = '';
+ $filefound = 0;
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$file = dol_buildpath($reldir."core/modules/supplier_invoice/doc/pdf_".$modele.".modules.php", 0);
@@ -185,12 +189,12 @@ if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT') {
* View
*/
+$form = new Form($db);
+
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
llxHeader("", "");
-$form = new Form($db);
-
$linkback = ''.$langs->trans("BackToModuleList").' ';
print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup');
@@ -205,6 +209,7 @@ print dol_get_fiche_head($head, 'invoice', $langs->trans("Suppliers"), -1, 'comp
print load_fiche_titre($langs->trans("SuppliersInvoiceNumberingModel"), '', '');
+print '
';
print '
';
print '';
print ''.$langs->trans("Name").' ';
@@ -244,7 +249,7 @@ foreach ($dirmodels as $reldir) {
print $module->info();
print '';
- // Show example of numbering model
+ // Show example of numbering module
print '';
$tmp = $module->getExample();
if (preg_match('/^Error/', $tmp)) {
@@ -297,13 +302,13 @@ foreach ($dirmodels as $reldir) {
}
}
-print '
';
+print '
';
/*
- * Modeles documents for supplier invoices
+ * Documents models for supplier invoices
*/
print load_fiche_titre($langs->trans("BillsPDFModules"), '', '');
@@ -329,6 +334,7 @@ if ($resql) {
dol_print_error($db);
}
+print '';
print '
'."\n";
print ''."\n";
print ''.$langs->trans("Name").' '."\n";
@@ -380,7 +386,7 @@ foreach ($dirmodels as $reldir) {
//if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name")
//{
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
- print 'scandir).'&label='.urlencode($module->name).'&type=invoice_supplier">';
+ print ' scandir).'&label='.urlencode($module->name).'&type=invoice_supplier">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
/*}
@@ -391,7 +397,7 @@ foreach ($dirmodels as $reldir) {
print "";
} else {
print ''."\n";
- print 'scandir).'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -400,9 +406,9 @@ foreach ($dirmodels as $reldir) {
if (getDolGlobalString("INVOICE_SUPPLIER_ADDON_PDF") == "$name") {
//print img_picto($langs->trans("Default"),'on');
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
- print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
+ print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
} else {
- print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -420,7 +426,7 @@ foreach ($dirmodels as $reldir) {
print $form->textwithpicto('', $htmltooltip, 1, 0);
print '';
print '';
- print ''.img_object($langs->trans("Preview"), 'pdf').' ';
+ print ''.img_object($langs->trans("Preview"), 'pdf').' ';
print ' ';
print " \n";
@@ -432,7 +438,7 @@ foreach ($dirmodels as $reldir) {
}
}
-print '
';
+print '
';
/*
* Other options
@@ -443,6 +449,8 @@ print ' ';
print ' ';
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
+
+print ' ';
print '';
@@ -482,6 +490,8 @@ print '';
*/
print load_fiche_titre($langs->trans("Notifications"), '', '');
+
+print '';
print '
';
print '';
print ''.$langs->trans("Parameter").' ';
@@ -495,6 +505,7 @@ print '';
print " \n";
print '
';
+print '
';
// End of page
llxFooter();
diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php
index abee8200cef..171ad4035a9 100644
--- a/htdocs/admin/supplier_order.php
+++ b/htdocs/admin/supplier_order.php
@@ -38,25 +38,28 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
// Load translation files required by the page
$langs->loadLangs(array("admin", "other", "orders", "stocks"));
-if (!$user->admin) {
- accessforbidden();
-}
+$action = GETPOST('action', 'aZ09');
$type = GETPOST('type', 'alpha');
$value = GETPOST('value', 'alpha');
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
$label = GETPOST('label', 'alpha');
-$action = GETPOST('action', 'aZ09');
$scandir = GETPOST('scan_dir', 'alpha');
$specimenthirdparty = new Societe($db);
$specimenthirdparty->initAsSpecimen();
+$error = 0;
+
+if (!$user->admin) {
+ accessforbidden();
+}
+
/*
-* Actions
-*/
+ * Actions
+ */
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
@@ -77,7 +80,9 @@ if ($action == 'updateMask') {
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
-} elseif ($action == 'specimen') { // For orders
+}
+
+if ($action == 'specimen') { // For orders
$modele = GETPOST('module', 'alpha');
$commande = new CommandeFournisseur($db);
@@ -317,8 +322,8 @@ print ' ';
/*
-* Documents models for supplier orders
-*/
+ * Documents models for supplier orders
+ */
print load_fiche_titre($langs->trans("OrdersModelModule"), '', '');
diff --git a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php
index c37eef06360..41ce5795ae6 100644
--- a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php
+++ b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php
@@ -49,9 +49,9 @@ class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices
/**
* @var array Minimum version of PHP required by module.
- * e.g.: PHP ≥ 5.6 = array(5, 6)
+ * e.g.: PHP ≥ 7.0 = array(7, 0)
*/
- public $phpmin = array(5, 6);
+ public $phpmin = array(7, 0);
/**
* @var string Dolibarr version of the loaded document
@@ -122,9 +122,10 @@ class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices
$texte = $this->description.". \n";
$texte .= '