Skip to content

Commit

Permalink
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
eldy committed Jan 9, 2025
2 parents de321e8 + bd08efc commit a7a50b3
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 55 deletions.
2 changes: 1 addition & 1 deletion htdocs/accountancy/bookkeeping/listbyaccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
$sql .= $db->plimit(1);
$res = $db->query($sql);

if ($res->num_rows > 0) {
if ($res !== false && $db->num_rows($res) > 0) {
$fiscalYear = $db->fetch_object($res);
$search_date_start = strtotime($fiscalYear->date_start);
$search_date_end = strtotime($fiscalYear->date_end);
Expand Down
32 changes: 17 additions & 15 deletions htdocs/accountancy/journal/expensereportsjournal.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,22 +253,24 @@
}

// Load all unbound lines
$sql = "SELECT fk_expensereport, COUNT(erd.rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
$sql .= " WHERE erd.fk_code_ventilation <= 0";
$sql .= " AND erd.total_ttc <> 0";
$sql .= " AND fk_expensereport IN (".$db->sanitize(implode(",", array_keys($taber))).")";
$sql .= " GROUP BY fk_expensereport";
$resql = $db->query($sql);

$num = $db->num_rows($resql);
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($resql);
if ($obj->nb > 0) {
$errorforinvoice[$obj->fk_expensereport] = 'somelinesarenotbound';
if (!empty($taber)) {
$sql = "SELECT fk_expensereport, COUNT(erd.rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
$sql .= " WHERE erd.fk_code_ventilation <= 0";
$sql .= " AND erd.total_ttc <> 0";
$sql .= " AND fk_expensereport IN (".$db->sanitize(implode(",", array_keys($taber))).")";
$sql .= " GROUP BY fk_expensereport";
$resql = $db->query($sql);

$num = $db->num_rows($resql);
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($resql);
if ($obj->nb > 0) {
$errorforinvoice[$obj->fk_expensereport] = 'somelinesarenotbound';
}
$i++;
}
$i++;
}

// Bookkeeping Write
Expand Down
50 changes: 25 additions & 25 deletions htdocs/accountancy/journal/purchasesjournal.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,34 +399,34 @@
}
}
*/

// New way, single query, load all unbound lines
$sql = "
SELECT
fk_facture_fourn,
COUNT(fd.rowid) as nb
FROM
" . MAIN_DB_PREFIX . "facture_fourn_det as fd
WHERE
fd.product_type <= 2
AND fd.fk_code_ventilation <= 0
AND fd.total_ttc <> 0
AND fk_facture_fourn IN (".$db->sanitize(implode(",", array_keys($tabfac))).")
GROUP BY fk_facture_fourn
";
$resql = $db->query($sql);

$num = $db->num_rows($resql);
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($resql);
if ($obj->nb > 0) {
$errorforinvoice[$obj->fk_facture_fourn] = 'somelinesarenotbound';
if (!empty($tabfac)) {
$sql = "
SELECT
fk_facture_fourn,
COUNT(fd.rowid) as nb
FROM
" . MAIN_DB_PREFIX . "facture_fourn_det as fd
WHERE
fd.product_type <= 2
AND fd.fk_code_ventilation <= 0
AND fd.total_ttc <> 0
AND fk_facture_fourn IN (".$db->sanitize(implode(",", array_keys($tabfac))).")
GROUP BY fk_facture_fourn
";
$resql = $db->query($sql);

$num = $db->num_rows($resql);
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($resql);
if ($obj->nb > 0) {
$errorforinvoice[$obj->fk_facture_fourn] = 'somelinesarenotbound';
}
$i++;
}
$i++;
}
//var_dump($errorforinvoice);exit;



// Bookkeeping Write
if ($action == 'writebookkeeping' && !$error && $user->hasRight('accounting', 'bind', 'write')) {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/system/perf.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
print '<br>';
print '<strong>'.$langs->trans("XDebug").'</strong><br>';
print '<div class="divsection">';
$test = !function_exists('xdebug_is_enabled');
$test = !function_exists('xdebug_is_debugger_active');
if ($test) {
print img_picto('', 'tick.png', 'class="pictofixedwidth"').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
} else {
Expand Down
6 changes: 3 additions & 3 deletions htdocs/admin/system/xdebug.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

print load_fiche_titre("XDebug", '', 'title_setup');

if (!function_exists('xdebug_is_enabled')) {
if (!function_exists('xdebug_is_debugger_active')) {
print "<br>\n";
print 'XDebug seems to be not installed. Function xdebug_is_enabled not found.';
llxFooter();
Expand All @@ -62,8 +62,8 @@
print '<br><br>';

if (function_exists('socket_create')) {
$address = ini_get('xdebug.remote_host') ? ini_get('xdebug.remote_host') : '127.0.0.1';
$port = ini_get('xdebug.remote_port') ? ini_get('xdebug.remote_port') : 9000;
$address = ini_get('xdebug.client_host') ? ini_get('xdebug.client_host') : '127.0.0.1';
$port = ini_get('xdebug.client_port') ? (int) ini_get('xdebug.client_port') : 9000;

print "<strong>Current xdebug setup:</strong><br>\n";
print "* Remote debug setup:<br>\n";
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/html.form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -11663,7 +11663,7 @@ public function buttonsSaveCancel($save_label = 'Save', $cancel_label = 'Cancel'

foreach ($buttons as $button) {
$addclass = empty($button['addclass']) ? '' : $button['addclass'];
$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->trans($button['label_key'])) . '">';
$retstring .= '<input type="submit" class="button button-' . $button['name'] . ($morecss ? ' ' . $morecss : '') . ' ' . $addclass . '" name="' . $button['name'] . '" value="' . dol_escape_htmltag($langs->transnoentities($button['label_key'])) . '">';
}
$retstring .= $withoutdiv ? '' : '</div>';

Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/class/html.formsetup.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -906,8 +906,8 @@ public function generateInputField()
} elseif ($this->type == 'yesno') {
if (!empty($conf->use_javascript_ajax)) {
$input = $this->fieldParams['input'] ?? array();
$revertonoff = $this->fieldParams['revertonoff'] ? 1 : 0;
$forcereload = $this->fieldParams['forcereload'] ? 1 : 0;
$revertonoff = isset($this->fieldParams['revertonoff']) ? 1 : 0;
$forcereload = isset($this->fieldParams['forcereload']) ? 1 : 0;

$out .= ajax_constantonoff($this->confKey, $input, $this->entity, $revertonoff, 0, $forcereload);
} else {
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/menus/standard/eldy.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2222,7 +2222,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
// Receptions
if (isModEnabled('reception')) {
$langs->load("receptions");
$newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->hasRight('reception', 'lire'), '', $mainmenu, 'receptions', 0, '', '', '', img_picto('', 'dollyrevert', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->hasRight('reception', 'lire'), '', $mainmenu, 'receptions', 0, '', '', '', img_picto('', 'dollyrevert', 'class="pictofixedwidth", style="text-align: right;"'));
$newmenu->add("/reception/card.php?action=create2&amp;leftmenu=receptions", $langs->trans("NewReception"), 1, $user->hasRight('reception', 'creer'));
$newmenu->add("/reception/list.php?leftmenu=receptions", $langs->trans("List"), 1, $user->hasRight('reception', 'lire'));
if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") {
Expand Down
6 changes: 3 additions & 3 deletions htdocs/public/webportal/tpl/header_login.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@
<?php
//$jNotifyCSSUrl = $context->rootUrl.'includes/jquery/plugins/jnotify/jquery.jnotify.css';
$jNotifyCSSUrl = dol_buildpath('/includes/jquery/plugins/jnotify/jquery.jnotify.min.css', 2);
print '<link rel="stylesheet" href="'.$jNotifyCSSUrl.' ">';
print '<link rel="stylesheet" href="'.$jNotifyCSSUrl.' ">'."\n";

// JQuery
//$jQueryJSUrl = $context->rootUrl.'includes/jquery/js/jquery.js';
$jQueryJSUrl = dol_buildpath('/includes/jquery/js/jquery.js', 2);
print '<script src="'.$jQueryJSUrl.'"></script>';
print '<script src="'.$jQueryJSUrl.'"></script>'."\n";

// JNotify
//$jNotifyJSUrl = $context->rootUrl.'includes/jquery/plugins/jnotify/jquery.jnotify.js';
$jNotifyJSUrl = dol_buildpath('/includes/jquery/plugins/jnotify/jquery.jnotify.min.js', 2);
print '<script src="'.$jNotifyJSUrl.'"></script>';
print '<script src="'.$jNotifyJSUrl.'"></script>'."\n";
?>
</head>
<body class="login-page">
4 changes: 2 additions & 2 deletions htdocs/webportal/controllers/document.controller.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ public function init()
exit;
}

$fileSize = dol_filesize($fullpath_original_file);
$fileSizeMaxDefault = 20 * 1024; // 20 Mo by default
$fileSize = dol_filesize($fullpath_original_file); // the returned value is in byte
$fileSizeMaxDefault = 20 * 1024 * 1024; // 20 Mo by default
$fileSizeMax = getDolGlobalInt('MAIN_SECURITY_MAXFILESIZE_DOWNLOADED', $fileSizeMaxDefault);
if ($fileSize > $fileSizeMax) {
dol_syslog('ErrorFileSizeTooLarge: ' . $fileSize);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/website/websiteaccount_card.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
$permissiontocreate = isModEnabled('website') && $user->hasRight('website', 'write');
$permissiontodelete = isModEnabled('website') && $user->hasRight('website', 'delete');
} elseif ($object->site == 'dolibarr_portal') {
$permissiontocreate = isModEnabled('webportal') && $user->hasRight('webportal', 'write');
$permissiontocreate = $permissiontodelete = isModEnabled('webportal') && $user->hasRight('webportal', 'write');
}
} else {
$permissiontocreate = isModEnabled('website') && $user->hasRight('website', 'write') || isModEnabled('webportal') && $user->hasRight('webportal', 'write');
Expand Down

0 comments on commit a7a50b3

Please sign in to comment.