Merge branch '12.0' into 12p18

This commit is contained in:
Alexandre SPANGARO 2021-08-15 07:19:33 +02:00
commit 0d467972cd
7 changed files with 11 additions and 7 deletions

View File

@ -5206,7 +5206,8 @@ elseif ($id > 0 || !empty($ref))
// Reopen a standard paid invoice
if ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT)
|| ($object->type == Facture::TYPE_CREDIT_NOTE && empty($discount->id))
|| ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id)))
|| ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id))
|| ($object->type == Facture::TYPE_SITUATION && empty($discount->id)))
&& ($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data
&& ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || $usercanreopen)) // A paid invoice (partially or completely)
{

View File

@ -1182,7 +1182,7 @@ class Form
// mode 1
$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&filter='.urlencode($filter).($showtype ? '&showtype='.urlencode($showtype) : '');
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
$out .= '<style type="text/css">.ui-autocomplete { z-index: 250; }</style>';
$out .= '<style type="text/css">.ui-autocomplete { z-index: 1003; }</style>';
if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : ';
elseif ($hidelabel > 1) {
$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
@ -6052,7 +6052,7 @@ class Form
$urloption = 'htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.'&filter='.urlencode($objecttmp->filter);
// Activate the auto complete using ajax call.
$out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array());
$out .= '<style type="text/css">.ui-autocomplete { z-index: 250; }</style>';
$out .= '<style type="text/css">.ui-autocomplete { z-index: 1003; }</style>';
if ($placeholder) $placeholder = ' placeholder="'.$placeholder.'"';
$out .= '<input type="text" class="'.$morecss.'"'.($disabled ? ' disabled="disabled"' : '').' name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
}

View File

@ -42,7 +42,7 @@ if (!empty($extrafieldsobjectkey) && !empty($search_array_options) && is_array($
if (in_array($typ, array('chkbxlst', 'checkbox'))) $mode_search = 4; // Search on a multiselect field with sql type = text
if (is_array($crit)) $crit = implode(' ', $crit); // natural_search() expects a string
elseif ($typ === 'select' and is_string($crit) and strpos($crit, ' ') === false) {
$sql .= ' AND ('.$extrafieldsobjectprefix.$tmpkey.' = "'.$db->escape($crit).'")';
$sql .= " AND (".$extrafieldsobjectprefix.$tmpkey." = '".$db->escape($crit)."')";
continue;
}
$sql .= natural_search($extrafieldsobjectprefix.$tmpkey, $crit, $mode_search);

View File

@ -309,7 +309,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
$diff_array = array_diff_assoc($qtyordred, $qtyshipped);
if (count($diff_array) == 0) {
//No diff => mean everythings is shipped
$ret = $object->setStatut(Commande::STATUS_CLOSED, $object->origin_id, $object->origin, 'ORDER_CLOSE');
$ret = $order->setStatut(Commande::STATUS_CLOSED, $object->origin_id, $object->origin, 'ORDER_CLOSE');
if ($ret < 0) {
$this->error = $object->error; $this->errors = $object->errors;
return $ret;

View File

@ -464,7 +464,7 @@ class CommandeFournisseur extends CommonOrder
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l";
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING))
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON l.fk_product = pfp.fk_product and l.ref = pfp.ref_fourn";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON l.fk_product = pfp.fk_product and l.ref = pfp.ref_fourn AND pfp.fk_soc = ".$this->socid;
$sql .= " WHERE l.fk_commande = ".$this->id;
if ($only_product) $sql .= ' AND p.fk_product_type = 0';
$sql .= " ORDER BY l.rang, l.rowid";

View File

@ -81,6 +81,9 @@ if (($id > 0) || $ref)
}
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('holidaycard', 'globalcard'));
$cancreate = 0;
if (!empty($user->rights->holiday->write_all)) $cancreate = 1;
if (!empty($user->rights->holiday->write) && in_array($fuserid, $childids)) $cancreate = 1;

View File

@ -449,7 +449,7 @@ if (empty($reshook)) {
}
// Set parent company
if ($action == 'set_thirdparty' && $user->rights->societe->creer) {
if ($action == 'set_thirdparty' && $user->rights->ticket->write) {
if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
$result = $object->setCustomer(GETPOST('editcustomer', 'int'));
$url = 'card.php?action=view&track_id=' . GETPOST('track_id', 'alpha');