diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 96700ba1e167650aff061bf35ddc91c43b7a4d60..4ec093dfafc0ef67831e72932b8659cabc9d8406 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -179,7 +179,7 @@ $c=getServerTimeZoneInt('summer'); $daylight=(is_numeric($c) && is_numeric($b))?round($c-$b):'unknown'; //print $a." ".$b." ".$c." ".$daylight; $val=($a>=0?'+':'').$a; -$val.=' ('.($a==='unknown'?'unknown':($a>=0?'+':'').($a*3600)).')'; +$val.=' ('.($a=='unknown'?'unknown':($a>=0?'+':'').($a*3600)).')'; $val.=' '.getServerTimeZoneString(); $val.=' '.$langs->trans("DaylingSavingTime").': '.($daylight==='unknown'?'unknown':($a==$c?yn($daylight):yn(0).($daylight?' ('.$langs->trans('YesInSummer').')':''))); print $form->textwithtooltip($val,$txt,2,1,img_info('')); diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index e4ff0e4e0d1ff9cec48ced49c9a1c202551b61ef..5d64b7d9327aad698c6da78cc2b870ac45965f6d 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1295,11 +1295,9 @@ class Categorie extends CommonObject * * @param string $sdir Repertoire destination finale * @param string $file Nom du fichier uploade - * @param int $maxWidth Largeur maximum que dois faire la miniature (160 par defaut) - * @param int $maxHeight Hauteur maximum que dois faire la miniature (120 par defaut) * @return void */ - function add_photo($sdir, $file, $maxWidth = 160, $maxHeight = 120) + function add_photo($sdir, $file) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -1321,36 +1319,11 @@ class Categorie extends CommonObject if (file_exists($originImage)) { // Cree fichier en taille vignette - $this->add_thumb($originImage,$maxWidth,$maxHeight); + $this->add_thumb($originImage); } } } - /** - * Build thumb - * - * @param string $file Chemin du fichier d'origine - * @return void - */ - function add_thumb($file) - { - global $maxwidthsmall, $maxheightsmall, $maxwidthmini, $maxheightmini, $quality; - - require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; // This define also $maxwidthsmall, $quality, ... - - if (file_exists($file)) - { - // Create small thumbs for company (Ratio is near 16/9) - // Used on logon for example - $imgThumbSmall = vignette($file, $maxwidthsmall, $maxheightsmall, '_small', $quality); - - // Create mini thumbs for company (Ratio is near 16/9) - // Used on menu or for setup page for example - $imgThumbMini = vignette($file, $maxwidthmini, $maxheightmini, '_mini', $quality); - } - } - - /** * Return tableau de toutes les photos de la categorie * diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index c38b1a8e34f969c43a90f4744a81d066eaaab27a..e51ded5e2974657b29d4f25fc8b42292ea3a24e2 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -259,7 +259,7 @@ if ($resql) if ($search_user > 0) $param.='&search_user='.$search_user; if ($search_sale > 0) $param.='&search_sale='.$search_sale; if ($search_total_ht != '') $param.='&search_total_ht='.$search_total_ht; - + $num = $db->num_rows($resql); print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); $i = 0; @@ -337,7 +337,7 @@ if ($resql) $generic_commande = new Commande($db); $generic_product = new Product($db); - while ($i < min($num,$limit)) + while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); $var=!$var; @@ -368,7 +368,7 @@ if ($resql) $nbprod++; // order contains real products $generic_product->id = $generic_commande->lines[$lig]->fk_product; if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product])) { - $generic_product->load_stock(true); + $generic_product->load_stock(); $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_reel; } else { $generic_product->stock_reel = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel']; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a316c3cd5118c309e1b63c050b94b607e4cf61e1..fe9cfd2401304630e1db644205bc52b61f509fc4 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3458,6 +3458,31 @@ abstract class CommonObject } } + /** + * Build thumb + * + * @param string $file Path file in UTF8 to original file to create thumbs from. + * @return void + */ + function add_thumb($file) + { + global $maxwidthsmall, $maxheightsmall, $maxwidthmini, $maxheightmini, $quality; + + require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; // This define also $maxwidthsmall, $quality, ... + + $file_osencoded=dol_osencode($file); + if (file_exists($file_osencoded)) + { + // Create small thumbs for company (Ratio is near 16/9) + // Used on logon for example + $imgThumbSmall = vignette($file_osencoded, $maxwidthsmall, $maxheightsmall, '_small', $quality); + + // Create mini thumbs for company (Ratio is near 16/9) + // Used on menu or for setup page for example + $imgThumbMini = vignette($file_osencoded, $maxwidthmini, $maxheightmini, '_mini', $quality); + } + } + /* Functions common to commonobject and commonobjectline */ @@ -3624,7 +3649,7 @@ abstract class CommonObject $attributeType = $extrafields->attribute_type[$attributeKey]; $attributeSize = $extrafields->attribute_size[$attributeKey]; $attributeLabel = $extrafields->attribute_label[$attributeKey]; - $attributeParam = $extrafields->attribute_param[$attributeKey]; + $attributeParam = $extrafields->attribute_param[$attributeKey]; switch ($attributeType) { case 'int': diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 777b3633cb5540a071eb9286f046dd180dda438c..e5b60f4094cd29cf0d622921e2710576342f147a 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -95,6 +95,7 @@ function getServerTimeZoneInt($refgmtdate='now') } else { + $tmp=0; dol_print_error('','PHP version must be 5.3+'); /* // Method 2 (does not include daylight, not supported by adodb) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 63c0f6ce4336121f7be7e31ed270faa657108d50..c1845482eafbd7a0482fab9ccf4cf0ca9750458b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4542,7 +4542,7 @@ function utf8_check($str) /** - * Return an UTF-8 string encoded into OS filesystem encoding. This function is used to define + * Return a string encoded into OS filesystem encoding. This function is used to define * value to pass to filesystem PHP functions. * * @param string $str String to encode (UTF-8) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 02686a94f03400b246508d9f0767d230886bfa38..4c341e58906f7697769c2d636c023ffa3970d459 100755 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -138,6 +138,8 @@ class Product extends CommonObject var $stats_commande=array(); var $stats_contrat=array(); var $stats_facture=array(); + var $stats_commande_fournisseur=array(); + var $multilangs=array(); //! Taille de l'image @@ -3311,31 +3313,6 @@ class Product extends CommonObject else return -1; } - /** - * Build thumb - * - * @param string $file Chemin du fichier d'origine - * @return void - */ - function add_thumb($file) - { - global $maxwidthsmall, $maxheightsmall, $maxwidthmini, $maxheightmini, $quality; - - require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; // This define also $maxwidthsmall, $quality, ... - - $file_osencoded=dol_osencode($file); - if (file_exists($file_osencoded)) - { - // Create small thumbs for company (Ratio is near 16/9) - // Used on logon for example - $imgThumbSmall = vignette($file, $maxwidthsmall, $maxheightsmall, '_small', $quality); - - // Create mini thumbs for company (Ratio is near 16/9) - // Used on menu or for setup page for example - $imgThumbMini = vignette($file, $maxwidthmini, $maxheightmini, '_mini', $quality); - } - } - /** * Affiche la premiere photo du produit *