diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php
index 1cce5388f90..8e50380e2ae 100644
--- a/htdocs/admin/agenda_other.php
+++ b/htdocs/admin/agenda_other.php
@@ -104,6 +104,8 @@ if ($action == 'set') {
$resultCreat = $defaultValues->create($user);
if ($resultCreat < 0) {
setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
+ } else {
+ setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
}
} elseif ($action == 'specimen') { // For orders
$modele = GETPOST('module', 'alpha');
@@ -316,6 +318,16 @@ print '
| '."\n";
print ''.$langs->trans("Value").' | '."\n";
print ''."\n";
+// AGENDA_DEFAULT_VIEW
+print ''."\n";
+$htmltext = $langs->trans("ThisValueCanOverwrittenOnUserLevel", $langs->transnoentitiesnoconv("UserGUISetup"));
+print '| '.$form->textwithpicto($langs->trans("AGENDA_DEFAULT_VIEW"), $htmltext).' | '."\n";
+print ' | '."\n";
+print ''."\n";
+$tmplist = array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
+print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
+print ' |
'."\n";
+
// Manual or automatic
print ''."\n";
@@ -340,16 +352,6 @@ if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
print '
'."\n";
}
-// AGENDA_DEFAULT_VIEW
-print ''."\n";
-$htmltext = $langs->trans("ThisValueCanOverwrittenOnUserLevel", $langs->transnoentitiesnoconv("UserGUISetup"));
-print '| '.$form->textwithpicto($langs->trans("AGENDA_DEFAULT_VIEW"), $htmltext).' | '."\n";
-print ' | '."\n";
-print ''."\n";
-$tmplist = array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
-print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
-print ' |
'."\n";
-
// AGENDA_EVENT_DEFAULT_STATUS
print ''."\n";
print '| '.$langs->trans("AGENDA_EVENT_DEFAULT_STATUS").' | '."\n";
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 63f18d2c046..52b93acdabb 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -937,7 +937,7 @@ if ($action == 'create') {
$("#selectcomplete").change(function() {
if ($("#selectcomplete").val() == 100)
{
- if ($("#doneby").val() <= 0) $("#doneby").val(\''.$user->id.'\');
+ if ($("#doneby").val() <= 0) $("#doneby").val(\''.((int) $user->id).'\');
}
if ($("#selectcomplete").val() == 0)
{
@@ -992,7 +992,8 @@ if ($action == 'create') {
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
print '
| '.$langs->trans("Type").' | ';
$default = (empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT) ? 'AC_RDV' : $conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT);
- $formactions->select_type_actions(GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", 0, -1);
+ print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"');
+ print $formactions->select_type_actions(GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot
print ' |
';
}
@@ -1000,7 +1001,7 @@ if ($action == 'create') {
print '| global->AGENDA_USE_EVENT_TYPE) ? ' class="fieldrequired titlefieldcreate"' : '').'>'.$langs->trans("Label").' | |
';
// Full day
- print '| '.$langs->trans("EventOnFullDay").' | |
';
+ print ' | |
';
$datep = ($datep ? $datep : (is_null($object->datep) ? '' : $object->datep));
if (GETPOST('datep', 'int', 1)) {
@@ -1311,7 +1312,7 @@ if ($action == 'create') {
print '';
- if ($conf->global->AGENDA_REMINDER_EMAIL || $conf->global->AGENDA_REMINDER_BROWSER) {
+ if (getDolGlobalString('AGENDA_REMINDER_EMAIL') || getDolGlobalString('AGENDA_REMINDER_BROWSER')) {
//checkbox create reminder
print '
';
print '
';
@@ -1336,10 +1337,11 @@ if ($action == 'create') {
print '';
//Mail Model
- print '| '.$langs->trans("EMailTemplates").' | ';
- print $form->selectModelMail('actioncommsend', 'actioncomm_send', 1, 1);
- print ' |
';
-
+ if (getDolGlobalString('AGENDA_REMINDER_EMAIL')) {
+ print '| '.$langs->trans("EMailTemplates").' | ';
+ print $form->selectModelMail('actioncommsend', 'actioncomm_send', 1, 1);
+ print ' |
';
+ }
print '';
print '';
diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php
index a248482ee9d..32c2345a657 100644
--- a/htdocs/comm/action/class/cactioncomm.class.php
+++ b/htdocs/comm/action/class/cactioncomm.class.php
@@ -145,7 +145,7 @@ class CActionComm
* @param string|int $active 1 or 0 to filter on event state active or not ('' by default = no filter)
* @param string $idorcode 'id' or 'code' or 'all'
* @param string $excludetype Type to exclude ('system' or 'systemauto')
- * @param int $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line per calendar (Default, Auto, BoothConf, ...)
+ * @param int $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1 or -2=Keep details and add a combined line per calendar (Default, Auto, BoothConf, ...)
* @param string $morefilter Add more SQL filter
* @param int $shortlabel 1=Get short label instead of long label
* @return mixed Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode.
@@ -241,7 +241,7 @@ class CActionComm
$transcode = $langs->trans($keyfortrans);
}
$label = (($transcode != $keyfortrans) ? $transcode : $langs->trans($obj->label));
- if ($onlyautoornot == -1 && !empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
+ if (($onlyautoornot == -1 || $onlyautoornot == -2) && !empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
if ($typecalendar == 'system') {
$label = ' '.$label;
$repid[-99] = $langs->trans("ActionAC_MANUAL");
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index 77d2680c222..4d6a032492f 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -107,10 +107,10 @@ $year = GETPOST("year", "int") ?GETPOST("year", "int") : date("Y");
$month = GETPOST("month", "int") ?GETPOST("month", "int") : date("m");
$week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W");
$day = GETPOST("day", "int") ?GETPOST("day", "int") : date("d");
-$pid = GETPOST("search_projectid", "int", 3) ?GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3);
-$status = GETPOST("search_status", 'aZ09') ?GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo'
-$type = GETPOST("search_type", 'aZ09') ?GETPOST("search_type", 'aZ09') : GETPOST("type", 'aZ09');
-$maxprint = (isset($_GET["maxprint"]) ?GETPOST("maxprint") : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
+$pid = GETPOST("search_projectid", "int", 3) ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3);
+$status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo'
+$type = GETPOSTISSET("search_type", 'aZ09') ? GETPOST("search_type", 'aZ09') : GETPOST("type", 'aZ09');
+$maxprint = GETPOSTISSET("maxprint") ? GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW;
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int'));
@@ -570,7 +570,7 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on
$s .= 'console.log("found parent div.dayevent with id = "+newval);'."\n";
$s .= 'var frm=jQuery("#searchFormList");'."\n";
$s .= 'var newurl = ui.item.find("a.cal_event").attr("href");'."\n";
- $s .= 'console.log(newurl);'."\n";
+ $s .= 'console.log("Found url on href of a.cal_event"+newurl+", we submit form with actionmove=mupdate");'."\n";
$s .= 'frm.attr("action", newurl).children("#newdate").val(newval);frm.submit();}'."\n";
$s .= '});'."\n";
}
@@ -1393,7 +1393,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month
print '';
print '';
- print '
';
+ print '';
print ' ';
// Column title of weeks numbers
echo ' | # | ';
@@ -1482,7 +1482,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month
print '';
print '';
- print '';
+ print '';
print '';
} elseif ($mode == 'show_week') {
// View by week
@@ -1502,7 +1502,7 @@ if (empty($mode) || $mode == 'show_month') { // View by month
print '';
print '';
- print '
';
+ print '';
print ' ';
$i = 0;
while ($i < 7) {
@@ -1544,10 +1544,9 @@ if (empty($mode) || $mode == 'show_month') { // View by month
print '';
echo '';
- echo '';
+ echo '';
echo '';
-} else // View by day
-{
+} else { // View by day
$newparam = $param; // newparam is for birthday links
$newparam = preg_replace('/mode=show_month&?/i', '', $newparam);
$newparam = preg_replace('/mode=show_week&?/i', '', $newparam);
diff --git a/htdocs/core/ajax/check_notifications.php b/htdocs/core/ajax/check_notifications.php
index bbbc95a19c5..a5efb52e787 100644
--- a/htdocs/core/ajax/check_notifications.php
+++ b/htdocs/core/ajax/check_notifications.php
@@ -170,8 +170,10 @@ if (empty($_SESSION['auto_check_events_not_before']) || $time >= $_SESSION['auto
$event['code'] = $obj->code;
$event['label'] = $obj->label;
$event['location'] = $obj->location;
- $event['reminder_date_formated'] = dol_print_date($db->jdate($obj->dateremind), 'standard');
- $event['event_date_start_formated'] = dol_print_date($db->jdate($obj->datep), 'standard');
+ $event['reminder_date_formated_tzserver'] = dol_print_date($db->jdate($obj->dateremind), 'standard', 'tzserver');
+ $event['event_date_start_formated_tzserver'] = dol_print_date($db->jdate($obj->datep), 'standard', 'tzserver');
+ $event['reminder_date_formated'] = dol_print_date($db->jdate($obj->dateremind), 'standard', 'tzuser');
+ $event['event_date_start_formated'] = dol_print_date($db->jdate($obj->datep), 'standard', 'tzuser');
$eventfound[$obj->id_agenda] = $event;
}
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index d4f4779a606..f5502426b00 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -352,7 +352,7 @@ class FormActions
* @param array|string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx'). Can be an array too.
* @param string $htmlname Name of select field
* @param string $excludetype A type to exclude ('systemauto', 'system', '')
- * @param integer $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line "All manual"
+ * @param integer $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line "All manual", -2=Combined line is disabled (not implemented yet)
* @param int $hideinfohelp 1=Do not show info help, 0=Show, -1=Show+Add info to tell how to set default value
* @param int $multiselect 1=Allow multiselect of action type
* @param int $nooutput 1=No output
@@ -373,7 +373,7 @@ class FormActions
$caction = new CActionComm($this->db);
// Suggest a list with manual events or all auto events
- $arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot);
+ $arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot, '', 0); // If we use param 'all' instead of 'code', there is no group by include in answer but the key 'type' of answer array contains the key for the group by.
if (empty($multiselect)) {
// Add empty line at start only if no multiselect
array_unshift($arraylist, ' ');
diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php
index eaf4804b213..f69dcb2874d 100644
--- a/htdocs/core/class/link.class.php
+++ b/htdocs/core/class/link.class.php
@@ -249,7 +249,7 @@ class Link extends CommonObject
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
- dol_syslog(get_class($this)."::fetchAll ".$num."records", LOG_DEBUG);
+ dol_syslog(get_class($this)."::fetchAll num=".((int) $num), LOG_DEBUG);
if ($num > 0) {
while ($obj = $this->db->fetch_object($resql)) {
$link = new Link($this->db);
diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php
index daa5f657549..fdbb755637a 100644
--- a/htdocs/core/db/DoliDB.class.php
+++ b/htdocs/core/db/DoliDB.class.php
@@ -62,6 +62,9 @@ abstract class DoliDB implements Database
/** @var string Last error number. For example: 'DB_ERROR_RECORD_ALREADY_EXISTS', '12345', ... */
public $lasterrno;
+ /** @var string If we need to set a prefix specific to the database so it can be reused (when defined instead of MAIN_DB_PREFIX) to forge requests */
+ public $prefix_db;
+
/** @var bool Status */
public $ok;
/** @var string */
diff --git a/htdocs/core/get_menudiv.php b/htdocs/core/get_menudiv.php
index 77b0416956b..597031945f1 100644
--- a/htdocs/core/get_menudiv.php
+++ b/htdocs/core/get_menudiv.php
@@ -121,12 +121,13 @@ print '
display: none;
}
- a.alilevel0 {
+ a.alilevel0, span.spanlilevel0 {
background-image: url(\''.DOL_URL_ROOT.'/theme/'.urlencode($conf->theme).'/img/next.png\') !important;
background-repeat: no-repeat !important;
background-position-x: 10px;
background-position-y: 16px;
padding: 1em 15px 1em 40px;
+ display: block;
}
li.lilevel0 font.vsmenudisabled {
background-repeat: no-repeat !important;
diff --git a/htdocs/core/js/lib_notification.js.php b/htdocs/core/js/lib_notification.js.php
index f4a4e59526a..af5952f6026 100644
--- a/htdocs/core/js/lib_notification.js.php
+++ b/htdocs/core/js/lib_notification.js.php
@@ -64,7 +64,7 @@ print "jQuery(document).ready(function () {\n";
//print " console.log('referrer=".dol_escape_js($_SERVER['HTTP_REFERER'])."');\n";
print ' var nowtime = Date.now();';
-print ' var time_auto_update = '.$conf->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY.';'."\n"; // Always defined
+print ' var time_auto_update = '.max(1, getDolGlobalInt('MAIN_BROWSER_NOTIFICATION_FREQUENCY')).';'."\n"; // Always defined
print ' var time_js_next_test;'."\n";
?>
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 126b69c233e..28a20ad6b09 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -1999,7 +1999,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
}
}
} elseif (!$phototoshow) { // example if modulepart = 'societe' or 'photo'
- $phototoshow .= $form->showphoto($modulepart, $object, 0, 0, 0, 'photoref', 'small', 1, 0, $maxvisiblephotos);
+ $phototoshow .= $form->showphoto($modulepart, $object, 0, 0, 0, 'photowithmargin photoref', 'small', 1, 0, $maxvisiblephotos);
}
if ($phototoshow) {
diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php
index 35186e423ef..5b426199a6e 100644
--- a/htdocs/core/menus/standard/eldy_menu.php
+++ b/htdocs/core/menus/standard/eldy_menu.php
@@ -317,7 +317,7 @@ class MenuManager
print '';
}
if ($val['enabled'] == 2) {
- print '