';
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') {
print '
';
}
diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php
index e0e01cab328..693170862e9 100644
--- a/htdocs/admin/accountant.php
+++ b/htdocs/admin/accountant.php
@@ -119,7 +119,7 @@ print '
global->MAIN_INFO_ACCOUNTANT_NAME) ? ' autofocus="autofocus"' : '').'>'."\n";
// Address
print '
'.$langs->trans("CompanyAddress").' ';
diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php
index 0166769660a..ce36d97d06a 100644
--- a/htdocs/admin/agenda_xcal.php
+++ b/htdocs/admin/agenda_xcal.php
@@ -164,6 +164,9 @@ $urlvcal .= $urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentit
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlvcal, ''.$langs->trans("WebCalUrlForVCalExport", 'vcal', '').' ');
$message .= '';
$message .= ajax_autoselect('onlinepaymenturl1');
$message .= ' ';
@@ -173,6 +176,9 @@ $urlical .= $urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlical, ''.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', '').' ');
$message .= '';
$message .= ajax_autoselect('onlinepaymenturl2');
$message .= ' ';
@@ -182,6 +188,9 @@ $urlrss .= $urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlrss, ''.$langs->trans("WebCalUrlForVCalExport", 'rss', '').' ');
$message .= '';
$message .= ajax_autoselect('onlinepaymenturl3');
$message .= ' ';
diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php
index b218a245c99..c2ca271e5ea 100644
--- a/htdocs/admin/confexped.php
+++ b/htdocs/admin/confexped.php
@@ -107,7 +107,7 @@ print ' '.$langs->trans("SendingsAbility").' ';
print '';
print ' ';
print '';
-print $langs->trans("Required");
+print ''.img_picto($langs->trans("Required"), 'switch_on').' ';
/*if (empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
{
print ''.img_picto($langs->trans("Disabled"),'switch_off').' ';
diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php
index 229fb3e2291..2ae77b03d07 100644
--- a/htdocs/admin/delais.php
+++ b/htdocs/admin/delais.php
@@ -222,7 +222,8 @@ if ($action == 'edit') {
print ' ';
print '';
- print ''.$langs->trans("DelaysOfToleranceBeforeWarning").' '.$langs->trans("Value").' ';
+ print ''.$langs->trans("DelaysOfToleranceBeforeWarning").' ';
+ print ''.$langs->trans("LateWarningAfter").' ';
foreach ($modules as $module => $delays) {
if (!empty($conf->$module->enabled)) {
@@ -230,7 +231,7 @@ if ($action == 'edit') {
$value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']}:0);
print '';
print ''.img_object('', $delay['img']).' ';
- print ''.$langs->trans('Delays_'.$delay['code']).' ';
+ print ' '.$langs->trans('Delays_'.$delay['code']).' ';
print ' '.$langs->trans("days").' ';
}
}
@@ -242,10 +243,10 @@ if ($action == 'edit') {
// Show if meteo is enabled
print '';
- print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
+ print ''.$langs->trans("Option").' '.$langs->trans("Value").' ';
print '';
- print ''.$langs->trans("MAIN_DISABLE_METEO").' ';
+ print ' '.$langs->trans("MAIN_DISABLE_METEO").' ';
print $form->selectarray('MAIN_DISABLE_METEO', $labelmeteo, (empty($conf->global->MAIN_DISABLE_METEO) ? 0 : $conf->global->MAIN_DISABLE_METEO));
print ' ';
@@ -256,7 +257,7 @@ if ($action == 'edit') {
*/
print '';
- print ''.$langs->trans("DelaysOfToleranceBeforeWarning").' '.$langs->trans("Value").' ';
+ print ''.$langs->trans("DelaysOfToleranceBeforeWarning").' '.$langs->trans("Value").' ';
foreach ($modules as $module => $delays) {
if (!empty($conf->$module->enabled)) {
@@ -276,7 +277,7 @@ if ($action == 'edit') {
// Show if meteo is enabled
print '';
- print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
+ print ''.$langs->trans("Option").' '.$langs->trans("Value").' ';
print '';
print ''.$langs->trans("MAIN_DISABLE_METEO").' ';
@@ -301,7 +302,7 @@ if (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METE
} else {
$str_mode_enabled = $str_mode_percentage;
}
- print ''.$str_mode_enabled.' ';
+ print ''.$str_mode_enabled.' ';
print ' ';
print ' ';
@@ -451,8 +452,9 @@ if ($action == 'edit') {
print $form->buttonsSaveCancel("Save", '');
print '';
} else {
- print ' ';
+ print ' ';
}
// End of page
diff --git a/htdocs/admin/openinghours.php b/htdocs/admin/openinghours.php
index a0f02fe99ac..b18ebd0c05f 100644
--- a/htdocs/admin/openinghours.php
+++ b/htdocs/admin/openinghours.php
@@ -97,7 +97,7 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit') {
print ' ';
print $form->textwithpicto($langs->trans("Monday"), $langs->trans("OpeningHoursFormatDesc"));
print ' ';
- print ' global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'> '."\n";
+ print ' global->MAIN_INFO_OPENINGHOURS_MONDAY) ? ' autofocus="autofocus"' : '').'>'."\n";
print '';
print $form->textwithpicto($langs->trans("Tuesday"), $langs->trans("OpeningHoursFormatDesc"));
diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php
index f04bfd78abd..fd8377b0a27 100644
--- a/htdocs/admin/pdf.php
+++ b/htdocs/admin/pdf.php
@@ -249,7 +249,7 @@ print load_fiche_titre($langs->trans("PDF"), '', 'title_setup');
$head = pdf_admin_prepare_head();
-print dol_get_fiche_head($head, 'general', $langs->trans("PDF"), -1, 'pdf');
+print dol_get_fiche_head($head, 'general', '', -1, '');
print ''.$form->textwithpicto($langs->trans("PDFDesc"), $s)." \n";
print " \n";
diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php
index f42c49a4bfe..72acf7fbf4f 100644
--- a/htdocs/admin/pdf_other.php
+++ b/htdocs/admin/pdf_other.php
@@ -84,7 +84,7 @@ print load_fiche_titre($langs->trans("PDF"), '', 'title_setup');
$head = pdf_admin_prepare_head();
-print dol_get_fiche_head($head, 'other', $langs->trans("other"), -1, 'pdf');
+print dol_get_fiche_head($head, 'other', '', -1, '');
$tooltiptext = '';
print ''.$form->textwithpicto($langs->trans("PDFOtherDesc"), $tooltiptext)." \n";
diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php
index 93f62337746..bb42808ebd4 100644
--- a/htdocs/admin/translation.php
+++ b/htdocs/admin/translation.php
@@ -254,6 +254,60 @@ $head = translation_prepare_head();
print dol_get_fiche_head($head, $mode, '', -1, '');
+
+$langcode = GETPOSTISSET('langcode') ? GETPOST('langcode') : $langs->defaultlang;
+
+$newlang = new Translate('', $conf);
+$newlang->setDefaultLang($langcode);
+
+$langsenfileonly = new Translate('', $conf);
+$langsenfileonly->setDefaultLang('en_US');
+
+$newlangfileonly = new Translate('', $conf);
+$newlangfileonly->setDefaultLang($langcode);
+
+$recordtoshow = array();
+
+// Search modules dirs
+$modulesdir = dolGetModulesDirs();
+
+$nbtotaloffiles = 0;
+
+// Search into dir of modules (the $modulesdir is already a list that loop on $conf->file->dol_document_root)
+$i = 0;
+foreach ($modulesdir as $keydir => $tmpsearchdir) {
+ $searchdir = $tmpsearchdir; // $searchdir can be '.../htdocs/core/modules/' or '.../htdocs/custom/mymodule/core/modules/'
+
+ // Directory of translation files
+ $dir_lang = dirname(dirname($searchdir))."/langs/".$langcode; // The 2 dirname is to go up in dir for 2 levels
+ $dir_lang_osencoded = dol_osencode($dir_lang);
+
+ $filearray = dol_dir_list($dir_lang_osencoded, 'files', 0, '', '', $sortfield, (strtolower($sortorder) == 'asc' ?SORT_ASC:SORT_DESC), 1);
+ foreach ($filearray as $file) {
+ $tmpfile = preg_replace('/.lang/i', '', basename($file['name']));
+ $moduledirname = (basename(dirname(dirname($dir_lang))));
+
+ $langkey = $tmpfile;
+ if ($i > 0) {
+ $langkey .= '@'.$moduledirname;
+ }
+ //var_dump($i.' - '.$keydir.' - '.$dir_lang_osencoded.' -> '.$moduledirname . ' / ' . $tmpfile.' -> '.$langkey);
+
+ $result = $newlang->load($langkey, 0, 0, '', 0); // Load translation files + database overwrite
+ $result = $newlangfileonly->load($langkey, 0, 0, '', 1); // Load translation files only
+ if ($result < 0) {
+ print 'Failed to load language file '.$tmpfile.' '."\n";
+ } else {
+ $nbtotaloffiles++;
+ }
+ //print 'After loading lang '.$langkey.', newlang has '.count($newlang->tab_translate).' records '."\n";
+
+ $result = $langsenfileonly->load($langkey, 0, 0, '', 1); // Load translation files only
+ }
+ $i++;
+}
+
+
if ($mode == 'overwrite') {
print ' ';
@@ -348,7 +402,14 @@ if ($mode == 'overwrite') {
if ($action == 'edit' && $obj->rowid == GETPOST('rowid', 'int')) {
print ' ';
} else {
+ //print $obj->transkey.' '.$langsenfileonly->tab_translate[$obj->transkey];
+ $titleforvalue = $langs->trans("Translation").' en_US for key '.$obj->transkey.': '.($langsenfileonly->tab_translate[$obj->transkey] ? $langsenfileonly->trans($obj->transkey) : ''.$langs->trans("None").' ');
+ /*if ($obj->lang != 'en_US') {
+ $titleforvalue .= ' '.$langs->trans("Translation").' '.$obj->lang.' '...;
+ }*/
+ print '';
print dol_escape_htmltag($obj->transvalue);
+ print ' ';
}
print ' ';
@@ -376,20 +437,6 @@ if ($mode == 'overwrite') {
}
if ($mode == 'searchkey') {
- $langcode = GETPOSTISSET('langcode') ? GETPOST('langcode') : $langs->defaultlang;
-
- $newlang = new Translate('', $conf);
- $newlang->setDefaultLang($langcode);
-
- $newlangfileonly = new Translate('', $conf);
- $newlangfileonly->setDefaultLang($langcode);
-
- $recordtoshow = array();
-
- // Search modules dirs
- $modulesdir = dolGetModulesDirs();
-
- $nbtotaloffiles = 0;
$nbempty = 0;
/*var_dump($langcode);
var_dump($transkey);
@@ -403,41 +450,10 @@ if ($mode == 'searchkey') {
if (empty($transvalue)) {
$nbempty++;
}
+
if ($action == 'search' && ($nbempty > 999)) { // 999 to disable this
setEventMessages($langs->trans("WarningAtLeastKeyOrTranslationRequired"), null, 'warnings');
} else {
- // Search into dir of modules (the $modulesdir is already a list that loop on $conf->file->dol_document_root)
- $i = 0;
- foreach ($modulesdir as $keydir => $tmpsearchdir) {
- $searchdir = $tmpsearchdir; // $searchdir can be '.../htdocs/core/modules/' or '.../htdocs/custom/mymodule/core/modules/'
-
- // Directory of translation files
- $dir_lang = dirname(dirname($searchdir))."/langs/".$langcode; // The 2 dirname is to go up in dir for 2 levels
- $dir_lang_osencoded = dol_osencode($dir_lang);
-
- $filearray = dol_dir_list($dir_lang_osencoded, 'files', 0, '', '', $sortfield, (strtolower($sortorder) == 'asc' ?SORT_ASC:SORT_DESC), 1);
- foreach ($filearray as $file) {
- $tmpfile = preg_replace('/.lang/i', '', basename($file['name']));
- $moduledirname = (basename(dirname(dirname($dir_lang))));
-
- $langkey = $tmpfile;
- if ($i > 0) {
- $langkey .= '@'.$moduledirname;
- }
- //var_dump($i.' - '.$keydir.' - '.$dir_lang_osencoded.' -> '.$moduledirname . ' / ' . $tmpfile.' -> '.$langkey);
-
- $result = $newlang->load($langkey, 0, 0, '', 0); // Load translation files + database overwrite
- $result = $newlangfileonly->load($langkey, 0, 0, '', 1); // Load translation files only
- if ($result < 0) {
- print 'Failed to load language file '.$tmpfile.' '."\n";
- } else {
- $nbtotaloffiles++;
- }
- //print 'After loading lang '.$langkey.', newlang has '.count($newlang->tab_translate).' records '."\n";
- }
- $i++;
- }
-
// Now search into translation array
foreach ($newlang->tab_translate as $key => $val) {
if ($transkey && !preg_match('/'.preg_quote($transkey, '/').'/i', $key)) {
@@ -532,8 +548,12 @@ if ($mode == 'searchkey') {
break;
}
print ''.$langcode.' '.$key.' ';
+ $titleforvalue = $langs->trans("Translation").' en_US for key '.$key.': '.($langsenfileonly->tab_translate[$key] ? $langsenfileonly->trans($key) : ''.$langs->trans("None").' ');
+ print '';
print dol_escape_htmltag($val);
- print ' ';
+ print '';
+ print ' ';
+ print '';
if (!empty($newlangfileonly->tab_translate[$key])) {
if ($val != $newlangfileonly->tab_translate[$key]) {
// retrieve rowid
diff --git a/htdocs/api/index.php b/htdocs/api/index.php
index 420338f2a9d..d5bc7e273e2 100644
--- a/htdocs/api/index.php
+++ b/htdocs/api/index.php
@@ -77,7 +77,6 @@ if (preg_match('/\/api\/index\.php/', $_SERVER["PHP_SELF"])) {
header('Access-Control-Allow-Headers: Content-Type, Authorization, api_key, DOLAPIKEY');
}
-
$res = 0;
if (!$res && file_exists("../main.inc.php")) {
$res = include '../main.inc.php';
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 627c2f0ce51..4a00894d26b 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -76,11 +76,14 @@ if ($complete == 'na' || $complete == -2) {
}
if ($fulldayevent) {
- $datep = dol_mktime('00', '00', 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
- $datef = dol_mktime('23', '59', '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
+ $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
+ // For "full day" events, we must store date in GMT (It must be viewed as same moment everywhere)
+ $datep = dol_mktime('00', '00', 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel');
+ $datef = dol_mktime('23', '59', '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel');
+ //print $db->idate($datep); exit;
} else {
- $datep = dol_mktime($aphour, $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
- $datef = dol_mktime($p2hour, $p2min, '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
+ $datep = dol_mktime($aphour, $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuserrel');
+ $datef = dol_mktime($p2hour, $p2min, '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuserrel');
}
// Security check
@@ -252,8 +255,15 @@ if (empty($reshook) && $action == 'add') {
$percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status
// Clean parameters
- $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser');
- $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser');
+ if ($fulldayevent) {
+ $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
+ // For "full day" events, we must store date in GMT (It must be viewed as same moment everywhere)
+ $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuser');
+ $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), $tzforfullday ? $tzforfullday : 'tzuser');
+ } else {
+ $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser');
+ $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser');
+ }
// Check parameters
if (!$datef && $percentage == 100) {
@@ -513,8 +523,16 @@ if (empty($reshook) && $action == 'update') {
$object->fetch_userassigned();
$object->oldcopy = clone $object;
- $datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser');
- $datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser');
+ // Clean parameters
+ if ($fulldayevent) {
+ $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
+ // For "full day" events, we must store date in GMT (It must be viewed as same moment everywhere)
+ $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuser');
+ $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), $tzforfullday ? $tzforfullday : 'tzuser');
+ } else {
+ $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser');
+ $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser');
+ }
$object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm');
$object->label = GETPOST("label", "alphanohtml");
@@ -1005,11 +1023,11 @@ if ($action == 'create') {
$datep = ($datep ? $datep : (is_null($object->datep) ? '' : $object->datep));
if (GETPOST('datep', 'int', 1)) {
- $datep = dol_stringtotime(GETPOST('datep', 'int', 1), 0);
+ $datep = dol_stringtotime(GETPOST('datep', 'int', 1), 'tzuser');
}
$datef = ($datef ? $datef : $object->datef);
if (GETPOST('datef', 'int', 1)) {
- $datef = dol_stringtotime(GETPOST('datef', 'int', 1), 0);
+ $datef = dol_stringtotime(GETPOST('datef', 'int', 1), 'tzuser');
}
if (empty($datef) && !empty($datep)) {
if (GETPOST("actioncode", 'aZ09') == 'AC_RDV' || empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT)) {
@@ -1024,16 +1042,16 @@ if ($action == 'create') {
print ''.$langs->trans("DateActionEnd").' ';
print ' ';
if (GETPOST("afaire") == 1) {
- print $form->selectDate($datep, 'ap', 1, 1, 0, "action", 1, 2, 0, 'fulldaystart'); // Empty value not allowed for start date and hours if "todo"
+ print $form->selectDate($datep, 'ap', 1, 1, 0, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel'); // Empty value not allowed for start date and hours if "todo"
} else {
- print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 2, 0, 'fulldaystart');
+ print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 2, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuserrel');
}
print ' - ';
//print ' - ';
if (GETPOST("afaire") == 1) {
- print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend');
+ print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel');
} else {
- print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend');
+ print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 0, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuserrel');
}
print ' ';
@@ -1518,20 +1536,21 @@ if ($id > 0) {
// Date start - end
print ''.$langs->trans("DateActionStart").' - '.$langs->trans("DateActionEnd").' ';
+ $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
if (GETPOST("afaire") == 1) {
- print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuser');
+ print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser');
} elseif (GETPOST("afaire") == 2) {
- print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuser');
+ print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser');
} else {
- print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', 'tzuser');
+ print $form->selectDate($datep ? $datep : $object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser');
}
print ' - ';
if (GETPOST("afaire") == 1) {
- print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuser');
+ print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser');
} elseif (GETPOST("afaire") == 2) {
- print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuser');
+ print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser');
} else {
- print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', 'tzuser');
+ print $form->selectDate($datef ? $datef : $object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend', '', '', '', 1, '', '', $object->fulldayevent ? ($tzforfullday ? $tzforfullday : 'tzuser') : 'tzuser');
}
print ' ';
@@ -1972,7 +1991,8 @@ if ($id > 0) {
if (empty($object->fulldayevent)) {
print dol_print_date($object->datep, 'dayhour', 'tzuser');
} else {
- print dol_print_date($object->datep, 'day', 'tzuser');
+ $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
+ print dol_print_date($object->datep, 'day', ($tzforfullday ? $tzforfullday : 'tzuser'));
}
if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) {
print img_warning($langs->trans("Late"));
@@ -1985,7 +2005,8 @@ if ($id > 0) {
if (empty($object->fulldayevent)) {
print dol_print_date($object->datef, 'dayhour', 'tzuser');
} else {
- print dol_print_date($object->datef, 'day', 'tzuser');
+ $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
+ print dol_print_date($object->datef, 'day', ($tzforfullday ? $tzforfullday : 'tzuser'));
}
if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now - $delay_warning)) {
print img_warning($langs->trans("Late"));
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 103fea28731..a5b4f1d8ce9 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -1955,14 +1955,14 @@ class ActionComm extends CommonObject
$event = array();
$event['uid'] = 'dolibarragenda-'.$this->db->database_name.'-'.$obj->id."@".$_SERVER["SERVER_NAME"];
$event['type'] = $type;
+
$datestart = $this->db->jdate($obj->datep) - (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600));
// fix for -> Warning: A non-numeric value encountered
if (is_numeric($this->db->jdate($obj->datep2))) {
- $dateend = $this->db->jdate($obj->datep2)
- - (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600));
+ $dateend = $this->db->jdate($obj->datep2) - (empty($conf->global->AGENDA_EXPORT_FIX_TZ) ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600));
} else {
- // use start date as fall-back to avoid import erros on empty end date
+ // use start date as fall-back to avoid pb with empty end date on ICS readers
$dateend = $datestart;
}
diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php
index c69d396cf26..3de00e9cb6f 100644
--- a/htdocs/comm/action/document.php
+++ b/htdocs/comm/action/document.php
@@ -201,7 +201,8 @@ if ($object->id > 0) {
if (empty($object->fulldayevent)) {
print dol_print_date($object->datep, 'dayhour', 'tzuser');
} else {
- print dol_print_date($object->datep, 'day', 'tzuser');
+ $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
+ print dol_print_date($object->datep, 'day', ($tzforfullday ? $tzforfullday : 'tzuser'));
}
if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) {
print img_warning($langs->trans("Late"));
@@ -214,7 +215,8 @@ if ($object->id > 0) {
if (empty($object->fulldayevent)) {
print dol_print_date($object->datef, 'dayhour', 'tzuser');
} else {
- print dol_print_date($object->datef, 'day', 'tzuser');
+ $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
+ print dol_print_date($object->datef, 'day', ($tzforfullday ? $tzforfullday : 'tzuser'));
}
if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now - $delay_warning)) {
print img_warning($langs->trans("Late"));
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index d3538c6a2c9..e8060bc314d 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -545,7 +545,8 @@ if ($user->rights->agenda->myactions->create || $user->rights->agenda->allaction
$newparam .= '&month='.((int) $month).'&year='.((int) $tmpforcreatebutton['year']).'&mode='.urlencode($mode);
//$param='month='.$monthshown.'&year='.$year;
- $hourminsec = '100000';
+ $hourminsec = dol_print_date(dol_mktime(10, 0, 0, 1, 1, 1970, 'gmt'), '%H', 'gmt').'0000'; // Set $hourminsec to '100000' to auto set hour to 10:00 at creation
+
$newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : '')));
}
@@ -808,11 +809,21 @@ if ($resql) {
$event->id = $obj->id;
$event->ref = $event->id;
- $event->datep = $db->jdate($obj->datep); // datep and datef are GMT date. Example: 1970-01-01 01:00:00, jdate will return 0 if TZ of PHP server is Europe/Berlin
- $event->datef = $db->jdate($obj->datep2);
+ $event->fulldayevent = $obj->fulldayevent;
+
+ // event->datep and event->datef must be GMT date.
+ if ($event->fulldayevent) {
+ $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
+ $event->datep = $db->jdate($obj->datep, $tzforfullday ? 'tzuser' : 'tzserver'); // If saved in $tzforfullday = gmt, we must invert date to be in user tz
+ $event->datef = $db->jdate($obj->datep2, $tzforfullday ? 'tzuser' : 'tzserver');
+ } else {
+ // Example: $obj->datep = '1970-01-01 01:00:00', jdate will return 0 if TZ of PHP server is Europe/Berlin (+1)
+ $event->datep = $db->jdate($obj->datep, 'tzserver');
+ $event->datef = $db->jdate($obj->datep2, 'tzserver');
+ }
//$event->datep_formated_gmt = dol_print_date($event->datep, 'dayhour', 'gmt');
- //var_dump($obj->datep);
- //var_dump($event->datep);
+ //var_dump($obj->id.' '.$obj->datep.' '.dol_print_date($obj->datep, 'dayhour', 'gmt'));
+ //var_dump($obj->id.' '.$event->datep.' '.dol_print_date($event->datep, 'dayhour', 'gmt'));
$event->type_code = $obj->type_code;
$event->type_label = $obj->type_label;
@@ -829,7 +840,6 @@ if ($resql) {
$event->fetch_userassigned(); // This load $event->userassigned
$event->priority = $obj->priority;
- $event->fulldayevent = $obj->fulldayevent;
$event->location = $obj->location;
$event->transparency = $obj->transparency;
$event->fk_element = $obj->fk_element;
@@ -865,25 +875,43 @@ if ($resql) {
$annee = dol_print_date($daycursor, '%Y', 'tzuserrel');
$mois = dol_print_date($daycursor, '%m', 'tzuserrel');
$jour = dol_print_date($daycursor, '%d', 'tzuserrel');
+
+ $daycursorend = $event->date_end_in_calendar;
+ $anneeend = dol_print_date($daycursorend, '%Y', 'tzuserrel');
+ $moisend = dol_print_date($daycursorend, '%m', 'tzuserrel');
+ $jourend = dol_print_date($daycursorend, '%d', 'tzuserrel');
+
//var_dump(dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt')); // Hour at greenwich
//var_dump($annee.'-'.$mois.'-'.$jour);
+ //print 'annee='.$annee.' mois='.$mois.' jour='.$jour.' ';
// Loop on each day covered by action to prepare an index to show on calendar
$loop = true; $j = 0;
- $daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
+ $daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt'); // $mois, $jour, $annee has been set for user tz
+ $daykeyend = dol_mktime(0, 0, 0, $moisend, $jourend, $anneeend, 'gmt'); // $moisend, $jourend, $anneeend has been set for user tz
+ /*
+ print 'GMT '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt').' ';
+ print 'TZSERVER '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzserver').' ';
+ print 'TZUSERREL '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel').' ';
+ print 'GMT '.$event->date_end_in_calendar.' '.dol_print_date($event->date_end_in_calendar, 'dayhour', 'gmt').' ';
+ print 'TZSERVER '.$event->date_end_in_calendar.' '.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzserver').' ';
+ print 'TZUSER '.$event->date_end_in_calendar.' '.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel').' ';
+ */
do {
//if ($event->id==408)
- //print 'daykey='.$daykey.' '.dol_print_date($daykey, 'dayhour', 'gmt').' '.$event->datep.' '.$event->datef.' ';
+ //print 'daykey='.$daykey.' daykeyend='.$daykeyend.' '.dol_print_date($daykey, 'dayhour', 'gmt').' - '.dol_print_date($event->datep, 'dayhour', 'gmt').' '.dol_print_date($event->datef, 'dayhour', 'gmt').' ';
+ //print 'daykey='.$daykey.' daykeyend='.$daykeyend.' '.dol_print_date($daykey, 'dayhour', 'tzuserrel').' - '.dol_print_date($event->datep, 'dayhour', 'tzuserrel').' '.dol_print_date($event->datef, 'dayhour', 'tzuserrel').' ';
$eventarray[$daykey][] = $event;
$j++;
$daykey += 60 * 60 * 24;
- if ($daykey > $event->date_end_in_calendar) {
+ //if ($daykey > $event->date_end_in_calendar) {
+ if ($daykey > $daykeyend) {
$loop = false;
}
} while ($loop);
-
+ //var_dump($eventarray);
//print 'Event '.$i.' id='.$event->id.' (start='.dol_print_date($event->datep).'-end='.dol_print_date($event->datef);
//print ' startincalendar='.dol_print_date($event->date_start_in_calendar).'-endincalendar='.dol_print_date($event->date_end_in_calendar).') was added in '.$j.' different index key of array ';
}
@@ -1805,12 +1833,16 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$cssclass .= " unmovable";
} elseif ($event->type_code == 'ICALEVENT') {
$cssclass .= " unmovable";
- } elseif ($event->date_end_in_calendar && date('Ymd', $event->date_start_in_calendar) != date('Ymd', $event->date_end_in_calendar)) {
- $tmpyearend = date('Y', $event->date_end_in_calendar);
- $tmpmonthend = date('m', $event->date_end_in_calendar);
- $tmpdayend = date('d', $event->date_end_in_calendar);
+ } elseif ($event->date_start_in_calendar && $event->date_end_in_calendar && date('Ymd', $event->date_start_in_calendar) != date('Ymd', $event->date_end_in_calendar)) {
+ // If the event is on several days
+ $tmpyearend = dol_print_date($event->date_start_in_calendar, '%Y', 'tzuserrel');
+ $tmpmonthend = dol_print_date($event->date_start_in_calendar, '%m', 'tzuserrel');
+ $tmpdayend = dol_print_date($event->date_start_in_calendar, '%d', 'tzuserrel');
+ //var_dump($tmpyearend.' '.$tmpmonthend.' '.$tmpdayend);
if ($tmpyearend != $annee || $tmpmonthend != $mois || $tmpdayend != $jour) {
- $cssclass .= " unmovable";
+ $cssclass .= " unmovable unmovable-mustusefirstdaytodrag";
+ } else {
+ $cssclass .= ' movable cursormove';
}
} else {
if ($user->rights->agenda->allactions->create ||
diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php
index de961b5517e..e2b412e15db 100644
--- a/htdocs/comm/action/list.php
+++ b/htdocs/comm/action/list.php
@@ -693,7 +693,7 @@ $tmpforcreatebutton = dol_getdate(dol_now(), true);
$newparam = '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year'];
//$param='month='.$monthshown.'&year='.$year;
-$hourminsec = '100000';
+$hourminsec = dol_print_date(dol_mktime(10, 0, 0, 1, 1, 1970, 'gmt'), '%H', 'gmt').'0000'; // Set $hourminsec to '100000' to auto set hour to 10:00 at creation
$url = DOL_URL_ROOT.'/comm/action/card.php?action=create';
$url .= '&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec;
@@ -953,7 +953,12 @@ while ($i < min($num, $limit)) {
// Start date
if (!empty($arrayfields['a.datep']['checked'])) {
print '';
- print dol_print_date($db->jdate($obj->dp), $formatToUse, 'tzuser');
+ if (empty($obj->fulldayevent)) {
+ print dol_print_date($db->jdate($obj->dp), $formatToUse, 'tzuser');
+ } else {
+ $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
+ print dol_print_date($db->jdate($obj->dp), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuser'));
+ }
$late = 0;
if ($actionstatic->hasDelay() && $actionstatic->percentage >= 0 && $actionstatic->percentage < 100 ) {
$late = 1;
@@ -967,7 +972,12 @@ while ($i < min($num, $limit)) {
// End date
if (!empty($arrayfields['a.datep2']['checked'])) {
print ' ';
- print dol_print_date($db->jdate($obj->dp2), $formatToUse, 'tzuser');
+ if (empty($obj->fulldayevent)) {
+ print dol_print_date($db->jdate($obj->dp2), $formatToUse, 'tzuser');
+ } else {
+ $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
+ print dol_print_date($db->jdate($obj->dp2), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuser'));
+ }
print ' ';
}
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 746075ab51e..45a4d2fdb57 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -2543,7 +2543,7 @@ if ($action == 'create') {
if (($object->statut == Propal::STATUS_DRAFT && $object->total_ttc >= 0 && count($object->lines) > 0)
|| ($object->statut == Propal::STATUS_DRAFT && !empty($conf->global->PROPAL_ENABLE_NEGATIVE) && count($object->lines) > 0)) {
if ($usercanvalidate) {
- print 'id.'&action=validate">'.$langs->trans('Validate').' ';
+ print 'id.'&action=validate&token='.newToken().'">'.$langs->trans('Validate').' ';
} else {
print ''.$langs->trans('Validate').' ';
}
@@ -2555,7 +2555,7 @@ if ($action == 'create') {
}*/
// Edit
if ($object->statut == Propal::STATUS_VALIDATED && $usercancreate) {
- print 'id.'&action=modif">'.$langs->trans('Modify').' ';
+ print 'id.'&action=modif&token='.newToken().'">'.$langs->trans('Modify').' ';
}
// ReOpen
@@ -2578,7 +2578,7 @@ if ($action == 'create') {
// Create a sale order
if (!empty($conf->commande->enabled) && $object->statut == Propal::STATUS_SIGNED) {
if ($usercancreateorder) {
- print ''.$langs->trans("AddOrder").' ';
+ print ''.$langs->trans("AddOrder").' ';
}
}
@@ -2586,7 +2586,7 @@ if ($action == 'create') {
if (!empty($conf->global->WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_PROPOSAL)) {
if ($object->statut == Propal::STATUS_SIGNED && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled))) {
if ($usercancreatepurchaseorder) {
- print ''.$langs->trans("AddPurchaseOrder").' ';
+ print ''.$langs->trans("AddPurchaseOrder").' ';
}
}
}
@@ -2595,7 +2595,7 @@ if ($action == 'create') {
if (!empty($conf->service->enabled) && !empty($conf->ficheinter->enabled) && $object->statut == Propal::STATUS_SIGNED) {
if ($usercancreateintervention) {
$langs->load("interventions");
- print ''.$langs->trans("AddIntervention").' ';
+ print ''.$langs->trans("AddIntervention").' ';
}
}
@@ -2604,14 +2604,14 @@ if ($action == 'create') {
$langs->load("contracts");
if ($usercancreatecontract) {
- print ''.$langs->trans('AddContract').' ';
+ print ''.$langs->trans('AddContract').' ';
}
}
// Create an invoice and classify billed
if ($object->statut == Propal::STATUS_SIGNED && empty($conf->global->PROPOSAL_ARE_NOT_BILLABLE)) {
if (!empty($conf->facture->enabled) && $usercancreateinvoice) {
- print ''.$langs->trans("CreateBill").' ';
+ print ''.$langs->trans("CreateBill").' ';
}
$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php
index 63cd091652a..b8675b3a7e5 100644
--- a/htdocs/compta/paymentbybanktransfer/index.php
+++ b/htdocs/compta/paymentbybanktransfer/index.php
@@ -192,6 +192,7 @@ $limit = 5;
$sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql .= " WHERE p.type = 'bank-transfer'";
+$sql .= " AND p.entity IN (".getEntity('invoice').")";
$sql .= " ORDER BY datec DESC";
$sql .= $db->plimit($limit);
diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php
index 38ea2fb1d52..65ba71a0d2f 100644
--- a/htdocs/compta/prelevement/line.php
+++ b/htdocs/compta/prelevement/line.php
@@ -262,12 +262,20 @@ if ($id) {
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
$sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf";
- $sql .= " , ".MAIN_DB_PREFIX."facture as f";
+ if ($type == 'bank-transfer') {
+ $sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f";
+ } else {
+ $sql .= " , ".MAIN_DB_PREFIX."facture as f";
+ }
$sql .= " , ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE pf.fk_prelevement_lignes = pl.rowid";
$sql .= " AND pl.fk_prelevement_bons = p.rowid";
$sql .= " AND f.fk_soc = s.rowid";
- $sql .= " AND pf.fk_facture = f.rowid";
+ if ($type == 'bank-transfer') {
+ $sql .= " AND pf.fk_facture_fourn = f.rowid";
+ } else {
+ $sql .= " AND pf.fk_facture = f.rowid";
+ }
$sql .= " AND f.entity IN (".getEntity('invoice').")";
$sql .= " AND pl.rowid = ".((int) $id);
if ($socid) {
diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php
index 0a5e4548e3f..d7ab444f2da 100644
--- a/htdocs/core/boxes/box_members_by_type.php
+++ b/htdocs/core/boxes/box_members_by_type.php
@@ -244,6 +244,7 @@ class box_members_by_type extends ModeleBoxes
);
} else {
$this->info_box_contents[$line][] = array(
+ 'tr' => 'class="liste_total"',
'td' => 'class="liste_total"',
'text' => $langs->trans("Total")
);
diff --git a/htdocs/core/boxes/box_members_subscriptions_by_year.php b/htdocs/core/boxes/box_members_subscriptions_by_year.php
index e7bf916d236..479d2424f09 100644
--- a/htdocs/core/boxes/box_members_subscriptions_by_year.php
+++ b/htdocs/core/boxes/box_members_subscriptions_by_year.php
@@ -196,6 +196,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes
);
} else {
$this->info_box_contents[$line][] = array(
+ 'tr' => 'class="liste_total"',
'td' => 'class="liste_total"',
'text' => $langs->trans("Total"),
);
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 811ad017c4d..8f112b9aa98 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1106,13 +1106,13 @@ class Form
}
print ''.$langs->trans("Product");
print ' '.$langs->trans("Service");
diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php
index 4476228d509..f23a66bbee4 100644
--- a/htdocs/core/db/DoliDB.class.php
+++ b/htdocs/core/db/DoliDB.class.php
@@ -302,8 +302,8 @@ abstract class DoliDB implements Database
/**
* Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true)
- * 19700101020000 -> 3600 with TZ+1 and gmt=0
- * 19700101020000 -> 7200 whaterver is TZ if gmt=1
+ * 19700101020000 -> 3600 with server TZ = +1 and $gm='tzserver'
+ * 19700101020000 -> 7200 whaterver is server TZ if $gm='gmt'
*
* @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS)
* @param mixed $gm 'gmt'=Input informations are GMT values, 'tzserver'=Local to server TZ
diff --git a/htdocs/core/js/dst.js b/htdocs/core/js/dst.js
index 83d4abd5f08..8433ada72a9 100644
--- a/htdocs/core/js/dst.js
+++ b/htdocs/core/js/dst.js
@@ -26,7 +26,8 @@
$(document).ready(function () {
var timezone = jstz.determine();
-
+ console.log("Timezone detected for user: "+timezone.name());
+
// Detect and save TZ and DST
var rightNow = new Date();
var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php
index d4028e2196b..237adc9447a 100644
--- a/htdocs/core/lib/date.lib.php
+++ b/htdocs/core/lib/date.lib.php
@@ -357,18 +357,18 @@ function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $exclu
* Convert a string date into a GM Timestamps date
* Warning: YYYY-MM-DDTHH:MM:SS+02:00 (RFC3339) is not supported. If parameter gm is 1, we will use no TZ, if not we will use TZ of server, not the one inside string.
*
- * @param string $string Date in a string
- * YYYYMMDD
- * YYYYMMDDHHMMSS
- * YYYYMMDDTHHMMSSZ
- * YYYY-MM-DDTHH:MM:SSZ (RFC3339)
- * DD/MM/YY or DD/MM/YYYY (deprecated)
- * DD/MM/YY HH:MM:SS or DD/MM/YYYY HH:MM:SS (deprecated)
- * @param int $gm 1 =Input date is GM date,
- * 0 =Input date is local date using PHP server timezone
- * @return int Date as a timestamp
- * 19700101020000 -> 7200 with gm=1
- * 19700101000000 -> 0 with gm=1
+ * @param string $string Date in a string
+ * YYYYMMDD
+ * YYYYMMDDHHMMSS
+ * YYYYMMDDTHHMMSSZ
+ * YYYY-MM-DDTHH:MM:SSZ (RFC3339)
+ * DD/MM/YY or DD/MM/YYYY (deprecated)
+ * DD/MM/YY HH:MM:SS or DD/MM/YYYY HH:MM:SS (deprecated)
+ * @param int|string $gm 'gmt' or 1 =Input date is GM date,
+ * 'tzserver' or 0 =Input date is date using PHP server timezone
+ * @return int Date as a timestamp
+ * 19700101020000 -> 7200 with gm=1
+ * 19700101000000 -> 0 with gm=1
*
* @see dol_print_date(), dol_mktime(), dol_getdate()
*/
@@ -408,7 +408,14 @@ function dol_stringtotime($string, $gm = 1)
$string = preg_replace('/([^0-9])/i', '', $string);
$tmp = $string.'000000';
- $date = dol_mktime(substr($tmp, 8, 2), substr($tmp, 10, 2), substr($tmp, 12, 2), substr($tmp, 4, 2), substr($tmp, 6, 2), substr($tmp, 0, 4), ($gm ? 1 : 0));
+ // Clean $gm
+ if ($gm === 1) {
+ $gm = 'gmt';
+ } elseif (empty($gm) || $gm === 'tzserver') {
+ $gm = 'tzserver';
+ }
+
+ $date = dol_mktime(substr($tmp, 8, 2), substr($tmp, 10, 2), substr($tmp, 12, 2), substr($tmp, 4, 2), substr($tmp, 6, 2), substr($tmp, 0, 4), $gm);
return $date;
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index c1a4dbedc39..9361bf5a206 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -2573,11 +2573,11 @@ function dol_mktime($hour, $minute, $second, $month, $day, $year, $gm = 'auto',
{
global $conf;
//print "- ".$hour.",".$minute.",".$second.",".$month.",".$day.",".$year.",".$_SERVER["WINDIR"]." -";
- //print 'gm:'.$gm.' gm==auto:'.($gm == 'auto').' ';
if ($gm === 'auto') {
$gm = (empty($conf) ? 'tzserver' : $conf->tzuserinputkey);
}
+ //print 'gm:'.$gm.' gm === auto:'.($gm === 'auto').' ';exit;
// Clean parameters
if ($hour == -1 || empty($hour)) {
diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php
index fcd1660985b..97ada3e3d4f 100644
--- a/htdocs/core/lib/xcal.lib.php
+++ b/htdocs/core/lib/xcal.lib.php
@@ -100,6 +100,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile)
$created = $event["created"];
$modified = $event["modified"];
$assignedUsers = $event["assignedUsers"];
+ //print $fulldayevent.' '.dol_print_date($startdate, 'dayhour', 'gmt');
// Format
$summary = format_cal($format, $summary);
@@ -191,16 +192,16 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile)
// Date must be GMT dates
// Current date
- fwrite($calfileh, "DTSTAMP:".dol_print_date($now, "dayhourxcard", true)."\n");
+ fwrite($calfileh, "DTSTAMP:".dol_print_date($now, "dayhourxcard", 'gmt')."\n");
// Start date
$prefix = "";
- $startdatef = dol_print_date($startdate, "dayhourxcard", true);
+ $startdatef = dol_print_date($startdate, "dayhourxcard", 'gmt');
if ($fulldayevent) {
// Local time
$prefix = ";VALUE=DATE";
- $startdatef = dol_print_date($startdate, "dayxcard", false);
+ $startdatef = dol_print_date($startdate, "dayxcard", 'gmt');
}
fwrite($calfileh, "DTSTART".$prefix.":".$startdatef."\n");
@@ -208,6 +209,9 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile)
// End date
if ($fulldayevent) {
if (empty($enddate)) {
+ // We add 1 day needed for full day event (DTEND must be next day after event).
+ // This is mention in https://datatracker.ietf.org/doc/html/rfc5545:
+ // "The "DTEND" property for a "VEVENT" calendar component specifies the non-inclusive end of the event."
$enddate = dol_time_plus_duree($startdate, 1, "d");
}
} else {
@@ -217,14 +221,14 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile)
}
$prefix = "";
- $enddatef = dol_print_date($enddate, "dayhourxcard", true);
+ $enddatef = dol_print_date($enddate, "dayhourxcard", 'gmt');
if ($fulldayevent) {
$prefix = ";VALUE=DATE";
- $enddatef = dol_print_date($enddate + 1, "dayxcard", false);
-
- // Local time
- //$enddatef .= dol_print_date($enddate+1,"dayhourxcard",false);
+ // We add 1 second so we reach the +1 day needed for full day event (DTEND must be next day after event)
+ // This is mention in https://datatracker.ietf.org/doc/html/rfc5545:
+ // "The "DTEND" property for a "VEVENT" calendar component specifies the non-inclusive end of the event."
+ $enddatef = dol_print_date($enddate + 1, "dayxcard", 'gmt');
}
fwrite($calfileh, "DTEND".$prefix.":".$enddatef."\n");
@@ -256,11 +260,11 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile)
}
if ($created) {
- fwrite($calfileh, "CREATED:".dol_print_date($created, "dayhourxcard", true)."\n");
+ fwrite($calfileh, "CREATED:".dol_print_date($created, "dayhourxcard", 'gmt')."\n");
}
if ($modified) {
- fwrite($calfileh, "LAST-MODIFIED:".dol_print_date($modified, "dayhourxcard", true)."\n");
+ fwrite($calfileh, "LAST-MODIFIED:".dol_print_date($modified, "dayhourxcard", 'gmt')."\n");
}
fwrite($calfileh, "SUMMARY:".$encoding.$summary."\n");
@@ -270,7 +274,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile)
fwrite($calfileh, "LOCATION:".$location."\n");
fwrite($calfileh, "TRANSP:OPAQUE\n");
fwrite($calfileh, "CLASS:CONFIDENTIAL\n");
- fwrite($calfileh, "DTSTAMP:".dol_print_date($startdatef, "dayhourxcard", true)."\n");
+ fwrite($calfileh, "DTSTAMP:".dol_print_date($startdatef, "dayhourxcard", 'gmt')."\n");
fwrite($calfileh, "END:VJOURNAL\n");
}
diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php
index c07e01570c2..543a8bdb17a 100644
--- a/htdocs/core/tpl/login.tpl.php
+++ b/htdocs/core/tpl/login.tpl.php
@@ -136,7 +136,7 @@ $(document).ready(function () {
-
+
diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php
index 6bfafcc1269..0d966e67416 100644
--- a/htdocs/hrm/job_agenda.php
+++ b/htdocs/hrm/job_agenda.php
@@ -189,18 +189,13 @@ if ($object->id > 0) {
}
- print '';
-
if (!empty($conf->agenda->enabled)) {
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
- print '
'.$langs->trans("AddAction").' ';
- } else {
- print '
'.$langs->trans("AddAction").' ';
+ $newcardbutton = '';
+ $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
}
}
- print '
';
-
if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.$socid;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
@@ -211,7 +206,7 @@ if ($object->id > 0) {
}
- //print load_fiche_titre($langs->trans("ActionsOnJob"), '', '');
+ print load_fiche_titre($langs->trans("ActionsOnJob"), $newcardbutton, '');
// List of all actions
$filters = array();
diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang
index 8bc4b54a090..a44c819aa78 100644
--- a/htdocs/langs/en_US/accountancy.lang
+++ b/htdocs/langs/en_US/accountancy.lang
@@ -62,24 +62,24 @@ MainAccountForSubscriptionPaymentNotDefined=Main accounting account for subscrip
AccountancyArea=Accounting area
AccountancyAreaDescIntro=Usage of the accountancy module is done in several step:
AccountancyAreaDescActionOnce=The following actions are usually executed one time only, or once per year...
-AccountancyAreaDescActionOnceBis=Next steps should be done to save you time in future by suggesting you the correct default accounting account when making the journalization (writing record in Journals and General ledger)
+AccountancyAreaDescActionOnceBis=Next steps should be done to save you time in future by suggesting you automaticaly the correct default accounting account when transferring data in accounting
AccountancyAreaDescActionFreq=The following actions are usually executed every month, week or day for very large companies...
-AccountancyAreaDescJournalSetup=STEP %s: Create or check content of your journal list from menu %s
+AccountancyAreaDescJournalSetup=STEP %s: Check content of your journal list from menu %s
AccountancyAreaDescChartModel=STEP %s: Check that a model of chart of account exists or create one from menu %s
AccountancyAreaDescChart=STEP %s: Select and|or complete your chart of account from menu %s
AccountancyAreaDescVat=STEP %s: Define accounting accounts for each VAT Rates. For this, use the menu entry %s.
AccountancyAreaDescDefault=STEP %s: Define default accounting accounts. For this, use the menu entry %s.
-AccountancyAreaDescExpenseReport=STEP %s: Define default accounting accounts for each type of expense report. For this, use the menu entry %s.
+AccountancyAreaDescExpenseReport=STEP %s: Define default accounting accounts for each type of Expense report. For this, use the menu entry %s.
AccountancyAreaDescSal=STEP %s: Define default accounting accounts for payment of salaries. For this, use the menu entry %s.
-AccountancyAreaDescContrib=STEP %s: Define default accounting accounts for special expenses (miscellaneous taxes). For this, use the menu entry %s.
+AccountancyAreaDescContrib=STEP %s: Define default accounting accounts for Taxes (special expenses). For this, use the menu entry %s.
AccountancyAreaDescDonation=STEP %s: Define default accounting accounts for donation. For this, use the menu entry %s.
AccountancyAreaDescSubscription=STEP %s: Define default accounting accounts for member subscription. For this, use the menu entry %s.
AccountancyAreaDescMisc=STEP %s: Define mandatory default account and default accounting accounts for miscellaneous transactions. For this, use the menu entry %s.
AccountancyAreaDescLoan=STEP %s: Define default accounting accounts for loans. For this, use the menu entry %s.
AccountancyAreaDescBank=STEP %s: Define accounting accounts and journal code for each bank and financial accounts. For this, use the menu entry %s.
-AccountancyAreaDescProd=STEP %s: Define accounting accounts on your products/services. For this, use the menu entry %s.
+AccountancyAreaDescProd=STEP %s: Define accounting accounts on your Products/Services. For this, use the menu entry %s.
AccountancyAreaDescBind=STEP %s: Check the binding between existing %s lines and accounting account is done, so application will be able to journalize transactions in Ledger in one click. Complete missing bindings. For this, use the menu entry %s.
AccountancyAreaDescWriteRecords=STEP %s: Write transactions into the Ledger. For this, go into menu %s , and click into button %s .
@@ -112,7 +112,7 @@ MenuAccountancyClosure=Closure
MenuAccountancyValidationMovements=Validate movements
ProductsBinding=Products accounts
TransferInAccounting=Transfer in accounting
-RegistrationInAccounting=Registration in accounting
+RegistrationInAccounting=Recording in accounting
Binding=Binding to accounts
CustomersVentilation=Customer invoice binding
SuppliersVentilation=Vendor invoice binding
@@ -120,7 +120,7 @@ ExpenseReportsVentilation=Expense report binding
CreateMvts=Create new transaction
UpdateMvts=Modification of a transaction
ValidTransaction=Validate transaction
-WriteBookKeeping=Register transactions in accounting
+WriteBookKeeping=Record transactions in accounting
Bookkeeping=Ledger
BookkeepingSubAccount=Subledger
AccountBalance=Account balance
@@ -294,7 +294,7 @@ Balancing=Balancing
FicheVentilation=Binding card
GeneralLedgerIsWritten=Transactions are written in the Ledger
GeneralLedgerSomeRecordWasNotRecorded=Some of the transactions could not be journalized. If there is no other error message, this is probably because they were already journalized.
-NoNewRecordSaved=No more record to journalize
+NoNewRecordSaved=No more record to transfer
ListOfProductsWithoutAccountingAccount=List of products not bound to any accounting account
ChangeBinding=Change the binding
Accounted=Accounted in ledger
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 74cda5437e1..23ee6c5a576 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1187,7 +1187,7 @@ BankModuleNotActive=Bank accounts module not enabled
ShowBugTrackLink=Show the link "%s "
ShowBugTrackLinkDesc=Keep empty to not display this link, use value 'github' for the link to the Dolibarr project or define directly an url 'https://...'
Alerts=Alerts
-DelaysOfToleranceBeforeWarning=Delay before displaying a warning alert for:
+DelaysOfToleranceBeforeWarning=Displaying a warning alert for...
DelaysOfToleranceDesc=Set the delay before an alert icon %s is shown onscreen for the late element.
Delays_MAIN_DELAY_ACTIONS_TODO=Planned events (agenda events) not completed
Delays_MAIN_DELAY_PROJECT_TO_CLOSE=Project not closed in time
@@ -2220,4 +2220,5 @@ NoDeployedModulesFoundWithThisSearchCriteria=No modules found for these search c
API_DISABLE_COMPRESSION=Disable compression of API responses
EachTerminalHasItsOwnCounter=Each terminal use its own counter.
FillAndSaveAccountIdAndSecret=Fill and save account ID and secret first
-PreviousHash=Previous hash
\ No newline at end of file
+PreviousHash=Previous hash
+LateWarningAfter="Late" warning after
\ No newline at end of file
diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang
index 710d49bfab6..2ace1eb97e1 100644
--- a/htdocs/langs/en_US/boxes.lang
+++ b/htdocs/langs/en_US/boxes.lang
@@ -23,7 +23,7 @@ BoxLastMembersSubscriptions=Latest member subscriptions
BoxFicheInter=Latest interventions
BoxCurrentAccounts=Open accounts balance
BoxTitleMemberNextBirthdays=Birthdays of this month (members)
-BoxTitleMembersByType=Members by type
+BoxTitleMembersByType=Members by type and status
BoxTitleMembersSubscriptionsByYear=Members Subscriptions by year
BoxTitleLastRssInfos=Latest %s news from %s
BoxTitleLastProducts=Products/Services: last %s modified
diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang
index dd1e0ea4027..4bd64f44577 100644
--- a/htdocs/langs/en_US/productbatch.lang
+++ b/htdocs/langs/en_US/productbatch.lang
@@ -42,4 +42,5 @@ HideLots=Hide lots
#Traceability - qc status
OutOfOrder=Out of order
InWorkingOrder=In working order
-ToReplace=Replace
\ No newline at end of file
+ToReplace=Replace
+CantMoveNonExistantSerial=Error. You ask a move on a record for a serial that does not exists anymore. May be you take the same serial on same warehouse several times in same shipment or it was used by another shipment. Remove this shipment and prepare another one.
diff --git a/htdocs/langs/fr_FR/hrm.lang b/htdocs/langs/fr_FR/hrm.lang
index d47596fe95e..cab3c7c11af 100644
--- a/htdocs/langs/fr_FR/hrm.lang
+++ b/htdocs/langs/fr_FR/hrm.lang
@@ -79,3 +79,4 @@ NoEval=Aucune évaluation effectuée pour cet employé
HowManyUserWithThisMaxNote=Nombre d'employés avec ce niveau
HighestRank=Plus haut niveau
SkillComparison=Comparaison des compétences
+ActionsOnJob=Événements sur cet emploi
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/productbatch.lang b/htdocs/langs/fr_FR/productbatch.lang
index e1883f5bba0..68b5e928084 100644
--- a/htdocs/langs/fr_FR/productbatch.lang
+++ b/htdocs/langs/fr_FR/productbatch.lang
@@ -43,3 +43,4 @@ HideLots=Masquer les lots
OutOfOrder=Hors d'usage
InWorkingOrder=En état de marche
ToReplace=Remplacer
+CantMoveNonExistantSerial=Erreur : Vous avez demandé un mouvement sur un numéro de série qui n’existe plus. Peut-être avez-vous requis le même numéro de série plusieurs fois dans une même expédition, ou il a déjà servi dans une autre expédition. Supprimez cette expédition et préparez-en une autre.
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index f1ca7ce2747..531d463eea1 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -42,6 +42,7 @@
//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
+//if (! defined('NOSESSION')) define('NOSESSION', '1'); // Disable session
// Load Dolibarr environment
$res = 0;
diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php
index bac6c958d24..4ede9e1e297 100644
--- a/htdocs/product/class/html.formproduct.class.php
+++ b/htdocs/product/class/html.formproduct.class.php
@@ -202,7 +202,7 @@ class FormProduct
/**
* Return list of warehouses
*
- * @param string|int $selected Id of preselected warehouse ('' or '-1' for no value, 'ifone'=select value if one value otherwise no value, '-2' to use the default value from setup)
+ * @param string|int $selected Id of preselected warehouse ('' or '-1' for no value, 'ifone' and 'ifonenodefault' = select value if one value otherwise no value, '-2' to use the default value from setup)
* @param string $htmlname Name of html select html
* @param string $filterstatus warehouse status filter, following comma separated filter options can be used
* 'warehouseopen' = select products from open warehouses,
@@ -279,7 +279,7 @@ class FormProduct
}
$out .= ' 0 || $ref) {
$default_vat = $object->tva_tx;
}
}
- $vattosuggest = (GETPOST("tva_tx") ?vatrate(GETPOST("tva_tx")) : ($default_vat != '' ?vatrate($default_vat) : ''));
+ $vattosuggest = (GETPOSTISSET("tva_tx") ? vatrate(GETPOST("tva_tx")) : ($default_vat != '' ?vatrate($default_vat) : ''));
$vattosuggest = preg_replace('/\s*\(.*\)$/', '', $vattosuggest);
print ' ';
print '';
diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php
index 18a394559a3..8389d63e843 100644
--- a/htdocs/product/stock/card.php
+++ b/htdocs/product/stock/card.php
@@ -959,7 +959,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') {
$delallowed = $usercancreate;
$modulepart = 'stock';
- print $formfile->showdocuments($modulepart, $object->ref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, '', 0, '', $object->default_lang, '', $object);
+ print $formfile->showdocuments($modulepart, $objectref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, '', 0, '', $object->default_lang, '', $object);
$somethingshown = $formfile->numoffiles;
print '';
diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php
index b53d67f1bd2..67119ff6839 100644
--- a/htdocs/product/stock/class/mouvementstock.class.php
+++ b/htdocs/product/stock/class/mouvementstock.class.php
@@ -851,7 +851,9 @@ class MouvementStock extends CommonObject
*/
private function createBatch($dluo, $qty)
{
- global $user;
+ global $user, $langs;
+
+ $langs->load('productbatch');
$pdluo = new Productbatch($this->db);
@@ -862,7 +864,7 @@ class MouvementStock extends CommonObject
$result = $pdluo->fetch($dluo);
if (empty($pdluo->id)) {
// We didn't find the line. May be it was deleted before by a previous move in same transaction.
- $this->error = 'Error. You ask a move on a record for a serial that does not exists anymore. May be you take the same serial on same warehouse several times in same shipment or it was used by another shipment. Remove this shipment and prepare another one.';
+ $this->error = $langs->trans('CantMoveNonExistantSerial');
$this->errors[] = $this->error;
$result = -2;
}
diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php
index ffcf5dd2f00..340fd7dc0df 100644
--- a/htdocs/product/stock/stockatdate.php
+++ b/htdocs/product/stock/stockatdate.php
@@ -363,7 +363,7 @@ print $form->select_produits($productid, 'productid', '', 0, 0, -1, 2, '', 0, ar
print ' ';
print img_picto('', 'stock', 'class="pictofiwedwidth"');
print ' ';
-print $formproduct->selectWarehouses((GETPOSTISSET('fk_warehouse') ? $fk_warehouse : 'ifone'), 'fk_warehouse', '', 1, 0, 0, $langs->trans('Warehouse'), 0, 0, null, '', null, 1, false, 'e.ref');
+print $formproduct->selectWarehouses((GETPOSTISSET('fk_warehouse') ? $fk_warehouse : 'ifonenodefault'), 'fk_warehouse', '', 1, 0, 0, $langs->trans('Warehouse'), 0, 0, null, '', null, 1, false, 'e.ref');
print '
';
$parameters = array();
diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php
index d0ca6416390..068dba8c50a 100644
--- a/htdocs/resource/element_resource.php
+++ b/htdocs/resource/element_resource.php
@@ -383,7 +383,8 @@ if (!$ret) {
if (empty($act->fulldayevent)) {
print dol_print_date($act->datep, 'dayhour', 'tzuser');
} else {
- print dol_print_date($act->datep, 'day', 'tzuser');
+ $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
+ print dol_print_date($act->datep, 'day', ($tzforfullday ? $tzforfullday : 'tzuser'));
}
if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) {
print img_warning($langs->trans("Late"));
@@ -396,7 +397,8 @@ if (!$ret) {
if (empty($act->fulldayevent)) {
print dol_print_date($act->datef, 'dayhour', 'tzuser');
} else {
- print dol_print_date($act->datef, 'day', 'tzuser');
+ $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
+ print dol_print_date($act->datef, 'day', ($tzforfullday ? $tzforfullday : 'tzuser'));
}
if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now - $delay_warning)) {
print img_warning($langs->trans("Late"));
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index 5ce837e160c..7ef10ab005a 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -264,7 +264,8 @@ input:invalid, select:invalid, input.--error , select.--error {
section.setupsection {
padding: 20px;
- background-color: var(--colorbacktitle1);
+ /* background-color: var(--colorbacktitle1); */
+ background-color: #f0f0f0;
border-radius: 5px;
}
@@ -728,6 +729,9 @@ textarea.centpercent {
text-align: center;
margin: 0px auto;
}
+.centerimp {
+ text-align: center !important;
+}
.alignstart {
text-align: start;
}
@@ -5917,6 +5921,7 @@ span#select2-taskid-container[title^='--'] {
}
span.select2.select2-container.select2-container--default {
+ text-align: initial;
global->THEME_SHOW_BORDER_ON_INPUT)) { ?>
border-left: none;
border-top: none;
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index da706095e17..3c44bec4f81 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -885,6 +885,9 @@ textarea.centpercent {
text-align: center;
margin: 0px auto;
}
+.centerimp {
+ text-align: center !important;
+}
.alignstart {
text-align: start;
}
@@ -6110,6 +6113,10 @@ span#select2-boxbookmark-container, span#select2-boxcombo-container {
overflow: hidden;
}
+span.select2.select2-container.select2-container--default {
+ text-align: initial;
+}
+
/* ============================================================================== */
/* For categories */
diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php
index 44b9edf358e..b2548807be4 100644
--- a/htdocs/ticket/list.php
+++ b/htdocs/ticket/list.php
@@ -621,10 +621,10 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.urlencode($limit);
}
foreach ($search as $key => $val) {
- if (is_array($search[$key]) && count($search[$key])) {
- foreach ($search[$key] as $skey) {
+ if (is_array($val) && count($val)) {
+ foreach ($val as $skey) {
if ($skey != '') {
- $param .= '&search_'.$key.'[]='.urlencode($skey);
+ $param .= (!empty($val)) ? '&search_'.$key.'[]='.urlencode($skey) : "";
}
}
} elseif ($search[$key] != '') {
diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php
index 1569fcabb39..64fa6b08b93 100644
--- a/htdocs/variants/combinations.php
+++ b/htdocs/variants/combinations.php
@@ -262,7 +262,7 @@ if (($action == 'add' || $action == 'create') && empty($massaction) && !GETPOST(
exit();
}
- $prodcomb->variation_weight = $weight_impact;
+ $prodcomb->variation_weight = price2num($weight_impact);
// for conf PRODUIT_MULTIPRICES
if ($conf->global->PRODUIT_MULTIPRICES) {
diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php
index dee62999cf4..7f34bdb6a18 100644
--- a/htdocs/viewimage.php
+++ b/htdocs/viewimage.php
@@ -230,7 +230,7 @@ $original_file = str_replace('..\\', '/', $original_file);
$refname = basename(dirname($original_file)."/");
// Check that file is allowed for view with viewimage.php
-if (!dolIsAllowedForPreview($original_file)) {
+if (!empty($original_file) && !dolIsAllowedForPreview($original_file)) {
accessforbidden('This file is not qualified for preview', 0, 0, 1);
}