';
if ($empty) {
print ' ';
}
@@ -730,9 +732,9 @@ class FormTicket
}
// If text is selected, we compare with code, otherwise with id
- if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) {
+ if (in_array($arraytypes['code'], $selected)) {
print ' selected="selected"';
- } elseif ($selected == $id) {
+ } elseif (in_array($id, $selected)) {
print ' selected="selected"';
} elseif ($arraytypes['use_default'] == "1" && !$selected && !$empty) {
print ' selected="selected"';
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index b5f8ced66a0..70589dfb120 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -939,6 +939,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
$search_name = GETPOST("search_name", 'alpha');
$search_address = GETPOST("search_address", 'alpha');
$search_poste = GETPOST("search_poste", 'alpha');
+ $search_note_private = GETPOST('search_note_private', 'alphanohtml');
$search_roles = GETPOST("search_roles", 'array');
$socialnetworks = getArrayOfSocialNetworks();
@@ -988,6 +989,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
'name' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1),
'poste' =>array('type'=>'varchar(128)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>2, 'index'=>1, 'position'=>20),
'address' =>array('type'=>'varchar(128)', 'label'=>'Address', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>3, 'index'=>1, 'position'=>30),
+ 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'visible'=>3, 'position'=>35),
'role' =>array('type'=>'checkbox', 'label'=>'Role', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>4, 'index'=>1, 'position'=>40),
'statut' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>50, 'arrayofkeyval'=>array(0=>$contactstatic->LibStatut(0, 1), 1=>$contactstatic->LibStatut(1, 1))),
);
@@ -998,6 +1000,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
't.name'=>array('label'=>"Name", 'checked'=>1, 'position'=>10),
't.poste'=>array('label'=>"PostOrFunction", 'checked'=>1, 'position'=>20),
't.address'=>array('label'=>(empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked'=>1, 'position'=>30),
+ 't.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'position'=>35),
'sc.role'=>array('label'=>"ContactByDefaultFor", 'checked'=>1, 'position'=>40),
't.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>50, 'class'=>'center'),
);
@@ -1032,6 +1035,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
$search_roles = array();
$search_address = '';
$search_poste = '';
+ $search_note_private = '';
$search = array();
$search_array_options = array();
@@ -1088,6 +1092,9 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
if ($search_address != '') {
$param .= '&search_address='.urlencode($search_address);
}
+ if ($search_note_private != '') {
+ $param .= '&search_note_private='.urlencode($search_note_private);
+ }
if ($optioncss != '') {
$param .= '&optioncss='.urlencode($optioncss);
}
@@ -1098,6 +1105,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
$sql = "SELECT t.rowid, t.lastname, t.firstname, t.fk_pays as country_id, t.civility, t.poste, t.phone as phone_pro, t.phone_mobile, t.phone_perso, t.fax, t.email, t.socialnetworks, t.statut, t.photo,";
$sql .= " t.civility as civility_id, t.address, t.zip, t.town";
+ $sql .= ", t.note_private";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)";
$sql .= " WHERE t.fk_soc = ".((int) $object->id);
@@ -1116,6 +1124,9 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
if ($search_address) {
$sql .= natural_search($searchAddressPhoneDBFields, $search_address);
}
+ if ($search_note_private) {
+ $sql .= natural_search('t.note_private', $search_note_private);
+ }
if (count($search_roles) > 0) {
$sql .= " AND t.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".$db->sanitize(implode(',', $search_roles))."))";
}
@@ -1297,6 +1308,15 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
print '';
}
+ // Note private
+ if (!empty($arrayfields['t.note_private']['checked'])) {
+ print '';
+ if ($obj->note_private) {
+ print dol_string_nohtmltag($obj->note_private);
+ }
+ print ' ';
+ }
+
// Role
if (!empty($arrayfields['sc.role']['checked'])) {
print '';
diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php
index 9aaf0771d44..03223a7b65a 100644
--- a/htdocs/core/lib/date.lib.php
+++ b/htdocs/core/lib/date.lib.php
@@ -169,7 +169,7 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforend
} else {
$date->add($interval);
}
- //Change the behavior of PHP over data-interval when the result of this function is Feb 29 (non-leap years), 30 or Feb 31 (php returns March 1, 2 or 3 respectively)
+ //Change the behavior of PHP over data-interval when the result of this function is Feb 29 (non-leap years), 30 or Feb 31 (so php returns March 1, 2 or 3 respectively)
if ($ruleforendofmonth == 1 && $duration_unit == 'm') {
$timeyear = dol_print_date($time, '%Y');
$timemonth = dol_print_date($time, '%m');
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index ce3f8961b32..c3eede90efd 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -2539,7 +2539,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$original_file = $conf->facture->multidir_output[$entity].'/'.$original_file;
} elseif ($modulepart == 'apercupropal' && !empty($conf->propal->multidir_output[$entity])) {
// Wrapping pour les apercu propal
- if ($fuser->rights->propale->{$lire}) {
+ if ($fuser->rights->propal->{$lire}) {
$accessallowed = 1;
}
$original_file = $conf->propal->multidir_output[$entity].'/'.$original_file;
@@ -2611,7 +2611,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$original_file = $conf->expensereport->dir_output.'/'.$original_file;
} elseif ($modulepart == 'propalstats' && !empty($conf->propal->multidir_temp[$entity])) {
// Wrapping pour les images des stats propales
- if ($fuser->rights->propale->{$lire}) {
+ if ($fuser->rights->propal->{$lire}) {
$accessallowed = 1;
}
$original_file = $conf->propal->multidir_temp[$entity].'/'.$original_file;
@@ -2832,7 +2832,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
//$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity;
} elseif (($modulepart == 'propal' || $modulepart == 'propale') && !empty($conf->propal->multidir_output[$entity])) {
// Wrapping pour les propales
- if ($fuser->rights->propale->{$lire} || preg_match('/^specimen/i', $original_file)) {
+ if ($fuser->rights->propal->{$lire} || preg_match('/^specimen/i', $original_file)) {
$accessallowed = 1;
}
$original_file = $conf->propal->multidir_output[$entity].'/'.$original_file;
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 040267e0259..6c278f4764d 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -10567,7 +10567,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
* @param array $params = [ // Various params for future : recommended rather than adding more function arguments
* 'attr' => [ // to add or override button attributes
* 'xxxxx' => '', // your xxxxx attribute you want
- * 'class' => '', // to add more css class to the button class attribute
+ * 'class' => 'reposition', // to add more css class to the button class attribute
* 'classOverride' => '' // to replace class attribute of the button
* ],
* 'confirm' => [
@@ -10614,7 +10614,7 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url =
if (empty($userRight)) {
$attr['class'] = 'butActionRefused';
$attr['href'] = '';
- $attr['title'] = $langs->trans('NotEnoughPermissions');
+ $attr['title'] = (($label && $text && $label != $text) ? $label : $langs->trans('NotEnoughPermissions'));
}
if (!empty($id)) {
@@ -10670,7 +10670,7 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url =
$TCompiledAttr = array();
foreach ($attr as $key => $value) {
- $TCompiledAttr[] = $key.'="'.$value.'"';
+ $TCompiledAttr[] = $key.'= "'.$value.'"';
}
$compiledAttributes = empty($TCompiledAttr) ? '' : implode(' ', $TCompiledAttr);
diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index a1bccc1dd28..7795f927c19 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -411,7 +411,7 @@ function show_stats_for_company($product, $socid)
print '';
// Customer proposals
- if (isModEnabled("propal") && $user->rights->propale->lire) {
+ if (isModEnabled("propal") && $user->rights->propal->lire) {
$nblines++;
$ret = $product->load_stats_propale($socid);
if ($ret < 0) {
diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql
index 046d1da2f0e..10c50ca99ee 100644
--- a/htdocs/core/menus/init_menu_auguria.sql
+++ b/htdocs/core/menus/init_menu_auguria.sql
@@ -157,15 +157,15 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->reception->enabled && $leftmenu=="receptions"', __HANDLER__, 'left', 1353__+MAX_llx_menu__, 'commercial', '', 1350__+MAX_llx_menu__, '/reception/stats/index.php?mainmenu=commercial&leftmenu=receptions', 'Statistics', 1, 'receptions', '$user->rights->reception->lire', '', 2, 2, __ENTITY__);
-- Commercial - Proposals
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?mainmenu=commercial&leftmenu=propals', 'Proposals', 0, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/card.php?mainmenu=commercial&action=create&leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propale->creer', '', 2, 0, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', 'List', 1, 'propal', '$user->rights->propale->lire', '', 2, 1, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=0', 'PropalsDraft', 1, 'propal', '$user->rights->propale->lire', '', 2, 2, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=1', 'PropalsOpened', 1, 'propal', '$user->rights->propale->lire', '', 2, 3, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1105__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=2', 'PropalStatusSigned', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1106__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=3', 'PropalStatusNotSigned', 1, 'propal', '$user->rights->propale->lire', '', 2, 5, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1107__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=4', 'PropalStatusBilled', 1, 'propal', '$user->rights->propale->lire', '', 2, 6, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?mainmenu=commercial&leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?mainmenu=commercial&leftmenu=propals', 'Proposals', 0, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/card.php?mainmenu=commercial&action=create&leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propal->creer', '', 2, 0, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', 'List', 1, 'propal', '$user->rights->propal->lire', '', 2, 1, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=0', 'PropalsDraft', 1, 'propal', '$user->rights->propal->lire', '', 2, 2, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=1', 'PropalsOpened', 1, 'propal', '$user->rights->propal->lire', '', 2, 3, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1105__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=2', 'PropalStatusSigned', 1, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1106__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=3', 'PropalStatusNotSigned', 1, 'propal', '$user->rights->propal->lire', '', 2, 5, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1107__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=4', 'PropalStatusBilled', 1, 'propal', '$user->rights->propal->lire', '', 2, 6, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?mainmenu=commercial&leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__);
-- Commercial - Customer's orders
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1200__+MAX_llx_menu__, 'commercial', 'orders', 5__+MAX_llx_menu__, '/commande/index.php?mainmenu=commercial&leftmenu=orders', 'CustomersOrders', 0, 'orders', '$user->rights->commande->lire', '', 2, 5, __ENTITY__);
diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php
index 594ab96d955..09f93a436ea 100644
--- a/htdocs/core/modules/import/import_csv.modules.php
+++ b/htdocs/core/modules/import/import_csv.modules.php
@@ -458,17 +458,27 @@ class ImportCsv extends ModeleImports
$param_array = array('', $newval, 0, $arrayrecord[0]['val']); // Param to fetch parent from account, in chart.
}
- call_user_func_array(array($classinstance, $method), $param_array);
+ $result = call_user_func_array(array($classinstance, $method), $param_array);
+
+ // If duplicate record found
+ if (!($classinstance->id != '') && $result == -2) {
+ $this->errors[$error]['lib'] = $langs->trans('ErrorMultipleRecordFoundFromRef', $newval);
+ $this->errors[$error]['type'] = 'FOREIGNKEY';
+ $errorforthistable++;
+ $error++;
+ }
+
// If not found, try the fetch from label
if (!($classinstance->id != '') && $objimport->array_import_convertvalue[0][$val]['rule'] == 'fetchidfromcodeorlabel') {
$param_array = array('', '', $newval);
call_user_func_array(array($classinstance, $method), $param_array);
}
$this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval] = $classinstance->id;
+
//print 'We have made a '.$class.'->'.$method.' to get id from code '.$newval.'. ';
if ($classinstance->id != '') { // id may be 0, it is a found value
$newval = $classinstance->id;
- } else {
+ } elseif (! $error) {
if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) {
$this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', num2Alpha($key - 1), $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict']));
} elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) {
@@ -729,9 +739,13 @@ class ImportCsv extends ModeleImports
if (isModEnabled("socialnetworks") && strpos($fieldname, "socialnetworks") !== false) {
if (!in_array("socialnetworks", $listfields)) {
$listfields[] = "socialnetworks";
+ $socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array
+ $listvalues[$socialkey] = '';
}
+ //var_dump($newval); var_dump($arrayrecord[($key - 1)]['type']);
if (!empty($newval) && $arrayrecord[($key - 1)]['type'] > 0) {
- $socialkey = array_search("socialnetworks", $listfields);
+ $socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array
+ //var_dump('sk='.$socialkey); // socialkey=19
$socialnetwork = explode("_", $fieldname)[1];
if (empty($listvalues[$socialkey]) || $listvalues[$socialkey] == "null") {
$json = new stdClass();
@@ -833,7 +847,6 @@ class ImportCsv extends ModeleImports
if (empty($lastinsertid)) { // No insert done yet for a parent table
$sqlSelect = "SELECT ".$fname." FROM ".$tablename;
-
$data = array_combine($listfields, $listvalues);
$where = array(); // filters to forge SQL request
$filters = array(); // filters to forge output error message
diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php
index 3637ce105c1..ecf7d8b4a77 100644
--- a/htdocs/core/modules/import/import_xlsx.modules.php
+++ b/htdocs/core/modules/import/import_xlsx.modules.php
@@ -502,17 +502,28 @@ class ImportXlsx extends ModeleImports
}*/
$param_array = array('', $newval, 0, $arrayrecord[0]['val']); // Param to fetch parent from account, in chart.
}
- call_user_func_array(array($classinstance, $method), $param_array);
+
+ $result = call_user_func_array(array($classinstance, $method), $param_array);
+
+ // If duplicate record found
+ if (!($classinstance->id != '') && $result == -2) {
+ $this->errors[$error]['lib'] = $langs->trans('ErrorMultipleRecordFoundFromRef', $newval);
+ $this->errors[$error]['type'] = 'FOREIGNKEY';
+ $errorforthistable++;
+ $error++;
+ }
+
// If not found, try the fetch from label
if (!($classinstance->id != '') && $objimport->array_import_convertvalue[0][$val]['rule'] == 'fetchidfromcodeorlabel') {
$param_array = array('', '', $newval);
call_user_func_array(array($classinstance, $method), $param_array);
}
$this->cacheconvert[$file . '_' . $class . '_' . $method . '_'][$newval] = $classinstance->id;
+
//print 'We have made a '.$class.'->'.$method.' to get id from code '.$newval.'. ';
if ($classinstance->id != '') { // id may be 0, it is a found value
$newval = $classinstance->id;
- } else {
+ } elseif (! $error) {
if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) {
$this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict']));
} elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) {
@@ -770,12 +781,14 @@ class ImportXlsx extends ModeleImports
}
// Define $listfields and $listvalues to build SQL request
- if ($conf->socialnetworks->enabled && strpos($fieldname, "socialnetworks") !== false) {
+ if (isModEnabled("socialnetworks") && strpos($fieldname, "socialnetworks") !== false) {
if (!in_array("socialnetworks", $listfields)) {
$listfields[] = "socialnetworks";
+ $socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array. Example socialkey=19
+ $listvalues[$socialkey] = '';
}
if (!empty($newval) && $arrayrecord[($key)]['type'] > 0) {
- $socialkey = array_search("socialnetworks", $listfields);
+ $socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array. Example socialkey=19
$socialnetwork = explode("_", $fieldname)[1];
if (empty($listvalues[$socialkey]) || $listvalues[$socialkey] == "null") {
$json = new stdClass();
@@ -797,7 +810,7 @@ class ImportXlsx extends ModeleImports
} elseif (empty($newval) && $arrayrecord[($key)]['type'] == 0) {
$listvalues[] = "''";
} else {
- $listvalues[] = "'" . $this->db->escape($newval) . "'";
+ $listvalues[] = "'".$this->db->escape($newval)."'";
}
}
}
@@ -810,7 +823,7 @@ class ImportXlsx extends ModeleImports
if (!empty($listfields) && is_array($objimport->array_import_fieldshidden[0])) {
// Loop on each hidden fields to add them into listfields/listvalues
foreach ($objimport->array_import_fieldshidden[0] as $key => $val) {
- if (!preg_match('/^' . preg_quote($alias, '/') . '\./', $key)) {
+ if (!preg_match('/^'.preg_quote($alias, '/').'\./', $key)) {
continue; // Not a field of current table
}
if ($val == 'user->id') {
@@ -876,17 +889,17 @@ class ImportXlsx extends ModeleImports
if (!empty($updatekeys)) {
// We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields)
- $where = array();
-
if (empty($lastinsertid)) { // No insert done yet for a parent table
$sqlSelect = "SELECT ".$fname." FROM " . $tablename;
$data = array_combine($listfields, $listvalues);
- $filters = array();
+
+ $where = array(); // filters to forge SQL request
+ $filters = array(); // filters to forge output error message
foreach ($updatekeys as $key) {
$col = $objimport->array_import_updatekeys[0][$key];
$key = preg_replace('/^.*\./i', '', $key);
- if ($conf->socialnetworks->enabled && strpos($key, "socialnetworks") !== false) {
+ if (isModEnabled("socialnetworks") && strpos($key, "socialnetworks") !== false) {
$tmp = explode("_", $key);
$key = $tmp[0];
$socialnetwork = $tmp[1];
diff --git a/htdocs/core/modules/modEventOrganization.class.php b/htdocs/core/modules/modEventOrganization.class.php
index f600ef633aa..437fa691713 100644
--- a/htdocs/core/modules/modEventOrganization.class.php
+++ b/htdocs/core/modules/modEventOrganization.class.php
@@ -327,7 +327,7 @@ class modEventOrganization extends DolibarrModules
*/
public function init($options = '')
{
- global $conf, $langs;
+ global $conf, $langs, $user;
// Permissions
$this->remove($options);
@@ -370,6 +370,28 @@ class modEventOrganization extends DolibarrModules
$init = $this->_init($sql, $options);
+
+ // Insert some vars
+ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
+ $formmail = new FormMail($this->db);
+
+ $template = $formmail->getEMailTemplate($this->db, 'conferenceorbooth', $user, $langs, 0, 1, '(EventOrganizationEmailAskConf)');
+ if ($template->id > 0) {
+ dolibarr_set_const($this->db, 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF', $template->id, 'chaine', 0, '', $conf->entity);
+ }
+ $template = $formmail->getEMailTemplate($this->db, 'conferenceorbooth', $user, $langs, 0, 1, '(EventOrganizationEmailAskBooth)');
+ if ($template->id > 0) {
+ dolibarr_set_const($this->db, 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH', $template->id, 'chaine', 0, '', $conf->entity);
+ }
+ $template = $formmail->getEMailTemplate($this->db, 'conferenceorbooth', $user, $langs, 0, 1, '(EventOrganizationEmailBoothPayment)');
+ if ($template->id > 0) {
+ dolibarr_set_const($this->db, 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH', $template->id, 'chaine', 0, '', $conf->entity);
+ }
+ $template = $formmail->getEMailTemplate($this->db, 'conferenceorbooth', $user, $langs, 0, 1, '(EventOrganizationEmailRegistrationPayment)');
+ if ($template->id > 0) {
+ dolibarr_set_const($this->db, 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT', $template->id, 'chaine', 0, '', $conf->entity);
+ }
+
return $init;
}
diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
index ee4e17ae19e..8b1261f35f0 100644
--- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
+++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
@@ -943,7 +943,7 @@ class doc_generic_project_odt extends ModelePDFProjects
'title' => "ListProposalsAssociatedProject",
'class' => 'Propal',
'table' => 'propal',
- 'test' => $conf->propal->enabled && $user->rights->propale->lire
+ 'test' => $conf->propal->enabled && $user->rights->propal->lire
),
'order' => array(
'title' => "ListOrdersAssociatedProject",
diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php
index c60f2c4bb66..9947bb49b0b 100644
--- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php
+++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php
@@ -374,7 +374,7 @@ class pdf_beluga extends ModelePDFProjects
'class'=>'Propal',
'table'=>'propal',
'datefieldname'=>'datep',
- 'test'=>$conf->propal->enabled && $user->rights->propale->lire,
+ 'test'=>$conf->propal->enabled && $user->rights->propal->lire,
'lang'=>'propal'),
'order'=>array(
'name'=>"CustomersOrders",
diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php
index 5f463e44846..9d9bd226fd6 100644
--- a/htdocs/core/tpl/contacts.tpl.php
+++ b/htdocs/core/tpl/contacts.tpl.php
@@ -41,7 +41,7 @@ $module = $object->element;
// Special cases
if ($module == 'propal') {
- $permission = $user->rights->propale->creer;
+ $permission = $user->rights->propal->creer;
} elseif ($module == 'fichinter') {
$permission = $user->rights->ficheinter->creer;
} elseif ($module == 'order_supplier') {
diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php
index dfa9b0e4591..9a9c5866023 100644
--- a/htdocs/core/tpl/notes.tpl.php
+++ b/htdocs/core/tpl/notes.tpl.php
@@ -60,7 +60,7 @@ if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES)) {
// Special cases
if ($module == 'propal') {
- $permission = $user->rights->propale->creer;
+ $permission = $user->rights->propal->creer;
} elseif ($module == 'supplier_proposal') {
$permission = $user->rights->supplier_proposal->creer;
} elseif ($module == 'fichinter') {
diff --git a/htdocs/core/tpl/object_discounts.tpl.php b/htdocs/core/tpl/object_discounts.tpl.php
index 4373f09fdb7..0770233c782 100644
--- a/htdocs/core/tpl/object_discounts.tpl.php
+++ b/htdocs/core/tpl/object_discounts.tpl.php
@@ -54,7 +54,7 @@ if ($fixedDiscount > 0) {
print $langs->trans($translationKey, $fixedDiscount).'.';
} else {
$translationKey = (!empty($discount_type)) ? 'HasNoRelativeDiscountFromSupplier' : 'CompanyHasNoRelativeDiscount';
- print ''.$langs->trans($translationKey).'. ';
+ print ''.$langs->trans($translationKey).'. ';
}
if ($isNewObject) {
print ' ('.$addrelativediscount.')';
@@ -115,7 +115,7 @@ if ($absolute_creditnote > 0) {
if ($absolute_discount <= 0 && $absolute_creditnote <= 0) {
$translationKey = !empty($discount_type) ? 'HasNoAbsoluteDiscountFromSupplier' : 'CompanyHasNoAbsoluteDiscount';
- print ''.$langs->trans($translationKey).'. ';
+ print ''.$langs->trans($translationKey).'. ';
if ($isInvoice && $object->statut == $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_CREDIT_NOTE && $object->type != $objclassname::TYPE_DEPOSIT) {
print ' ('.$addabsolutediscount.')';
diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php
index 87a054c699f..5de627a9a9a 100644
--- a/htdocs/cron/card.php
+++ b/htdocs/cron/card.php
@@ -473,6 +473,16 @@ if (($action == "create") || ($action == "edit")) {
}
$input .= "".$langs->trans('Weeks')." ";
print $input;
+
+ $input = " unitfrequency == "2678400") {
+ $input .= ' checked />';
+ } else {
+ $input .= ' />';
+ }
+ $input .= "".$langs->trans('Monthly')." ";
+ print $input;
+
print " ";
print "";
print " ";
@@ -664,6 +674,9 @@ if (($action == "create") || ($action == "edit")) {
if ($object->unitfrequency == "604800") {
print $langs->trans('CronEach')." ".($object->frequency)." ".$langs->trans('Weeks');
}
+ if ($object->unitfrequency == "2678400") {
+ print $langs->trans('CronEach')." ".($object->frequency)." ".$langs->trans('Month');
+ }
print "";
print '';
diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php
index db48c0e7fce..8f4b32ae502 100644
--- a/htdocs/cron/class/cronjob.class.php
+++ b/htdocs/cron/class/cronjob.class.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2007-2022 Laurent Destailleur
* Copyright (C) 2013 Florian Henry
*
* This program is free software; you can redistribute it and/or modify
@@ -23,6 +23,7 @@
// Put here all includes required by your class file
require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php";
/**
@@ -1408,21 +1409,30 @@ class Cronjob extends CommonObject
if (empty($this->datenextrun)) {
if (empty($this->datestart)) {
- $this->datenextrun = $now + ($this->frequency * $this->unitfrequency);
+ if ($this->unitfrequency == 2678400) {
+ $this->datenextrun = dol_time_plus_duree($now, $this->frequency, 'm');
+ } else {
+ $this->datenextrun = $now + ($this->frequency * $this->unitfrequency);
+ }
} else {
- $this->datenextrun = $this->datestart + ($this->frequency * $this->unitfrequency);
+ if ($this->unitfrequency == 2678400) {
+ $this->datenextrun = dol_time_plus_duree($this->datestart, $this->frequency, 'm');
+ } else {
+ $this->datenextrun = $this->datestart + ($this->frequency * $this->unitfrequency);
+ }
}
}
if ($this->datenextrun < $now && $this->frequency > 0 && $this->unitfrequency > 0) {
// Loop until date is after future
while ($this->datenextrun < $now) {
- $this->datenextrun += ($this->frequency * $this->unitfrequency);
-
- // TODO For exact frequency (every month, every year, ...), use instead a dol_time_plus_duree($time, $duration_value, $duration_unit)
+ if ($this->unitfrequency == 2678400) {
+ $this->datenextrun = dol_time_plus_duree($this->datenextrun, $this->frequency, 'm');
+ } else {
+ $this->datenextrun += ($this->frequency * $this->unitfrequency);
+ }
}
} else {
- //$this->datenextrun=$this->datenextrun + ($this->frequency * $this->unitfrequency);
dol_syslog(get_class($this)."::reprogram_jobs datenextrun is already in future, we do not change it");
}
diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php
index 44152f0c68b..fb76767bf1e 100644
--- a/htdocs/datapolicy/class/datapolicycron.class.php
+++ b/htdocs/datapolicy/class/datapolicycron.class.php
@@ -451,8 +451,8 @@ class DataPolicyCron
$this->db->begin();
foreach ($arrayofparameters as $key => $params) {
- if ($conf->global->$key != '' && is_numeric($conf->global->$key) && (int) $conf->global->$key > 0) {
- $sql = sprintf($params['sql'], (int) $conf->entity, (int) $conf->global->$key, (int) $conf->global->$key);
+ if (getDolGlobalInt($key) > 0) {
+ $sql = sprintf($params['sql'], (int) $conf->entity, (int) getDolGlobalInt($key), (int) getDolGlobalInt($key));
$resql = $this->db->query($sql);
diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
index 222a0c78946..909758ca3f2 100644
--- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php
+++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
@@ -103,12 +103,13 @@ class ConferenceOrBoothAttendee extends CommonObject
public $fields = array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"),
- 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'),
+ 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>15, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'),
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'),
'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'autofocusoncreate'=>1, 'searchall'=>1),
'firstname' => array('type'=>'varchar(100)', 'label'=>'Firstname', 'enabled'=>'1', 'position'=>31, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1),
'lastname' => array('type'=>'varchar(100)', 'label'=>'Lastname', 'enabled'=>'1', 'position'=>32, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status = 1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'position'=>40, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"OrganizationEventLinkToThirdParty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'),
+ 'email_company' => array('type'=>'mail', 'label'=>'EmailCompany', 'enabled'=>'1', 'position'=>41, 'notnull'=>0, 'visible'=>-2, 'searchall'=>1),
'date_subscription' => array('type'=>'datetime', 'label'=>'DateOfRegistration', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1, 'showoncombobox'=>'1',),
'fk_invoice' => array('type'=>'integer:Facture:compta/facture/class/facture.class.php', 'label'=>'Invoice', 'enabled'=>'$conf->facture->enabled', 'position'=>57, 'notnull'=>0, 'visible'=>-1, 'index'=>0, 'picto'=>'bill', 'css'=>'tdoverflowmax150 maxwidth500'),
'amount' => array('type'=>'price', 'label'=>'AmountPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfSubscriptionPaid",),
@@ -125,11 +126,13 @@ class ConferenceOrBoothAttendee extends CommonObject
);
public $rowid;
public $ref;
- public $fk_soc;
public $fk_actioncomm;
+ public $fk_project;
public $email;
public $firstname;
public $lastname;
+ public $fk_soc;
+ public $email_company;
public $date_subscription;
public $fk_invoice;
public $amount;
diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php
index cbaab666767..174196a23a5 100644
--- a/htdocs/fichinter/list.php
+++ b/htdocs/fichinter/list.php
@@ -126,8 +126,8 @@ $arrayfields = array(
'f.description'=>array('label'=>'Description', 'checked'=>1),
'f.datec'=>array('label'=>'DateCreation', 'checked'=>0, 'position'=>500),
'f.tms'=>array('label'=>'DateModificationShort', 'checked'=>0, 'position'=>500),
- 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))),
- 'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES))),
+ 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))),
+ 'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))),
'f.fk_statut'=>array('label'=>'Status', 'checked'=>1, 'position'=>1000),
'fd.description'=>array('label'=>"DescriptionOfLine", 'checked'=>1, 'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS) ? 1 : 0),
'fd.date'=>array('label'=>'DateOfLine', 'checked'=>1, 'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS) ? 1 : 0),
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index 208a184bca2..e0434378573 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -196,8 +196,8 @@ $arrayfields = array(
'country.code_iso'=>array('label'=>"Country", 'enabled'=>1, 'position'=>49),
'typent.code'=>array('label'=>"ThirdPartyType", 'enabled'=>$checkedtypetiers, 'position'=>50),
'u.login'=>array('label'=>"AuthorRequest", 'enabled'=>1, 'position'=>51),
- 'cf.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>100),
- 'cf.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>110),
+ 'cf.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position'=>100),
+ 'cf.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position'=>110),
);
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 6dbe069be25..44337454772 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -3019,7 +3019,7 @@ if ($action == 'create') {
print $langs->trans('PaymentConditions');
print '';
if ($action != 'editconditions' && $form_permission) {
- print ' id.'">'.img_edit($langs->trans('SetConditions'), 1).' ';
+ print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).' ';
}
print ' ';
print '';
@@ -3154,7 +3154,7 @@ if ($action == 'create') {
if (isModEnabled('intracommreport')) {
$langs->loadLangs(array("intracommreport"));
print ' ';
- print '';
+ print '';
print $langs->trans('IntracommReportTransportMode');
print ' ';
if ($action != 'editmode' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) {
@@ -3300,7 +3300,7 @@ if ($action == 'create') {
$i = 0;
print '';
- print '
';
+ print '';
print '';
print ''.($object->type == FactureFournisseur::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).' ';
print ''.$langs->trans('Date').' ';
@@ -3326,7 +3326,7 @@ if ($action == 'create') {
$paymentstatic->type_label = $objp->payment_type;
print ' ';
- print '';
+ print ' ';
print $paymentstatic->getNomUrl(1);
print ' ';
print ''.dol_print_date($db->jdate($objp->dp), 'day').' ';
@@ -3784,21 +3784,26 @@ if ($action == 'create') {
// Delete
$isErasable = $object->is_erasable();
- if ($action != 'confirm_edit' && ($user->rights->fournisseur->facture->supprimer || ($usercancreate && $isErasable == 1))) { // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions)
- //var_dump($isErasable);
+ if ($action != 'confirm_edit' && ($usercandelete || ($usercancreate && $isErasable == 1))) { // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions)
+ $enableDelete = false;
+ $htmltooltip = '';
+ $params = (empty($conf->use_javascript_ajax) ? array() : array('attr' => array('class' => 'reposition')));
+ //var_dump($isErasable); var_dump($params);
if ($isErasable == -4) {
- print ''.$langs->trans('Delete').' ';
+ $htmltooltip = $langs->trans("DisabledBecausePayments");
} elseif ($isErasable == -3) { // Should never happen with supplier invoice
- print ''.$langs->trans('Delete').' ';
+ $htmltooltip = $langs->trans("DisabledBecauseNotLastSituationInvoice");
} elseif ($isErasable == -2) { // Should never happen with supplier invoice
- print ''.$langs->trans('Delete').' ';
+ $htmltooltip = $langs->trans("DisabledBecauseNotLastInvoice");
} elseif ($isErasable == -1) {
- print ''.$langs->trans('Delete').' ';
+ $htmltooltip = $langs->trans("DisabledBecauseDispatchedInBookkeeping");
} elseif ($isErasable <= 0) { // Any other cases
- print ''.$langs->trans('Delete').' ';
+ $htmltooltip = $langs->trans("DisabledBecauseNotErasable");
} else {
- print 'id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' ';
+ $enableDelete = true;
+ $htmltooltip = '';
}
+ print dolGetButtonAction($htmltooltip, $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), $object->id, $enableDelete, $params);
}
print '';
diff --git a/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php b/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php
index 60bb56ff173..81e3f9f2155 100644
--- a/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php
+++ b/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php
@@ -43,7 +43,7 @@ $value_private .= "\n";
/*
// Special cases
if ($module == 'propal') {
-$permission = $user->rights->propale->creer;
+$permission = $user->rights->propal->creer;
} elseif ($module == 'supplier_proposal') {
$permission = $user->rights->supplier_proposal->creer;
} elseif ($module == 'fichinter') {
diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql
index bce46a70e49..d2886631942 100644
--- a/htdocs/install/mysql/data/llx_c_email_templates.sql
+++ b/htdocs/install/mysql/data/llx_c_email_templates.sql
@@ -21,25 +21,26 @@
--
-- Bank Thirdparty
-INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,'$conf->societe->enabled && $conf->banque->enabled && $conf->prelevement->enabled',0,'__(YourSEPAMandate)__','__(Hello)__, \n\n__(FindYourSEPAMandate)__ : \n__MYCOMPANY_NAME__ \n__MYCOMPANY_FULLADDRESS__ \n__(Sincerely)__ \n__USER_SIGNATURE__',null, 0);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,'isModEnabled("societe") && isModEnabled("banque") && isModEnabled("prelevement")',0,'__(YourSEPAMandate)__','__(Hello)__, \n\n__(FindYourSEPAMandate)__ : \n__MYCOMPANY_NAME__ \n__MYCOMPANY_FULLADDRESS__ \n__(Sincerely)__ \n__USER_SIGNATURE__',null, 0);
-- Members
-INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__ \n __ONLINE_PAYMENT_TEXT_AND_URL__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0);
-INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfYourMembershipWasValidated)__ __(FirstName)__ : __MEMBER_FIRSTNAME__ __(LastName)__ : __MEMBER_LASTNAME__ __(ID)__ : __MEMBER_ID__ \n __ONLINE_PAYMENT_TEXT_AND_URL__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0);
-INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__ \n\n \n__(Sincerely)__ __USER_SIGNATURE__',null, 1);
-INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfSubscriptionReminderEmail)__ \n __ONLINE_PAYMENT_TEXT_AND_URL__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0);
-INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(YourMembershipWasCanceled)__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0);
-INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__, \n\n__(ThisIsContentOfYourCard)__ \n__(ID)__ : __ID__ \n__(Civility)__ : __MEMBER_CIVILITY__ \n__(Firstname)__ : __MEMBER_FIRSTNAME__ \n__(Lastname)__ : __MEMBER_LASTNAME__ \n__(Fullname)__ : __MEMBER_FULLNAME__ \n__(Company)__ : __MEMBER_COMPANY__ \n__(Address)__ : __MEMBER_ADDRESS__ \n__(Zip)__ : __MEMBER_ZIP__ \n__(Town)__ : __MEMBER_TOWN__ \n__(Country)__ : __MEMBER_COUNTRY__ \n__(Email)__ : __MEMBER_EMAIL__ \n__(Birthday)__ : __MEMBER_BIRTH__ \n__(Photo)__ : __MEMBER_PHOTO__ \n__(Login)__ : __MEMBER_LOGIN__ \n__(Phone)__ : __MEMBER_PHONE__ \n__(PhonePerso)__ : __MEMBER_PHONEPRO__ \n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__ \n__(Sincerely)__ __USER_SIGNATURE__',null, 0);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__ \n __ONLINE_PAYMENT_TEXT_AND_URL__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfYourMembershipWasValidated)__ __(FirstName)__ : __MEMBER_FIRSTNAME__ __(LastName)__ : __MEMBER_LASTNAME__ __(ID)__ : __MEMBER_ID__ \n __ONLINE_PAYMENT_TEXT_AND_URL__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__ \n\n \n__(Sincerely)__ __USER_SIGNATURE__',null, 1);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfSubscriptionReminderEmail)__ \n __ONLINE_PAYMENT_TEXT_AND_URL__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(YourMembershipWasCanceled)__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__, \n\n__(ThisIsContentOfYourCard)__ \n__(ID)__ : __ID__ \n__(Civility)__ : __MEMBER_CIVILITY__ \n__(Firstname)__ : __MEMBER_FIRSTNAME__ \n__(Lastname)__ : __MEMBER_LASTNAME__ \n__(Fullname)__ : __MEMBER_FULLNAME__ \n__(Company)__ : __MEMBER_COMPANY__ \n__(Address)__ : __MEMBER_ADDRESS__ \n__(Zip)__ : __MEMBER_ZIP__ \n__(Town)__ : __MEMBER_TOWN__ \n__(Country)__ : __MEMBER_COUNTRY__ \n__(Email)__ : __MEMBER_EMAIL__ \n__(Birthday)__ : __MEMBER_BIRTH__ \n__(Photo)__ : __MEMBER_PHOTO__ \n__(Login)__ : __MEMBER_LOGIN__ \n__(Phone)__ : __MEMBER_PHONE__ \n__(PhonePerso)__ : __MEMBER_PHONEPRO__ \n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__ \n__(Sincerely)__ __USER_SIGNATURE__',null, 0);
-- Recruiting
-INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__, \n\n__(YourCandidatureAnswerMessage)__ __ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'isModEnabled("recruitment")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__, \n\n__(YourCandidatureAnswerMessage)__ __ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0);
-- Event organization
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__, __(OrganizationEventConfRequestWasReceived)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskBooth)', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__, __(OrganizationEventBoothRequestWasReceived)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
-- TODO Add message for registration only to event __ONLINE_PAYMENT_TEXT_AND_URL__
-INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsBooth)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailBoothPayment)__', '__(Hello)__, __(OrganizationEventPaymentOfBoothWasReceived)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
-INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsEvent)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailRegistrationPayment)__', '__(Hello)__, __(OrganizationEventPaymentOfRegistrationWasReceived)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailBoothPayment)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailBoothPayment)__', '__(Hello)__, __(OrganizationEventPaymentOfBoothWasReceived)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailRegistrationPayment)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailRegistrationPayment)__', '__(Hello)__, __(OrganizationEventPaymentOfRegistrationWasReceived)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
+--
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__, __(OrganizationEventBulkMailToAttendees)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__, __(OrganizationEventBulkMailToSpeakers)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
index acbcbf7b0d3..60803396be3 100644
--- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
+++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql
@@ -737,3 +737,34 @@ ALTER TABLE llx_loan_schedule ADD UNIQUE INDEX uk_loan_schedule_ref (fk_loan, da
-- We need when upgrade 15 to 16 with Dolibarr v17+ for upgrade2 function migrate_user_photospath2()
ALTER TABLE llx_user CHANGE COLUMN note note_private text;
+
+
+-- Bank Thirdparty
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,'isModEnabled("societe") && isModEnabled("banque") && isModEnabled("prelevement")',0,'__(YourSEPAMandate)__','__(Hello)__, \n\n__(FindYourSEPAMandate)__ : \n__MYCOMPANY_NAME__ \n__MYCOMPANY_FULLADDRESS__ \n__(Sincerely)__ \n__USER_SIGNATURE__',null, 0);
+
+-- Members
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__ \n __ONLINE_PAYMENT_TEXT_AND_URL__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfYourMembershipWasValidated)__ __(FirstName)__ : __MEMBER_FIRSTNAME__ __(LastName)__ : __MEMBER_LASTNAME__ __(ID)__ : __MEMBER_ID__ \n __ONLINE_PAYMENT_TEXT_AND_URL__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__ \n\n \n__(Sincerely)__ __USER_SIGNATURE__',null, 1);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(ThisIsContentOfSubscriptionReminderEmail)__ \n __ONLINE_PAYMENT_TEXT_AND_URL__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__, \n\n__(YourMembershipWasCanceled)__ \n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__, \n\n__(ThisIsContentOfYourCard)__ \n__(ID)__ : __ID__ \n__(Civility)__ : __MEMBER_CIVILITY__ \n__(Firstname)__ : __MEMBER_FIRSTNAME__ \n__(Lastname)__ : __MEMBER_LASTNAME__ \n__(Fullname)__ : __MEMBER_FULLNAME__ \n__(Company)__ : __MEMBER_COMPANY__ \n__(Address)__ : __MEMBER_ADDRESS__ \n__(Zip)__ : __MEMBER_ZIP__ \n__(Town)__ : __MEMBER_TOWN__ \n__(Country)__ : __MEMBER_COUNTRY__ \n__(Email)__ : __MEMBER_EMAIL__ \n__(Birthday)__ : __MEMBER_BIRTH__ \n__(Photo)__ : __MEMBER_PHOTO__ \n__(Login)__ : __MEMBER_LOGIN__ \n__(Phone)__ : __MEMBER_PHONE__ \n__(PhonePerso)__ : __MEMBER_PHONEPRO__ \n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__ \n__(Sincerely)__ __USER_SIGNATURE__',null, 0);
+
+-- Recruiting
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'isModEnabled("recruitment")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__, \n\n__(YourCandidatureAnswerMessage)__ __ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n \n__(Sincerely)__ __USER_SIGNATURE__',null, 0);
+
+-- Event organization
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__, __(OrganizationEventConfRequestWasReceived)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskBooth)', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__, __(OrganizationEventBoothRequestWasReceived)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
+-- TODO Add message for registration only to event __ONLINE_PAYMENT_TEXT_AND_URL__
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailBoothPayment)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailBoothPayment)__', '__(Hello)__, __(OrganizationEventPaymentOfBoothWasReceived)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailRegistrationPayment)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailRegistrationPayment)__', '__(Hello)__, __(OrganizationEventPaymentOfRegistrationWasReceived)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
+--
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__, __(OrganizationEventBulkMailToAttendees)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__, __(OrganizationEventBulkMailToSpeakers)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
+
+-- Partnership
+INSERT INTO llx_c_email_templates (entity, module, type_template, label, lang, position, topic, joinfiles, content) VALUES (0, 'partnership', 'partnership_send', '(SendingEmailOnPartnershipWillSoonBeCanceled)', '', 100, '[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipWillSoonBeCanceledTopic)__', 0, '\n __(Hello)__, \n__(YourPartnershipWillSoonBeCanceledContent)__
\n \n\n \n\n __(Sincerely)__ \n __[MAIN_INFO_SOCIETE_NOM]__ \n \n');
+INSERT INTO llx_c_email_templates (entity, module, type_template, label, lang, position, topic, joinfiles, content) VALUES (0, 'partnership', 'partnership_send', '(SendingEmailOnPartnershipCanceled)', '', 100, '[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipCanceledTopic)__', 0, '\n __(Hello)__, \n__(YourPartnershipCanceledContent)__
\n \n\n \n\n __(Sincerely)__ \n __[MAIN_INFO_SOCIETE_NOM]__ \n \n');
+INSERT INTO llx_c_email_templates (entity, module, type_template, label, lang, position, topic, joinfiles, content) VALUES (0, 'partnership', 'partnership_send', '(SendingEmailOnPartnershipRefused)', '', 100, '[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipRefusedTopic)__', 0, '\n __(Hello)__, \n__(YourPartnershipRefusedContent)__
\n \n\n \n\n __(Sincerely)__ \n __[MAIN_INFO_SOCIETE_NOM]__ \n \n');
+INSERT INTO llx_c_email_templates (entity, module, type_template, label, lang, position, topic, joinfiles, content) VALUES (0, 'partnership', 'partnership_send', '(SendingEmailOnPartnershipAccepted)', '', 100, '[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipAcceptedTopic)__', 0, '\n __(Hello)__, \n__(YourPartnershipAcceptedContent)__
\n \n\n \n\n __(Sincerely)__ \n __[MAIN_INFO_SOCIETE_NOM]__ \n \n');
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index b26761b3a49..ba92fc4f8a1 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -2329,4 +2329,6 @@ HelpCssOnViewDesc=The Css used when viewing the field.
HelpCssOnListDesc=The Css used when field is inside a list table. Example: "tdoverflowmax200"
RECEPTION_PDF_HIDE_ORDERED=Hide the quantity ordered on the generated documents for receptions
MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT=Show the price on the generated documents for receptions
-WarningDisabled=Warning disabled
\ No newline at end of file
+WarningDisabled=Warning disabled
+LimitsAndMitigation=Access limits and mitigation
+
\ No newline at end of file
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index 7ea8295a346..f13baf06446 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -13,6 +13,7 @@ BillsStatistics=Customers invoices statistics
BillsStatisticsSuppliers=Vendors invoices statistics
DisabledBecauseDispatchedInBookkeeping=Disabled because invoice was dispatched into bookkeeping
DisabledBecauseNotLastInvoice=Disabled because invoice is not erasable. Some invoices were recorded after this one and it will create holes in the counter.
+DisabledBecauseNotLastSituationInvoice=Disabled because invoice is not erasable. This invoice is not the last one in situation invoice cycle.
DisabledBecauseNotErasable=Disabled because cannot be erased
InvoiceStandard=Standard invoice
InvoiceStandardAsk=Standard invoice
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index 6ff5a63196a..860ae75e604 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -97,6 +97,7 @@ ErrorWrongValueForField=Field %s : '%s ' does not match regex rule <
ErrorHtmlInjectionForField=Field %s : The value '%s ' contains a malicious data not allowed
ErrorFieldValueNotIn=Field %s : '%s ' is not a value found in field %s of %s
ErrorFieldRefNotIn=Field %s : '%s ' is not a %s existing ref
+ErrorMultipleRecordFoundFromRef=Several record found when searching from ref %s . No way to know which ID to use.
ErrorsOnXLines=%s errors found
ErrorFileIsInfectedWithAVirus=The antivirus program was not able to validate the file (file might be infected by a virus)
ErrorNumRefModel=A reference exists into database (%s) and is not compatible with this numbering rule. Remove record or renamed reference to activate this module.
@@ -299,6 +300,7 @@ ErrorCharPlusNotSupportedByImapForSearch=IMAP search is not able to search into
ErrorTableNotFound=Table %s not found
ErrorValueForTooLow=Value for %s is too low
ErrorValueCantBeNull=Value for %s can't be null
+ErrorDateOfMovementLowerThanDateOfFileTransmission=The date of the bank transaction can't be lower than the date of the file transmission
# Warnings
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang
index 78378c6c5d3..b6368a7d374 100644
--- a/htdocs/langs/en_US/languages.lang
+++ b/htdocs/langs/en_US/languages.lang
@@ -36,6 +36,7 @@ Language_en_SA=English (Saudi Arabia)
Language_en_SG=English (Singapore)
Language_en_US=English (United States)
Language_en_ZA=English (South Africa)
+Language_en_ZW=English (Zimbabwe)
Language_es_ES=Spanish
Language_es_AR=Spanish (Argentina)
Language_es_BO=Spanish (Bolivia)
diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang
index bf2dabf5a0a..fa2ed9669d9 100644
--- a/htdocs/langs/en_US/products.lang
+++ b/htdocs/langs/en_US/products.lang
@@ -399,7 +399,7 @@ ActionAvailableOnVariantProductOnly=Action only available on the variant of prod
ProductsPricePerCustomer=Product prices per customers
ProductSupplierExtraFields=Additional Attributes (Supplier Prices)
DeleteLinkedProduct=Delete the child product linked to the combination
-AmountUsedToUpdateWAP=Amount to use to update the Weighted Average Price
+AmountUsedToUpdateWAP=Unit amount to use to update the Weighted Average Price
PMPValue=Weighted average price
PMPValueShort=WAP
mandatoryperiod=Mandatory periods
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index b11ed9a6158..dcf9bb7d96d 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -2469,7 +2469,7 @@ function printDropdownQuickadd()
"title" => "NewPropal@propal",
"name" => "Proposal@propal",
"picto" => "object_propal",
- "activation" => isModEnabled("propal") && $user->hasRight("propale", "write"), // vs hooking
+ "activation" => isModEnabled("propal") && $user->hasRight("propal", "write"), // vs hooking
"position" => 30,
),
diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php
index e247b5fabb5..705dc202932 100644
--- a/htdocs/modulebuilder/index.php
+++ b/htdocs/modulebuilder/index.php
@@ -1780,7 +1780,7 @@ if ($dirins && $action == 'generatepackage') {
dol_mkdir($dirofmodule);
}
// Note: We exclude /bin/ to not include the already generated zip
- $result = dol_compress_dir($dir, $outputfilezip, 'zip', '/\/bin\//', $modulelowercase);
+ $result = dol_compress_dir($dir, $outputfilezip, 'zip', '/\/bin\/|\.git/', $modulelowercase);
} else {
$result = -1;
}
diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php
index 7f0cc15f873..f7a6ed88571 100644
--- a/htdocs/mrp/mo_list.php
+++ b/htdocs/mrp/mo_list.php
@@ -84,7 +84,7 @@ if (!$sortorder) {
}
// Initialize array of search criterias
-$search_all = GETPOST('search_all', 'alphanohtml');
+$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
$search = array();
foreach ($object->fields as $key => $val) {
if (GETPOST('search_'.$key, 'alpha') !== '') {
@@ -230,8 +230,8 @@ $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
}
-$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_production lineparent ON t.fk_parent_line = lineparent.rowid";
-$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_mo moparent ON lineparent.fk_mo = moparent.rowid";
+$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_production as lineparent ON t.fk_parent_line = lineparent.rowid";
+$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_mo as moparent ON lineparent.fk_mo = moparent.rowid";
// Add table from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
@@ -266,17 +266,17 @@ foreach ($search as $key => $val) {
$mode_search = 2;
}
if ($search[$key] != '') {
- $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search));
+ $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
}
} else {
if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
$columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
if (preg_match('/_dtstart$/', $key)) {
- $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'";
+ $sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'";
}
if (preg_match('/_dtend$/', $key)) {
- $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'";
+ $sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'";
}
}
}
diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php
index 24b3516684e..64ae11909ef 100644
--- a/htdocs/mrp/mo_production.php
+++ b/htdocs/mrp/mo_production.php
@@ -814,6 +814,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Lines to consume
+ $bomcostupdated = 0; // We will recalculate the unitary cost to produce a product using the real "products to consume into MO"
+
if (!empty($object->lines)) {
$nblinetoconsume = 0;
foreach ($object->lines as $line) {
@@ -832,7 +834,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$linecost = price2num($tmpproduct->pmp, 'MT');
if ($object->qty > 0) {
- // add free consume line cost to bomcost
+ // add free consume line cost to $bomcostupdated
$costprice = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp);
if (empty($costprice)) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
@@ -843,12 +845,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$costprice = 0;
}
}
- $linecost = price2num(($line->qty * $costprice) / $object->qty, 'MT');
- $bomcost += $linecost;
+ $linecost = price2num(($line->qty * $costprice) / $object->qty, 'MT'); // price for line for all quantities
+ $bomcostupdated += price2num(($line->qty * $costprice) / $object->qty, 'MU'); // same but with full accuracy
}
- $bomcost = price2num($bomcost, 'MU');
-
+ $bomcostupdated = price2num($bomcostupdated, 'MU');
$arrayoflines = $object->fetchLinesLinked('consumed', $line->id);
$alreadyconsumed = 0;
foreach ($arrayoflines as $line2) {
@@ -1136,7 +1137,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print ''.$langs->trans("Product").' ';
print ''.$langs->trans("Qty").' ';
if ($permissiontoupdatecost) {
- if (empty($bomcost)) {
+ if (empty($bomcostupdated)) {
print ''.$form->textwithpicto($langs->trans("UnitCost"), $langs->trans("AmountUsedToUpdateWAP")).' ';
} else {
print ''.$form->textwithpicto($langs->trans("ManufacturingPrice"), $langs->trans("AmountUsedToUpdateWAP")).' ';
@@ -1230,17 +1231,25 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($permissiontoupdatecost) {
// Defined $manufacturingcost
$manufacturingcost = 0;
- if ($object->mrptype == 0) { // If MO is a "Manufacture" type (and not "Disassemble"
- $manufacturingcost = $bomcost;
+ $manufacturingcostsrc = '';
+ if ($object->mrptype == 0) { // If MO is a "Manufacture" type (and not "Disassemble")
+ $manufacturingcost = $bomcostupdated;
+ $manufacturingcostsrc = $langs->trans("CalculatedFromProductsToConsume");
+ if (empty($manufacturingcost)) {
+ $manufacturingcost = $bomcost;
+ $manufacturingcostsrc = $langs->trans("ValueFromBom");
+ }
if (empty($manufacturingcost)) {
$manufacturingcost = price2num($tmpproduct->cost_price, 'MU');
+ $manufacturingcostsrc = $langs->trans("CostPrice");
}
if (empty($manufacturingcost)) {
$manufacturingcost = price2num($tmpproduct->pmp, 'MU');
+ $manufacturingcostsrc = $langs->trans("PMPValue");
}
}
- print '';
+ print ' ';
if ($manufacturingcost) {
print price($manufacturingcost);
}
@@ -1344,19 +1353,27 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($permissiontoupdatecost) {
// Defined $manufacturingcost
$manufacturingcost = 0;
- if ($object->mrptype == 0) { // If MO is a "Manufacture" type (and not "Disassemble"
- $manufacturingcost = $bomcost;
+ $manufacturingcostsrc = '';
+ if ($object->mrptype == 0) { // If MO is a "Manufacture" type (and not "Disassemble")
+ $manufacturingcost = $bomcostupdated;
+ $manufacturingcostsrc = $langs->trans("CalculatedFromProductsToConsume");
+ if (empty($manufacturingcost)) {
+ $manufacturingcost = $bomcost;
+ $manufacturingcostsrc = $langs->trans("ValueFromBom");
+ }
if (empty($manufacturingcost)) {
$manufacturingcost = price2num($tmpproduct->cost_price, 'MU');
+ $manufacturingcostsrc = $langs->trans("CostPrice");
}
if (empty($manufacturingcost)) {
$manufacturingcost = price2num($tmpproduct->pmp, 'MU');
+ $manufacturingcostsrc = $langs->trans("PMPValue");
}
}
if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
$preselected = (GETPOSTISSET('pricetoproduce-'.$line->id.'-'.$i) ? GETPOST('pricetoproduce-'.$line->id.'-'.$i) : ($manufacturingcost ? price($manufacturingcost) : ''));
- print ' ';
+ print ' ';
} else {
print ' ';
}
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 2071171feba..8eac47207cd 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -2831,7 +2831,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action ==
//print '';
// Propals
- if (isModEnabled("propal") && $user->rights->propale->creer) {
+ if (isModEnabled("propal") && $user->rights->propal->creer) {
$propal = new Propal($db);
$langs->load("propal");
diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php
index a2bcceab0e5..b0d06f15701 100644
--- a/htdocs/product/stats/card.php
+++ b/htdocs/product/stats/card.php
@@ -440,7 +440,7 @@ if ($result || !($id > 0)) {
continue;
}
- if ($graphfiles == 'propal' && !$user->rights->propale->lire) {
+ if ($graphfiles == 'propal' && !$user->rights->propal->lire) {
continue;
}
if ($graphfiles == 'order' && !$user->rights->commande->lire) {
diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php
index 4919ffdba84..b70d2e08161 100644
--- a/htdocs/product/stats/propal.php
+++ b/htdocs/product/stats/propal.php
@@ -138,7 +138,7 @@ if ($id > 0 || !empty($ref)) {
print dol_get_fiche_end();
- if ($user->rights->propale->lire) {
+ if ($user->rights->propal->lire) {
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, d.total_ht as amount,";
$sql .= " p.ref_client,";
$sql .= "p.datep, p.fk_statut as statut, d.rowid, d.qty";
diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php
index 538fc6aa362..50b17b0ac06 100644
--- a/htdocs/product/stats/supplier_proposal.php
+++ b/htdocs/product/stats/supplier_proposal.php
@@ -137,7 +137,7 @@ if ($id > 0 || !empty($ref)) {
print dol_get_fiche_end();
- if ($user->rights->propale->lire) {
+ if ($user->rights->propal->lire) {
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, d.total_ht as amount,";
//$sql .= " p.ref_supplier,";
$sql .= "p.date_valid, p.fk_statut as statut, d.rowid, d.qty";
diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php
index 40181167baa..69ae5eda5e0 100644
--- a/htdocs/product/stock/tpl/stockcorrection.tpl.php
+++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php
@@ -109,7 +109,7 @@ if ($object->element == 'product') {
if (empty($ident) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) {
$ident = $conf->global->MAIN_DEFAULT_WAREHOUSE;
}
- print img_picto('', 'stock').$formproduct->selectWarehouses($ident, 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100');
+ print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($ident, 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100 maxwidth300 widthcentpercentminusx');
print '';
}
if ($object->element == 'stock') {
@@ -155,10 +155,11 @@ if (ismodEnabled('productbatch') &&
print ' ';
print ' ';
} else {
- print ' ';
+ print img_picto('', 'barcode', 'class="pictofixedwidth"').' ';
}
print '';
print '
';
+
print '';
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print ''.$langs->trans("SellByDate").' ';
diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php
index 819fa404d52..7d08f2014a0 100644
--- a/htdocs/product/stock/tpl/stocktransfer.tpl.php
+++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php
@@ -104,7 +104,7 @@ if (isModEnabled('productbatch') &&
print ' ';
print ' ';
} else {
- print ' ';
+ print img_picto('', 'barcode', 'class="pictofixedwidth"').' ';
}
print ' ';
print ' ';
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index 01ffe38cc0d..346382c6294 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -388,7 +388,7 @@ $listofreferent = array(
'lang'=>'propal',
'buttonnew'=>'AddProp',
'testnew'=>$user->rights->propal->creer,
- 'test'=>$conf->propal->enabled && $user->rights->propale->lire),
+ 'test'=>$conf->propal->enabled && $user->rights->propal->lire),
'order'=>array(
'name'=>"CustomersOrders",
'title'=>"ListOrdersAssociatedProject",
diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php
index 29adb2947d0..2504260cbc5 100644
--- a/htdocs/public/payment/paymentko.php
+++ b/htdocs/public/payment/paymentko.php
@@ -136,6 +136,10 @@ foreach ($_POST as $k => $v) {
dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment');
+// Set $appli for emails title
+$appli = $mysoc->name;
+
+
if (!empty($_SESSION['ipaddress'])) { // To avoid to make action twice
// Get on url call
$fulltag = $FULLTAG;
@@ -173,21 +177,6 @@ if (!empty($_SESSION['ipaddress'])) { // To avoid to make action twice
$from = $conf->global->MAILING_EMAIL_FROM;
$sendto = $sendemail;
- // Define link to login card
- $appli = constant('DOL_APPLICATION_TITLE');
- if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
- $appli = $conf->global->MAIN_APPLICATION_TITLE;
- if (preg_match('/\d\.\d/', $appli)) {
- if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
- $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
- }
- } else {
- $appli .= " ".DOL_VERSION;
- }
- } else {
- $appli .= " ".DOL_VERSION;
- }
-
$urlback = $_SERVER["REQUEST_URI"];
$topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("NewOnlinePaymentFailed");
$content = "";
diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php
index 4d1336351b3..c56732f5938 100644
--- a/htdocs/public/payment/paymentok.php
+++ b/htdocs/public/payment/paymentok.php
@@ -1266,7 +1266,7 @@ if ($ispaymentok) {
$thirdparty = new Societe($db);
$resultthirdparty = $thirdparty->fetch($attendeetovalidate->fk_soc);
if ($resultthirdparty < 0) {
- setEventMessages(null, $attendeetovalidate->errors, "errors");
+ setEventMessages($resultthirdparty->error, $resultthirdparty->errors, "errors");
} else {
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
@@ -1289,11 +1289,10 @@ if ($ispaymentok) {
$subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content;
} else {
- $subject = '['.$object->ref.' - '.$outputlangs->trans("NewRegistration").']';
+ $subject = '['.$appli.'] '.$object->ref.' - '.$outputlangs->trans("NewRegistration").']';
$msg = $outputlangs->trans("OrganizationEventPaymentOfRegistrationWasReceived");
}
-
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
@@ -1301,6 +1300,13 @@ if ($ispaymentok) {
$texttosend = make_substitutions($msg, $substitutionarray, $outputlangs);
$sendto = $attendeetovalidate->email;
+ $cc = '';
+ if ($thirdparty->email) {
+ $cc = $thirdparty->email;
+ }
+ if ($attendeetovalidate->email_company && $attendeetovalidate->email_company != $thirdparty->email) {
+ $cc = ($cc ? ', ' : '').$attendeetovalidate->email_company;
+ }
$from = $conf->global->MAILING_EMAIL_FROM;
$urlback = $_SERVER["REQUEST_URI"];
@@ -1321,7 +1327,7 @@ if ($ispaymentok) {
$listofmimes = array(dol_mimetype($file));
}
- $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, '', '', 0, $ishtml);
+ $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, $cc, '', 0, $ishtml);
$result = $mailfile->sendfile();
if ($result) {
@@ -1493,7 +1499,7 @@ if ($ispaymentok) {
$subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content;
} else {
- $subject = '['.$booth->ref.' - '.$outputlangs->trans("NewRegistration").']';
+ $subject = '['.$appli.'] '.$booth->ref.' - '.$outputlangs->trans("NewRegistration").']';
$msg = $outputlangs->trans("OrganizationEventPaymentOfBoothWasReceived");
}
@@ -1542,6 +1548,11 @@ if ($ispaymentok) {
}
}
+
+// Set $appli for emails title
+$appli = $mysoc->name;
+
+
if ($ispaymentok) {
// Get on url call
$onlinetoken = empty($PAYPALTOKEN) ? $_SESSION['onlinetoken'] : $PAYPALTOKEN;
@@ -1600,19 +1611,6 @@ if ($ispaymentok) {
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
// Define link to login card
- $appli = constant('DOL_APPLICATION_TITLE');
- if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
- $appli = $conf->global->MAIN_APPLICATION_TITLE;
- if (preg_match('/\d\.\d/', $appli)) {
- if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
- $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
- }
- } else {
- $appli .= " ".DOL_VERSION;
- }
- } else {
- $appli .= " ".DOL_VERSION;
- }
$urlback = $_SERVER["REQUEST_URI"];
$topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived");
@@ -1740,21 +1738,6 @@ if ($ispaymentok) {
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
- // Define link to login card
- $appli = constant('DOL_APPLICATION_TITLE');
- if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
- $appli = $conf->global->MAIN_APPLICATION_TITLE;
- if (preg_match('/\d\.\d/', $appli)) {
- if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
- $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
- }
- } else {
- $appli .= " ".DOL_VERSION;
- }
- } else {
- $appli .= " ".DOL_VERSION;
- }
-
$urlback = $_SERVER["REQUEST_URI"];
$topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("ValidationOfPaymentFailed");
$content = "";
diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php
index 1ffe5c63db3..ed968ea6f4e 100644
--- a/htdocs/takepos/css/pos.css.php
+++ b/htdocs/takepos/css/pos.css.php
@@ -825,3 +825,118 @@ div#moreinfo, div#infowarehouse {
display: table;
clear: both;
}
+
+.div5 .price {
+ display: none;
+}
+
+.div5 .imgadd {
+ display: none;
+}
+
+@media screen and (max-width: 767px) {
+ .div4 {
+ height: auto;
+ width: 100%;
+ float: left;
+ box-sizing: border-box;
+ font-size: 6px;
+ padding-top: 10px;
+ padding-bottom: 2px;
+ margin-left: 2px;
+ }
+
+ .div4 .wrapper.divempty, .div4 img, .div4 .wrapper:nth-last-child(1), .div4 .wrapper:nth-last-child(2), #prodiv22, #prodiv23, .catwatermark {
+ display: none!important;
+ }
+
+ .tab-category {
+ float: left;
+ position: relative;
+ width: 25%;
+ height: 33%;
+ margin: 0;
+ padding: 1px;
+ border: 2px solid #EEE;
+ text-align: center;
+ box-sizing: border-box;
+ background-color: #fff;
+ }
+
+ .div4 .wrapper, .tab-category {
+ width: auto;
+ height: auto;
+ padding: 6px;
+ text-align: center;
+ cursor: pointer;
+ border: 1px solid #FFF!important;
+ border-top: 3px solid #FFF!important;
+ }
+
+ .div4 .tab-category.active {
+ border-right: 1px solid #CCC !important;
+ border-left: 1px solid #CCC !important;
+ border-top: 3px solid var(--colorbackhmenu1) !important;
+ }
+
+ .div5 {
+ height: 100%;
+ width: 100%;
+ padding-top: 0px;
+ }
+
+ div.description {
+ position: initial;
+ width: auto;
+ background-color: black;
+ opacity: 1;
+ text-align: center;
+ padding-top: 0px;
+ background: -webkit-linear-gradient(top, rgba(250,250,250,0), rgba(250,250,250,0.5), rgba(250,250,250,0.95), rgba(250,250,250,1));
+ }
+
+ .div5 .description .description_content {
+ font-weight: bold;
+ font-size: 14px;
+ padding-left: 10px;
+ }
+
+ .div5 .wrapper2 {
+ width: 100%;
+ display: inline-flex;
+ align-items: center;
+ padding: 10px;
+ }
+
+ .div5 .wrapper2.divempty {
+ display: none;
+ }
+
+ div.wrapper2 {
+ float: none;
+ }
+
+ .div5 .arrow {
+ width: auto;
+ height: auto;
+ display: none!important;
+ }
+
+ .div5 .arrow .centerinmiddle {
+ transform: translate(0, 0);
+ }
+
+ .div5 .price {
+ font-size: 14px;
+ margin-left: auto;
+ margin-right: 30px;
+ padding-right: 10px;
+ font-weight: bold;
+ color: #ff6d6d;
+ display: flex;
+ }
+
+ .div5 .imgadd {
+ display: flex;
+ }
+}
\ No newline at end of file
diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php
index faa843aec9a..7443c380b9a 100644
--- a/htdocs/takepos/index.php
+++ b/htdocs/takepos/index.php
@@ -1346,7 +1346,7 @@ if (!empty($conf->global->TAKEPOS_WEIGHING_SCALE)) {
onclick="MoreProducts('less');" global->TAKEPOS_WEIGHING_SCALE)) {
+
+
+
...
diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php
index 58317deba15..1e6dfb54dbc 100644
--- a/htdocs/theme/eldy/badges.inc.php
+++ b/htdocs/theme/eldy/badges.inc.php
@@ -66,6 +66,7 @@ span.badgeneutral {
background-color: #e4e4e4;
color: #666;
border-radius: 10px;
+ white-space: nowrap;
}
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index fe31593efbf..9c0ac895a55 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -1295,6 +1295,10 @@ select.flat.selectlimit {
text-overflow: ellipsis;
white-space: nowrap;
}
+.spanoverflow {
+ overflow-x: clip;
+ text-overflow: ellipsis;
+}
.tdoverflowmax50 { /* For tdoverflow, the max-midth become a minimum ! */
max-width: 50px;
overflow: hidden;
diff --git a/htdocs/theme/md/badges.inc.php b/htdocs/theme/md/badges.inc.php
index 4a36177e852..cfa1afbc9f2 100644
--- a/htdocs/theme/md/badges.inc.php
+++ b/htdocs/theme/md/badges.inc.php
@@ -69,6 +69,7 @@ span.badgeneutral {
background-color: #e4e4e4;
color: #666;
border-radius: 10px;
+ white-space: nowrap;
}
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 41950369dc2..346b683f83c 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -1405,12 +1405,19 @@ select.flat.selectlimit {
width: 130px;
}
/* using a tdoverflowxxx make the min-width not working */
+.tdnooverflowimp {
+ text-overflow: none;
+}
.tdoverflow {
max-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
+.spanoverflow {
+ overflow-x: clip;
+ text-overflow: ellipsis;
+}
.tdoverflowmax50 { /* For tdoverflow, the max-midth become a minimum ! */
max-width: 50px;
overflow: hidden;
diff --git a/htdocs/ticket/class/api_tickets.class.php b/htdocs/ticket/class/api_tickets.class.php
index 2fd77693984..35e01a74f0d 100644
--- a/htdocs/ticket/class/api_tickets.class.php
+++ b/htdocs/ticket/class/api_tickets.class.php
@@ -246,6 +246,7 @@ class Tickets extends DolibarrApi
$socid = DolibarrApiAccess::$user->socid;
}
+ $search_sale = null;
// If the internal user must only see his customers, force searching by him
$search_sale = 0;
if (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) {
diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php
index c989d6f1c4d..e2f4d9c60ba 100644
--- a/htdocs/ticket/list.php
+++ b/htdocs/ticket/list.php
@@ -397,6 +397,12 @@ foreach ($search as $key => $val) {
$sql .= natural_search($key, $search[$key], 2);
}
continue;
+ } elseif ($key == 'type_code') {
+ $newarrayoftypecodes = is_array($search[$key]) ? $search[$key] : (!empty($search[$key]) ? explode(',', $search[$key]) : array());
+ if (count($newarrayoftypecodes)) {
+ $sql .= natural_search($key, join(',', $newarrayoftypecodes), 3);
+ }
+ continue;
}
$mode_search = ((!empty($object->fields[$key]) && ($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key]))) ? 1 : 0);
@@ -814,7 +820,7 @@ foreach ($object->fields as $key => $val) {
print '';
} elseif ($key == 'type_code') {
print '';
- $formTicket->selectTypesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150'));
+ $formTicket->selectTypesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150'), 1);
print ' ';
} elseif ($key == 'category_code') {
print '';
diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php
index b04f6ed4737..bdcf381c8bb 100644
--- a/test/phpunit/CodingSqlTest.php
+++ b/test/phpunit/CodingSqlTest.php
@@ -193,7 +193,7 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase
$result=strpos($filecontent, '"');
if ($result) {
- $result=(! strpos($filecontent, '["') && ! strpos($filecontent, '{"'));
+ $result=(! strpos($filecontent, '["') && ! strpos($filecontent, '{"') && ! strpos($filecontent, '("'));
}
//print __METHOD__." Result for checking we don't have double quote = ".$result."\n";
$this->assertTrue($result===false, 'Found double quote that is not [" neither {" (used for json content) into '.$file.'. Bad.');