Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
a7a50b39a9
11 changed files with 55 additions and 53 deletions
|
|
@ -157,7 +157,7 @@ if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('searc
|
|||
$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);
|
||||
|
|
|
|||
|
|
@ -253,22 +253,24 @@ if ($result) {
|
|||
}
|
||||
|
||||
// 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);
|
||||
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';
|
||||
$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
|
||||
|
|
|
|||
|
|
@ -399,34 +399,34 @@ foreach ($tabfac as $key => $val) { // Loop on each invoice
|
|||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// 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);
|
||||
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';
|
||||
$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')) {
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ print "<br>\n";
|
|||
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 {
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-system_xdebug');
|
|||
|
||||
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();
|
||||
|
|
@ -62,8 +62,8 @@ print '</span>';
|
|||
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";
|
||||
|
|
|
|||
|
|
@ -11663,7 +11663,7 @@ class Form
|
|||
|
||||
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>';
|
||||
|
||||
|
|
|
|||
|
|
@ -906,8 +906,8 @@ class FormSetupItem
|
|||
} 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 {
|
||||
|
|
|
|||
|
|
@ -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&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") {
|
||||
|
|
|
|||
|
|
@ -28,17 +28,17 @@ global $langs;
|
|||
<?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">
|
||||
|
|
|
|||
|
|
@ -212,8 +212,8 @@ class DocumentController extends Controller
|
|||
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);
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ if ($object->id > 0) {
|
|||
$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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue