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

This commit is contained in:
Laurent Destailleur 2020-07-29 13:54:12 +02:00
commit 2687666579
11 changed files with 48 additions and 28 deletions

View File

@ -8,6 +8,7 @@ ALL:
Check "@CHANGE"
PrestaShopWebservice:
---------------------
Replace
@ -27,6 +28,19 @@ With
DEBUGBAR:
---------
Move
this.options = {
bodyMarginBottom: true,
bodyMarginBottomHeight: parseInt($('body').css('margin-bottom')),
};
few line lower in the
initialize: function() {
ESCPOS:
-------
Replace

View File

@ -251,15 +251,17 @@ if (!empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' &&
if ($tmpmodule != 'api')
$tmpmodule = preg_replace('/api$/i', '', $tmpmodule);
$classfile = str_replace('_', '', $tmpmodule);
if ($module == 'supplierproposals')
// Special cases that does not match name rules conventions
if ($moduleobject == 'supplierproposals')
$classfile = 'supplier_proposals';
if ($module == 'supplierorders')
if ($moduleobject == 'supplierorders')
$classfile = 'supplier_orders';
if ($module == 'supplierinvoices')
if ($moduleobject == 'supplierinvoices')
$classfile = 'supplier_invoices';
if ($module == 'ficheinter')
if ($moduleobject == 'ficheinter')
$classfile = 'interventions';
if ($module == 'interventions')
if ($moduleobject == 'interventions')
$classfile = 'interventions';
$dir_part_file = dol_buildpath('/'.$moduledirforclass.'/class/api_'.$classfile.'.class.php', 0, 2);

View File

@ -403,8 +403,8 @@ if ($view == "recent")
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
$resql = $db->query($sql);
$nbtotalofrecords = $db->num_rows($resql);
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
{
$page = 0;
@ -414,14 +414,14 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$sql .= $db->plimit($limit + 1, $offset);
$result = $db->query($sql);
if (!$result)
$resql = $db->query($sql);
if (! $resql)
{
dol_print_error($db);
exit;
}
$num = $db->num_rows($result);
$num = $db->num_rows($resql);
$arrayofselected = is_array($toselect) ? $toselect : array();
@ -777,7 +777,7 @@ $i = 0;
$totalarray = array();
while ($i < min($num, $limit))
{
$obj = $db->fetch_object($result);
$obj = $db->fetch_object($resql);
$arraysocialnetworks = (array) json_decode($obj->socialnetworks, true);
$contactstatic->lastname = $obj->lastname;
@ -975,7 +975,7 @@ while ($i < min($num, $limit))
$i++;
}
$db->free($result);
$db->free($resql);
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook

View File

@ -5510,8 +5510,7 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1)
{
$allowed_tags = array(
"html", "head", "meta", "body", "article", "a", "abbr", "b", "blockquote", "br", "cite", "div", "dl", "dd", "dt", "em", "font", "img", "ins", "hr", "i", "li", "link",
"ol", "p", "q", "s", "section", "span", "strike", "strong", "title",
"table", "tr", "th", "td", "u", "ul"
"ol", "p", "q", "s", "section", "span", "strike", "strong", "title", "table", "tr", "th", "td", "u", "ul", "sup", "sub", "blockquote", "pre", "h1", "h2", "h3", "h4", "h5", "h6"
);
$allowed_tags_string = join("><", $allowed_tags);
$allowed_tags_string = preg_replace('/^>/', '', $allowed_tags_string);

View File

@ -1828,7 +1828,6 @@ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanag
}
if (empty($reshook))
{
if ($object->lines[$i]->special_code == 3) return '';
if (empty($hidedetails) || $hidedetails > 1) $result .= $langs->transnoentitiesnoconv($object->lines[$i]->getLabelOfUnit('short'));
}
return $result;

View File

@ -288,6 +288,7 @@ class Expedition extends CommonObject
$this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."expedition (";
$sql .= "ref";
$sql .= ", entity";
$sql .= ", ref_customer";
@ -327,10 +328,10 @@ class Expedition extends CommonObject
$sql .= ", ".($this->fk_delivery_address > 0 ? $this->fk_delivery_address : "null");
$sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : "null");
$sql .= ", '".$this->db->escape($this->tracking_number)."'";
$sql .= ", ".$this->weight;
$sql .= ", ".$this->sizeS; // TODO Should use this->trueDepth
$sql .= ", ".$this->sizeW; // TODO Should use this->trueWidth
$sql .= ", ".$this->sizeH; // TODO Should use this->trueHeight
$sql.= ", ".(is_numeric($this->weight)?$this->weight:'NULL');
$sql.= ", ".(is_numeric($this->sizeS)?$this->sizeS:'NULL'); // TODO Should use this->trueDepth
$sql.= ", ".(is_numeric($this->sizeW)?$this->sizeW:'NULL'); // TODO Should use this->trueWidth
$sql.= ", ".(is_numeric($this->sizeH)?$this->sizeH:'NULL'); // TODO Should use this->trueHeight
$sql .= ", ".($this->weight_units != '' ? (int) $this->weight_units : 'NULL');
$sql .= ", ".($this->size_units != '' ? (int) $this->size_units : 'NULL');
$sql .= ", ".(!empty($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null");

View File

@ -332,9 +332,11 @@ class CommandeFournisseur extends CommonOrder
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON c.fk_mode_reglement = p.id";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method";
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid';
$sql .= " WHERE c.entity IN (".getEntity('supplier_order').")";
if (empty($id)) $sql .= " WHERE c.entity IN (".getEntity('supplier_order').")";
else $sql .= " WHERE c.rowid=".$id;
if ($ref) $sql .= " AND c.ref='".$this->db->escape($ref)."'";
else $sql .= " AND c.rowid=".$id;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql = $this->db->query($sql);

View File

@ -409,12 +409,11 @@ if (typeof(PhpDebugBar) == 'undefined') {
className: "phpdebugbar " + csscls('minimized'),
options: {
bodyMarginBottom: true,
bodyMarginBottomHeight: parseInt($('body').css('margin-bottom'))
},
initialize: function() {
this.options = {
bodyMarginBottom: true,
bodyMarginBottomHeight: parseInt($('body').css('margin-bottom')),
};
this.controls = {};
this.dataMap = {};
this.datasets = {};

View File

@ -58,6 +58,7 @@ CREATE OR REPLACE FUNCTION dol_util_triggerall(DoEnable boolean) RETURNS integer
-- Add triggers for timestamp fields named tms
CREATE OR REPLACE FUNCTION update_modified_column_tms() RETURNS TRIGGER AS $$ BEGIN NEW.tms = now(); RETURN NEW; END; $$ LANGUAGE plpgsql;
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_accounting_account FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_accounting_fiscalyear FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_actioncomm FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
@ -127,6 +128,9 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_localtax FOR EACH RO
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mailing FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mailing_cibles FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_menu FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mrp_mo FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mrp_mo_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mrp_production FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_notify FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_notify_def FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_opensurvey_comments FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();

View File

@ -204,7 +204,7 @@ if ($id > 0 || !empty($ref))
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", $option, '', $sortfield, $sortorder);
print_liste_field_titre("DatePropal", $_SERVER["PHP_SELF"], "p.datep", "", $option, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "d.qty", "", $option, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "p.total", "", $option, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "d.total_ht", "", $option, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "p.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder);
print "</tr>\n";

View File

@ -147,7 +147,7 @@ button.dropdown-item.global-search-item {
* MENU Dropdown
*/
.login_block.usedropdown .logout-btn{
display: none;
/* display: none; */
}
.tmenu .open.dropdown, .tmenu .open.dropdown {