diff --git a/ChangeLog b/ChangeLog index d07eb68eac375..262cf2b42cfe4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -657,7 +657,7 @@ NEW: Disabled users are striked. NEW: Enhance navigation of project module NEW: fichinter lines ordered by rang AND DATE NEW: hidden conf to use input file multiple from mail form -NEW: hidden feature: SUPPLIERORDER_WITH_NOPRICEDEFINED allow supplier order even if no supplier price defined +NEW: hidden feature: SUPPLIER_ORDER_WITH_NOPRICEDEFINED allow supplier order even if no supplier price defined NEW: Hidden option MAIN_LANDING_PAGE to choose the first page to show after login works as a "global" option (llx_const) and as a "per user" option (llx_user_param). NEW: Holiday is a now a RH module. All RH module provides by default visilibity on users of its hierarchy. NEW: If error is reported during migration process, you can ignore it to avoid to be locked. diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index a5d43f2e350c8..dd03d477c6f3a 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -42,7 +42,7 @@ $value = GETPOST('value','alpha'); $param = GETPOST('param','alpha'); $cancel = GETPOST('cancel','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type = 'action'; @@ -273,7 +273,7 @@ print ''."\n"; if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name") { - print 'scandir.'&label='.urlencode($module->name).'&type=action">'; + print 'scandir.'&label='.urlencode($module->name).'&type=action">'; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; } @@ -286,7 +286,7 @@ else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -298,7 +298,7 @@ } else { - print 'scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index afe60acff2e3d..d1aeff55113d9 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -43,7 +43,7 @@ $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type = 'bankaccount'; @@ -322,7 +322,7 @@ print ''; } else { print '' . "\n"; - print '' . img_picto($langs->trans("Disabled"), 'switch_off') . ''; + print '' . img_picto($langs->trans("Disabled"), 'switch_off') . ''; print ""; } @@ -331,7 +331,7 @@ if ($conf->global->BANKADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print '' . img_picto($langs->trans("Disabled"), 'off') . ''; + print '' . img_picto($langs->trans("Disabled"), 'off') . ''; } print ''; diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index 3d3db2451d2cc..0a31b24b109d4 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -190,7 +190,7 @@ } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').''; } print ''; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index e9ad5ab6ed659..1c88073cf2b70 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -46,7 +46,7 @@ $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type = 'order'; @@ -464,7 +464,7 @@ else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -476,7 +476,7 @@ } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 427b3a531c433..ae8daea86e2ca 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -37,7 +37,7 @@ $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='contract'; if (empty($conf->global->CONTRACT_ADDON)) @@ -397,7 +397,7 @@ else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -409,7 +409,7 @@ } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index af932b94b4501..ba389c5207ac9 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -45,7 +45,7 @@ $action=GETPOST('action','alpha'); $value=GETPOST('value','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='shipping'; if (empty($conf->global->EXPEDITION_ADDON_NUMBER)) @@ -263,7 +263,7 @@ } else { - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Disabled"),'switch_off'); print ''; } @@ -402,7 +402,7 @@ else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -414,7 +414,7 @@ } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; @@ -440,7 +440,7 @@ print ''; if ($module->type == 'pdf') { - print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').''; } else { diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index cd14d47205720..97ce21ab58505 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -44,7 +44,7 @@ $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='expensereport'; @@ -398,7 +398,7 @@ if (in_array($name, $def)) { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; print ""; @@ -406,7 +406,7 @@ else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -418,7 +418,7 @@ } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 64257225719cb..751cbce81e948 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -44,7 +44,7 @@ $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='ficheinter'; @@ -431,7 +431,7 @@ if (in_array($name, $def)) { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; print ""; @@ -439,7 +439,7 @@ else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -451,7 +451,7 @@ } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index fe41afabfb893..24e2772ae0d60 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -44,7 +44,7 @@ $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='delivery'; @@ -385,7 +385,7 @@ if (in_array($name, $def)) { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; print ""; @@ -393,7 +393,7 @@ else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -405,7 +405,7 @@ } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 061b9d50f6a87..2ef7a5002684f 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -36,7 +36,7 @@ $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='invoice'; if (empty($conf->global->PAYMENT_ADDON)) $conf->global->PAYMENT_ADDON = 'mod_payment_cicada.php'; @@ -188,7 +188,7 @@ } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').''; } print ''; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 86108be013602..f368010078bdf 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -332,7 +332,7 @@ else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -344,7 +344,7 @@ } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 2f90145f3cc8a..b3434d0bd7a50 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -43,7 +43,7 @@ $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='propal'; /* @@ -443,7 +443,7 @@ else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -455,7 +455,7 @@ } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 6d65af336b9e8..d3ea8b9a63ea1 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -44,7 +44,7 @@ $type=GETPOST('type', 'alpha'); $value=GETPOST('value', 'alpha'); $action=GETPOST('action', 'alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $specimenthirdparty=new Societe($db); $specimenthirdparty->initAsSpecimen(); @@ -398,7 +398,7 @@ //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 ''; /*} @@ -411,7 +411,7 @@ 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 ""; } @@ -421,11 +421,11 @@ { //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 ''; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 21b3de68835fe..6b99bb1c39c77 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -45,7 +45,7 @@ $value=GETPOST('value', 'alpha'); $label = GETPOST('label','alpha'); $action=GETPOST('action', 'alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $specimenthirdparty=new Societe($db); $specimenthirdparty->initAsSpecimen(); @@ -420,7 +420,7 @@ print ''."\n"; if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name") { - print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'; + print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; } @@ -433,7 +433,7 @@ else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -445,7 +445,7 @@ } else { - print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 4227f4d42215e..c83b60cab63fe 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -39,7 +39,7 @@ $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='supplier_payment'; @@ -274,7 +274,7 @@ } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').''; } print ''; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 4e7efa4d9229e..44d8b2f3627c1 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -38,7 +38,7 @@ $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='supplier_proposal'; $error=0; @@ -423,7 +423,7 @@ else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -435,7 +435,7 @@ } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c7dd20547f4fb..9a93276f299b7 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2322,10 +2322,6 @@ function select_produits_fournisseurs($socid, $selected='', $htmlname='productid unset($producttmpselect); } - if (!empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) - { - print ''; - } // mode=2 means suppliers products $urloption=($socid > 0?'socid='.$socid.'&':'').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice; print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); @@ -2333,11 +2329,6 @@ function select_produits_fournisseurs($socid, $selected='', $htmlname='productid } else { - if (!empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) - { - print ''; - print ''; - } print $this->select_produits_fournisseurs_list($socid,$selected,$htmlname,$filtertype,$filtre,'',-1,0,0,$alsoproductwithnosupplierprice); } } diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 76a1458b91355..dc86a2ef9f3c8 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -40,6 +40,7 @@ * Ex: array('disabled'=> ) * Ex: array('show'=> ) * Ex: array('update_textarea'=> ) + * Ex: array('option_disabled'=> id to disable and warning to show if we select a disabled value (this is possible when using autocomplete ajax) * @return string Script */ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLength=2, $autoselect=0, $ajaxoptions=array()) @@ -146,6 +147,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt $("#'.$htmlname.'").val(ui.item.id).trigger("change"); // Select new value // Disable an element if (options.option_disabled) { + console.log("Make action option_disabled on #"+options.option_disabled+" with disabled="+ui.item.disabled) if (ui.item.disabled) { $("#" + options.option_disabled).prop("disabled", true); if (options.error) { @@ -154,28 +156,32 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt if (options.warning) { $.jnotify(options.warning, "warning", false); // Output with jnotify the warning message } - } else { + } else { $("#" + options.option_disabled).removeAttr("disabled"); } } if (options.disabled) { + console.log("Make action disabled on each "+options.option_disabled) $.each(options.disabled, function(key, value) { $("#" + value).prop("disabled", true); }); } if (options.show) { + console.log("Make action show on each "+options.show) $.each(options.show, function(key, value) { $("#" + value).show().trigger("show"); }); } // Update an input if (ui.item.update) { + console.log("Make action update on each ui.item.update") // loop on each "update" fields $.each(ui.item.update, function(key, value) { $("#" + key).val(value).trigger("change"); }); } if (ui.item.textarea) { + console.log("Make action textarea on each ui.item.textarea") $.each(ui.item.textarea, function(key, value) { if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined" && CKEDITOR.instances[key] != "undefined") { CKEDITOR.instances[key].setData(value); @@ -192,7 +198,6 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt } ,delay: 500 }).data("'.$dataforrenderITem.'")._renderItem = function( ul, item ) { - return $("
  • ") .data( "'.$dataforitem.'", item ) // jQuery UI > 1.10.0 .append( \'\' + item.label + "" ) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 1be45a27f7d5c..97f50498fb063 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -26,7 +26,7 @@ * $langs * $dateSelector * $forceall (0 by default, 1 for supplier invoices/orders) - * $senderissupplier (0 by default, 1 for supplier invoices/orders) + * $senderissupplier (0 by default, 1 or 2 for supplier invoices/orders) * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax) */ @@ -208,12 +208,13 @@ } else { + // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum if ($senderissupplier != 2) { $ajaxoptions=array( 'update' => array('qty'=>'qty','remise_percent' => 'discount','idprod' => 'idprod'), // html id tags that will be edited with which ajax json response key - 'option_disabled' => 'addPredefinedProductButton', // html id to disable once select is done - 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'error' + 'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done + 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for exemple shown we select a disabled option into combo) ); $alsoproductwithnosupplierprice=0; } @@ -222,6 +223,7 @@ $ajaxoptions = array(); $alsoproductwithnosupplierprice=1; } + $form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice); } echo ''; diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index 2ca1cba108393..69e48248d57fe 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -42,6 +42,8 @@ $action = GETPOST('action','alpha'); $value = GETPOST('value'); +$label = GETPOST('label','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='donation'; @@ -287,14 +289,14 @@ else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"),'switch_on').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"),'switch_on').''; print ''; } } else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -308,7 +310,7 @@ else { print ""; - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; print ''; } diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index f40273f7b3fb2..0c2c7044e5d33 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1157,7 +1157,7 @@ public function create($user, $notrigger=0) // insert products details into database for ($i=0;$i<$num;$i++) { - $result = $this->addline( // This include test on qty if option SUPPLIERORDER_WITH_NOPRICEDEFINED is not set + $result = $this->addline( // This include test on qty if option SUPPLIER_ORDER_WITH_NOPRICEDEFINED is not set $this->lines[$i]->desc, $this->lines[$i]->subprice, $this->lines[$i]->qty, @@ -1393,7 +1393,7 @@ public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocalt if ($fk_product > 0) { - if (empty($conf->global->SUPPLIERORDER_WITH_NOPRICEDEFINED)) + if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) { // Check quantity is enough dol_syslog(get_class($this)."::addline we check supplier prices fk_product=".$fk_product." fk_prod_fourn_price=".$fk_prod_fourn_price." qty=".$qty." fourn_ref=".$fourn_ref); @@ -2842,8 +2842,9 @@ public function calcAndSetStatusDispatch(User $user, $closeopenorder=1, $comment $supplierorderdispatch = new CommandeFournisseurDispatch($this->db); $filter=array('t.fk_commande'=>$this->id); if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) { - $filter['t.status']=1; + $filter['t.status']=1; // Restrict to lines with status validated } + $ret=$supplierorderdispatch->fetchAll('','',0,0,$filter); if ($ret<0) { @@ -2854,20 +2855,27 @@ public function calcAndSetStatusDispatch(User $user, $closeopenorder=1, $comment { if (is_array($supplierorderdispatch->lines) && count($supplierorderdispatch->lines)>0) { - //Build array with quantity deliverd by product + $date_liv = dol_now(); + + // Build array with quantity deliverd by product foreach($supplierorderdispatch->lines as $line) { $qtydelivered[$line->fk_product]+=$line->qty; } foreach($this->lines as $line) { $qtywished[$line->fk_product]+=$line->qty; } - - $date_liv = dol_now(); - //Compare array - $diff_array=array_diff_assoc($qtydelivered,$qtywished); - - if (count($diff_array)==0) //No diff => mean everythings is received + $diff_array=array_diff_assoc($qtydelivered,$qtywished); // Warning: $diff_array is done only on common keys. + $keysinwishednotindelivered=array_diff(array_keys($qtywished),array_keys($qtydelivered)); // To check we also have same number of keys + $keysindeliverednotinwished=array_diff(array_keys($qtydelivered),array_keys($qtywished)); // To check we also have same number of keys + /*var_dump(array_keys($qtydelivered)); + var_dump(array_keys($qtywished)); + var_dump($diff_array); + var_dump($keysinwishednotindelivered); + var_dump($keysindeliverednotinwished); + exit;*/ + + if (count($diff_array)==0 && count($keysinwishednotindelivered)==0 && count($keysindeliverednotinwished)==0) //No diff => mean everythings is received { if ($closeopenorder) { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 4e3362d36ac2a..5656643820644 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -365,21 +365,29 @@ { $productsupplier = new ProductFournisseur($db); - if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) + if (empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) // TODO this test seems useless { $idprod=0; if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) } - - if (GETPOST('idprodfournprice') > 0) + if (preg_match('/^idprod_([0-9]+)$/',GETPOST('idprodfournprice'), $reg)) + { + $idprod=$reg[1]; + $res=$productsupplier->fetch($idprod); + // Call to init properties of $productsupplier + // So if a supplier price already exists for another thirdparty (first one found), we use it as reference price + $productsupplier->get_buyprice(0, -1, $idprod, 'none'); // We force qty to -1 to be sure to find if a supplier price exist + } + elseif (GETPOST('idprodfournprice') > 0) { - $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qty); // Just to see if a price exists for the quantity. Not used to found vat. + $qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat. + //$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist + $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch); + $res=$productsupplier->fetch($idprod); } if ($idprod > 0) { - $res=$productsupplier->fetch($idprod); - $label = $productsupplier->label; $desc = $productsupplier->description; @@ -400,8 +408,8 @@ $tva_tx, $localtax1_tx, $localtax2_tx, + $idprod, $productsupplier->id, - GETPOST('idprodfournprice'), $productsupplier->fourn_ref, $remise_percent, 'HT', @@ -2105,6 +2113,7 @@ // Add free products/services form global $forceall, $senderissupplier, $dateSelector; $forceall=1; $senderissupplier=1; $dateSelector=0; + if (! empty($conf->global->SUPPLIER_ORDER_WITH_NOPRICEDEFINED)) $senderissupplier=2; // $senderissupplier=2 is same than 1 but disable test on minimum qty and disable autofill qty with minimum. // Show object lines $inputalsopricewithtax=0; diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index c0465a6165879..f4f05f96b786d 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -28,6 +28,7 @@ * \ingroup commande * \brief Page to dispatch receiving */ + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_order/modules_commandefournisseur.php'; require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; @@ -84,17 +85,33 @@ * Actions */ -if ($action == 'checkdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) { +if ($action == 'checkdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) +{ + $error=0; $supplierorderdispatch = new CommandeFournisseurDispatch($db); + + $db->begin(); + $result = $supplierorderdispatch->fetch($lineid); if (! $result) - dol_print_error($db); - $result = $supplierorderdispatch->setStatut(1); - if ($result < 0) { + { + $error++; setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); - $error ++; $action = ''; - } else { + } + + if (! $error) + { + $result = $supplierorderdispatch->setStatut(1); + if ($result < 0) { + setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); + $error++; + $action = ''; + } + } + + if (! $error) + { $result = $object->calcAndSetStatusDispatch($user); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -102,19 +119,42 @@ $action = ''; } } + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } } -if ($action == 'uncheckdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) { +if ($action == 'uncheckdispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) +{ + $error=0; $supplierorderdispatch = new CommandeFournisseurDispatch($db); + + $db->begin(); + $result = $supplierorderdispatch->fetch($lineid); if (! $result) - dol_print_error($db); - $result = $supplierorderdispatch->setStatut(0); - if ($result < 0) { + { + $error++; setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); - $error ++; $action = ''; - } else { + } + + if (! $error) + { + $result = $supplierorderdispatch->setStatut(0); + if ($result < 0) { + setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); + $error ++; + $action = ''; + } + } + if (! $error) + { $result = $object->calcAndSetStatusDispatch($user); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -122,19 +162,42 @@ $action = ''; } } + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } } -if ($action == 'denydispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) { +if ($action == 'denydispatchline' && ! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) +{ + $error=0; $supplierorderdispatch = new CommandeFournisseurDispatch($db); + + $db->begin(); + $result = $supplierorderdispatch->fetch($lineid); if (! $result) - dol_print_error($db); - $result = $supplierorderdispatch->setStatut(2); - if ($result < 0) { + { + $error++; setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); - $error ++; $action = ''; - } else { + } + + if (! $error) + { + $result = $supplierorderdispatch->setStatut(2); + if ($result < 0) { + setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); + $error ++; + $action = ''; + } + } + if (! $error) + { $result = $object->calcAndSetStatusDispatch($user); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -142,6 +205,14 @@ $action = ''; } } + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } } if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) { @@ -743,7 +814,8 @@ // Add button to check/uncheck disaptching print ''; - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))) { + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))) + { if (empty($objp->status)) { print '' . $langs->trans("Approve") . ''; print '' . $langs->trans("Deny") . ''; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index cdc6419d4a9f1..a3d396e75a132 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -976,21 +976,30 @@ if ($prod_entry_mode != 'free' && empty($error)) // With combolist mode idprodfournprice is > 0 or -1. With autocomplete, idprodfournprice is > 0 or '' { - $idprod=0; $productsupplier=new ProductFournisseur($db); - if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-2; // Same behaviour than with combolist. When not select idprodfournprice is now -2 (to avoid conflict with next action that may return -1) + $idprod=0; + if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) - if (GETPOST('idprodfournprice') > 0) + if (preg_match('/^idprod_([0-9]+)$/',GETPOST('idprodfournprice'), $reg)) + { + $idprod=$reg[1]; + $res=$productsupplier->fetch($idprod); + // Call to init properties of $productsupplier + // So if a supplier price already exists for another thirdparty (first one found), we use it as reference price + $productsupplier->get_buyprice(0, -1, $idprod, 'none'); // We force qty to -1 to be sure to find if a supplier price exist + } + elseif (GETPOST('idprodfournprice') > 0) { - $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qty); // Just to see if a price exists for the quantity. Not used to found vat. + $qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat. + //$qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist + $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch); + $res=$productsupplier->fetch($idprod); } //Replaces $fk_unit with the product's if ($idprod > 0) { - $result=$productsupplier->fetch($idprod); - $label = $productsupplier->label; $desc = $productsupplier->description; @@ -1005,10 +1014,29 @@ $type = $productsupplier->type; $price_base_type = 'HT'; - // TODO Save the product supplier ref into database into field ref_supplier (must rename field ref into ref_supplier first) - $result=$object->addline($desc, $productsupplier->fourn_pu, $tva_tx, $localtax1_tx, $localtax2_tx, $qty, $idprod, $remise_percent, $date_start, $date_end, 0, $tva_npr, $price_base_type, $type, -1, 0, $array_options, $productsupplier->fk_unit); + // TODO Save the product supplier ref into database (like done for supplier propal and order) into field ref_supplier (must rename field ref into ref_supplier first) + $result=$object->addline( + $desc, + $productsupplier->fourn_pu, + $tva_tx, + $localtax1_tx, + $localtax2_tx, + $qty, + $idprod, + $remise_percent, + $date_start, + $date_end, + 0, + $tva_npr, + $price_base_type, + $type, + -1, + 0, + $array_options, + $productsupplier->fk_unit + ); } - if ($idprod == -2 || $idprod == 0) + if ($idprod == -99 || $idprod == 0) { // Product not selected $error++; diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 172bdd9354cce..78829e489a61a 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -46,7 +46,7 @@ $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='product'; // Pricing Rules @@ -460,7 +460,7 @@ else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -472,7 +472,7 @@ } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index 9e35ea77e0bca..744e52e0f2f5c 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -43,7 +43,7 @@ $value = GETPOST('value','alpha'); $action = GETPOST('action','alpha'); $label = GETPOST('label','alpha'); -$scandir = GETPOST('scandir','alpha'); +$scandir = GETPOST('scan_dir','alpha'); $type='project'; @@ -645,7 +645,7 @@ if (in_array($name, $def)) { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; print ""; @@ -653,7 +653,7 @@ else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -665,7 +665,7 @@ } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; @@ -804,7 +804,7 @@ if (in_array($name, $def)) { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; print ""; @@ -812,7 +812,7 @@ else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -824,7 +824,7 @@ } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 5c84be25521cc..89ef7d0323daa 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -108,7 +108,7 @@ if ($action == 'set') { $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); + $scandir = GETPOST('scan_dir','alpha'); $type='company'; $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; @@ -135,7 +135,7 @@ if ($action == 'setdoc') { $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); + $scandir = GETPOST('scan_dir','alpha'); $db->begin(); @@ -521,7 +521,7 @@ print "\n"; //if ($conf->global->COMPANY_ADDON_PDF != "$name") //{ - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; //} @@ -542,7 +542,7 @@ else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 5c39f910b660b..cfb8ca5223462 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -574,7 +574,7 @@ { $productsupplier = new ProductFournisseur($db); - if (empty($conf->global->SUPPLIER_PROPOSAL_WITH_NOPRICEDEFINED)) + if (empty($conf->global->SUPPLIER_PROPOSAL_WITH_NOPRICEDEFINED)) // TODO this test seems useless { $idprod=0; if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) @@ -589,8 +589,9 @@ } elseif (GETPOST('idprodfournprice') > 0) { - //$idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qty); // Just to see if a price exists for the quantity. Not used to found vat. - $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), -1); // We force qty to -1 to be sure to find if a supplier price exist + //$qtytosearch=$qty; // Just to see if a price exists for the quantity. Not used to found vat. + $qtytosearch=-1; // We force qty to -1 to be sure to find if a supplier price exist + $idprod=$productsupplier->get_buyprice(GETPOST('idprodfournprice'), $qtytosearch); $res=$productsupplier->fetch($idprod); } @@ -600,7 +601,7 @@ $price_base_type = $productsupplier->fourn_price_base_type; $type = $productsupplier->type; $label = $productsupplier->label; - $desc = $productsupplier->description; + $desc = $productsupplier->description; if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc); $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice'));