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

This commit is contained in:
Laurent Destailleur 2021-10-22 15:42:32 +02:00
commit bede1116a8
7 changed files with 16 additions and 4 deletions

View File

@ -223,7 +223,7 @@ $sql .= $object->getFieldList('t');
// Add fields from extrafields
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : '');
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
}
}
// Add fields from hooks

View File

@ -97,6 +97,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
}
$sql .= " WHERE c.fk_soc = s.rowid";
$sql .= " AND c.entity IN (".getEntity('supplier_order').")";
$sql .= " AND c.date_livraison IS NOT NULL";
$sql .= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_ORDERSENT.", ".CommandeFournisseur::STATUS_RECEIVED_PARTIALLY.")";
if (!$user->rights->societe->client->voir && !$user->socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);

View File

@ -1101,7 +1101,7 @@ function activateModule($value, $withdeps = 1)
if (!count($ret['errors'])) {
$ret['nbmodules']++;
$ret['nbperms'] += count($objMod->rights);
$ret['nbperms'] += (is_array($objMod->rights)?count($objMod->rights):0);
}
return $ret;

View File

@ -195,7 +195,7 @@ if (!in_array($type, array('text/x-javascript')) && !dolIsAllowedForPreview($ori
}
// Security: Delete string ../ or ..\ into $original_file
$original_file = preg_replace('/\.\.+/','..', $original_file); // Replace '... or more' with '..'
$original_file = preg_replace('/\.\.+/', '..', $original_file); // Replace '... or more' with '..'
$original_file = str_replace('../', '/', $original_file);
$original_file = str_replace('..\\', '/', $original_file);

View File

@ -415,6 +415,7 @@ class FactureFournisseur extends CommonInvoice
$sql = "INSERT INTO ".MAIN_DB_PREFIX."facture_fourn (";
$sql .= "ref";
$sql .= ", ref_supplier";
$sql .= ", ref_ext";
$sql .= ", entity";
$sql .= ", type";
$sql .= ", libelle";
@ -438,6 +439,7 @@ class FactureFournisseur extends CommonInvoice
$sql .= " VALUES (";
$sql .= "'(PROV)'";
$sql .= ", '".$this->db->escape($this->ref_supplier)."'";
$sql .= ", '".$this->db->escape($this->ref_ext)."'";
$sql .= ", ".$conf->entity;
$sql .= ", '".$this->db->escape($this->type)."'";
$sql .= ", '".$this->db->escape(isset($this->label) ? $this->label : (isset($this->libelle) ? $this->libelle : ''))."'";
@ -647,6 +649,7 @@ class FactureFournisseur extends CommonInvoice
$sql .= " t.rowid,";
$sql .= " t.ref,";
$sql .= " t.ref_supplier,";
$sql .= " t.ref_ext,";
$sql .= " t.entity,";
$sql .= " t.type,";
$sql .= " t.fk_soc,";
@ -708,6 +711,7 @@ class FactureFournisseur extends CommonInvoice
$this->ref = $obj->ref ? $obj->ref : $obj->rowid; // We take rowid if ref is empty for backward compatibility
$this->ref_supplier = $obj->ref_supplier;
$this->ref_ext = $obj->ref_ext;
$this->entity = $obj->entity;
$this->type = empty($obj->type) ? self::TYPE_STANDARD : $obj->type;
$this->fk_soc = $obj->fk_soc;
@ -924,6 +928,9 @@ class FactureFournisseur extends CommonInvoice
if (isset($this->ref_supplier)) {
$this->ref_supplier = trim($this->ref_supplier);
}
if (isset($this->ref_ext)) {
$this->ref_ext = trim($this->ref_ext);
}
if (isset($this->entity)) {
$this->entity = trim($this->entity);
}
@ -1013,6 +1020,7 @@ class FactureFournisseur extends CommonInvoice
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn SET";
$sql .= " ref=".(isset($this->ref) ? "'".$this->db->escape($this->ref)."'" : "null").",";
$sql .= " ref_supplier=".(isset($this->ref_supplier) ? "'".$this->db->escape($this->ref_supplier)."'" : "null").",";
$sql .= " ref_ext=".(isset($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "null").",";
$sql .= " entity=".(isset($this->entity) ? $this->entity : "null").",";
$sql .= " type=".(isset($this->type) ? $this->type : "null").",";
$sql .= " fk_soc=".(isset($this->fk_soc) ? $this->fk_soc : "null").",";

View File

@ -265,7 +265,7 @@ $sql .= $object->getFieldList('t');
// Add fields from extrafields
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : '');
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
}
}
// Add fields from hooks

View File

@ -384,6 +384,9 @@ class User extends CommonObject
$this->rights->user = new stdClass();
$this->rights->user->user = new stdClass();
$this->rights->user->self = new stdClass();
$this->rights->user->user_advance = new stdClass();
$this->rights->user->self_advance = new stdClass();
$this->rights->user->group_advance = new stdClass();
}
/**