';
-
// Text of email after creatio of a ticket
$mail_mesg_new = getDolGlobalString("TICKET_MESSAGE_MAIL_NEW", $langs->trans('TicketNewEmailBody'));
print '
';
@@ -541,6 +501,22 @@
print '
';
print '
';
+ // Also send to main email address
+ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
+ print '
';
@@ -1054,7 +1055,7 @@
print $form->buttonsSaveCancel("CreateDraftIntervention");
// Show origin lines
- if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
+ if (!empty($origin) && !empty($originid) && is_object($objectsrc) && !getDolGlobalInt('FICHINTER_DISABLE_DETAILS')) {
$title = $langs->trans('Services');
print load_fiche_titre($title);
diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php
index 30bfffaaf1b14..08b4b55373a34 100644
--- a/htdocs/fichinter/list.php
+++ b/htdocs/fichinter/list.php
@@ -1025,7 +1025,7 @@
print ''."\n";
- $total += $obj->duree;
+ $total += (isset($obj->duree) ? $obj->duree : 0);
}
$i++;
}
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 66761d12cdd31..8f3041a20ec93 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -220,7 +220,7 @@
// Set incoterm
if ($action == 'set_incoterms' && $usercancreate) {
- $result = $object->setIncoterms(GETPOSTINT('incoterm_id'), GETPOSTINT('location_incoterms'));
+ $result = $object->setIncoterms(GETPOSTINT('incoterm_id'), GETPOST('location_incoterms'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index bc0d1140b2dc1..2f64ae47dc458 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -445,7 +445,7 @@
}
} elseif ($action == 'set_incoterms' && isModEnabled('incoterm') && $usercancreate) {
// Set incoterm
- $result = $object->setIncoterms(GETPOSTINT('incoterm_id'), GETPOSTINT('location_incoterms'));
+ $result = $object->setIncoterms(GETPOSTINT('incoterm_id'), GETPOST('location_incoterms'));
} elseif ($action == 'setmode' && $usercancreate) {
// payment mode
$result = $object->setPaymentMethods(GETPOSTINT('mode_reglement_id'));
diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql
index b2397e2069cf0..ec3053a6a400c 100644
--- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql
+++ b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql
@@ -349,7 +349,8 @@ ALTER TABLE llx_societe_commerciaux ADD COLUMN fk_c_type_contact_code varchar(32
-- VPGSQL8.2 DROP INDEX uk_societe_commerciaux;
ALTER TABLE llx_societe_commerciaux ADD UNIQUE INDEX uk_societe_commerciaux_c_type_contact (fk_soc, fk_user, fk_c_type_contact_code);
ALTER TABLE llx_c_type_contact ADD INDEX idx_c_type_contact_code (code);
-ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_c_type_contact_code FOREIGN KEY (fk_c_type_contact_code) REFERENCES llx_c_type_contact(code);
+--Removed, not unique. ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_c_type_contact_code FOREIGN KEY (fk_c_type_contact_code) REFERENCES llx_c_type_contact(code);
+ALTER TABLE llx_societe_commerciaux DROP FOREIGN KEY fk_societe_commerciaux_fk_c_type_contact_code;
ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe(rowid);
ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_user FOREIGN KEY (fk_user) REFERENCES llx_user(rowid);
diff --git a/htdocs/install/mysql/tables/llx_societe_commerciaux.key.sql b/htdocs/install/mysql/tables/llx_societe_commerciaux.key.sql
index 1672ff659c1f4..f4bc719c4ba32 100644
--- a/htdocs/install/mysql/tables/llx_societe_commerciaux.key.sql
+++ b/htdocs/install/mysql/tables/llx_societe_commerciaux.key.sql
@@ -17,6 +17,6 @@
-- ===================================================================
ALTER TABLE llx_societe_commerciaux ADD UNIQUE INDEX uk_societe_commerciaux_c_type_contact (fk_soc, fk_user, fk_c_type_contact_code);
-ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_c_type_contact_code FOREIGN KEY (fk_c_type_contact_code) REFERENCES llx_c_type_contact(code);
+--Removed, not unique. ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_c_type_contact_code FOREIGN KEY (fk_c_type_contact_code) REFERENCES llx_c_type_contact(code);
ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe(rowid);
ALTER TABLE llx_societe_commerciaux ADD CONSTRAINT fk_societe_commerciaux_fk_user FOREIGN KEY (fk_user) REFERENCES llx_user(rowid);
diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang
index bb0cd645857cc..4e3788f05120f 100644
--- a/htdocs/langs/en_US/ticket.lang
+++ b/htdocs/langs/en_US/ticket.lang
@@ -72,10 +72,10 @@ TicketPublicAccess=A public interface requiring no identification is available a
TicketSetupDictionaries=The type of ticket, severity and analytic codes are configurable from dictionaries
TicketParamModule=Module variable setup
TicketParamMail=Email setup
-TicketEmailNotificationFrom=Sender e-mail for notification on answers
-TicketEmailNotificationFromHelp=Sender e-mail to use to send the notification email when an answer is provided inside the back office. For example noreply@example.com
+TicketEmailNotificationFrom=Sender e-mail for notification on tickets
+TicketEmailNotificationFromHelp=Sender e-mail to use to send the notification emails for tickets creation or messages. For example noreply@example.com
TicketEmailNotificationTo=Notify ticket creation to this e-mail address
-TicketEmailNotificationToHelp=If present, this e-mail address will be notified of a ticket creation
+TicketEmailNotificationToHelp=If present, this e-mail address will be notified of a ticket creation (in addition to any other default recipients)
TicketNewEmailBodyLabel=Text message sent after creating a ticket
TicketNewEmailBodyHelp=The text specified here will be inserted into the email confirming the creation of a new ticket from the public interface. Information on the consultation of the ticket are automatically added.
TicketParamPublicInterface=Public interface setup
@@ -96,7 +96,9 @@ TicketPublicInterfaceTextHelpMessageHelpAdmin=This text will appear above the me
ExtraFieldsTicket=Extra attributes
TicketCkEditorEmailNotActivated=HTML editor is not activated. Please put FCKEDITOR_ENABLE_MAIL content to 1 to get it.
TicketsDisableEmail=Do not send emails for ticket creation or message recording
-TicketsDisableEmailHelp=By default, emails are sent when new tickets or messages created. Enable this option to disable *all* email notifications
+TicketsDisableEmailHelp=By default, notification emails to third parties are sent when new tickets or messages are created for both backoffice and public interface. Enable this option to disable email notifications to thirdparties when creation is done from backoffice.
+TicketsNotifyThirdPartyFromBackOfficeByDefault=Notify third party by default on ticket creation from backoffice
+TicketsNotifyThirdPartyFromBackOfficeByDefaultHelp=When creating a ticket from the backoffice, the option "Notify third party" will be checked by default
TicketsLogEnableEmail=Enable log by email
TicketsLogEnableEmailHelp=At each change, an email will be sent **to each contact** associated with the ticket.
TicketParams=Params
@@ -117,7 +119,7 @@ TicketsAutoAssignTicketHelp=When creating a ticket, the user can be automaticall
TicketNumberingModules=Tickets numbering module
TicketsModelModule=Document templates for tickets
TicketNotifyTiersAtCreation=Notify third party at creation
-TicketsDisableCustomerEmail=Always disable emails when a ticket is created from public interface
+TicketsDisableCustomerEmail=Always disable emails to third parties when a ticket is created from the backoffice
TicketsPublicNotificationNewMessage=Send email(s) when a new message/comment is added to a ticket
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)
diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php
index fd7ea010270e5..60cd678ba363d 100644
--- a/htdocs/product/stock/class/mouvementstock.class.php
+++ b/htdocs/product/stock/class/mouvementstock.class.php
@@ -446,7 +446,7 @@ public function _create($user, $fk_product, $entrepot_id, $qty, $type, $price =
return -8;
}
} else {
- if (isset($product->stock_warehouse[$entrepot_id]) && (empty($product->stock_warehouse[$entrepot_id]->real) || $product->stock_warehouse[$entrepot_id]->real < abs($qty))) {
+ if (empty($product->stock_warehouse[$entrepot_id]) || empty($product->stock_warehouse[$entrepot_id]->real) || $product->stock_warehouse[$entrepot_id]->real < abs($qty)) {
$langs->load("stocks");
$this->error = $langs->trans('qtyToTranferIsNotEnough').' : '.$product->ref;
$this->errors[] = $langs->trans('qtyToTranferIsNotEnough').' : '.$product->ref;
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index d770f23f4f5ff..6f4a3aa4832bd 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -857,7 +857,7 @@
print '';
} elseif ($id > 0 || !empty($ref)) {
- $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
+ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
/*
* Projet card in view mode
diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php
index 219feb82a0f76..24629554b3227 100644
--- a/htdocs/ticket/class/ticket.class.php
+++ b/htdocs/ticket/class/ticket.class.php
@@ -223,7 +223,7 @@ class Ticket extends CommonObject
public $cache_msgs_ticket;
/**
- * @var int Notify thirdparty at create
+ * @var int Save if a thirdparty was notified at creation at ticket or not
*/
public $notify_tiers_at_create;
@@ -2779,10 +2779,10 @@ public function newMessage($user, &$action, $private = 1, $public_area = 0)
}
// Add global email address recipient
- if (getDolGlobalString('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS') &&
- getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') && !array_key_exists(getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'), $sendto)
- ) {
- $sendto[getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO')] = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO');
+ if (getDolGlobalString('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS') && !array_key_exists(getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'), $sendto)) {
+ if (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO')) {
+ $sendto[getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO')] = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO');
+ }
}
if (!empty($sendto)) {