diff --git a/build/exe/doliwamp/Languages/MyCatalan.isl b/build/exe/doliwamp/Languages/MyCatalan.isl
index b157d1cea27..cb1066b5f91 100644
--- a/build/exe/doliwamp/Languages/MyCatalan.isl
+++ b/build/exe/doliwamp/Languages/MyCatalan.isl
@@ -43,5 +43,5 @@ DoliWampWillStartApacheMysql=L'instal·lador DoliWamp intentarà iniciar o reini
OldVersionFoundAndMoveInNew=S'ha trobat una versió antiga de base de dades i ha estat moguda per a ser utilitzada per la nova versió de Dolibarr
OldVersionFoundButFailedToMoveInNew=S'ha trobat una versió antiga de base de dades, però no es pot moure per a ser utilitzada per la nova versió de Dolibarr
-DLLMissing=La teva instal·lació windows no té el component "Microsoft Visual C++ Redistributable for Visual Studio 2012". Instal·la primer la versió de 32-bit (vcredist_x86.exe) (pots trobar-la a https://www.microsoft.com/en-us/download/) i reiniciar després la instal·lació/actualització de DoliWamp.
+DLLMissing=La teva instal·lació windows no té el component "Microsoft Visual C++ Redistributable for Visual Studio 2015". Instal·la primer la versió de 32-bit (vcredist_x86.exe) (pots trobar-la a https://www.microsoft.com/en-us/download/) i reiniciar després la instal·lació/actualització de DoliWamp.
ContinueAnyway=Continua igualment (el procés d'instal·lació podria fallar sense aquest prerequisit)
diff --git a/build/exe/doliwamp/Languages/MyEnglish.isl b/build/exe/doliwamp/Languages/MyEnglish.isl
index 7ad94c4ca86..237513cd311 100644
--- a/build/exe/doliwamp/Languages/MyEnglish.isl
+++ b/build/exe/doliwamp/Languages/MyEnglish.isl
@@ -44,5 +44,5 @@ DoliWampWillStartApacheMysql=DoliWamp installer will now start or restart Apache
OldVersionFoundAndMoveInNew=An old database version has been found and moved to be used by new Dolibarr version
OldVersionFoundButFailedToMoveInNew=An old database version has been found but could not be moved to be used with new Dolibarr version
-DLLMissing=Your Windows installation is missing The "Micrsoft Visual C++ Redistributable for Visual Studio 2012" component. Please install the 32-bit version (vcredist_x86.exe) first (you can find it at https://www.microsoft.com/en-us/download/) and restart DoliWamp installation/upgrade after.
+DLLMissing=Your Windows installation is missing The "Micrsoft Visual C++ Redistributable for Visual Studio 2015" component. Please install the 32-bit version (vcredist_x86.exe) first (you can find it at https://www.microsoft.com/en-us/download/) and restart DoliWamp installation/upgrade after.
ContinueAnyway=Continue anyway (install process may fails without this prerequisite)
diff --git a/build/exe/doliwamp/Languages/MyFrench.isl b/build/exe/doliwamp/Languages/MyFrench.isl
index c3fd15cbac8..6c6294fb7c4 100644
--- a/build/exe/doliwamp/Languages/MyFrench.isl
+++ b/build/exe/doliwamp/Languages/MyFrench.isl
@@ -44,5 +44,5 @@ DoliWampWillStartApacheMysql=L'installeur DoliWamp va maintenant d
OldVersionFoundAndMoveInNew=Une ancienne version de base a été trouvée et déplacée pour fonctionner avec la nouvelle version de Dolibarr.
OldVersionFoundButFailedToMoveInNew=Une ancienne version de base a été trouvée mais ne peut être déplacée pour être utilisée avec la nouvelle version de Dolibarr.
-DLLMissing=L'installation de votre Windows est incomplète. Il manque le composant "Micrsoft Visual C++ Redistributable for Visual Studio 2012". Installer la version 32-bit (vcredist_x86.exe) d'abord (vous pourrez le trouver à https://www.microsoft.com/fr-fr/download/) puis relancer l'installation de DoliWamp après.
+DLLMissing=L'installation de votre Windows est incomplète. Il manque le composant "Micrsoft Visual C++ Redistributable for Visual Studio 2015". Installer la version 32-bit (vcredist_x86.exe) d'abord (vous pourrez le trouver à https://www.microsoft.com/fr-fr/download/) puis relancer l'installation de DoliWamp après.
ContinueAnyway=Continuer malgré tout (le process d'installaton échouera)
diff --git a/build/exe/doliwamp/Languages/MyGerman.isl b/build/exe/doliwamp/Languages/MyGerman.isl
index 8bfd78dbea2..132260b7273 100644
--- a/build/exe/doliwamp/Languages/MyGerman.isl
+++ b/build/exe/doliwamp/Languages/MyGerman.isl
@@ -43,5 +43,5 @@ DoliWampWillStartApacheMysql=Die DoliWamp-Installation wird nun starten oder Apa
OldVersionFoundAndMoveInNew=Eine alte Datenbankversion wurde gefunden und verschoben, um von der neuen Dolibarr-Version verwendet zu werden.
OldVersionFoundButFailedToMoveInNew=Eine alte Datenbankversion wurde gefunden, konnte jedoch nicht verschoben werden, um mit der neuen Dolibarr-Version verwendet zu werden.
-DLLMissing=Your Windows installation is missing The "Micrsoft Visual C++ Redistributable for Visual Studio 2012" component. Please install the 32-bit version (vcredist_x86.exe) first (you can find it at https://www.microsoft.com/en-us/download/) and restart DoliWamp installation/upgrade after.
+DLLMissing=Your Windows installation is missing The "Micrsoft Visual C++ Redistributable for Visual Studio 2015" component. Please install the 32-bit version (vcredist_x86.exe) first (you can find it at https://www.microsoft.com/en-us/download/) and restart DoliWamp installation/upgrade after.
ContinueAnyway=Fahren Sie trotzdem fort (der Installationsvorgang kann ohne diese Voraussetzung fehlschlagen).
diff --git a/build/exe/doliwamp/Languages/MySpanish.isl b/build/exe/doliwamp/Languages/MySpanish.isl
index c31aedf895f..6880a9263e1 100644
--- a/build/exe/doliwamp/Languages/MySpanish.isl
+++ b/build/exe/doliwamp/Languages/MySpanish.isl
@@ -43,5 +43,5 @@ DoliWampWillStartApacheMysql=El instalador DoliWamp intentará iniciar o reinici
OldVersionFoundAndMoveInNew=Se ha encontrado una versión antigua de base de datos y ha sido movida para ser utilizada por la nueva versión de Dolibarr
OldVersionFoundButFailedToMoveInNew=Se ha encontrado una versión antigua de base de datos, pero no se pudo mover para ser utilizada por la nueva versión de Dolibarr
-DLLMissing=Su instalación Windows no tiene el componente "Microsoft Visual C++ Redistributable for Visual Studio 2012". Instale primero la versión de 32-bit (vcredist_x86.exe) (puedes encontrarlo en https://www.microsoft.com/en-us/download/) y reiniciar después la instalación/actualización de DoliWamp.
+DLLMissing=Su instalación Windows no tiene el componente "Microsoft Visual C++ Redistributable for Visual Studio 2015". Instale primero la versión de 32-bit (vcredist_x86.exe) (puedes encontrarlo en https://www.microsoft.com/en-us/download/) y reiniciar después la instalación/actualización de DoliWamp.
ContinueAnyway=Continua igualmente (el proceso de instalación podría fallar sin este prerequisito)
diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php
index 27226d388f6..a3b94ad21c5 100644
--- a/htdocs/accountancy/admin/fiscalyear.php
+++ b/htdocs/accountancy/admin/fiscalyear.php
@@ -97,7 +97,7 @@ $help_url = "EN:Module_Double_Entry_Accounting";
llxHeader('', $title, $help_url);
-$sql = "SELECT f.rowid, f.label, f.date_start, f.date_end, f.statut, f.entity";
+$sql = "SELECT f.rowid, f.label, f.date_start, f.date_end, f.statut as status, f.entity";
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear as f";
$sql .= " WHERE f.entity = ".$conf->entity;
$sql .= $db->order($sortfield, $sortorder);
@@ -144,7 +144,10 @@ if ($result) {
while ($i < $num && $i < $max) {
$obj = $db->fetch_object($result);
+ $fiscalyearstatic->ref = $obj->rowid;
$fiscalyearstatic->id = $obj->rowid;
+ $fiscalyearstatic->statut = $obj->status;
+ $fiscalyearstatic->status = $obj->status;
print '
';
print '';
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index c19777c9007..cf3ea671257 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -1251,6 +1251,8 @@ if ($id > 0) {
$sql .= natural_search("f.code", $search_code);
} elseif ($search_code != '' && $id == 2) {
$sql .= natural_search("d.code_departement", $search_code);
+ } elseif ($search_code != '' && $id == 14) {
+ $sql .= natural_search("e.code", $search_code);
} elseif ($search_code != '' && $id != 9) {
$sql .= natural_search("code", $search_code);
}
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index ab814957e5b..8af61c8d721 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -582,8 +582,16 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on
// Local calendar
$s .= ' '.$langs->trans("LocalAgenda").'
';
- // Holiday calendar
- $s .= ' '.$langs->trans("Holidays").'
';
+ if ($user->rights->holiday->read) {
+ // Holiday calendar
+ $s .= '
+
+
+ ' . $langs->trans("Holidays") . '
+
+
';
+ }
// External calendars
if (is_array($showextcals) && count($showextcals) > 0) {
@@ -998,76 +1006,78 @@ if ($showbirthday) {
}
}
-// LEAVE CALENDAR
-$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status";
-$sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
-$sql .= " WHERE u.rowid = x.fk_user";
-$sql .= " AND u.statut = '1'"; // Show only active users (0 = inactive user, 1 = active user)
-$sql .= " AND (x.statut = '2' OR x.statut = '3')"; // Show only public leaves (2 = leave wait for approval, 3 = leave approved)
+if ($user->rights->holiday->read) {
+ // LEAVE CALENDAR
+ $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status";
+ $sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
+ $sql .= " WHERE u.rowid = x.fk_user";
+ $sql .= " AND u.statut = '1'"; // Show only active users (0 = inactive user, 1 = active user)
+ $sql .= " AND (x.statut = '2' OR x.statut = '3')"; // Show only public leaves (2 = leave wait for approval, 3 = leave approved)
-if ($mode == 'show_day') {
- // Request only leaves for the current selected day
- $sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin"; // date_debut and date_fin are date without time
-} elseif ($mode == 'show_week') {
- // TODO: Add filter to reduce database request
-} elseif ($mode == 'show_month') {
- // TODO: Add filter to reduce database request
-}
+ if ($mode == 'show_day') {
+ // Request only leaves for the current selected day
+ $sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin"; // date_debut and date_fin are date without time
+ } elseif ($mode == 'show_week') {
+ // TODO: Add filter to reduce database request
+ } elseif ($mode == 'show_month') {
+ // TODO: Add filter to reduce database request
+ }
-$resql = $db->query($sql);
-if ($resql) {
- $num = $db->num_rows($resql);
- $i = 0;
+ $resql = $db->query($sql);
+ if ($resql) {
+ $num = $db->num_rows($resql);
+ $i = 0;
- while ($i < $num) {
- $obj = $db->fetch_object($resql);
+ while ($i < $num) {
+ $obj = $db->fetch_object($resql);
- $event = new ActionComm($db);
+ $event = new ActionComm($db);
- // Need the id of the leave object for link to it
- $event->id = $obj->rowid;
- $event->ref = $event->id;
+ // Need the id of the leave object for link to it
+ $event->id = $obj->rowid;
+ $event->ref = $event->id;
- $event->type_code = 'HOLIDAY';
- $event->type_label = '';
- $event->type_color = '';
- $event->type = 'holiday';
- $event->type_picto = 'holiday';
+ $event->type_code = 'HOLIDAY';
+ $event->type_label = '';
+ $event->type_color = '';
+ $event->type = 'holiday';
+ $event->type_picto = 'holiday';
- $event->datep = $db->jdate($obj->date_start) + (empty($halfday) || $halfday == 1 ? 0 : 12 * 60 * 60 - 1);
- $event->datef = $db->jdate($obj->date_end) + (empty($halfday) || $halfday == -1 ? 24 : 12) * 60 * 60 - 1;
- $event->date_start_in_calendar = $event->datep;
- $event->date_end_in_calendar = $event->datef;
+ $event->datep = $db->jdate($obj->date_start) + (empty($halfday) || $halfday == 1 ? 0 : 12 * 60 * 60 - 1);
+ $event->datef = $db->jdate($obj->date_end) + (empty($halfday) || $halfday == -1 ? 24 : 12) * 60 * 60 - 1;
+ $event->date_start_in_calendar = $event->datep;
+ $event->date_end_in_calendar = $event->datef;
- if ($obj->status == 3) {
- // Show no symbol for leave with state "leave approved"
- $event->percentage = -1;
- } elseif ($obj->status == 2) {
- // Show TO-DO symbol for leave with state "leave wait for approval"
- $event->percentage = 0;
+ if ($obj->status == 3) {
+ // Show no symbol for leave with state "leave approved"
+ $event->percentage = -1;
+ } elseif ($obj->status == 2) {
+ // Show TO-DO symbol for leave with state "leave wait for approval"
+ $event->percentage = 0;
+ }
+
+ if ($obj->halfday == 1) {
+ $event->label = $obj->lastname.' ('.$langs->trans("Morning").')';
+ } elseif ($obj->halfday == -1) {
+ $event->label = $obj->lastname.' ('.$langs->trans("Afternoon").')';
+ } else {
+ $event->label = $obj->lastname;
+ }
+
+ $daycursor = $event->date_start_in_calendar;
+ $annee = dol_print_date($daycursor, '%Y', 'tzuserrel');
+ $mois = dol_print_date($daycursor, '%m', 'tzuserrel');
+ $jour = dol_print_date($daycursor, '%d', 'tzuserrel');
+
+ $daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
+ do {
+ $eventarray[$daykey][] = $event;
+
+ $daykey += 60 * 60 * 24;
+ } while ($daykey <= $event->date_end_in_calendar);
+
+ $i++;
}
-
- if ($obj->halfday == 1) {
- $event->label = $obj->lastname.' ('.$langs->trans("Morning").')';
- } elseif ($obj->halfday == -1) {
- $event->label = $obj->lastname.' ('.$langs->trans("Afternoon").')';
- } else {
- $event->label = $obj->lastname;
- }
-
- $daycursor = $event->date_start_in_calendar;
- $annee = dol_print_date($daycursor, '%Y', 'tzuserrel');
- $mois = dol_print_date($daycursor, '%m', 'tzuserrel');
- $jour = dol_print_date($daycursor, '%d', 'tzuserrel');
-
- $daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
- do {
- $eventarray[$daykey][] = $event;
-
- $daykey += 60 * 60 * 24;
- } while ($daykey <= $event->date_end_in_calendar);
-
- $i++;
}
}
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 4bfe37810ed..f2143582584 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -1270,6 +1270,10 @@ class Propal extends CommonObject
dol_print_error($this->db);
break;
}
+
+ // Set the id on created row
+ $line->id = $result;
+
// Defined the new fk_parent_line
if ($result > 0 && $line->product_type == 9) {
$fk_parent_line = $result;
@@ -1403,6 +1407,8 @@ class Propal extends CommonObject
}
foreach ($object->lines as $line) {
+ $line->id = 0;
+
if ($line->fk_product > 0) {
$prod = new Product($this->db);
$res = $prod->fetch($line->fk_product);
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 1b1b77343dd..a37fa4575c6 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -1345,6 +1345,9 @@ class Commande extends CommonOrder
$line->marge_tx = $marginInfos[1];
$line->marque_tx = $marginInfos[2];
+ $line->origin = $object->element;
+ $line->origin_id = $object->lines[$i]->id;
+
// get extrafields from original line
$object->lines[$i]->fetch_optionals();
foreach ($object->lines[$i]->array_options as $options_key => $value) {
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 8169193ea08..948f195214a 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -222,6 +222,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
+$error = 0;
/*
@@ -513,6 +514,7 @@ if (empty($reshook)) {
} else {
$lineid = 0;
$error++;
+ $errors[] = $objecttmp->error;
break;
}
// Defined the new fk_parent_line
diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php
index 234eeb1e688..5fbc305b58b 100644
--- a/htdocs/core/actions_massactions.inc.php
+++ b/htdocs/core/actions_massactions.inc.php
@@ -752,7 +752,7 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto
$arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'\.pdf$';
}
foreach ($listofobjectref as $tmppdf) {
- $arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'_[a-zA-Z0-9\-\_\']+\.pdf$'; // To include PDF generated from ODX files
+ $arrayofinclusion[] = '^'.preg_quote(dol_sanitizeFileName($tmppdf), '/').'_[a-zA-Z0-9\-\_\'\&\.]+\.pdf$'; // To include PDF generated from ODX files
}
$listoffiles = dol_dir_list($uploaddir, 'all', 1, implode('|', $arrayofinclusion), '\.meta$|\.png', 'date', SORT_DESC, 0, true);
diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php
index 3ef8a3daddf..2e72fcc3365 100644
--- a/htdocs/core/boxes/box_graph_product_distribution.php
+++ b/htdocs/core/boxes/box_graph_product_distribution.php
@@ -161,7 +161,7 @@ class box_graph_product_distribution extends ModeleBoxes
$showpointvalue = 1;
$nocolor = 0;
$stats_proposal = new PropaleStats($this->db, $socid, ($userid > 0 ? $userid : 0));
- $data2 = $stats_proposal->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), 5);
+ $data2 = $stats_proposal->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), $max);
if (empty($data2)) {
$showpointvalue = 0;
$nocolor = 1;
@@ -224,7 +224,7 @@ class box_graph_product_distribution extends ModeleBoxes
$nocolor = 0;
$mode = 'customer';
$stats_order = new CommandeStats($this->db, $socid, $mode, ($userid > 0 ? $userid : 0));
- $data3 = $stats_order->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), 5);
+ $data3 = $stats_order->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), $max);
if (empty($data3)) {
$showpointvalue = 0;
$nocolor = 1;
@@ -288,7 +288,7 @@ class box_graph_product_distribution extends ModeleBoxes
$nocolor = 0;
$mode = 'customer';
$stats_invoice = new FactureStats($this->db, $socid, $mode, ($userid > 0 ? $userid : 0));
- $data1 = $stats_invoice->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), 5);
+ $data1 = $stats_invoice->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), $max);
if (empty($data1)) {
$showpointvalue = 0;
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 9bda1575d37..dd7b8731763 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -5715,9 +5715,15 @@ abstract class CommonObject
*/
public function addThumbs($file)
{
- global $maxwidthsmall, $maxheightsmall, $maxwidthmini, $maxheightmini, $quality;
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
- require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; // This define also $maxwidthsmall, $quality, ...
+ $tmparraysize = getDefaultImageSizes();
+ $maxwidthsmall = $tmparraysize['maxwidthsmall'];
+ $maxheightsmall = $tmparraysize['maxheightsmall'];
+ $maxwidthmini = $tmparraysize['maxwidthmini'];
+ $maxheightmini = $tmparraysize['maxheightmini'];
+ //$quality = $tmparraysize['quality'];
+ $quality = 50; // For thumbs, we force quality to 50
$file_osencoded = dol_osencode($file);
if (file_exists($file_osencoded)) {
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 830e8a29de8..e555e50b4db 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -1714,10 +1714,16 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess
$resupload = dol_move_uploaded_file($TFile['tmp_name'][$i], $destfull, $allowoverwrite, 0, $TFile['error'][$i], 0, $varfiles, $upload_dir);
if (is_numeric($resupload) && $resupload > 0) { // $resupload can be 'ErrorFileAlreadyExists'
- global $maxwidthsmall, $maxheightsmall, $maxwidthmini, $maxheightmini;
-
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
+ $tmparraysize = getDefaultImageSizes();
+ $maxwidthsmall = $tmparraysize['maxwidthsmall'];
+ $maxheightsmall = $tmparraysize['maxheightsmall'];
+ $maxwidthmini = $tmparraysize['maxwidthmini'];
+ $maxheightmini = $tmparraysize['maxheightmini'];
+ //$quality = $tmparraysize['quality'];
+ $quality = 50; // For thumbs, we force quality to 50
+
// Generate thumbs.
if ($generatethumbs) {
if (image_format_supported($destfull) == 1) {
@@ -1725,10 +1731,10 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess
// We can't use $object->addThumbs here because there is no $object known
// Used on logon for example
- $imgThumbSmall = vignette($destfull, $maxwidthsmall, $maxheightsmall, '_small', 50, "thumbs");
+ $imgThumbSmall = vignette($destfull, $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
// Create mini thumbs for image (Ratio is near 16/9)
// Used on menu or for setup page for example
- $imgThumbMini = vignette($destfull, $maxwidthmini, $maxheightmini, '_mini', 50, "thumbs");
+ $imgThumbMini = vignette($destfull, $maxwidthmini, $maxheightmini, '_mini', $quality, "thumbs");
}
}
diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php
index 9ca4684ef51..25cdae47e84 100644
--- a/htdocs/core/lib/images.lib.php
+++ b/htdocs/core/lib/images.lib.php
@@ -23,12 +23,34 @@
*/
// Define size of logo small and mini
+// TODO Remove this and call getDefaultImageSizes() instead
$maxwidthsmall = 480;
$maxheightsmall = 270; // Near 16/9eme
$maxwidthmini = 128;
$maxheightmini = 72; // 16/9eme
$quality = 80;
+/**
+ * Return default values for image sizes
+ *
+ * @return array Array of default values
+ */
+function getDefaultImageSizes()
+{
+ $maxwidthsmall = 480;
+ $maxheightsmall = 270; // Near 16/9eme
+ $maxwidthmini = 128;
+ $maxheightmini = 72; // 16/9eme
+ $quality = 80;
+
+ return array(
+ 'maxwidthsmall' => $maxwidthsmall,
+ 'maxheightsmall' => $maxheightsmall,
+ 'maxwidthmini' => $maxwidthmini,
+ 'maxheightmini' => $maxheightmini,
+ 'quality' => $quality
+ );
+}
/**
* Return if a filename is file name of a supported image format
diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql
index e6fc16a62d6..64966744fde 100644
--- a/htdocs/core/menus/init_menu_auguria.sql
+++ b/htdocs/core/menus/init_menu_auguria.sql
@@ -9,6 +9,7 @@ delete from llx_menu where menu_handler=__HANDLER__ and entity=__ENTITY__;
-- table llx_menu
--
+
-- Top-Menu
-- old: (module, enabled, rowid, ...)
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 1__+MAX_llx_menu__, '', '1', __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__);
@@ -17,7 +18,7 @@ insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, left
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 16__+MAX_llx_menu__, 'bom|mrp', '$conf->bom->enabled || $conf->mrp->enabled', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'MRP', -1, 'mrp', '$user->rights->bom->read||$user->rights->mrp->read', '', 0, 31, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', '$conf->project->enabled', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 5__+MAX_llx_menu__, 'propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__);
-insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire', '', 2, 50, __ENTITY__);
+insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire || ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire', '', 2, 50, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 14__+MAX_llx_menu__, 'banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 52, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 9__+MAX_llx_menu__, 'comptabilite|accounting|asset', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->asset->enabled', __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', -1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire || $user->rights->asset->read', '', 2, 54, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 8__+MAX_llx_menu__, '', '', __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__);
@@ -25,7 +26,7 @@ insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, left
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 15__+MAX_llx_menu__, 'hrm|holiday|deplacement|expensereport', '$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled', __HANDLER__, 'top', 'hrm', '', 0, '/hrm/index.php?mainmenu=hrm&leftmenu=', 'HRM', -1, 'holiday', '$user->rights->user->user->lire || $user->rights->holiday->read || $user->rights->deplacement->lire || $user->rights->expensereport->lire', '', 0, 80, __ENTITY__);
--- Sub-Menues
+-- Sub-Menus
-- Home - Dashboard
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 90__+MAX_llx_menu__, 'home', '', 1__+MAX_llx_menu__, '/index.php', 'MyDashboard', 0, '', '', '', 2, 0, __ENTITY__);
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index acefebb6a8f..25a0bbee175 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -346,7 +346,7 @@ if (empty($reshook)) {
}
//var_dump($batch_line[2]);
- if ($totalqty > 0 && !$error) { // There is at least one thing to ship and no error
+ if (($totalqty > 0 || !empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) && $error) { // There is at least one thing to ship and no error
for ($i = 0; $i < $num; $i++) {
$qty = "qtyl".$i;
if (!isset($batch_line[$i])) {
@@ -355,7 +355,7 @@ if (empty($reshook)) {
//shipment from multiple stock locations
$nbstockline = count($stockLine[$i]);
for ($j = 0; $j < $nbstockline; $j++) {
- if ($stockLine[$i][$j]['qty'] > 0) {
+ if ($stockLine[$i][$j]['qty'] > 0 || ($stockLine[$i][$j]['qty'] == 0 && !empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS))) {
$ret = $object->addline($stockLine[$i][$j]['warehouse_id'], $stockLine[$i][$j]['ix_l'], $stockLine[$i][$j]['qty'], $array_options[$i]);
if ($ret < 0) {
setEventMessages($object->error, $object->errors, 'errors');
@@ -364,7 +364,7 @@ if (empty($reshook)) {
}
}
} else {
- if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && $conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) {
+ if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && !empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS))) {
$ent = "entl".$i;
$idl = "idl".$i;
$entrepot_id = is_numeric(GETPOST($ent, 'int')) ?GETPOST($ent, 'int') : GETPOST('entrepot_id', 'int');
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 1f7326ed40a..04279cf7fe5 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -2612,10 +2612,22 @@ if ($action == 'create') {
,async:false
,dataType:"json"
,success:function(response) {
- if (response.response_status == "success"){
- jQuery("#value_unit_ht").val(response.data);
- jQuery("#value_unit_ht").trigger("change");
- jQuery("#value_unit").val("");
+ if (response.response_status == "success"){';
+
+ if (!empty($conf->global->EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY)) {
+ print '
+ jQuery("#value_unit").val(parseFloat(response.data) * (100 + parseFloat(tva)) / 100);
+ jQuery("#value_unit").trigger("change");
+ ';
+ } else {
+ print '
+ jQuery("#value_unit_ht").val(response.data);
+ jQuery("#value_unit_ht").trigger("change");
+ jQuery("#value_unit").val("");
+ ';
+ }
+
+ print '
} else if(response.response_status == "error" && response.errorMessage != undefined && response.errorMessage.length > 0 ){
$.jnotify(response.errorMessage, "error", {timeout: 0, type: "error"},{ remove: function (){} } );
}
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 ceff2a32f3c..861c69f79e6 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
@@ -741,6 +741,9 @@ 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;
+ALTER TABLE llx_overwrite_trans DROP INDEX uk_overwrite_trans;
+ALTER TABLE llx_overwrite_trans ADD UNIQUE INDEX uk_overwrite_trans(lang, transkey, entity);
+
-- 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);
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index f15d5f019ba..54146704708 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -798,7 +798,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
print ' ';
// Other options
- $parameters = array();
+ $parameters = array('arrayfields' => &$arrayfields);
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $taskstatic, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
@@ -1072,7 +1072,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
$j = 0; $level = 0;
$nboftaskshown = projectLinesa($j, 0, $tasksarray, $level, true, 0, $tasksrole, $object->id, 1, $object->id, $filterprogresscalc, ($object->usage_bill_time ? 1 : 0), $arrayfields);
} else {
- $colspan = 11;
+ $colspan = count($arrayfields);
if ($object->usage_bill_time) {
$colspan += 2;
}