Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/compta/facture/card.php
	htdocs/core/class/html.form.class.php
	htdocs/product/price.php
This commit is contained in:
Laurent Destailleur 2020-12-17 21:50:05 +01:00
commit 3b8947dadd
8 changed files with 107 additions and 73 deletions

View File

@ -299,7 +299,7 @@ SELECT2
Edit CSS to restore line removed between 4.0.5 and 4.0.6. It generates this bug: https://github.com/select2/select2/issues/5832
.select2-hidden-accessible {
margin: -1px !important; /* line to restore */
margin: -10000px !important; /* line to restore */
}

View File

@ -39,6 +39,8 @@ if (!$user->admin) accessforbidden();
$action = GETPOST('action', 'aZ09');
$type = 'paymentorder';
$error = 0;
/*
* Actions
@ -73,30 +75,25 @@ if ($action == "set")
} else $error++;
$res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"), 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
if (! ($res > 0)) $error++;
if (GETPOST("PRELEVEMENT_USER") > 0)
{
$res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
}
if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END") == "")
{
$res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
}
if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD") == "")
{
$res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
}
if (GETPOST("PRELEVEMENT_USER") > 0) {
$res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity);
if (! ($res > 0)) $error++;
}
if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END") == "") {
$res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity);
if (! ($res > 0)) $error++;
}
if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD") == "") {
$res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity);
if (! ($res > 0)) $error++;
}
if (GETPOST("PRELEVEMENT_ADDDAYS") || GETPOST("PRELEVEMENT_ADDDAYS") == "")
{
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
} elseif (!$error)
{
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
if (! ($res > 0)) $error++;
if (! $error) {
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
@ -193,9 +190,10 @@ print '</td></tr>';
//ADDDAYS
print '<tr class="oddeven"><td>'.$langs->trans("ADDDAYS").'</td>';
print '<td class="left">';
if (!$conf->global->PRELEVEMENT_ADDDAYS) $conf->global->PRELEVEMENT_ADDDAYS = 0;
if (empty($conf->global->PRELEVEMENT_ADDDAYS)) $conf->global->PRELEVEMENT_ADDDAYS = 0;
print '<input type="text" name="PRELEVEMENT_ADDDAYS" value="'.$conf->global->PRELEVEMENT_ADDDAYS.'" size="5" ></td>';
print '</td></tr>';
print '</table>';
print '<br>';

View File

@ -2433,22 +2433,22 @@ if (empty($reshook))
{
$object->fetch($id, '', '', '', true);
if ($object->statut == Facture::STATUS_VALIDATED
&& $object->type == Facture::TYPE_SITUATION
&& $usercancreate
&& !$objectidnext
&& $object->is_last_in_cycle()
&& $usercanunvalidate
)
{
$outingError = 0;
$newCycle = $object->newCycle(); // we need to keep the "situation behavior" so we place it on a new situation cycle
if ($newCycle > 1)
{
// Search credit notes
$lastCycle = $object->situation_cycle_ref;
$lastSituationCounter = $object->situation_counter;
$linkedCreditNotesList = array();
if (in_array($object->statut, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED))
&& $object->type == Facture::TYPE_SITUATION
&& $usercancreate
&& !$objectidnext
&& $object->is_last_in_cycle()
&& $usercanunvalidate
)
{
$outingError = 0;
$newCycle = $object->newCycle(); // we need to keep the "situation behavior" so we place it on a new situation cycle
if ($newCycle > 1)
{
// Search credit notes
$lastCycle = $object->situation_cycle_ref;
$lastSituationCounter = $object->situation_counter;
$linkedCreditNotesList = array();
if (count($object->tab_next_situation_invoice) > 0) {
foreach ($object->tab_next_situation_invoice as $next_invoice) {
@ -3764,18 +3764,18 @@ if ($action == 'create')
// Confirmation to remove invoice from cycle
if ($action == 'situationout') {
$text = $langs->trans('ConfirmRemoveSituationFromCycle', $object->ref);
$label = $langs->trans("ConfirmOuting");
$formquestion = array();
// remove situation from cycle
if ($object->statut == Facture::STATUS_VALIDATED
&& $usercancreate
&& !$objectidnext
&& $object->is_last_in_cycle()
&& $usercanunvalidate
)
{
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id, $label, $text, 'confirm_situationout', $formquestion, "yes", 1);
$text = $langs->trans('ConfirmRemoveSituationFromCycle', $object->ref);
$label = $langs->trans("ConfirmOuting");
$formquestion = array();
// remove situation from cycle
if (in_array($object->statut, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED))
&& $usercancreate
&& !$objectidnext
&& $object->is_last_in_cycle()
&& $usercanunvalidate
)
{
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id, $label, $text, 'confirm_situationout', $formquestion, "yes", 1);
}
}
@ -5278,12 +5278,12 @@ if ($action == 'create')
}
// Remove situation from cycle
if ($object->statut > Facture::STATUS_DRAFT
&& $object->type == Facture::TYPE_SITUATION
&& $usercancreate
&& !$objectidnext
&& $object->situation_counter > 1
&& $object->is_last_in_cycle()
if (in_array($object->statut, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED))
&& $object->type == Facture::TYPE_SITUATION
&& $usercancreate
&& !$objectidnext
&& $object->situation_counter > 1
&& $object->is_last_in_cycle()
&& $usercanunvalidate
)
{

View File

@ -6259,12 +6259,6 @@ class Form
$resql = $this->db->query($sql);
if ($resql)
{
if (!$forcecombo)
{
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
$out .= ajax_combobox($htmlname, null, $conf->global->$confkeyforautocompletemode);
}
// Construct $out and $outarray
$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').($moreparams ? ' '.$moreparams : '').' name="'.$htmlname.'">'."\n";
@ -6310,6 +6304,11 @@ class Form
}
$out .= '</select>'."\n";
if (!$forcecombo) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
$out .= ajax_combobox($htmlname, null, $conf->global->$confkeyforautocompletemode);
}
} else {
dol_print_error($this->db);
}

View File

@ -121,7 +121,7 @@
-webkit-clip-path: inset(50%) !important;
clip-path: inset(50%) !important;
height: 1px !important;
margin: -1px !important;
margin: -10000px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;

View File

@ -1438,14 +1438,14 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
{
$db->free($result);
// Il doit au moins y avoir la ligne de prix initial.
// On l'ajoute donc pour remettre a niveau (pb vieilles versions)
//$object->updatePrice($object->price, $object->price_base_type, $user, $object->tva_tx, $object->price_min);
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
$object->updatePrice($object->multiprices[1], $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), $object->multiprices_min[1], 1);
} else {
$object->updatePrice($object->price, $object->price_base_type, $user, $object->tva_tx, $object->price_min);
}
// Il doit au moins y avoir la ligne de prix initial.
// On l'ajoute donc pour remettre a niveau (pb vieilles versions)
// We emulate the change of the price from interface with the same value than the one into table llx_product
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
$object->updatePrice(($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_ttc[1] : $object->multiprices[1]), $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), ($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_min_ttc[1] : $object->multiprices_min[1]), 1);
} else {
$object->updatePrice(($object->price_base_type == 'TTC' ? $object->price_ttc : $object->price), $object->price_base_type, $user, $object->tva_tx, ($object->price_base_type == 'TTC' ? $object->price_min_ttc : $object->price_min));
}
$result = $db->query($sql);
$num = $db->num_rows($result);

View File

@ -6762,6 +6762,24 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before
}
}
@media only screen and (max-width: 320px)
{
.dropdown dd ul {
max-width: 270px; /* must always be 50 slower than width */
}
}
@media only screen and (max-width: 300px)
{
.dropdown dd ul {
max-width: 250px;
}
}
@media only screen and (max-width: 280px)
{
.dropdown dd ul {
max-width: 230px;
}
}
<?php

View File

@ -429,6 +429,25 @@ a.top-menu-dropdown-link {
}
}
@media only screen and (max-width: 320px)
{
.dropdown dd ul {
max-width: 270px; /* must always be 50 slower than width */
}
}
@media only screen and (max-width: 300px)
{
.dropdown dd ul {
max-width: 250px;
}
}
@media only screen and (max-width: 280px)
{
.dropdown dd ul {
max-width: 230px;
}
}
.dropdown-search-input::placeholder {
color: color(#575756 a(0.8));