';
+
if (!empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print '
';
// On sell
if ($accounting_product_mode == 'ACCOUNTANCY_SELL' || $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') {
@@ -437,7 +445,8 @@ if ($result)
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
if (!empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "p.description", "", $param, '', $sortfield, $sortorder);
- // On sell / On purchase
+ print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "p.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
+ // On sell / On purchase
if ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
print_liste_field_titre("OnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, '', $sortfield, $sortorder, 'center ');
$fieldtosortaccount = "p.accountancy_code_sell";
@@ -553,11 +562,16 @@ if ($result)
{
// TODO ADJUST DESCRIPTION SIZE
// print '
' . $obj->description . '
';
- // TODO: we shoul set a user defined value to adjust user square / wide screen size
- $trunclengh = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
- print '
';
+ // TODO: we should set a user defined value to adjust user square / wide screen size
+ $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
+ print '
';
@@ -602,7 +616,7 @@ if ($result)
// Accounting account buy intra (In EEC)
print '
';
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
- if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy_intra;
+ if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy;
$codesell = length_accountg($obj->accountancy_code_buy_intra);
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
@@ -612,7 +626,7 @@ if ($result)
// Accounting account buy export (Out of EEC)
print '
';
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
- if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy_export;
+ if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy;
$codesell = length_accountg($obj->accountancy_code_buy_export);
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php
index 9d5dcbc32e3..1420cc0263e 100644
--- a/htdocs/admin/emailcollector_card.php
+++ b/htdocs/admin/emailcollector_card.php
@@ -496,6 +496,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
'X3'=>'---',
'withtrackingid'=>array('label'=>'WithDolTrackingID', 'data-noparam'=>1),
'withouttrackingid'=>array('label'=>'WithoutDolTrackingID', 'data-noparam'=>1),
+ 'withtrackingidinmsgid'=>array('label'=>'WithDolTrackingIDInMsgId', 'data-noparam'=>1),
+ 'withouttrackingidinmsgid'=>array('label'=>'WithoutDolTrackingIDInMsgId', 'data-noparam'=>1),
'X4'=>'---',
'isnotanswer'=>array('label'=>'IsNotAnAnswer', 'data-noparam'=>1),
'isanswer'=>array('label'=>'IsAnAnswer', 'data-noparam'=>1)
@@ -538,7 +540,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '
';
}
print ''."\n";
}
diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php
index feca9bf582e..8971f5a69d4 100644
--- a/htdocs/admin/mails.php
+++ b/htdocs/admin/mails.php
@@ -773,11 +773,17 @@ if ($action == 'edit')
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
{
- // MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS is list of IPs where email is sent from. Example: '1.2.3.4, [aaaa:bbbb:cccc:dddd]'.
- if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS))
+ if (!empty($conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD))
{
- // List of IP show as record to add in SPF if we use the mail method
- $text .= ($text ? '
' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
+ // List of string to add in SPF if the setup use the mail method
+ $text .= ($text ? '
' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD);
+ } else {
+ // MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS is list of IPs where email is sent from. Example: '1.2.3.4, [aaaa:bbbb:cccc:dddd]'.
+ if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS))
+ {
+ // List of IP show as record to add in SPF if we use the mail method
+ $text .= ($text ? '
' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
+ }
}
} else {
if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS))
@@ -785,7 +791,7 @@ if ($action == 'edit')
// List of IP show as record to add as allowed IP if we use the smtp method
$text .= ($text ? '
' : '').$langs->trans("WarningPHPMail2", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
}
- if (!empty($conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD))
+ if (!empty($conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD)) // Should be required only if you have set to use your own SMTP and wat to warn users to update their domain name to match your SMTP server.
{
// List of string to add in SPF if we use the smtp method
$text .= ($text ? '
' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD);
diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php
index 95487fc0bc3..363edca6c80 100644
--- a/htdocs/admin/pdf.php
+++ b/htdocs/admin/pdf.php
@@ -89,18 +89,6 @@ if ($action == 'update')
exit;
}
-if ($action == 'activate_pdfsecurity')
-{
- dolibarr_set_const($db, "PDF_SECURITY_ENCRYPTION", "1", 'chaine', 0, '', $conf->entity);
- header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
- exit;
-} elseif ($action == 'disable_pdfsecurity')
-{
- dolibarr_del_const($db, "PDF_SECURITY_ENCRYPTION", $conf->entity);
- header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
- exit;
-}
-
/*
diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php
index 7bb252394c3..b8d0304c5eb 100644
--- a/htdocs/blockedlog/class/blockedlog.class.php
+++ b/htdocs/blockedlog/class/blockedlog.class.php
@@ -185,6 +185,13 @@ class BlockedLog
// $conf->global->BANK_ENABLE_POS_CASHCONTROL must be set to 1 by all POS modules
$moduleposenabled = ($conf->cashdesk->enabled || $conf->takepos->enabled || !empty($conf->global->BANK_ENABLE_POS_CASHCONTROL));
if ($moduleposenabled) $this->trackedevents['CASHCONTROL_VALIDATE'] = 'logCASHCONTROL_VALIDATE';
+
+ if (!empty($conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED)) {
+ $tmparrayofmoresupportedevents = explode(',', $conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED);
+ foreach ($tmparrayofmoresupportedevents as $val) {
+ $this->trackedevents[$val] = 'log'.$val;
+ }
+ }
}
/**
diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php
index 1230a0e3269..1e59943a794 100644
--- a/htdocs/bom/bom_card.php
+++ b/htdocs/bom/bom_card.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2017-2020 Laurent Destailleur
* Copyright (C) 2019 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
@@ -181,6 +181,8 @@ if (empty($reshook))
unset($_POST['qty']);
unset($_POST['qty_frozen']);
unset($_POST['disable_stock_change']);
+
+ $object->fetchLines();
}
}
}
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 0fe69fa10ea..3818f459893 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -48,7 +48,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
// Load translation files required by the page
-$langs->loadLangs(array("companies", "other", "commercial", "bills", "orders", "agenda"));
+$langs->loadLangs(array("companies", "other", "commercial", "bills", "orders", "agenda", "mails"));
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
@@ -393,31 +393,36 @@ if (empty($reshook) && $action == 'add')
$moreparam = '';
if ($user->id != $object->userownerid) $moreparam = "filtert=-1"; // We force to remove filter so created record is visible when going back to per user view.
- //Create eminder
+ //Create reminders
if ($addreminder == 'on'){
$actionCommReminder = new ActionCommReminder($db);
- $dateremind = dol_time_plus_duree($datep, -$offsetvalue, 'i');
+ $dateremind = dol_time_plus_duree($datep, -$offsetvalue, $offsetunit);
$actionCommReminder->dateremind = $dateremind;
$actionCommReminder->typeremind = $remindertype;
- $actionCommReminder->fk_user = $user;
$actionCommReminder->offsetunit = $offsetunit;
$actionCommReminder->offsetvalue = $offsetvalue;
$actionCommReminder->status = $actionCommReminder::STATUS_TODO;
$actionCommReminder->fk_actioncomm = $object->id;
if ($remindertype == 'email') $actionCommReminder->fk_email_template = $modelmail;
- $res = $actionCommReminder->create($user);
+ // the notification must be created for every user assigned to the event
+ foreach ($object->userassigned as $userassigned)
+ {
+ $actionCommReminder->fk_user = $userassigned['id'];
+ $res = $actionCommReminder->create($user);
- if ($res <= 0){
- // If error
- $error++;
- $langs->load("errors");
- $error = $langs->trans('ErrorReminderActionCommCreation').' '.$actionCommReminder->error;
- setEventMessages($error, $actionCommReminder->errors, 'errors');
- $action = 'create'; $donotclearsession = 1;
- }
+ if ($res <= 0){
+ // If error
+ $db->rollback();
+ $langs->load("errors");
+ $error = $langs->trans('ErrorReminderActionCommCreation');
+ setEventMessages($error, null, 'errors');
+ $action = 'create'; $donotclearsession = 1;
+ break;
+ }
+ }
}
if ($error) {
@@ -634,9 +639,51 @@ if (empty($reshook) && $action == 'update')
$categories = GETPOST('categories', 'array');
$object->setCategories($categories);
+ $object->loadReminders();
+ if (!empty($object->reminders) && $object->datep > dol_now())
+ {
+ foreach ($object->reminders as $reminder)
+ {
+ $reminder->delete($user);
+ }
+ $object->reminders = array();
+ }
+
+ //Create reminders
+ if ($addreminder == 'on' && $object->datep > dol_now()){
+ $actionCommReminder = new ActionCommReminder($db);
+
+ $dateremind = dol_time_plus_duree($datep, -$offsetvalue, $offsetunit);
+
+ $actionCommReminder->dateremind = $dateremind;
+ $actionCommReminder->typeremind = $remindertype;
+ $actionCommReminder->offsetunit = $offsetunit;
+ $actionCommReminder->offsetvalue = $offsetvalue;
+ $actionCommReminder->status = $actionCommReminder::STATUS_TODO;
+ $actionCommReminder->fk_actioncomm = $object->id;
+ if ($remindertype == 'email') $actionCommReminder->fk_email_template = $modelmail;
+
+ // the notification must be created for every user assigned to the event
+ foreach ($object->userassigned as $userassigned)
+ {
+ $actionCommReminder->fk_user = $userassigned['id'];
+ $res = $actionCommReminder->create($user);
+
+ if ($res <= 0){
+ // If error
+ $langs->load("errors");
+ $error = $langs->trans('ErrorReminderActionCommCreation');
+ setEventMessages($error, null, 'errors');
+ $action = 'create'; $donotclearsession = 1;
+ break;
+ }
+ }
+ }
+
unset($_SESSION['assignedtouser']);
- $db->commit();
+ if (!$error) $db->commit();
+ else $db->rollback();
} else {
setEventMessages($object->error, $object->errors, 'errors');
$db->rollback();
@@ -1236,7 +1283,7 @@ if ($action == 'create')
}
});
- $("#selectremindertype").click(function(){
+ $("#selectremindertype").change(function(){
var selected_option = $("#selectremindertype option:selected").val();
if(selected_option == "email") {
$("#select_actioncommsendmodel_mail").closest("tr").show();
@@ -1664,41 +1711,82 @@ if ($id > 0)
{
$filtreuserid = $user->id;
if ($user->rights->agenda->allactions->read) $filtreuserid = 0;
- $object->loadReminders('', $filteruserid);
+ $object->loadReminders('', $filteruserid, false);
print '';
- print '
';
if (in_array($val['type'], array('int', 'integer'))) $value = GETPOSTISSET($key) ?GETPOST($key, 'int') : $object->$key;
- elseif ($val['type'] == 'text' || $val['type'] == 'html') $value = GETPOSTISSET($key) ?GETPOST($key, 'restricthtml') : $object->$key;
- else $value = GETPOSTISSET($key) ?GETPOST($key, 'alpha') : $object->$key;
+ elseif (preg_match('/^(text|html)/', $val['type'])) {
+ $tmparray = explode(':', $val['type']);
+ if (!empty($tmparray[1])) {
+ $check = $tmparray[1];
+ } else {
+ $check = 'restricthtml';
+ }
+ $value = GETPOSTISSET($key) ? GETPOST($key, $check) : $object->$key;
+ }
+ else $value = GETPOSTISSET($key) ? GETPOST($key, 'alpha') : $object->$key;
//var_dump($val.' '.$key.' '.$value);
if ($val['noteditable']) print $object->showOutputField($val, $key, $value, '', '', '', 0);
else print $object->showInputField($val, $key, $value, '', '', '', 0);
diff --git a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php
index 19eab2e5974..0800d66eea3 100644
--- a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php
+++ b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php
@@ -83,6 +83,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
|| $action === 'CASHCONTROL_VALIDATE'
|| (in_array($object->element, array('facture', 'supplier_invoice')) && $action === 'DOC_DOWNLOAD' && $object->statut != 0)
|| (in_array($object->element, array('facture', 'supplier_invoice')) && $action === 'DOC_PREVIEW' && $object->statut != 0)
+ || (!empty($conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED) && in_array($action, explode(',', $conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED)))
)
{
$qualified++;
diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php
index b070b69b4c9..943b7c73fb3 100644
--- a/htdocs/emailcollector/class/emailcollector.class.php
+++ b/htdocs/emailcollector/class/emailcollector.class.php
@@ -1006,6 +1006,8 @@ class EmailCollector extends CommonObject
if ($rule['type'] == 'smaller') $search .= ($search ? ' ' : '').'SMALLER "'.str_replace('"', '', $rule['rulevalue']).'"';
if ($rule['type'] == 'larger') $search .= ($search ? ' ' : '').'LARGER "'.str_replace('"', '', $rule['rulevalue']).'"';
+ if ($rule['type'] == 'withtrackingidinmsgid') { $searchfilterdoltrackid++; $searchhead .= '/Message-ID.*@'.preg_quote($host, '/').'/'; }
+ if ($rule['type'] == 'withouttrackingidinmsgid') { $searchfilterdoltrackid++; $searchhead .= '/Message-ID.*@'.preg_quote($host, '/').'/'; }
if ($rule['type'] == 'withtrackingid') { $searchfilterdoltrackid++; $searchhead .= '/References.*@'.preg_quote($host, '/').'/'; }
if ($rule['type'] == 'withouttrackingid') { $searchfilternodoltrackid++; $searchhead .= '! /References.*@'.preg_quote($host, '/').'/'; }
diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php
index 40c8a91d235..cb8db05fa34 100644
--- a/htdocs/emailcollector/class/emailcollectorfilter.class.php
+++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php
@@ -165,7 +165,7 @@ class EmailCollectorFilter extends CommonObject
$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"));
return -1;
}
- if (!in_array($this->type, array('seen', 'unseen', 'unanswered', 'answered', 'withtrackingid', 'withouttrackingid', 'isanswer', 'isnotanswer')) && empty($this->rulevalue))
+ if (!in_array($this->type, array('seen', 'unseen', 'unanswered', 'answered', 'withtrackingidinmsgid', 'withouttrackingidinmsgid', 'withtrackingid', 'withouttrackingid', 'isanswer', 'isnotanswer')) && empty($this->rulevalue))
{
$langs->load("errors");
$this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("SearchString"));
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index f0cfeed3cca..d0bc877d910 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -58,8 +58,8 @@ class Fichinter extends CommonObject
'datet' =>array('type'=>'date', 'label'=>'Datet', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
'duree' =>array('type'=>'double', 'label'=>'Duree', 'enabled'=>1, 'visible'=>-1, 'position'=>100),
'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>105, 'showoncombobox'=>1),
- 'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>110),
- 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>115),
+ 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110),
+ 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>115),
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>120),
'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'Last main doc', 'enabled'=>1, 'visible'=>-1, 'position'=>125),
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>130),
diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php
index bf3b8d43f9d..818c1763786 100644
--- a/htdocs/fichinter/class/fichinterrec.class.php
+++ b/htdocs/fichinter/class/fichinterrec.class.php
@@ -564,14 +564,14 @@ class FichinterRec extends Fichinter
if ($user->rights->fichinter->creer) {
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter_rec ";
$sql .= " SET frequency='".$this->db->escape($freq)."'";
- $sql .= ", last_gen='".$this->db->escape($courant)."'";
+ $sql .= ", date_last_gen='".$this->db->escape($courant)."'";
$sql .= " WHERE rowid = ".$this->id;
$resql = $this->db->query($sql);
if ($resql) {
$this->frequency = $freq;
- $this->last_gen = $courant;
+ $this->date_last_gen = $courant;
return 0;
} else {
dol_print_error($this->db);
diff --git a/htdocs/includes/odtphp/Segment.php b/htdocs/includes/odtphp/Segment.php
index cd8bec8c4ff..ca8797ba577 100644
--- a/htdocs/includes/odtphp/Segment.php
+++ b/htdocs/includes/odtphp/Segment.php
@@ -231,14 +231,10 @@ class Segment implements IteratorAggregate, Countable
//throw new SegmentException("var $key not found in {$this->getName()}");
}
- $value=$this->odf->htmlToUTFAndPreOdf($value);
+ $tag = $this->odf->getConfig('DELIMITER_LEFT') . $key . $this->odf->getConfig('DELIMITER_RIGHT');
- $value = $encode ? htmlspecialchars($value) : $value;
- $value = ($charset == 'ISO-8859') ? utf8_encode($value) : $value;
-
- $value=$this->odf->preOdfToOdf($value);
-
- $this->vars[$this->odf->getConfig('DELIMITER_LEFT') . $key . $this->odf->getConfig('DELIMITER_RIGHT')] = $value;
+ $this->vars[$tag] = $this->odf->convertVarToOdf($value, $encode, $charset);
+
return $this;
}
/**
diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php
index 3d510fdbaf1..5ec9b8f8870 100644
--- a/htdocs/includes/odtphp/odf.php
+++ b/htdocs/includes/odtphp/odf.php
@@ -141,7 +141,23 @@ class Odf
//}
}
+ $this->vars[$tag] = $this->convertVarToOdf($value, $encode, $charset);
+
+ return $this;
+ }
+
+ /**
+ * Replaces html tags in odt tags and returns a compatible string
+ * @param string $key Name of the variable within the template
+ * @param string $value Replacement value
+ * @param bool $encode If true, special XML characters are encoded
+ * @param string $charset Charset
+ * @return string
+ */
+ public function convertVarToOdf($value, $encode = true, $charset = 'ISO-8859')
+ {
$value = ($charset == 'ISO-8859') ? utf8_encode($value) : $value;
+ $convertedValue = $value;
// Check if the value includes html tags
if ($this->_hasHtmlTag($value) === true) {
@@ -155,7 +171,7 @@ class Odf
''
);
- $this->vars[$tag] = $this->_replaceHtmlWithOdtTag($this->_getDataFromHtml($value), $customStyles, $fontDeclarations);
+ $convertedValue = $this->_replaceHtmlWithOdtTag($this->_getDataFromHtml($value), $customStyles, $fontDeclarations);
foreach ($customStyles as $key => $val) {
array_push($automaticStyles, '' . $val . '');
@@ -179,9 +195,9 @@ class Odf
}
$this->contentXml = str_replace('', $fonts . '', $this->contentXml);
}
- else $this->vars[$tag] = preg_replace('/(\r\n|\r|\n)/i', "", $value);
-
- return $this;
+ else $convertedValue = preg_replace('/(\r\n|\r|\n)/i', "", $value);
+
+ return $convertedValue;
}
/**
diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql
index 83a502dbbff..b66d205ef40 100644
--- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql
+++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql
@@ -98,7 +98,8 @@ ALTER TABLE llx_bom_bomline ADD COLUMN position integer NOT NULL DEFAULT 0;
ALTER TABLE llx_bom_bomline ADD COLUMN qty_frozen smallint DEFAULT 0;
ALTER TABLE llx_bom_bomline ADD COLUMN disable_stock_change smallint DEFAULT 0;
-ALTER TABLE llx_bom_bomline DROP COLUMN `rank`;
+-- VMYSQL4.1 ALTER TABLE llx_bom_bomline DROP COLUMN `rank`;
+-- VPGSQL8.2 ALTER TABLE llx_bom_bomline DROP COLUMN rank;
create table llx_categorie_warehouse
(
diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql
index 91c155d3d84..c0efe6d68b3 100644
--- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql
+++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql
@@ -315,6 +315,7 @@ ALTER TABLE llx_c_chargesociales ADD COLUMN accountancy_code varchar(15) DEFAULT
-- Tables for accountancy expert
DROP TABLE llx_accountingaccount;
+DROP TABLE llx_accounting_account;
DROP TABLE llx_accountingsystem;
DROP TABLE llx_accounting_system;
diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql
index 0f84c92ef22..88d9ae1b685 100644
--- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql
+++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql
@@ -102,6 +102,10 @@ ALTER TABLE llx_expedition DROP FOREIGN KEY fk_expedition_fk_shipping_method;
ALTER TABLE llx_expedition DROP INDEX idx_expedition_fk_expedition_methode;
ALTER TABLE llx_expedition CHANGE COLUMN fk_expedition_methode fk_shipping_method integer;
+-- This table and constraint should not exists as it appears in more recent version, but we may have it if we load an old dump
+-- on a newly created database and we want to be sure upgrade of rowid into autoincrement done later will works.
+ALTER TABLE llx_reception DROP FOREIGN KEY fk_reception_fk_shipping_method;
+
ALTER TABLE llx_c_shipment_mode ADD COLUMN tracking VARCHAR(255) NOT NULL DEFAULT '' AFTER description;
--ALTER TABLE llx_c_shipment_mode DROP COLUMN CASCADE;
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 1498639d731..241848a594a 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -484,7 +484,7 @@ WarningPHPMailA=- Using the server of the Email Service Provider increase the tr
WarningPHPMailB=- Some Email Service Providers (like Yahoo) do not allow you to send an email from another server than their own server. Your current setup uses the server of the application to send email and not the server of your email provider, so some recipients (the one compatible with the restrictive DMARC protocol), will ask your email provider if they can accept your email and some email providers (like Yahoo) may respond "no" because the server is not theirs, so few of your sent Emails may not be accepted for delivery (be careful also of your email provider's sending quota).
WarningPHPMailC=- Using the SMTP server of your own Email Service Provider to send emails is also interesting so all emails sent from application will also be saved into your "Sent" directory of your mailbox.
WarningPHPMail2=If your email SMTP provider need to restrict email client to some IP addresses (very rare), this is the IP address of the mail user agent (MUA) for your ERP CRM application: %s.
-WarningPHPMailSPF=If the domain name in your sender email address is protected by SPF (ask you email provider), you must include the following IPs in the SPF record of the DNS of your domain: %s.
+WarningPHPMailSPF=If the domain name in your sender email address is protected by a SPF record (ask you domain name registar), you must add the following IPs in the SPF record of the DNS of your domain: %s.
ClickToShowDescription=Click to show description
DependsOn=This module needs the module(s)
RequiredBy=This module is required by module(s)
@@ -1988,6 +1988,8 @@ LoadThirdPartyFromName=Load third party searching on %s (load only)
LoadThirdPartyFromNameOrCreate=Load third party searching on %s (create if not found)
WithDolTrackingID=Message from a conversation initiated by a first email sent from Dolibarr
WithoutDolTrackingID=Message from a conversation initiated by a first email NOT sent from Dolibarr
+WithDolTrackingIDInMsgId=Message sent from Dolibarr
+WithoutDolTrackingIDInMsgId=Message NOT sent from Dolibarr
CreateCandidature=Create candidature
FormatZip=Zip
MainMenuCode=Menu entry code (mainmenu)
@@ -2030,7 +2032,7 @@ ImportSetup=Setup of module Import
InstanceUniqueID=Unique ID of the instance
SmallerThan=Smaller than
LargerThan=Larger than
-IfTrackingIDFoundEventWillBeLinked=Note that If a tracking ID of an object is found into incoming email, or if the email is an answer of an email aready collected and linked to an object, the event will be automatically linked to the known related object too.
+IfTrackingIDFoundEventWillBeLinked=Note that If a tracking ID of an object is found into email, or if the email is an answer of an email aready collected and linked to an object, the created event will be automatically linked to the known related object.
WithGMailYouCanCreateADedicatedPassword=With a GMail account, if you enabled the 2 steps validation, it is recommanded to create a dedicated second password for the application instead of using your own account passsword from https://myaccount.google.com/.
EmailCollectorTargetDir=It may be a desired behaviour to move the email into another tag/directory when it was processed successfully. Just set name of directory here to use this feature (Do NOT use special characters in name). Note that you must also use a read/write login account.
EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\s([^\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body.
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index 399dd3b10b8..8465f804d5c 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -70,7 +70,7 @@ class MyObject extends CommonObject
/**
- * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
+ * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
* 'label' the translation key.
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM)
diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php
index a90c9dd5b1b..6c75d96fe89 100644
--- a/htdocs/product/class/api_products.class.php
+++ b/htdocs/product/class/api_products.class.php
@@ -72,15 +72,16 @@ class Products extends DolibarrApi
* @param int $id ID of product
* @param int $includestockdata Load also information about stock (slower)
* @param bool $includesubproducts Load information about subproducts
+ * @param bool $includeparentid Load also ID of parent product (if product is a variant of a parent product)
* @return array|mixed Data without useless information
*
* @throws RestException 401
* @throws RestException 403
* @throws RestException 404
*/
- public function get($id, $includestockdata = 0, $includesubproducts = false)
+ public function get($id, $includestockdata = 0, $includesubproducts = false, $includeparentid = false)
{
- return $this->_fetch($id, '', '', '', $includestockdata, $includesubproducts);
+ return $this->_fetch($id, '', '', '', $includestockdata, $includesubproducts, $includeparentid);
}
/**
@@ -91,6 +92,7 @@ class Products extends DolibarrApi
* @param string $ref Ref of element
* @param int $includestockdata Load also information about stock (slower)
* @param bool $includesubproducts Load information about subproducts
+ * @param bool $includeparentid Load also ID of parent product (if product is a variant of a parent product)
*
* @return array|mixed Data without useless information
*
@@ -100,9 +102,9 @@ class Products extends DolibarrApi
* @throws RestException 403
* @throws RestException 404
*/
- public function getByRef($ref, $includestockdata = 0, $includesubproducts = false)
+ public function getByRef($ref, $includestockdata = 0, $includesubproducts = false, $includeparentid = false)
{
- return $this->_fetch('', $ref, '', '', $includestockdata, $includesubproducts);
+ return $this->_fetch('', $ref, '', '', $includestockdata, $includesubproducts, $includeparentid);
}
/**
@@ -113,6 +115,7 @@ class Products extends DolibarrApi
* @param string $ref_ext Ref_ext of element
* @param int $includestockdata Load also information about stock (slower)
* @param bool $includesubproducts Load information about subproducts
+ * @param bool $includeparentid Load also ID of parent product (if product is a variant of a parent product)
*
* @return array|mixed Data without useless information
*
@@ -122,9 +125,9 @@ class Products extends DolibarrApi
* @throws RestException 403
* @throws RestException 404
*/
- public function getByRefExt($ref_ext, $includestockdata = 0, $includesubproducts = false)
+ public function getByRefExt($ref_ext, $includestockdata = 0, $includesubproducts = false, $includeparentid = false)
{
- return $this->_fetch('', '', $ref_ext, '', $includestockdata, $includesubproducts);
+ return $this->_fetch('', '', $ref_ext, '', $includestockdata, $includesubproducts, $includeparentid);
}
/**
@@ -135,6 +138,7 @@ class Products extends DolibarrApi
* @param string $barcode Barcode of element
* @param int $includestockdata Load also information about stock (slower)
* @param bool $includesubproducts Load information about subproducts
+ * @param bool $includeparentid Load also ID of parent product (if product is a variant of a parent product)
*
* @return array|mixed Data without useless information
*
@@ -144,9 +148,9 @@ class Products extends DolibarrApi
* @throws RestException 403
* @throws RestException 404
*/
- public function getByBarcode($barcode, $includestockdata = 0, $includesubproducts = false)
+ public function getByBarcode($barcode, $includestockdata = 0, $includesubproducts = false, $includeparentid = false)
{
- return $this->_fetch('', '', '', $barcode, $includestockdata, $includesubproducts);
+ return $this->_fetch('', '', '', $barcode, $includestockdata, $includesubproducts, $includeparentid);
}
/**
diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php
index 4666de59a8e..973bbabba2d 100644
--- a/htdocs/takepos/css/pos.css.php
+++ b/htdocs/takepos/css/pos.css.php
@@ -669,3 +669,71 @@ div#moreinfo, div#infowarehouse {
padding-right: 4px;
}
}
+
+/* Modal box */
+.modal {
+ display: none; /* Hidden by default */
+ position: fixed;
+ z-index: 20;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ overflow: auto;
+ background-color: rgb(0,0,0);
+ background-color: rgba(0,0,0,0.4);
+}
+
+/* The Close Button */
+.close {
+ color: #aaa;
+ float: right;
+ font-size: 28px;
+ font-weight: bold;
+}
+
+.close:hover,
+.close:focus {
+ color: black;
+ text-decoration: none;
+ cursor: pointer;
+}
+
+.modal-header {
+ padding: 2px 16px;
+ background-color: #2b4161;
+ color: white;
+}
+
+.modal-body {padding: 2px 16px;}
+
+.modal-content {
+ position: relative;
+ background-color: #fefefe;
+ margin: 15% auto; /* 15% from the top and centered */
+ padding: 0;
+ border: 1px solid #888;
+ width: 40%;
+ box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
+ animation-name: animatetop;
+ animation-duration: 0.4s;
+ min-width: 200px;
+}
+
+@keyframes animatetop {
+ from {top: -300px; opacity: 0}
+ to {top: 0; opacity: 1}
+}
+
+.block {
+ display: block;
+ width: 100%;
+ border: none;
+ color: white;
+ background-color: #8c907e;
+ padding: 14px 28px;
+ font-size: 16px;
+ cursor: pointer;
+ text-align: center;
+ margin: 2px;
+}
diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php
index 73b039d97e9..bcc56ff0166 100644
--- a/htdocs/takepos/index.php
+++ b/htdocs/takepos/index.php
@@ -728,27 +728,12 @@ function CashReport(rowid)
// Popup to select the terminal to use
function TerminalsDialog()
{
- jQuery("#dialog-info").dialog({
- resizable: false,
- height: global->TAKEPOS_NUM_TERMINALS / 3 * 20); ?>,
- width: dol_optimize_smallscreen ? 316 : 400); ?>,
- modal: true,
- buttons: {
- 'trans("Terminal")) ?> 1': function() {
- location.href='index.php?setterminal=1';
- }
- global->TAKEPOS_NUM_TERMINALS; $i++)
- {
- print ",
- '".dol_escape_js($langs->trans("Terminal"))." ".$i."': function() {
- location.href='index.php?setterminal=".$i."';
- }
- ";
- }
- ?>
- }
- });
+ var modal = document.getElementById("ModalTerminal");
+ var span = document.getElementsByClassName("close")[0];
+ span.onclick = function() {
+ modal.style.display = "none";
+ }
+ modal.style.display = "block";
}
function DirectPayment(){
@@ -802,7 +787,6 @@ $( document ).ready(function() {
'.$langs->trans('TerminalSelect').'';
$keyCodeForEnter = $conf->global->{'CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']} > 0 ? $conf->global->{'CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']} : '';
?>