diff --git a/htdocs/admin/fournisseur.php b/htdocs/admin/fournisseur.php index 7feb60781533baac9194d9313571e6408ec945d0..9ede4addb525f4b95140d71de9f939e903cfd3e7 100644 --- a/htdocs/admin/fournisseur.php +++ b/htdocs/admin/fournisseur.php @@ -132,10 +132,12 @@ if ($_GET["action"] == 'specimenfacture') // For invoices if ($_GET["action"] == 'set') { $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES ('".$_GET["value"]."','".$_GET["type"]."',".$conf->entity.")"; - if ($db->query($sql)) + $res=$db->query($sql); + if ($res) { } + else dol_print_error($db); } if ($_GET["action"] == 'del') @@ -144,10 +146,12 @@ if ($_GET["action"] == 'del') $sql.= " WHERE nom = '".$_GET["value"]."'"; $sql.= " AND type = '".$_GET["type"]."'"; $sql.= " AND entity = ".$conf->entity; - if ($db->query($sql)) + $db->query($sql); + if ($res) { } + else dol_print_error($db); } if ($_GET["action"] == 'setdoc') @@ -348,7 +352,7 @@ print '<td width="100">'.$langs->trans("Name").'</td>'."\n"; print '<td>'.$langs->trans("Description").'</td>'."\n"; print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n"; print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n"; -print '<td align="center" width="32" colspan="2">'.$langs->trans("Info").'</td>'; +print '<td align="center" width="40" colspan="2">'.$langs->trans("Info").'</td>'; print '</tr>'."\n"; clearstatcache(); @@ -366,8 +370,9 @@ if (is_resource($handle)) $classname = substr($file, 0, dol_strlen($file) -12); $var=!$var; - print "<tr ".$bc[$var].">\n <td>$name"; - print "</td>\n <td>\n"; + print "<tr ".$bc[$var].">\n"; + print "<td>".$name."</td>\n"; + print "<td>\n"; require_once($dir.$file); $module = new $classname($db,$specimenthirdparty); print $module->description; @@ -379,7 +384,7 @@ if (is_resource($handle)) print '<td align="center">'."\n"; if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name") { - print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&type=supplier_order">'; + print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&type=order_supplier">'; print img_picto($langs->trans("Enabled"),'on'); print '</a>'; } @@ -392,7 +397,7 @@ if (is_resource($handle)) else { print '<td align="center">'."\n"; - print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&type=supplier_order">'.img_picto($langs->trans("Disabled"),'off').'</a>'; + print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&type=order_supplier">'.img_picto($langs->trans("Disabled"),'off').'</a>'; print "</td>"; } @@ -404,7 +409,7 @@ if (is_resource($handle)) } else { - print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&type=supplier_order"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'on').'</a>'; + print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'on').'</a>'; } print '</td>'; @@ -472,7 +477,7 @@ print '<td width="100">'.$langs->trans("Name").'</td>'."\n"; print '<td>'.$langs->trans("Description").'</td>'."\n"; print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n"; print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n"; -print '<td align="center" width="32" colspan="2">'.$langs->trans("Info").'</td>'; +print '<td align="center" width="40" colspan="2">'.$langs->trans("Info").'</td>'; print '</tr>'."\n"; clearstatcache(); @@ -489,8 +494,9 @@ if (is_resource($handle)) $classname = substr($file, 0, dol_strlen($file) -12); $var=!$var; - print "<tr ".$bc[$var].">\n <td>$name"; - print "</td>\n <td>\n"; + print "<tr ".$bc[$var].">\n"; + print "<td>".$name."</td>\n"; + print "<td>"; require_once($dir.$file); $module = new $classname($db,$specimenthirdparty); print $module->description; @@ -502,7 +508,7 @@ if (is_resource($handle)) print "<td align=\"center\">\n"; if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name") { - print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&type=supplier_invoice">'; + print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&type=invoice_supplier">'; print img_picto($langs->trans("Enabled"),'on'); print '</a>'; } @@ -515,7 +521,7 @@ if (is_resource($handle)) else { print "<td align=\"center\">\n"; - print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&type=supplier_invoice">'.img_picto($langs->trans("Disabled"),'off').'</a>'; + print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"),'off').'</a>'; print "</td>"; } @@ -527,7 +533,7 @@ if (is_resource($handle)) } else { - print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&type=supplier_invoice" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'on').'</a>'; + print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&type=invoice_supplier" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'on').'</a>'; } print '</td>'; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 957867375d67d82342838907659e97c1d65d3031..b96e89ae48151420592dab14ee2a5f887ed834e0 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -470,8 +470,8 @@ class FormMail if ($this->param["models"]=='facture_relance') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendInvoiceReminder"); } if ($this->param["models"]=='propal_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendProposal"); } if ($this->param["models"]=='order_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendOrder"); } - if ($this->param["models"]=='supplier_order_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierOrder"); } - if ($this->param["models"]=='supplier_facture_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } + if ($this->param["models"]=='order_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierOrder"); } + if ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } $defaultmessage=make_substitutions($defaultmessage,$this->substit,$langs); if (isset($_POST["message"])) $defaultmessage=$_POST["message"]; $defaultmessage=str_replace('\n',"\n",$defaultmessage); diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 94d442e02135335d1b0a67fb80f2e89d2178d524..99979b80b08c4acc39d2580e61e4b830d31fa1d7 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1466,7 +1466,7 @@ if ($id > 0 || ! empty($ref)) $formmail->substit['__ORDERREF__']=$commande->ref; // Tableau des parametres complementaires $formmail->param['action']='send'; - $formmail->param['models']='supplier_order_send'; + $formmail->param['models']='order_supplier_send'; $formmail->param['orderid']=$commande->id; $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$commande->id; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 15145ebcca33e6d736db14ec04706102d66ba650..b7a27e82ca874d77e8262b7d550cbac665f5dca7 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1859,7 +1859,7 @@ else $formmail->substit['__FACREF__']=$fac->ref; // Tableau des parametres complementaires $formmail->param['action']='send'; - $formmail->param['models']='supplier_facture_send'; + $formmail->param['models']='invoice_supplier_send'; $formmail->param['facid']=$fac->id; $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?facid='.$fac->id; diff --git a/htdocs/includes/modules/modFournisseur.class.php b/htdocs/includes/modules/modFournisseur.class.php index df002032eb5e1ebe2b89077938d3e7bcd300c218..99a2843fb444493a2e6647abcdeea5d3c2e37737 100644 --- a/htdocs/includes/modules/modFournisseur.class.php +++ b/htdocs/includes/modules/modFournisseur.class.php @@ -89,7 +89,7 @@ class modFournisseur extends DolibarrModules $this->const[$r][1] = "chaine"; $this->const[$r][2] = "mod_commande_fournisseur_muguet"; $r++; - + $this->const[$r][0] = "INVOICE_SUPPLIER_ADDON_PDF"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "canelle"; @@ -207,7 +207,7 @@ class modFournisseur extends DolibarrModules $this->rights[$r][3] = 0; $this->rights[$r][4] = 'facture'; $this->rights[$r][5] = 'supprimer'; - + $this->rights[$r][0] = 1235; $this->rights[$r][1] = 'Envoyer les factures par mail'; $this->rights[$r][2] = 'a'; @@ -273,7 +273,7 @@ class modFournisseur extends DolibarrModules $sql = array( "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity, - "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','supplier_order',".$conf->entity.")", + "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','order_supplier',".$conf->entity.")", ); $this->load_datas();