diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php
index dfe5b47379c..72427de3ab0 100644
--- a/htdocs/admin/ticket_public.php
+++ b/htdocs/admin/ticket_public.php
@@ -106,6 +106,12 @@ if ($action == 'setvar') {
if (!$res > 0) {
$error++;
}
+
+ $param_public_notification_new_message_default_email = GETPOST('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL', 'alpha');
+ $res = dolibarr_set_const($db, 'TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL', $param_public_notification_new_message_default_email, 'chaine', 0, '', $conf->entity);
+ if (!$res > 0) {
+ $error++;
+ }
}
if ($action == 'setvarother') {
@@ -377,7 +383,31 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
print $form->textwithpicto('', $langs->trans("TicketUrlPublicInterfaceHelpAdmin"), 1, 'help');
print '';
- print '';
+ // Activate email notification when a new message is added
+ print '
| ' . $langs->trans("TicketsPublicNotificationNewMessage") . ' | ';
+ print '';
+ if ($conf->use_javascript_ajax) {
+ print ajax_constantonoff('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED');
+ } else {
+ $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
+ print $form->selectarray("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED", $arrval, $conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED);
+ }
+ print ' | ';
+ print '';
+ print $form->textwithpicto('', $langs->trans("TicketsPublicNotificationNewMessageHelp"), 1, 'help');
+ print ' | ';
+ print '
';
+
+ // Send notification when a new message is added to a email if a user is not assigned to the ticket
+ print '| ' . $langs->trans("TicketPublicNotificationNewMessageDefaultEmail") . '';
+ print ' | ';
+ print ' | ';
+ print '';
+ print '';
+ print $form->textwithpicto('', $langs->trans("TicketPublicNotificationNewMessageDefaultEmailHelp"), 1, 'help');
+ print ' |
';
+
+ print '';
print '';
print '';
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index e0ded511928..5ef377adb33 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -90,6 +90,15 @@ $status = GETPOST("search_status", 'aZ09') ?GETPOST("search_status", 'aZ09') : G
$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);
$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'));
+if ($dateselect > 0)
+{
+ $day=GETPOST('dateselectday', 'int');
+ $month=GETPOST('dateselectmonth', 'int');
+ $year=GETPOST('dateselectyear', 'int');
+}
+
// Set actioncode (this code must be same for setting actioncode into peruser, listacton and index)
if (GETPOST('search_actioncode', 'array'))
{
@@ -371,6 +380,9 @@ if ($action == 'show_day')
$picto = 'calendarday';
}
+$nav .= $form->selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0);
+$nav .= ' ';
+
// Must be after the nav definition
$param .= '&year='.$year.'&month='.$month.($day ? '&day='.$day : '');
//print 'x'.$param;
diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php
index 467275d5fc0..20b756877cc 100644
--- a/htdocs/comm/action/list.php
+++ b/htdocs/comm/action/list.php
@@ -52,6 +52,7 @@ $year = GETPOST("year", 'int');
$month = GETPOST("month", 'int');
$day = GETPOST("day", 'int');
$toselect = GETPOST('toselect', 'array');
+$confirm = GETPOST('confirm', 'alpha');
// Set actioncode (this code must be same for setting actioncode into peruser, listacton and index)
if (GETPOST('search_actioncode', 'array'))
@@ -156,6 +157,11 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
* Actions
*/
+if (GETPOST('cancel', 'alpha'))
+{
+ $action='list'; $massaction='';
+}
+
if (GETPOST("viewcal") || GETPOST("viewweek") || GETPOST("viewday"))
{
$param = '';
@@ -224,6 +230,17 @@ if (empty($reshook) && !empty($massaction))
}
}
+// As mass deletion happens with a confirm step, $massaction is not use for the final step (deletion).
+if (empty($reshook))
+{
+ $objectclass = 'ActionComm';
+ $objectlabel = 'Events';
+ $uploaddir = true;
+ // Only users that can delete any event can remove records.
+ $permissiontodelete = $user->rights->agenda->allactions->delete;
+ include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
+}
+
/*
* View
*/
@@ -280,6 +297,10 @@ $arrayofmassactions = array(
'set_all_events_to_in_progress' => $langs->trans("SetAllEventsToInProgress"),
'set_all_events_to_finished' => $langs->trans("SetAllEventsToFinished"),
);
+if ($user->rights->agenda->allactions->delete)
+{
+ $arrayofmassactions['predelete'] = ''.$langs->trans("Delete");
+}
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
@@ -477,6 +498,8 @@ if ($resql)
print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit, 0, 0, 1);
+ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
+
$moreforfilter = '';
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php
index 23c76ae81fb..26ea16af4bb 100644
--- a/htdocs/core/actions_massactions.inc.php
+++ b/htdocs/core/actions_massactions.inc.php
@@ -46,7 +46,7 @@ if (empty($objectclass) || empty($uploaddir))
// For backward compatibility
if (!empty($permtoread) && empty($permissiontoread)) $permissiontoread = $permtoread;
if (!empty($permtocreate) && empty($permissiontoadd)) $permissiontoadd = $permtocreate;
-if (!empty($permtodelete) && empty($permissiontodelete)) $permissiontoread = $permtodelete;
+if (!empty($permtodelete) && empty($permissiontodelete)) $permissiontodelete = $permtodelete;
// Mass actions. Controls on number of lines checked.
diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
index 90b627ea425..220e1f51eca 100644
--- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
+++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
@@ -262,6 +262,7 @@ ALTER TABLE llx_commande_fournisseur_dispatch MODIFY COLUMN batch varchar(128);
ALTER TABLE llx_stock_mouvement MODIFY COLUMN batch varchar(128);
ALTER TABLE llx_mrp_production MODIFY COLUMN batch varchar(128);
ALTER TABLE llx_mrp_production MODIFY qty real NOT NULL DEFAULT 1;
+ALTER TABLE llx_expeditiondet_batch MODIFY COLUMN batch varchar(128);
create table llx_categorie_website_page
(
diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang
index 80518c3401a..a9cff9391d0 100644
--- a/htdocs/langs/en_US/ticket.lang
+++ b/htdocs/langs/en_US/ticket.lang
@@ -130,6 +130,10 @@ TicketNumberingModules=Tickets numbering module
TicketNotifyTiersAtCreation=Notify third party at creation
TicketGroup=Group
TicketsDisableCustomerEmail=Always disable emails when a ticket is created from public interface
+TicketsPublicNotificationNewMessage=Send email(s) when a new message is added
+TicketsPublicNotificationNewMessageHelp=Send email(s) when a new message is added from public interface (to assigned user or the notifications email to (update) and/or the notifications email to)
+TicketPublicNotificationNewMessageDefaultEmail=Notifications email to (update)
+TicketPublicNotificationNewMessageDefaultEmailHelp=Send email new message notifications to this address if the ticket don't have a user assigned or the user don't have a email.
#
# Index & list page
#
diff --git a/htdocs/langs/fr_FR/ticket.lang b/htdocs/langs/fr_FR/ticket.lang
index cf077e518c4..370fdaa1c21 100644
--- a/htdocs/langs/fr_FR/ticket.lang
+++ b/htdocs/langs/fr_FR/ticket.lang
@@ -130,6 +130,10 @@ TicketNumberingModules=Module de numérotation des tickets
TicketNotifyTiersAtCreation=Notifier le tiers à la création
TicketGroup=Groupe
TicketsDisableCustomerEmail=Toujours désactiver les courriels lorsqu'un ticket est créé depuis l'interface publique
+TicketsPublicNotificationNewMessage=Envoi d'e-mails lorsqu'un nouveau message est ajouté
+TicketsPublicNotificationNewMessageHelp=Envoi d'e-mails lorsqu'un nouveau message est ajouté depuis l'interface public (à l'utilisateur assigné ou à l'e-mail de notification à (nouveaux message) et/ou l'e-mail de notification à)
+TicketPublicNotificationNewMessageDefaultEmail=E-mail de notification à (nouveaux message)
+TicketPublicNotificationNewMessageDefaultEmailHelp=Envoyer des notifications de nouveaux message par e-mail à cette adresse si aucun utilisateur n'a été affecté au ticket ou qu'il n'a pas d'e-mail.
#
# Index & list page
#
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index f4edfdea548..a3bf3be14a6 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -39,8 +39,10 @@ $hookmanager->initHooks(array('projectsindex'));
// Load translation files required by the page
$langs->loadLangs(array('projects', 'companies'));
+$action = GETPOST('action', 'alpha');
$search_project_user = GETPOST('search_project_user', 'int');
$mine = GETPOST('mode', 'aZ09') == 'mine' ? 1 : 0;
+if ($mine == 0 && $search_project_user === '') $search_project_user = $user->conf->MAIN_SEARCH_PROJECT_USER_PROJECTSINDEX;
if ($search_project_user == $user->id) $mine = 1;
// Security check
@@ -54,6 +56,24 @@ $sortorder = GETPOST("sortorder", 'alpha');
$max = 3;
+/*
+ * Actions
+ */
+
+$parameters = array();
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
+if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+if (empty($reshook)) {
+ if ($action == 'refresh_search_project_user') {
+ $search_project_user = GETPOST('search_project_user', 'int');
+ $tabparam = array("MAIN_SEARCH_PROJECT_USER_PROJECTSINDEX" => $search_project_user);
+
+ include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
+ $result = dol_set_user_param($db, $conf, $user, $tabparam);
+ }
+}
+
+
/*
* View
*/
@@ -81,6 +101,7 @@ else $titleall = $langs->trans("AllAllowedProjects").'
';
$morehtml = '';
$morehtml .= '