diff --git a/ChangeLog b/ChangeLog
index bb44e0fa0be..ec201fa378e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,7 +15,8 @@ NEW: Add a performance center page with all information and advices related to t
NEW: A lot of fix into english text after a small proofreading campaign (still not perfect, but really better)
NEW: All main menu entries are using the picto of the module
NEW: Add a copy to clipboard button on some fields
-NEW: Add an example of scheduled job to send email reminder for unpayed invoices
+NEW: Add an example of scheduled job to send email reminder for unpayed invoices
+NEW: Can make massive stock transfers from a CSV file.
NEW: Accountancy - Add FEC import
NEW: Accountancy - Add a confirmation form with options on export
NEW: Accountancy - Add select date from/to in already bind customer and supplier list
@@ -159,6 +160,7 @@ NEW: #13739 #17390 Product API route added to get product stock and product with
WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
+* Module SimplePOS is deprecated. If you need a POS module, please use the module TakePOS.
* The ICS value for direct debit or credit transfer is now store on each bank account instead of into the global setup.
* API /setup/shipment_methods has been replaced with API /setup/shipping_methods
* Field "total" renamed into to "total_ht" for table llx_facture, llx_facture_rec for better field name consistency
diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt
index 9ea62de9048..4f80f06d444 100644
--- a/dev/dolibarr_changes.txt
+++ b/dev/dolibarr_changes.txt
@@ -245,6 +245,14 @@ RESTLER:
// @CHANGE LDR
if (!is_string($haystack)) return false;
+* Replace
+
+ $loaders = array_unique(static::$rogueLoaders);
+
+ with
+
+ $loaders = array_unique(static::$rogueLoaders, SORT_REGULAR);
+
+With swagger 2 provided into /explorer:
----------------------------------------
diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php
index 142d5accb0f..1a6d99261bd 100644
--- a/htdocs/admin/modules.php
+++ b/htdocs/admin/modules.php
@@ -386,7 +386,8 @@ foreach ($modulesdir as $dir) {
}
$moduleposition = ($objMod->module_position ? $objMod->module_position : '50');
- if ($moduleposition == '50' && ($objMod->isCoreOrExternalModule() == 'external')) {
+ if ($objMod->isCoreOrExternalModule() == 'external' && $moduleposition < 100000) {
+ // an external module should never return a value lower than '80'.
$moduleposition = '80'; // External modules at end by default
}
diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php
index fbc2412a9df..b76836a8dde 100644
--- a/htdocs/admin/tools/listevents.php
+++ b/htdocs/admin/tools/listevents.php
@@ -372,7 +372,7 @@ if ($result) {
print_liste_field_titre("UserAgent", $_SERVER["PHP_SELF"], "e.user_agent", "", $param, '', $sortfield, $sortorder);
}
if (!empty($arrayfields['e.prefix_session']['checked'])) {
- print_liste_field_titre("PrefixSession", $_SERVER["PHP_SELF"], "e.prefix_session", "", $param, '', $sortfield, $sortorder);
+ print_liste_field_titre("SuffixSessionName", $_SERVER["PHP_SELF"], "e.prefix_session", "", $param, '', $sortfield, $sortorder);
}
print_liste_field_titre('');
print "\n";
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 10e96b50014..793518ed150 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -937,6 +937,7 @@ if ($action == 'create') {
print ' ';
print ' ';
print ' ';
+ print ' ';
if ($backtopage) {
print ' ';
}
@@ -1183,7 +1184,7 @@ if ($action == 'create') {
$projectid = GETPOST('projectid', 'int');
print '
'.$langs->trans("Project").' ';
- print img_picto('', 'project', 'class="paddingrightonly"');
+ print img_picto('', 'project', 'class="pictofixedwidth"');
print $formproject->select_projects((!empty($societe->id) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
print ' ';
@@ -1430,6 +1431,7 @@ if ($id > 0) {
print ' ';
print ' ';
print ' ';
+ print ' ';
if ($backtopage) {
print ' ';
}
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 984d77e7263..b5bd94f0c2e 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -1436,11 +1436,9 @@ if (empty($reshook)) {
*/
$form = new Form($db);
-$formother = new FormOther($db);
$formfile = new FormFile($db);
$formpropal = new FormPropal($db);
$formmargin = new FormMargin($db);
-$companystatic = new Societe($db);
if (!empty($conf->projet->enabled)) {
$formproject = new FormProjets($db);
}
@@ -1582,7 +1580,7 @@ if ($action == 'create') {
//$warehouse_id = $soc->warehouse_id;
} else {
print ' ';
- print img_picto('', 'company').$form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500');
+ print img_picto('', 'company').$form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
// reload page to retrieve customer informations
if (empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) {
print '';
$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
- $out .= ' ';
+ $out .= ' ';
$out .= ' ';
}
@@ -3670,13 +3670,14 @@ class Form
/**
* Retourne la liste des types de delais de livraison possibles
*
- * @param int $selected Id du type de delais pre-selectionne
- * @param string $htmlname Nom de la zone select
- * @param string $filtertype To add a filter
+ * @param int $selected Id du type de delais pre-selectionne
+ * @param string $htmlname Nom de la zone select
+ * @param string $filtertype To add a filter
* @param int $addempty Add empty entry
+ * @param string $morecss More CSS
* @return void
*/
- public function selectAvailabilityDelay($selected = '', $htmlname = 'availid', $filtertype = '', $addempty = 0)
+ public function selectAvailabilityDelay($selected = '', $htmlname = 'availid', $filtertype = '', $addempty = 0, $morecss = '')
{
global $langs, $user;
@@ -3684,7 +3685,7 @@ class Form
dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
- print '';
+ print '';
if ($addempty) {
print ' ';
}
@@ -3694,7 +3695,7 @@ class Form
} else {
print '';
}
- print $arrayavailability['label'];
+ print dol_escape_htmltag($arrayavailability['label']);
print ' ';
}
print ' ';
@@ -4154,15 +4155,16 @@ class Form
/**
* Return a HTML select list of shipping mode
*
- * @param string $selected Id shipping mode pre-selected
- * @param string $htmlname Name of select zone
- * @param string $filtre To filter list. This parameter must not come from input of users
- * @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
- * @param string $moreattrib To add more attribute on select
+ * @param string $selected Id shipping mode pre-selected
+ * @param string $htmlname Name of select zone
+ * @param string $filtre To filter list. This parameter must not come from input of users
+ * @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
+ * @param string $moreattrib To add more attribute on select
* @param int $noinfoadmin 0=Add admin info, 1=Disable admin info
+ * @param string $morecss More CSS
* @return void
*/
- public function selectShippingMethod($selected = '', $htmlname = 'shipping_method_id', $filtre = '', $useempty = 0, $moreattrib = '', $noinfoadmin = 0)
+ public function selectShippingMethod($selected = '', $htmlname = 'shipping_method_id', $filtre = '', $useempty = 0, $moreattrib = '', $noinfoadmin = 0, $morecss = '')
{
global $langs, $conf, $user;
@@ -4183,7 +4185,7 @@ class Form
$num = $this->db->num_rows($result);
$i = 0;
if ($num) {
- print '';
+ print '';
if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
print ' ';
}
@@ -4946,16 +4948,18 @@ class Form
$formconfirm .= ''."\n";
// Line title
- $formconfirm .= ''.img_picto('', 'recent').' '.$title.' '."\n";
+ $formconfirm .= '';
+ $formconfirm .= img_picto('', 'recent').' '.$title;
+ $formconfirm .= ' '."\n";
// Line text
if (is_array($formquestion) && !empty($formquestion['text'])) {
- $formconfirm .= ''.$formquestion['text'].' '."\n";
+ $formconfirm .= ''.$formquestion['text'].' '."\n";
}
// Line form fields
if ($more) {
- $formconfirm .= ''."\n";
+ $formconfirm .= ' '."\n";
$formconfirm .= $more;
$formconfirm .= ' '."\n";
}
@@ -4963,10 +4967,10 @@ class Form
// Line with question
$formconfirm .= '';
$formconfirm .= ''.$question.' ';
- $formconfirm .= '';
- $formconfirm .= $this->selectyesno("confirm", $newselectedchoice);
+ $formconfirm .= ' ';
+ $formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly');
+ $formconfirm .= ' ';
$formconfirm .= ' ';
- $formconfirm .= ' ';
$formconfirm .= ' '."\n";
$formconfirm .= '
'."\n";
@@ -7837,9 +7841,10 @@ class Form
* @param bool $disabled true or false
* @param int $useempty 1=Add empty line
* @param int $addjscombo 1=Add js beautifier on combo box
+ * @param string $morecss More CSS
* @return string See option
*/
- public function selectyesno($htmlname, $value = '', $option = 0, $disabled = false, $useempty = 0, $addjscombo = 0)
+ public function selectyesno($htmlname, $value = '', $option = 0, $disabled = false, $useempty = 0, $addjscombo = 0, $morecss = '')
{
global $langs;
@@ -7852,7 +7857,7 @@ class Form
$disabled = ($disabled ? ' disabled' : '');
- $resultyesno = ''."\n";
+ $resultyesno = ''."\n";
if ($useempty) {
$resultyesno .= ' '."\n";
}
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 7cf9978d32b..45429512046 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -851,7 +851,7 @@ class FormFile
// Show file size
$size = (!empty($file['size']) ? $file['size'] : dol_filesize($filedir."/".$file["name"]));
- $out .= ''.dol_print_size($size, 1, 1).' ';
+ $out .= ''.dol_print_size($size, 1, 1).' ';
// Show file date
$date = (!empty($file['date']) ? $file['date'] : dol_filemtime($filedir."/".$file["name"]));
diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php
index c0a8844b572..20debf50f12 100644
--- a/htdocs/core/js/lib_foot.js.php
+++ b/htdocs/core/js/lib_foot.js.php
@@ -214,17 +214,17 @@ print '
print "\n/* JS CODE TO ENABLE ClipBoard copy paste*/\n";
print 'jQuery(\'.clipboardCPShowOnHover\').hover(
function() {
- console.log("We hover a value with a copy paste feature");
+ console.log("We hover a value with a copy paste feature");
$(this).children(".clipboardCPButton, .clipboardCPText").show();
},
function() {
- console.log("We hover out the value with a copy paste feature");
+ console.log("We hover out the value with a copy paste feature");
$(this).children(".clipboardCPButton, .clipboardCPText").hide();
}
);';
-print 'jQuery(\'.clipboardCPButton\').click(function() {
+print 'jQuery(\'.clipboardCPButton, .clipboardCPValueToPrint\').click(function() {
/* console.log(this.parentNode); */
- console.log("We click on a clipboardCPButton tag");
+ console.log("We click on a clipboardCPButton or clipboardCPValueToPrint class");
if (window.getSelection) {
selection = window.getSelection();
diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php
index 8874b96eda5..bd69b812200 100644
--- a/htdocs/core/lib/ajax.lib.php
+++ b/htdocs/core/lib/ajax.lib.php
@@ -454,7 +454,7 @@ function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete =
templateResult: function (data, container) { /* Format visible output into combo list */
/* Code to add class of origin OPTION propagated to the new select2 tag */
if (data.element) { $(container).addClass($(data.element).attr("class")); }
- console.log($(data.element).attr("data-html"));
+ //console.log($(data.element).attr("data-html"));
if (data.id == -1 && $(data.element).attr("data-html") == undefined) {
return \' \';
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 8d171a048b0..48237bbc826 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -3514,9 +3514,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'github', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies',
'generic', 'home', 'hrm', 'members', 'products', 'invoicing',
- 'partnership', 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'refresh', 'salary', 'shipment', 'supplier_invoice', 'technic', 'ticket',
+ 'partnership', 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'question', 'refresh', 'salary', 'shipment', 'supplier_invoice', 'technic', 'ticket',
'error', 'warning',
- 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource',
+ 'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource',
'shapes', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
'uncheck', 'user-cog', 'website', 'workstation',
@@ -3558,7 +3558,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'other'=>'square',
'playdisabled'=>'play', 'pdf'=>'file-pdf', 'poll'=>'check-double', 'pos'=>'cash-register', 'preview'=>'binoculars', 'project'=>'project-diagram', 'projectpub'=>'project-diagram', 'projecttask'=>'tasks', 'propal'=>'file-signature',
'partnership'=>'handshake', 'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'previous'=>'arrow-alt-circle-left', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell',
- 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge',
+ 'recent' => 'question', 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge',
'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature',
'refresh'=>'redo', 'resource'=>'laptop-house',
'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s',
@@ -10236,7 +10236,8 @@ function readfileLowMemory($fullpath_original_file_osencoded, $method = -1)
}
/**
- * Create a button to copy $valuetocopy in the clipboard
+ * Create a button to copy $valuetocopy in the clipboard.
+ * Code that handle the click is inside lib_foot.jsp.php
*
* @param string $valuetocopy The value to print
* @param int $showonlyonhover Show the copy-paste button only on hover
@@ -10245,6 +10246,12 @@ function readfileLowMemory($fullpath_original_file_osencoded, $method = -1)
*/
function showValueWithClipboardCPButton($valuetocopy, $showonlyonhover = 1, $texttoshow = '')
{
+ global $conf;
+
+ /*if (!empty($conf->dol_no_mouse_hover)) {
+ $showonlyonhover = 0;
+ }*/
+
if ($texttoshow) {
$result = ''.$valuetocopy.' '.$texttoshow.' ';
} else {
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 0315e848e94..ffa06ebd508 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -2694,7 +2694,7 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide
// define progress color according to time spend vs workload
$progressBarClass = 'progress-bar-info';
if ($task->planned_workload) {
- $progressCalculated = round(100 * doubleval($task->duration_effective) / doubleval($task->planned_workload), 2);
+ $progressCalculated = round(100 * floatval($task->duration_effective) / floatval($task->planned_workload), 2);
// this conf is actually hidden, by default we use 10% for "be carefull or warning"
$warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.10;
@@ -2702,12 +2702,12 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide
$diffTitle = ' '.$langs->trans('ProgressDeclared').' : '.$task->progress.($task->progress ? '%' : '');
$diffTitle .= ' '.$langs->trans('ProgressCalculated').' : '.$progressCalculated.($progressCalculated ? '%' : '');
- //var_dump($progressCalculated.' '.$warningRatio.' '.$task->progress.' '.doubleval($task->progress * $warningRatio));
- if (doubleval($progressCalculated) > doubleval($task->progress * $warningRatio)) {
+ //var_dump($progressCalculated.' '.$warningRatio.' '.$task->progress.' '.floatval($task->progress * $warningRatio));
+ if (floatval($progressCalculated) > floatval($task->progress * $warningRatio)) {
$progressBarClass = 'progress-bar-danger';
$title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress - $progressCalculated).' '.$langs->trans("point"));
$diff = ' '.($task->progress - $progressCalculated).'% ';
- } elseif (doubleval($progressCalculated) > doubleval($task->progress)) { // warning if close at 10%
+ } elseif (floatval($progressCalculated) > floatval($task->progress)) { // warning if close at 10%
$progressBarClass = 'progress-bar-warning';
$title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress - $progressCalculated).' '.$langs->trans("point"));
$diff = ' '.($task->progress - $progressCalculated).'% ';
@@ -2771,18 +2771,18 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide
$out .= '';
$out .= ' ';
- $diffval = doubleval($task->progress) - doubleval($progressCalculated);
+ $diffval = floatval($task->progress) - floatval($progressCalculated);
if ($diffval >= 0) {
// good
- $out .= '
';
+ $out .= '
';
if (!empty($task->progress)) {
- $out .= '
';
+ $out .= '
';
}
$out .= '
';
} else {
// bad
- $out .= '
';
- $out .= '
';
+ $out .= '
';
+ $out .= '
';
$out .= '
';
}
$out .= '
';
@@ -2811,17 +2811,17 @@ function getTaskProgressBadge($task, $label = '', $tooltip = '')
// define color according to time spend vs workload
$badgeClass = 'badge ';
if ($task->planned_workload) {
- $progressCalculated = round(100 * doubleval($task->duration_effective) / doubleval($task->planned_workload), 2);
+ $progressCalculated = round(100 * floatval($task->duration_effective) / floatval($task->planned_workload), 2);
// this conf is actually hidden, by default we use 10% for "be carefull or warning"
$warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.10;
- if (doubleval($progressCalculated) > doubleval($task->progress * $warningRatio)) {
+ if (floatval($progressCalculated) > floatval($task->progress * $warningRatio)) {
$badgeClass .= 'badge-danger';
if (empty($tooltip)) {
$tooltip = $task->progress.'% < '.$langs->trans("TimeConsumed").' '.$progressCalculated.'%';
}
- } elseif (doubleval($progressCalculated) > doubleval($task->progress)) { // warning if close at 10%
+ } elseif (floatval($progressCalculated) > floatval($task->progress)) { // warning if close at 10%
$badgeClass .= 'badge-warning';
if (empty($tooltip)) {
$tooltip = $task->progress.'% < '.$langs->trans("TimeConsumed").' '.$progressCalculated.'%';
diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index 700c9c5ed86..6d01fcfee0a 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -339,7 +339,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
$thumbsbyrow = 6;
print '
';
- print '
';
+ print '';
// Title
if ($foruserprofile) {
diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php
index 8824d9cc06d..721b908b9d1 100644
--- a/htdocs/core/lib/website2.lib.php
+++ b/htdocs/core/lib/website2.lib.php
@@ -283,11 +283,11 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage,
/**
- * Save content of the index.php and/or wrapper.php page
+ * Save content of the index.php and/or the wrapper.php page
*
* @param string $pathofwebsite Path of website root
* @param string $fileindex Full path of file index.php
- * @param string $filetpl File tpl the index.php page redirect to
+ * @param string $filetpl File tpl the index.php page redirect to (used only if $fileindex is provided)
* @param string $filewrapper Full path of file wrapper.php
* @return boolean True if OK
*/
diff --git a/htdocs/core/modules/modCashDesk.class.php b/htdocs/core/modules/modCashDesk.class.php
index ba6c7ddce6c..a128b92ee29 100644
--- a/htdocs/core/modules/modCashDesk.class.php
+++ b/htdocs/core/modules/modCashDesk.class.php
@@ -51,7 +51,7 @@ class modCashDesk extends DolibarrModules
$this->name = preg_replace('/^mod/i', '', get_class($this));
$this->description = "CashDesk module";
- $this->version = 'dolibarr';
+ $this->version = 'deprecated';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->picto = 'cash-register';
diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php
index b3079691cd5..7c7813fbe14 100644
--- a/htdocs/core/photos_resize.php
+++ b/htdocs/core/photos_resize.php
@@ -487,8 +487,10 @@ print load_fiche_titre($title);
$infoarray = dol_getImageSize($dir."/".GETPOST("file", 'alpha'));
$height = $infoarray['height'];
$width = $infoarray['width'];
-print ''.$langs->trans("CurrentInformationOnImage").': ';
-print $langs->trans("Width").': '.$width.' x '.$langs->trans("Height").': '.$height.' ';
+print ''.$langs->trans("CurrentInformationOnImage").': ';
+print '';
+print $langs->trans("Width").': '.$width.' x '.$langs->trans("Height").': '.$height.' ';
+print ' ';
print ' '."\n";
@@ -546,36 +548,42 @@ if (!empty($conf->use_javascript_ajax)) {
print ''.$langs->trans("Recenter").' ';
print $langs->trans("DefineNewAreaToPick").'... ';
print '';
- print '
';
- print '
';
- print '
';
- print '
';
- print ''."\n";
+ print ''."\n";
+ } else {
+ $langs->load("other");
+ print ''.$langs->trans("FeatureNotAvailableOnDevicesWithoutMouse").'
';
+ }
print ''."\n";
print ' ';
}
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 78925c74b9f..8586e0fc623 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -1955,7 +1955,7 @@ class FactureFournisseur extends CommonInvoice
$this->line->remise_percent = $remise_percent;
$this->line->date_start = $date_start;
$this->line->date_end = $date_end;
- $this->line->ventil = $ventil;
+ $this->line->fk_code_ventilation = $ventil;
$this->line->rang = $rang;
$this->line->info_bits = $info_bits;
$this->line->fk_remise_except = $fk_remise_except;
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 30c37bb4d88..0bc26ea8f2b 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -75,6 +75,7 @@ $lineid = GETPOST('lineid', 'int');
$projectid = GETPOST('projectid', 'int');
$origin = GETPOST('origin', 'alpha');
$originid = GETPOST('originid', 'int');
+$fac_rec = GETPOST('fac_rec', 'int');
// PDF
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
@@ -2211,13 +2212,14 @@ if ($action == 'create') {
// Payment mode
print ''.$langs->trans('PaymentMode').' ';
- $form->select_types_paiements(GETPOSTISSET('mode_reglement_id') ?GETPOST('mode_reglement_id', 'int') : $mode_reglement_id, 'mode_reglement_id', 'DBIT');
+ print img_picto('', 'bank', 'class="pictofixedwidth"');
+ $form->select_types_paiements(GETPOSTISSET('mode_reglement_id') ?GETPOST('mode_reglement_id', 'int') : $mode_reglement_id, 'mode_reglement_id', 'DBIT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx');
print ' ';
// Bank Account
if (!empty($conf->banque->enabled)) {
print ''.$langs->trans('BankAccount').' ';
- print img_picto('', 'bank_account').$form->select_comptes((GETPOSTISSET('fk_account') ?GETPOST('fk_account', 'alpha') : $fk_account), 'fk_account', 0, '', 1, '', 0, '', 1);
+ print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes((GETPOSTISSET('fk_account') ?GETPOST('fk_account', 'alpha') : $fk_account), 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
print ' ';
}
@@ -2227,7 +2229,8 @@ if ($action == 'create') {
$langs->load('projects');
print ''.$langs->trans('Project').' ';
- print img_picto('', 'project').$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
+ print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
+ print ' id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'"> ';
print ' ';
}
diff --git a/htdocs/includes/restler/framework/Luracast/Restler/AutoLoader.php b/htdocs/includes/restler/framework/Luracast/Restler/AutoLoader.php
index 5ed160a070a..b11506ea86c 100644
--- a/htdocs/includes/restler/framework/Luracast/Restler/AutoLoader.php
+++ b/htdocs/includes/restler/framework/Luracast/Restler/AutoLoader.php
@@ -263,7 +263,7 @@ class AutoLoader
* @return bool false unless className now exists
*/
private function loadLastResort($className, $loader = null) {
- $loaders = array_unique(static::$rogueLoaders);
+ $loaders = array_unique(static::$rogueLoaders, SORT_REGULAR);
if (isset($loader)) {
if (false === array_search($loader, $loaders))
static::$rogueLoaders[] = $loader;
diff --git a/htdocs/index.php b/htdocs/index.php
index 5485f9bc7be..91b2de32087 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -472,7 +472,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
$classe = (!empty($classes[$keyIndex]) ? $classes[$keyIndex] : '');
if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe])) {
$groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey] ? $boardloaded[$classe]->nb[$globalStatsKey] : 0;
- $nbTotal = doubleval($groupElement['globalStats']['total']);
+ $nbTotal = floatval($groupElement['globalStats']['total']);
if ($nbTotal >= 10000) {
$nbTotal = round($nbTotal / 1000, 2).'k';
}
diff --git a/htdocs/install/mysql/data/llx_00_c_country.sql b/htdocs/install/mysql/data/llx_00_c_country.sql
index 296b6d0e412..bc09a7fd1f6 100644
--- a/htdocs/install/mysql/data/llx_00_c_country.sql
+++ b/htdocs/install/mysql/data/llx_00_c_country.sql
@@ -106,16 +106,16 @@ INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (75
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (76,'HR','HRV','Croatie',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (77,'CU','CUB','Cuba',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (78,'CY','CYP','Cyprus',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (79,'CZ','CZE','République Tchèque',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (80,'DK','DNK','Danemark',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (79,'CZ','CZE','Czech Republic',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (80,'DK','DNK','Denmark',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (81,'DJ','DJI','Djibouti',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (82,'DM','DMA','Dominique',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (83,'DO','DOM','République Dominicaine',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (84,'EC','ECU','Equateur',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (85,'EG','EGY','Egypte',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (86,'SV','SLV','Salvador',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (87,'GQ','GNQ','Guinée Equatoriale',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (88,'ER','ERI','Erythrée',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (82,'DM','DMA','Dominica',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (83,'DO','DOM','Dominican Republic',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (84,'EC','ECU','Republic of Ecuador',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (85,'EG','EGY','Egypt',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (86,'SV','SLV','El Salvador',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (87,'GQ','GNQ','Equatorial Guinea',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (88,'ER','ERI','Eritrea',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (89,'EE','EST','Estonia',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (90,'ET','ETH','Ethiopia',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (91,'FK','FLK','Falkland Islands',1,0);
diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql
index 5e739f07b72..27a9f8dd1f5 100644
--- a/htdocs/install/mysql/data/llx_20_c_departements.sql
+++ b/htdocs/install/mysql/data/llx_20_c_departements.sql
@@ -62,6 +62,7 @@
-- Slovenia (need to check code SI-Id)
-- Taiwan
-- Tunisia
+-- United States of America
@@ -1120,6 +1121,60 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN24', '', 0, '', 'Zaghouan');
+-- USA States (id country=11)
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'AL', '', 0, 'ALABAMA', 'Alabama');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'AK', '', 0, 'ALASKA', 'Alaska');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'AZ', '', 0, 'ARIZONA', 'Arizona');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'AR', '', 0, 'ARKANSAS', 'Arkansas');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'CA', '', 0, 'CALIFORNIA', 'California');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'CO', '', 0, 'COLORADO', 'Colorado');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'CT', '', 0, 'CONNECTICUT', 'Connecticut');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'DE', '', 0, 'DELAWARE', 'Delaware');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'FL', '', 0, 'FLORIDA', 'Florida');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'GA', '', 0, 'GEORGIA', 'Georgia');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'HI', '', 0, 'HAWAII', 'Hawaii');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'ID', '', 0, 'IDAHO', 'Idaho');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'IL', '', 0, 'ILLINOIS','Illinois');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'IN', '', 0, 'INDIANA', 'Indiana');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'IA', '', 0, 'IOWA', 'Iowa');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'KS', '', 0, 'KANSAS', 'Kansas');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'KY', '', 0, 'KENTUCKY', 'Kentucky');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'LA', '', 0, 'LOUISIANA', 'Louisiana');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'ME', '', 0, 'MAINE', 'Maine');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'MD', '', 0, 'MARYLAND', 'Maryland');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'MA', '', 0, 'MASSACHUSSETTS', 'Massachusetts');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'MI', '', 0, 'MICHIGAN', 'Michigan');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'MN', '', 0, 'MINNESOTA', 'Minnesota');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'MS', '', 0, 'MISSISSIPPI', 'Mississippi');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'MO', '', 0, 'MISSOURI', 'Missouri');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'MT', '', 0, 'MONTANA', 'Montana');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'NE', '', 0, 'NEBRASKA', 'Nebraska');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'NV', '', 0, 'NEVADA', 'Nevada');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'NH', '', 0, 'NEW HAMPSHIRE', 'New Hampshire');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'NJ', '', 0, 'NEW JERSEY', 'New Jersey');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'NM', '', 0, 'NEW MEXICO', 'New Mexico');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'NY', '', 0, 'NEW YORK', 'New York');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'NC', '', 0, 'NORTH CAROLINA', 'North Carolina');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'ND', '', 0, 'NORTH DAKOTA', 'North Dakota');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'OH', '', 0, 'OHIO', 'Ohio');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'OK', '', 0, 'OKLAHOMA', 'Oklahoma');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'OR', '', 0, 'OREGON', 'Oregon');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'PA', '', 0, 'PENNSYLVANIA', 'Pennsylvania');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'RI', '', 0, 'RHODE ISLAND', 'Rhode Island');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'SC', '', 0, 'SOUTH CAROLINA', 'South Carolina');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'SD', '', 0, 'SOUTH DAKOTA', 'South Dakota');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'TN', '', 0, 'TENNESSEE', 'Tennessee');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'TX', '', 0, 'TEXAS', 'Texas');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'UT', '', 0, 'UTAH', 'Utah');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'VT', '', 0, 'VERMONT', 'Vermont');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'VA', '', 0, 'VIRGINIA', 'Virginia');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'WA', '', 0, 'WASHINGTON', 'Washington');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'WV', '', 0, 'WEST VIRGINIA', 'West Virginia');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'WI', '', 0, 'WISCONSIN', 'Wisconsin');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'WY', '', 0, 'WYOMING', 'Wyoming');
+
+
+
-- Provinces Bolivia (id country=52)
@@ -1513,59 +1568,6 @@ INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc
--- Provinces US (id country=11)
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('AL', 1101, '', 0, 'ALABAMA', 'Alabama', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('AK', 1101, '', 0, 'ALASKA', 'Alaska', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('AZ', 1101, '', 0, 'ARIZONA', 'Arizona', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('AR', 1101, '', 0, 'ARKANSAS', 'Arkansas', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('CA', 1101, '', 0, 'CALIFORNIA', 'California', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('CO', 1101, '', 0, 'COLORADO', 'Colorado', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('CT', 1101, '', 0, 'CONNECTICUT', 'Connecticut', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('DE', 1101, '', 0, 'DELAWARE', 'Delaware', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('FL', 1101, '', 0, 'FLORIDA', 'Florida', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('GA', 1101, '', 0, 'GEORGIA', 'Georgia', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('HI', 1101, '', 0, 'HAWAII', 'Hawaii', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('ID', 1101, '', 0, 'IDAHO', 'Idaho', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('IL', 1101, '', 0, 'ILLINOIS','Illinois', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('IN', 1101, '', 0, 'INDIANA', 'Indiana', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('IA', 1101, '', 0, 'IOWA', 'Iowa', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('KS', 1101, '', 0, 'KANSAS', 'Kansas', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('KY', 1101, '', 0, 'KENTUCKY', 'Kentucky', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('LA', 1101, '', 0, 'LOUISIANA', 'Louisiana', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('ME', 1101, '', 0, 'MAINE', 'Maine', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MD', 1101, '', 0, 'MARYLAND', 'Maryland', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MA', 1101, '', 0, 'MASSACHUSSETTS', 'Massachusetts', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MI', 1101, '', 0, 'MICHIGAN', 'Michigan', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MN', 1101, '', 0, 'MINNESOTA', 'Minnesota', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MS', 1101, '', 0, 'MISSISSIPPI', 'Mississippi', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MO', 1101, '', 0, 'MISSOURI', 'Missouri', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MT', 1101, '', 0, 'MONTANA', 'Montana', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NE', 1101, '', 0, 'NEBRASKA', 'Nebraska', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NV', 1101, '', 0, 'NEVADA', 'Nevada', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NH', 1101, '', 0, 'NEW HAMPSHIRE', 'New Hampshire', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NJ', 1101, '', 0, 'NEW JERSEY', 'New Jersey', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NM', 1101, '', 0, 'NEW MEXICO', 'New Mexico', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NY', 1101, '', 0, 'NEW YORK', 'New York', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NC', 1101, '', 0, 'NORTH CAROLINA', 'North Carolina', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('ND', 1101, '', 0, 'NORTH DAKOTA', 'North Dakota', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('OH', 1101, '', 0, 'OHIO', 'Ohio', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('OK', 1101, '', 0, 'OKLAHOMA', 'Oklahoma', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('OR', 1101, '', 0, 'OREGON', 'Oregon', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('PA', 1101, '', 0, 'PENNSYLVANIA', 'Pennsylvania', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('RI', 1101, '', 0, 'RHODE ISLAND', 'Rhode Island', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('SC', 1101, '', 0, 'SOUTH CAROLINA', 'South Carolina', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('SD', 1101, '', 0, 'SOUTH DAKOTA', 'South Dakota', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('TN', 1101, '', 0, 'TENNESSEE', 'Tennessee', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('TX', 1101, '', 0, 'TEXAS', 'Texas', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('UT', 1101, '', 0, 'UTAH', 'Utah', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('VT', 1101, '', 0, 'VERMONT', 'Vermont', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('VA', 1101, '', 0, 'VIRGINIA', 'Virginia', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('WA', 1101, '', 0, 'WASHINGTON', 'Washington', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('WV', 1101, '', 0, 'WEST VIRGINIA', 'West Virginia', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('WI', 1101, '', 0, 'WISCONSIN', 'Wisconsin', 1);
-insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('WY', 1101, '', 0, 'WYOMING', 'Wyoming', 1);
-
-
-- San Salvador (id country=86)
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SS', 8601, '', 0, '', 'San Salvador', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SA', 8603, '', 0, '', 'Santa Ana', 1);
diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
index cf5da55d719..b95ea30f8fb 100644
--- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
+++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
@@ -492,12 +492,14 @@ CREATE TABLE llx_knowledgemanagement_knowledgerecord(
model_pdf varchar(255),
question text NOT NULL,
answer text,
+ url varchar(255),
fk_ticket integer,
status integer NOT NULL
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;
ALTER TABLE llx_knowledgemanagement_knowledgerecord ADD COLUMN fk_ticket integer;
+ALTER TABLE llx_knowledgemanagement_knowledgerecord ADD COLUMN url varchar(255);
create table llx_knowledgemanagement_knowledgerecord_extrafields
diff --git a/htdocs/install/mysql/tables/llx_knowledgemanagement_knowledgerecord.sql b/htdocs/install/mysql/tables/llx_knowledgemanagement_knowledgerecord.sql
index 5c9e4cf199f..c5332372019 100644
--- a/htdocs/install/mysql/tables/llx_knowledgemanagement_knowledgerecord.sql
+++ b/htdocs/install/mysql/tables/llx_knowledgemanagement_knowledgerecord.sql
@@ -28,6 +28,7 @@ CREATE TABLE llx_knowledgemanagement_knowledgerecord(
model_pdf varchar(255),
question text NOT NULL,
answer text,
+ url varchar(255),
fk_ticket integer,
status integer NOT NULL
-- END MODULEBUILDER FIELDS
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 467fba89199..78077474c96 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -2103,7 +2103,6 @@ PDF_SHOW_PROJECT=Show project on document
ShowProjectLabel=Project Label
PDF_USE_ALSO_LANGUAGE_CODE=If you want to have some texts in your PDF duplicated in 2 different languages in the same generated PDF, you must set here this second language so generated PDF will contains 2 different languages in same page, the one chosen when generating PDF and this one (only few PDF templates support this). Keep empty for 1 language per PDF.
FafaIconSocialNetworksDesc=Enter here the code of a FontAwesome icon. If you don't know what is FontAwesome, you can use the generic value fa-address-book.
-FeatureNotAvailableWithReceptionModule=Feature not available when module Reception is enabled
RssNote=Note: Each RSS feed definition provides a widget that you must enable to have it available in dashboard
JumpToBoxes=Jump to Setup -> Widgets
MeasuringUnitTypeDesc=Use here a value like "size", "surface", "volume", "weight", "time"
diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang
index 95297a98859..bb35099ab82 100644
--- a/htdocs/langs/en_US/other.lang
+++ b/htdocs/langs/en_US/other.lang
@@ -129,6 +129,7 @@ ClosedByLogin=User login who closed
FileWasRemoved=File %s was removed
DirWasRemoved=Directory %s was removed
FeatureNotYetAvailable=Feature not yet available in the current version
+FeatureNotAvailableOnDevicesWithoutMouse=Feature not available on devices without mouse
FeaturesSupported=Supported features
Width=Width
Height=Height
@@ -263,7 +264,7 @@ ContactCreatedByEmailCollector=Contact/address created by email collector from e
ProjectCreatedByEmailCollector=Project created by email collector from email MSGID %s
TicketCreatedByEmailCollector=Ticket created by email collector from email MSGID %s
OpeningHoursFormatDesc=Use a - to separate opening and closing hours. Use a space to enter different ranges. Example: 8-12 14-18
-PrefixSession=Prefix for session ID
+SuffixSessionName=Suffix for session name
##### Export #####
ExportsArea=Exports area
diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php
index 4619b04f7a1..bbd2724fb1c 100644
--- a/htdocs/mrp/mo_agenda.php
+++ b/htdocs/mrp/mo_agenda.php
@@ -131,7 +131,7 @@ $formproject = new FormProjets($db);
if ($object->id > 0) {
$title = $langs->trans("Agenda");
//if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
- $help_url = 'EN:Module_Agenda_En';
+ $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Agenda';
llxHeader('', $title, $help_url);
if (!empty($conf->notification->enabled)) {
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 98fb4132bb8..c92f847a1e9 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1181,7 +1181,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if ($type != 1 && !empty($conf->stock->enabled)) {
// Default warehouse
print ''.$langs->trans("DefaultWarehouse").' ';
- print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'pictofixedwidth');
+ print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"');
print $formproduct->selectWarehouses(GETPOST('fk_default_warehouse'), 'fk_default_warehouse', 'warehouseopen', 1);
print ' ';
print ' ';
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 16c72297e10..5130db9cd2f 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -14,7 +14,7 @@
* Copyright (C) 2014 Ion agorria
* Copyright (C) 2016-2018 Ferran Marcet
* Copyright (C) 2017 Gustavo Novaro
- * Copyright (C) 2019-2020 Frédéric France
+ * Copyright (C) 2019-2021 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -372,6 +372,9 @@ class Product extends CommonObject
public $oldcopy;
+ /**
+ * @var int Default warehouse Id
+ */
public $fk_default_warehouse;
/**
* @var int ID
@@ -388,6 +391,10 @@ class Product extends CommonObject
* @see $ref_supplier
*/
public $ref_fourn;
+
+ /**
+ * @var string ref supplier
+ */
public $ref_supplier;
/**
@@ -1627,6 +1634,36 @@ class Product extends CommonObject
}
}
+ /**
+ * used to check if price have really change to avoid log pollution
+ *
+ * @param int $level price level to change
+ * @return array
+ */
+ private function getArrayForPriceCompare($level = 0)
+ {
+
+ $testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly');
+
+ foreach ($testExit as $field){
+ if (!isset($this->$field[$level])) {
+ return array();
+ }
+ }
+
+ $lastPrice = array(
+ 'level' => $level ? $level : 1,
+ 'multiprices' => doubleval($this->multiprices[$level]),
+ 'multiprices_ttc' => doubleval($this->multiprices_ttc[$level]),
+ 'multiprices_base_type' => $this->multiprices_base_type[$level],
+ 'multiprices_min' => doubleval($this->multiprices_min[$level]),
+ 'multiprices_min_ttc' => doubleval($this->multiprices_min_ttc[$level]),
+ 'multiprices_tva_tx' => doubleval($this->multiprices_tva_tx[$level]),
+ 'multiprices_recuperableonly' => doubleval($this->multiprices_recuperableonly[$level]),
+ );
+
+ return $lastPrice;
+ }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -1975,6 +2012,8 @@ class Product extends CommonObject
{
global $conf, $langs;
+ $lastPriceData = $this->getArrayForPriceCompare($level); // temporary store current price before update
+
$id = $this->id;
dol_syslog(get_class($this)."::update_price id=".$id." newprice=".$newprice." newpricebase=".$newpricebase." newminprice=".$newminprice." level=".$level." npr=".$newnpr." newdefaultvatcode=".$newdefaultvatcode);
@@ -2107,7 +2146,11 @@ class Product extends CommonObject
// Price by quantity
$this->price_by_qty = $newpbq;
- $this->_log_price($user, $level); // Save price for level into table product_price
+ // check if price have really change before log
+ $newPriceData = $this->getArrayForPriceCompare($level);
+ if (!empty(array_diff_assoc($newPriceData, $lastPriceData)) || empty($conf->global->PRODUIT_MULTIPRICES)) {
+ $this->_log_price($user, $level); // Save price for level into table product_price
+ }
$this->level = $level; // Store level of price edited for trigger
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index 7dfb94be79f..9548643166a 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -1470,7 +1470,6 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
}
print ''.$langs->trans("PriceBase").' ';
- print $conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL;
if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
print ''.$langs->trans("DefaultTaxRate").' ';
}
diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php
index b8698ff7ad3..91284944397 100644
--- a/htdocs/product/stock/card.php
+++ b/htdocs/product/stock/card.php
@@ -5,6 +5,7 @@
* Copyright (C) 2005-2014 Regis Houssin
* Copyright (C) 2016 Francis Appels
* Copyright (C) 2021 Noé Cendrier
+ * Copyright (C) 2021 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -612,6 +613,14 @@ if ($action == 'create') {
}
$sql = "SELECT p.rowid as rowid, p.ref, p.label as produit, p.tobatch, p.fk_product_type as type, p.price, p.price_ttc, p.entity,";
+ $sql .= "p.tosell, p.tobuy,";
+ $sql .= "p.accountancy_code_sell,";
+ $sql .= "p.accountancy_code_sell_intra,";
+ $sql .= "p.accountancy_code_sell_export,";
+ $sql .= "p.accountancy_code_buy,";
+ $sql .= "p.accountancy_code_buy_intra,";
+ $sql .= "p.accountancy_code_buy_export,";
+ $sql .= 'p.barcode,';
if ($separatedPMP) {
$sql .= " pa.pmp as ppmp,";
} else {
@@ -683,6 +692,15 @@ if ($action == 'create') {
$productstatic->entity = $objp->entity;
$productstatic->status_batch = $objp->tobatch;
$productstatic->fk_unit = $objp->fk_unit;
+ $productstatic->status = $objp->tosell;
+ $productstatic->status_buy = $objp->tobuy;
+ $productstatic->barcode = $objp->barcode;
+ $productstatic->accountancy_code_sell = $objp->accountancy_code_sell;
+ $productstatic->accountancy_code_sell_intra = $objp->accountancy_code_sell_intra;
+ $productstatic->accountancy_code_sell_export = $objp->accountancy_code_sell_export;
+ $productstatic->accountancy_code_buy = $objp->accountancy_code_buy;
+ $productstatic->accountancy_code_buy_intra = $objp->accountancy_code_buy_intra;
+ $productstatic->accountancy_code_buy_export = $objp->accountancy_code_buy_export;
print $productstatic->getNomUrl(1, 'stock', 16);
print ' ';
@@ -768,6 +786,7 @@ if ($action == 'create') {
}
print ' ';
print ' ';
+ print ' ';
print ' ';
} else {
dol_print_error($db);
diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php
index d8dad67bee2..4877bb861ab 100644
--- a/htdocs/product/stock/class/mouvementstock.class.php
+++ b/htdocs/product/stock/class/mouvementstock.class.php
@@ -150,7 +150,7 @@ class MouvementStock extends CommonObject
*/
public function _create($user, $fk_product, $entrepot_id, $qty, $type, $price = 0, $label = '', $inventorycode = '', $datem = '', $eatby = '', $sellby = '', $batch = '', $skip_batch = false, $id_product_batch = 0, $disablestockchangeforsubproduct = 0)
{
- // phpcs:disable
+ // phpcs:enable
global $conf, $langs;
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@@ -160,26 +160,26 @@ class MouvementStock extends CommonObject
dol_syslog(get_class($this)."::_create start userid=$user->id, fk_product=$fk_product, warehouse_id=$entrepot_id, qty=$qty, type=$type, price=$price, label=$label, inventorycode=$inventorycode, datem=".$datem.", eatby=".$eatby.", sellby=".$sellby.", batch=".$batch.", skip_batch=".$skip_batch);
// start hook at beginning
- global $action, $hookmanager;
- $hookmanager->initHooks(array('mouvementstock'));
- // Hook of thirdparty module
- if (is_object($hookmanager)) {
+ global $action, $hookmanager;
+ $hookmanager->initHooks(array('mouvementstock'));
+ // Hook of thirdparty module
+ if (is_object($hookmanager)) {
$parameters = array(
- 'currentcontext' => 'mouvementstock',
- 'user' => &$user,
- 'fk_product' => &$fk_product,
- 'entrepot_id' => &$entrepot_id,
- 'qty' => &$qty,
- 'type' => &$type,
- 'price' => &$price,
- 'label' => &$label,
- 'inventorycode' => &$inventorycode,
- 'datem' => &$datem,
- 'eatby' => &$eatby,
- 'sellby' => &$sellby,
- 'batch' => &$batch,
- 'skip_batch' => &$skip_batch,
- 'id_product_batch' => &$id_product_batch
+ 'currentcontext' => 'mouvementstock',
+ 'user' => &$user,
+ 'fk_product' => &$fk_product,
+ 'entrepot_id' => &$entrepot_id,
+ 'qty' => &$qty,
+ 'type' => &$type,
+ 'price' => &$price,
+ 'label' => &$label,
+ 'inventorycode' => &$inventorycode,
+ 'datem' => &$datem,
+ 'eatby' => &$eatby,
+ 'sellby' => &$sellby,
+ 'batch' => &$batch,
+ 'skip_batch' => &$skip_batch,
+ 'id_product_batch' => &$id_product_batch
);
$reshook = $hookmanager->executeHooks('stockMovementCreate', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
@@ -190,8 +190,8 @@ class MouvementStock extends CommonObject
} elseif ($reshook > 0) {
return $hookmanager->resPrint;
}
- }
- // end hook at beginning
+ }
+ // end hook at beginning
// Clean parameters
$price = price2num($price, 'MU'); // Clean value for the casse we receive a float zero value, to have it a real zero value.
@@ -244,10 +244,8 @@ class MouvementStock extends CommonObject
$product->load_stock('novirtual');
// Test if product require batch data. If yes, and there is not, we throw an error.
- if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch)
- {
- if (empty($batch))
- {
+ if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) {
+ if (empty($batch)) {
$langs->load("errors");
$this->errors[] = $langs->transnoentitiesnoconv("ErrorTryToMakeMoveOnProductRequiringBatchData", $product->ref);
dol_syslog("Try to make a movement of a product with status_batch on without any batch data");
@@ -266,23 +264,17 @@ class MouvementStock extends CommonObject
$sql .= " WHERE pb.fk_product = ".$fk_product." AND pb.batch = '".$this->db->escape($batch)."'";
dol_syslog(get_class($this)."::_create scan serial for this product to check if eatby and sellby match", LOG_DEBUG);
$resql = $this->db->query($sql);
- if ($resql)
- {
+ if ($resql) {
$num = $this->db->num_rows($resql);
$i = 0;
- if ($num > 0)
- {
- while ($i < $num)
- {
+ if ($num > 0) {
+ while ($i < $num) {
$obj = $this->db->fetch_object($resql);
- if ($obj->eatby)
- {
- if ($eatby)
- {
+ if ($obj->eatby) {
+ if ($eatby) {
$tmparray = dol_getdate($eatby, true);
$eatbywithouthour = dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']);
- if ($this->db->jdate($obj->eatby) != $eatby && $this->db->jdate($obj->eatby) != $eatbywithouthour) // We test date without hours and with hours for backward compatibility
- {
+ if ($this->db->jdate($obj->eatby) != $eatby && $this->db->jdate($obj->eatby) != $eatbywithouthour) { // We test date without hours and with hours for backward compatibility
// If found and eatby/sellby defined into table and provided and differs, return error
$langs->load("stocks");
$this->errors[] = $langs->transnoentitiesnoconv("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($this->db->jdate($obj->eatby), 'dayhour'), dol_print_date($eatbywithouthour, 'dayhour'));
@@ -294,14 +286,12 @@ class MouvementStock extends CommonObject
$eatby = $obj->eatby; // If found and eatby/sellby defined into table and not provided, we take value from table
}
} else {
- if ($eatby) // If found and eatby/sellby not defined into table and provided, we update table
- {
+ if ($eatby) { // If found and eatby/sellby not defined into table and provided, we update table
$productlot = new Productlot($this->db);
$result = $productlot->fetch($obj->rowid);
$productlot->eatby = $eatby;
$result = $productlot->update($user);
- if ($result <= 0)
- {
+ if ($result <= 0) {
$this->error = $productlot->error;
$this->errors = $productlot->errors;
$this->db->rollback();
@@ -309,14 +299,11 @@ class MouvementStock extends CommonObject
}
}
}
- if ($obj->sellby)
- {
- if ($sellby)
- {
+ if ($obj->sellby) {
+ if ($sellby) {
$tmparray = dol_getdate($sellby, true);
$sellbywithouthour = dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']);
- if ($this->db->jdate($obj->sellby) != $sellby && $this->db->jdate($obj->sellby) != $sellbywithouthour) // We test date without hours and with hours for backward compatibility
- {
+ if ($this->db->jdate($obj->sellby) != $sellby && $this->db->jdate($obj->sellby) != $sellbywithouthour) { // We test date without hours and with hours for backward compatibility
// If found and eatby/sellby defined into table and provided and differs, return error
$this->errors[] = $langs->transnoentitiesnoconv("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($this->db->jdate($obj->sellby)), dol_print_date($sellby));
dol_syslog($langs->transnoentities("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($this->db->jdate($obj->sellby)), dol_print_date($sellby)), LOG_ERR);
@@ -326,17 +313,13 @@ class MouvementStock extends CommonObject
} else {
$sellby = $obj->sellby; // If found and eatby/sellby defined into table and not provided, we take value from table
}
- }
- else
- {
- if ($sellby) // If found and eatby/sellby not defined into table and provided, we update table
- {
+ } else {
+ if ($sellby) { // If found and eatby/sellby not defined into table and provided, we update table
$productlot = new Productlot($this->db);
$result = $productlot->fetch($obj->rowid);
$productlot->sellby = $sellby;
$result = $productlot->update($user);
- if ($result <= 0)
- {
+ if ($result <= 0) {
$this->error = $productlot->error;
$this->errors = $productlot->errors;
$this->db->rollback();
@@ -347,9 +330,7 @@ class MouvementStock extends CommonObject
$i++;
}
- }
- else // If not found, we add record
- {
+ } else { // If not found, we add record
$productlot = new Productlot($this->db);
$productlot->entity = $conf->entity;
$productlot->fk_product = $fk_product;
@@ -358,17 +339,14 @@ class MouvementStock extends CommonObject
$productlot->eatby = $eatby;
$productlot->sellby = $sellby;
$result = $productlot->create($user);
- if ($result <= 0)
- {
+ if ($result <= 0) {
$this->error = $productlot->error;
$this->errors = $productlot->errors;
$this->db->rollback();
return -4;
}
}
- }
- else
- {
+ } else {
dol_print_error($this->db);
$this->db->rollback();
return -1;
@@ -381,21 +359,17 @@ class MouvementStock extends CommonObject
// Check if stock is enough when qty is < 0
// Note that qty should be > 0 with type 0 or 3, < 0 with type 1 or 2.
- if ($movestock && $qty < 0 && empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER))
- {
- if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch)
- {
+ if ($movestock && $qty < 0 && empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) {
+ if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) {
$foundforbatch = 0;
$qtyisnotenough = 0;
- foreach ($product->stock_warehouse[$entrepot_id]->detail_batch as $batchcursor => $prodbatch)
- {
+ foreach ($product->stock_warehouse[$entrepot_id]->detail_batch as $batchcursor => $prodbatch) {
if ($batch != $batchcursor) continue;
$foundforbatch = 1;
if ($prodbatch->qty < abs($qty)) $qtyisnotenough = $prodbatch->qty;
break;
}
- if (!$foundforbatch || $qtyisnotenough)
- {
+ if (!$foundforbatch || $qtyisnotenough) {
$langs->load("stocks");
include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
$tmpwarehouse = new Entrepot($this->db);
@@ -406,11 +380,8 @@ class MouvementStock extends CommonObject
$this->db->rollback();
return -8;
}
- }
- else
- {
- if (empty($product->stock_warehouse[$entrepot_id]->real) || $product->stock_warehouse[$entrepot_id]->real < abs($qty))
- {
+ } else {
+ if (empty($product->stock_warehouse[$entrepot_id]->real) || $product->stock_warehouse[$entrepot_id]->real < abs($qty)) {
$langs->load("stocks");
$this->error = $langs->trans('qtyToTranferIsNotEnough').' : '.$product->ref;
$this->errors[] = $langs->trans('qtyToTranferIsNotEnough').' : '.$product->ref;
@@ -420,8 +391,7 @@ class MouvementStock extends CommonObject
}
}
- if ($movestock && $entrepot_id > 0) // Change stock for current product, change for subproduct is done after
- {
+ if ($movestock && $entrepot_id > 0) { // Change stock for current product, change for subproduct is done after
// Set $origintype, fk_origin, fk_project
$fk_project = 0;
if (!empty($this->origin)) { // This is set by caller for tracking reason
@@ -431,10 +401,8 @@ class MouvementStock extends CommonObject
$fk_project = $fk_origin;
} else {
$res = $this->origin->fetch($fk_origin);
- if ($res > 0)
- {
- if (!empty($this->origin->fk_project))
- {
+ if ($res > 0) {
+ if (!empty($this->origin->fk_project)) {
$fk_project = $this->origin->fk_project;
}
}
@@ -466,13 +434,10 @@ class MouvementStock extends CommonObject
dol_syslog(get_class($this)."::_create insert record into stock_mouvement", LOG_DEBUG);
$resql = $this->db->query($sql);
- if ($resql)
- {
+ if ($resql) {
$mvid = $this->db->last_insert_id(MAIN_DB_PREFIX."stock_mouvement");
$this->id = $mvid;
- }
- else
- {
+ } else {
$this->error = $this->db->lasterror();
$this->errors[] = $this->error;
$error = -1;
@@ -485,18 +450,15 @@ class MouvementStock extends CommonObject
// Test if there is already a record for couple (warehouse / product), so later we will make an update or create.
$alreadyarecord = 0;
- if (!$error)
- {
+ if (!$error) {
$sql = "SELECT rowid, reel FROM ".MAIN_DB_PREFIX."product_stock";
$sql .= " WHERE fk_entrepot = ".((int) $entrepot_id)." AND fk_product = ".((int) $fk_product); // This is a unique key
dol_syslog(get_class($this)."::_create check if a record already exists in product_stock", LOG_DEBUG);
$resql = $this->db->query($sql);
- if ($resql)
- {
+ if ($resql) {
$obj = $this->db->fetch_object($resql);
- if ($obj)
- {
+ if ($obj) {
$alreadyarecord = 1;
$oldqtywarehouse = $obj->reel;
$fk_product_stock = $obj->rowid;
@@ -510,10 +472,8 @@ class MouvementStock extends CommonObject
// Calculate new AWP (PMP)
$newpmp = 0;
- if (!$error)
- {
- if ($type == 0 || $type == 3)
- {
+ if (!$error) {
+ if ($type == 0 || $type == 3) {
// After a stock increase
// Note: PMP is calculated on stock input only (type of movement = 0 or 3). If type == 0 or 3, qty should be > 0.
// Note: Price should always be >0 or 0. PMP should be always >0 (calculated on input)
@@ -540,10 +500,8 @@ class MouvementStock extends CommonObject
}
}
// Update stock quantity
- if (!$error)
- {
- if ($alreadyarecord > 0)
- {
+ if (!$error) {
+ if ($alreadyarecord > 0) {
$sql = "UPDATE ".MAIN_DB_PREFIX."product_stock SET reel = reel + ".((float) $qty);
$sql .= " WHERE fk_entrepot = ".((int) $entrepot_id)." AND fk_product = ".((int) $fk_product);
} else {
@@ -554,39 +512,29 @@ class MouvementStock extends CommonObject
dol_syslog(get_class($this)."::_create update stock value", LOG_DEBUG);
$resql = $this->db->query($sql);
- if (!$resql)
- {
+ if (!$resql) {
$this->errors[] = $this->db->lasterror();
$error = -3;
- }
- elseif (empty($fk_product_stock))
- {
+ } elseif (empty($fk_product_stock)) {
$fk_product_stock = $this->db->last_insert_id(MAIN_DB_PREFIX."product_stock");
}
}
// Update detail stock for batch product
- if (!$error && !empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch)
- {
+ if (!$error && !empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) {
// check unicity for serial numbered equipments ( different for lots managed products)
- if ( $product->status_batch == 2 && $qty > 0 )
- {
- if ( $this->getBatchCount($fk_product, $batch) > 0 )
- {
+ if ( $product->status_batch == 2 && $qty > 0 ) {
+ if ( $this->getBatchCount($fk_product, $batch) > 0 ) {
$error++;
$this->errors[] = $langs->trans("SerialNumberAlreadyInUse", $batch, $product->ref);
- }
- elseif ( $qty > 1 )
- {
+ } elseif ( $qty > 1 ) {
$error++;
$this->errors[] = $langs->trans("TooManyQtyForSerialNumber", $product->ref, $batch);
}
}
- if ( ! $error )
- {
- if ($id_product_batch > 0)
- {
+ if ( ! $error ) {
+ if ($id_product_batch > 0) {
$result = $this->createBatch($id_product_batch, $qty);
} else {
$param_batch = array('fk_product_stock' =>$fk_product_stock, 'batchnumber'=>$batch);
@@ -597,8 +545,7 @@ class MouvementStock extends CommonObject
}
// Update PMP and denormalized value of stock qty at product level
- if (!$error)
- {
+ if (!$error) {
$newpmp = price2num($newpmp, 'MU');
// $sql = "UPDATE ".MAIN_DB_PREFIX."product SET pmp = ".$newpmp.", stock = ".$this->db->ifsql("stock IS NULL", 0, "stock") . " + ".$qty;
@@ -610,8 +557,7 @@ class MouvementStock extends CommonObject
dol_syslog(get_class($this)."::_create update AWP", LOG_DEBUG);
$resql = $this->db->query($sql);
- if (!$resql)
- {
+ if (!$resql) {
$this->errors[] = $this->db->lasterror();
$error = -4;
}
@@ -625,26 +571,21 @@ class MouvementStock extends CommonObject
}
// Add movement for sub products (recursive call)
- if (!$error && !empty($conf->global->PRODUIT_SOUSPRODUITS) && empty($conf->global->INDEPENDANT_SUBPRODUCT_STOCK) && empty($disablestockchangeforsubproduct))
- {
+ if (!$error && !empty($conf->global->PRODUIT_SOUSPRODUITS) && empty($conf->global->INDEPENDANT_SUBPRODUCT_STOCK) && empty($disablestockchangeforsubproduct)) {
$error = $this->_createSubProduct($user, $fk_product, $entrepot_id, $qty, $type, 0, $label, $inventorycode); // we use 0 as price, because AWP must not change for subproduct
}
- if ($movestock && !$error)
- {
+ if ($movestock && !$error) {
// Call trigger
$result = $this->call_trigger('STOCK_MOVEMENT', $user);
if ($result < 0) $error++;
// End call triggers
}
- if (!$error)
- {
+ if (!$error) {
$this->db->commit();
return $mvid;
- }
- else
- {
+ } else {
$this->db->rollback();
dol_syslog(get_class($this)."::_create error code=".$error, LOG_ERR);
return -6;
@@ -768,35 +709,27 @@ class MouvementStock extends CommonObject
dol_syslog(get_class($this)."::_createSubProduct for parent product ".$idProduct, LOG_DEBUG);
$resql = $this->db->query($sql);
- if ($resql)
- {
+ if ($resql) {
$i = 0;
- while ($obj = $this->db->fetch_object($resql))
- {
+ while ($obj = $this->db->fetch_object($resql)) {
$pids[$i] = $obj->fk_product_fils;
$pqtys[$i] = $obj->qty;
$i++;
}
$this->db->free($resql);
- }
- else
- {
+ } else {
$error = -2;
}
// Create movement for each subproduct
- foreach ($pids as $key => $value)
- {
- if (!$error)
- {
+ foreach ($pids as $key => $value) {
+ if (!$error) {
$tmpmove = dol_clone($this, 1);
$result = $tmpmove->_create($user, $pids[$key], $entrepot_id, ($qty * $pqtys[$key]), $type, 0, $label, $inventorycode); // This will also call _createSubProduct making this recursive
- if ($result < 0)
- {
+ if ($result < 0) {
$this->error = $tmpmove->error;
$this->errors = array_merge($this->errors, $tmpmove->errors);
- if ($result == -2)
- {
+ if ($result == -2) {
$this->errors[] = $langs->trans("ErrorNoteAlsoThatSubProductCantBeFollowedByLot");
}
$error = $result;
@@ -862,27 +795,26 @@ class MouvementStock extends CommonObject
}
- /**
- * Return nb of subproducts lines for a product
- *
- * @param int $id Id of product
- * @return int <0 if KO, nb of subproducts if OK
- * @deprecated A count($product->getChildsArbo($id,1)) is same. No reason to have this in this class.
- */
- /*
- public function nbOfSubProducts($id)
- {
- $nbSP=0;
+ // /**
+ // * Return nb of subproducts lines for a product
+ // *
+ // * @param int $id Id of product
+ // * @return int <0 if KO, nb of subproducts if OK
+ // * @deprecated A count($product->getChildsArbo($id,1)) is same. No reason to have this in this class.
+ // */
+ // public function nbOfSubProducts($id)
+ // {
+ // $nbSP=0;
- $resql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."product_association";
- $resql.= " WHERE fk_product_pere = ".((int) $id);
- if ($this->db->query($resql))
- {
- $obj=$this->db->fetch_object($resql);
- $nbSP=$obj->nb;
- }
- return $nbSP;
- }*/
+ // $resql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."product_association";
+ // $resql.= " WHERE fk_product_pere = ".((int) $id);
+ // if ($this->db->query($resql))
+ // {
+ // $obj=$this->db->fetch_object($resql);
+ // $nbSP=$obj->nb;
+ // }
+ // return $nbSP;
+ // }
/**
* Count number of product in stock before a specific date
@@ -901,8 +833,7 @@ class MouvementStock extends CommonObject
dol_syslog(get_class($this).__METHOD__.'', LOG_DEBUG);
$resql = $this->db->query($sql);
- if ($resql)
- {
+ if ($resql) {
$obj = $this->db->fetch_object($resql);
if ($obj) $nb = $obj->nb;
return (empty($nb) ? 0 : $nb);
@@ -930,19 +861,16 @@ class MouvementStock extends CommonObject
$result = 0;
// Try to find an existing record with same batch number or id
- if (is_numeric($dluo))
- {
+ if (is_numeric($dluo)) {
$result = $pdluo->fetch($dluo);
- if (empty($pdluo->id))
- {
+ if (empty($pdluo->id)) {
// We didn't find the line. May be it was deleted before by a previous move in same transaction.
$this->error = 'Error. You ask a move on a record for a serial that does not exists anymore. May be you take the same serial on same warehouse several times in same shipment or it was used by another shipment. Remove this shipment and prepare another one.';
$this->errors[] = $this->error;
$result = -2;
}
} elseif (is_array($dluo)) {
- if (isset($dluo['fk_product_stock']))
- {
+ if (isset($dluo['fk_product_stock'])) {
$vfk_product_stock = $dluo['fk_product_stock'];
$vbatchnumber = $dluo['batchnumber'];
@@ -956,8 +884,7 @@ class MouvementStock extends CommonObject
$result = -1;
}
- if ($result >= 0)
- {
+ if ($result >= 0) {
// No error
if ($pdluo->id > 0) { // product_batch record found
//print "Avant ".$pdluo->qty." Apres ".($pdluo->qty + $qty)." ";
@@ -975,8 +902,7 @@ class MouvementStock extends CommonObject
$pdluo->batch = $vbatchnumber;
$result = $pdluo->create($user, 1);
- if ($result < 0)
- {
+ if ($result < 0) {
$this->error = $pdluo->error;
$this->errors = $pdluo->errors;
}
@@ -1036,6 +962,10 @@ class MouvementStock extends CommonObject
require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php';
$origin = new Reception($this->db);
break;
+ case 'inventory':
+ require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
+ $origin = new Inventory($this->db);
+ break;
default:
if ($origintype) {
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index e53675d8bb6..6def79ac36d 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -3332,17 +3332,58 @@ class Societe extends CommonObject
{
// phpcs:enable
if ($this->id) {
- $sql = "UPDATE ".MAIN_DB_PREFIX."societe";
- $sql .= " SET parent = ".($id > 0 ? $id : "null");
- $sql .= " WHERE rowid = ".$this->id;
- dol_syslog(get_class($this).'::set_parent', LOG_DEBUG);
- $resql = $this->db->query($sql);
- if ($resql) {
- $this->parent = $id;
+ // Check if the id we want to add as parent has not already one parent that is the current id we try to update
+ $sameparent = $this->validateFamilyTree($id, $this->id, 0);
+ if ($sameparent < 0) {
+ return -1;
+ } elseif ($sameparent == 1) {
+ setEventMessages('ParentCompanyToAddIsAlreadyAChildOfModifiedCompany', null, 'warnings');
+ return -1;
+ } else {
+ $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe SET parent = '.($id > 0 ? $id : 'null').' WHERE rowid = '.((int) $this->id);
+ dol_syslog(get_class($this).'::set_parent', LOG_DEBUG);
+ $resql = $this->db->query($sql);
+ if ($resql) {
+ $this->parent = $id;
+ return 1;
+ } else {
+ return -1;
+ }
+ }
+ } else {
+ return -1;
+ }
+ }
+
+ /**
+ * Check if a thirdparty $idchild is or not inside the parents (or grand parents) of another thirdparty id $idparent.
+ *
+ * @param int $idparent Id of thirdparty to check
+ * @param int $idchild Id of thirdparty to compare to
+ * @param int $counter Counter to protect against infinite loops
+ * @return int <0 if KO, 0 if OK or 1 if at some level a parent company was the child to compare to
+ */
+ public function validateFamilyTree($idparent, $idchild, $counter = 0)
+ {
+ if ($counter > 100) {
+ dol_syslog("Too high level of parent - child for company. May be an infinite loop ?", LOG_WARNING);
+ }
+
+ $sql = 'SELECT s.parent';
+ $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
+ $sql .= ' WHERE rowid = '.$idparent;
+ $resql = $this->db->query($sql);
+ if ($resql) {
+ $obj = $this->db->fetch_object($resql);
+
+ if ($obj->parent == '') {
+ return 0;
+ } elseif ($obj->parent == $idchild) {
return 1;
} else {
- return -1;
+ $sameparent = $this->validateFamilyTree($obj->parent, $idchild, ($counter + 1));
}
+ return $sameparent;
} else {
return -1;
}
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index f79857d744f..0a3e9207a96 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -467,10 +467,10 @@ if ($search_sale && $search_sale != '-1') {
$sql .= ", sc.fk_soc, sc.fk_user";
}
// We'll need these fields in order to filter by categ
-if ($search_categ_cus) {
+if ($search_categ_cus && $search_categ_cus!=-1) {
$sql .= ", cc.fk_categorie, cc.fk_soc";
}
-if ($search_categ_sup) {
+if ($search_categ_sup && $search_categ_sup!=-1) {
$sql .= ", cs.fk_categorie, cs.fk_soc";
}
// Add fields from extrafields
@@ -494,10 +494,10 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_effectif as staff on (staff.id = s.fk_ef
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as region on (region. code_region = state.fk_region)";
// We'll need this table joined to the select in order to filter by categ
-if (!empty($search_categ_cus)) {
+if (!empty($search_categ_cus) && $search_categ_cus!=-1) {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ
}
-if (!empty($search_categ_sup)) {
+if (!empty($search_categ_sup) && $search_categ_sup!=-1) {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; // We'll need this table joined to the select in order to filter by categ
}
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."c_stcomm as st ON s.fk_stcomm = st.id";
diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php
index d874266f81d..7122c252cbe 100644
--- a/htdocs/theme/eldy/btn.inc.php
+++ b/htdocs/theme/eldy/btn.inc.php
@@ -51,7 +51,12 @@ if (!empty($conf->global->THEME_DARKMODEENABLED)) {
}*/
div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused, div.tabsAction > a.butActionDelete,
div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tabsAction > span.butActionDelete,
-div.tabsAction > div.divButAction > span.butAction {
+div.tabsAction > div.divButAction > span.butAction,
+div.tabsAction > div.divButAction > span.butActionDelete,
+div.tabsAction > div.divButAction > span.butActionRefused,
+div.tabsAction > div.divButAction > a.butAction,
+div.tabsAction > div.divButAction > a.butActionDelete,
+div.tabsAction > div.divButAction > a.butActionRefused {
margin-bottom: 1.4em !important;
margin-right: 0px !important;
}
@@ -303,6 +308,23 @@ div.pagination li:first-child a.btnTitle{
}
}
+/* rule to reduce top menu - 3rd reduction: The menu for user is on left */
+@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */
+{
+ .butAction, .butActionRefused, .butActionDelete {
+ font-size: 0.9em;
+ }
+}
+
+/* smartphone */
+@media only screen and (max-width: 767px)
+{
+ .butAction, .butActionRefused, .butActionDelete {
+ font-size: 0.85em;
+ }
+}
+
+
global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (!$user->admin)) { ?>
.butActionRefused, .butActionNewRefused, .btnTitle.refused {
display: none !important;
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index e451a2af30b..6c705c62489 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -902,8 +902,8 @@ span.fa.fa-plus-circle.paddingleft {
height: 28px;
vertical-align: middle;
}
-.divsocialnetwork:not(:first-child) {
- padding-left: 20px;
+.divsocialnetwork:not(:last-child) {
+ padding-: 20px;
}
div.divsearchfield {
float: ;
@@ -1027,6 +1027,7 @@ ul.attendees li {
list-style-type: none;
padding-top:1px;
padding-bottom:1px;
+ line-height: 1.6em;
}
.googlerefreshcal {
padding-top: 4px;
@@ -1472,6 +1473,10 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select
width: calc(100% - 40px) !important;
display: inline-block;
}
+ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-selection), input.widthcentpercentminusxx {
+ width: calc(100% - 70px) !important;
+ display: inline-block;
+ }
.logopublicpayment #dolpaymentlogo {
max-width: 260px;
@@ -6770,10 +6775,14 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before
/* For copy-paste feature */
/* ============================================================================== */
+span.clipboardCPValueToPrint {
+ display: inline-block;
+}
span.clipboardCPValue.hidewithsize {
width: 0 !important;
display: inline-block;
color: transparent;
+ white-space: nowrap;
}
.clipboardCPShowOnHover .clipboardCPButton {
diff --git a/htdocs/theme/md/btn.inc.php b/htdocs/theme/md/btn.inc.php
index c0d6e2c9cd7..2517415a96f 100644
--- a/htdocs/theme/md/btn.inc.php
+++ b/htdocs/theme/md/btn.inc.php
@@ -379,6 +379,23 @@ div.pagination .btnTitle:hover .btnTitle-label{
}
}
+/* rule to reduce top menu - 3rd reduction: The menu for user is on left */
+@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */
+{
+ .butAction, .butActionRefused, .butActionDelete {
+ font-size: 0.9em;
+ }
+}
+
+/* smartphone */
+@media only screen and (max-width: 767px)
+{
+ .butAction, .butActionRefused, .butActionDelete {
+ font-size: 0.85em;
+ }
+}
+
+
global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (!$user->admin)) { ?>
.butActionRefused, .butActionNewRefused, .btnTitle.refused {
display: none !important;
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 1ebe047ead7..407a38ea320 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -1002,8 +1002,8 @@ body[class*="colorblind-"] .text-success{
height: 28px;
vertical-align: middle;
}
-.divsocialnetwork:not(:first-child) {
- padding-left: 20px;
+.divsocialnetwork:not(:last-child) {
+ padding-: 20px;
}
div.divsearchfield {
float: ;
@@ -1496,6 +1496,18 @@ table[summary="list_of_modules"] .fa-cog {
padding-right: 10px !important;
}
+ .hideonsmartphone { display: none; }
+ .hideonsmartphoneimp { display: none !important; }
+
+ select.minwidth100imp, select.minwidth100, select.minwidth200, select.minwidth200imp, select.minwidth300 {
+ width: calc(100% - 40px) !important;
+ display: inline-block;
+ }
+ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-selection), input.widthcentpercentminusxx {
+ width: calc(100% - 70px) !important;
+ display: inline-block;
+ }
+
.poweredbyimg {
width: 48px;
}
@@ -1580,8 +1592,6 @@ table[summary="list_of_modules"] .fa-cog {
line-height: 1.4em;
}
- .hideonsmartphone { display: none; }
- .hideonsmartphoneimp { display: none !important; }
.noenlargeonsmartphone { width : 50px !important; display: inline !important; }
.maxwidthonsmartphone, #search_newcompany.ui-autocomplete-input { max-width: 100px; }
.maxwidth50onsmartphone { max-width: 40px; }
@@ -6634,10 +6644,14 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before
/* For copy-paste feature */
/* ============================================================================== */
+span.clipboardCPValueToPrint {
+ display: inline-block;
+}
span.clipboardCPValue.hidewithsize {
width: 0 !important;
display: inline-block;
color: transparent;
+ white-space: nowrap;
}
.clipboardCPShowOnHover .clipboardCPButton {
diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php
index 3faf6dc770c..b474bdfc678 100644
--- a/htdocs/user/agenda_extsites.php
+++ b/htdocs/user/agenda_extsites.php
@@ -206,15 +206,15 @@ while ($i <= $MAXAGENDA) {
print ''.$langs->trans("AgendaExtNb", $key)." ";
// Name
$name_value = (GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$key) ?GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$key) : (empty($object->conf->$name) ? '' : $object->conf->$name));
- print ' ';
+ print ' ';
// URL
$src_value = (GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key) ?GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key) : (empty($object->conf->$src) ? '' : $object->conf->$src));
- print ' ';
+ print ' ';
// Offset TZ
$offsettz_value = (GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key) ? GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key) : (empty($object->conf->$offsettz) ? 0 : $object->conf->$offsettz));
print ' ';
// Color (Possible colors are limited by Google)
- print '';
+ print ' ';
//print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist);
$color_value = (GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key) ?GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key) : (empty($object->conf->$color) ? 'ffffff' : $object->conf->$color));
print $formother->selectColor($color_value, "AGENDA_EXT_COLOR_".$id.'_'.$key, 'extsitesconfig', 1, '', 'hideifnotset');
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index 595dd8154d6..cb4e7350e0e 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -2718,9 +2718,8 @@ if ($action == 'create' || $action == 'adduserldap') {
if ($action != 'edit' && $action != 'presend') {
print '';
- /*
- * Generated documents
- */
+
+ // Generated documents
$filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->user->dir_output."/".dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
@@ -2741,7 +2740,6 @@ if ($action == 'create' || $action == 'adduserldap') {
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'user', $socid, 1);
-
print '
';
}
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 981374996cf..b8e63ea8f19 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -2558,11 +2558,13 @@ class User extends CommonObject
/**
* Return clickable link of login (eventualy with picto)
*
- * @param int $withpicto Include picto into link
- * @param string $option Sur quoi pointe le lien
- * @return string Chaine avec URL
+ * @param int $withpictoimg Include picto into link
+ * @param string $option On what the link point to ('leave', 'accountancy', 'nolink', )
+ * @param integer $notooltip 1=Disable tooltip on picto and name
+ * @param string $morecss Add more css on link
+ * @return string String with URL
*/
- public function getLoginUrl($withpicto = 0, $option = '')
+ public function getLoginUrl($withpictoimg = 0, $option = '', $notooltip = 0, $morecss = '')
{
global $langs, $user;
@@ -2587,11 +2589,23 @@ class User extends CommonObject
}
$result .= $linkstart;
- if ($withpicto) {
- $result .= img_object($langs->trans("ShowUser"), 'user', 'class="paddingright"');
+ if ($withpictoimg) {
+ $paddafterimage = '';
+ if (abs($withpictoimg) == 1) {
+ $paddafterimage = 'style="margin-'.($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right').': 3px;"';
+ }
+ // Only picto
+ if ($withpictoimg > 0) {
+ $picto = ''.img_object('', 'user', $paddafterimage.' '.($notooltip ? '' : 'class="paddingright classfortooltip"'), 0, 0, $notooltip ? 0 : 1).' ';
+ } else {
+ // Picto must be a photo
+ $picto = ''.Form::showphoto('userphoto', $this, 0, 0, 0, 'userphoto'.($withpictoimg == -3 ? 'small' : ''), 'mini', 0, 1).' ';
+ }
+ $result .= $picto;
}
$result .= $this->login;
$result .= $linkend;
+
return $result;
}
diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php
index 2856f787b52..b492e31177f 100644
--- a/htdocs/user/param_ihm.php
+++ b/htdocs/user/param_ihm.php
@@ -231,19 +231,9 @@ if ($action == 'edit') {
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
- if (!empty($conf->use_javascript_ajax)) {/*
- print '';*/
- }
+ print dol_get_fiche_end();
+
+
if (!empty($conf->use_javascript_ajax)) {
print '