mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
FIX Returns
This commit is contained in:
parent
81ed97e9fc
commit
444ba4bf46
|
|
@ -66,7 +66,7 @@ $idproduct = GETPOST('idproduct', 'int');
|
|||
|
||||
top_httphead();
|
||||
|
||||
if ($action == 'getDurationUnitByProduct') {
|
||||
if ($action == 'getDurationUnitByProduct' && $user->hasRight('product', 'lire')) {
|
||||
$product = new Product($db);
|
||||
$res = $product->fetch($idproduct);
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,9 @@ if (empty($outputalsopricetotalwithtax)) {
|
|||
}
|
||||
|
||||
// add html5 elements
|
||||
$domData = ' data-element="'.$line->element.'service"';
|
||||
if($filtertype == 1) $domData = ' data-element="'.$line->element.'service"';
|
||||
else $domData = ' data-element="'.$line->element.'"';
|
||||
|
||||
$domData .= ' data-id="'.$line->id.'"';
|
||||
$domData .= ' data-qty="'.$line->qty.'"';
|
||||
$domData .= ' data-product_type="'.$line->product_type.'"';
|
||||
|
|
|
|||
|
|
@ -427,9 +427,9 @@ class CUnits // extends CommonObject
|
|||
{
|
||||
|
||||
if ($mode == 'short_label') {
|
||||
return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid', 0, ' AND unit_type = "'.$unit_type.'"');
|
||||
return dol_getIdFromCode($this->db, $code, 'c_units', 'short_label', 'rowid', 0, ' AND unit_type = "'.$this->db->escape($unit_type).'"');
|
||||
} elseif ($mode == 'code') {
|
||||
return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid', 0, ' AND unit_type = "'. $unit_type .'"');
|
||||
return dol_getIdFromCode($this->db, $code, 'c_units', 'code', 'rowid', 0, ' AND unit_type = "'. $this->db->escape($unit_type) .'"');
|
||||
}
|
||||
|
||||
return $code;
|
||||
|
|
|
|||
|
|
@ -8539,11 +8539,11 @@ function dol_osencode($str)
|
|||
* @param string $fieldkey Field to search the key into
|
||||
* @param string $fieldid Field to get
|
||||
* @param int $entityfilter Filter by entity
|
||||
* @param string $filters Filter on other fields
|
||||
* @param string $filters Filter on other fields
|
||||
* @return int <0 if KO, Id of code if OK
|
||||
* @see $langs->getLabelFromKey
|
||||
*/
|
||||
function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = 'id', $entityfilter = 0, $filters = array())
|
||||
function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = 'id', $entityfilter = 0, $filters = '')
|
||||
{
|
||||
global $cache_codes;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user