diff --git a/htdocs/boutique/commande/class/boutiquecommande.class.php b/htdocs/boutique/commande/class/boutiquecommande.class.php index 4b2d41e5221..143a4e3f1ad 100644 --- a/htdocs/boutique/commande/class/boutiquecommande.class.php +++ b/htdocs/boutique/commande/class/boutiquecommande.class.php @@ -41,12 +41,11 @@ class BoutiqueCommande /** * Constructor * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function BoutiqueCommande($DB) + function BoutiqueCommande($db) { - $this->db = $DB; - $this->id = $id; + $this->db = $db; $this->billing_adr = new Address(); $this->delivry_adr = new Address(); @@ -107,7 +106,8 @@ class BoutiqueCommande if ( $result ) { $num = $this->db->num_rows($result); - + + $i=0; while ($i < $num) { $array = $this->db->fetch_array($result); diff --git a/htdocs/boutique/promotion/class/promotion.class.php b/htdocs/boutique/promotion/class/promotion.class.php index d78c54e729f..5ee5a743a3f 100644 --- a/htdocs/boutique/promotion/class/promotion.class.php +++ b/htdocs/boutique/promotion/class/promotion.class.php @@ -41,12 +41,11 @@ class Promotion /** * Constructor * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function Promotion($DB) + function Promotion($db) { - $this->db = $DB; - $this->id = $id; + $this->db = $db; } /** diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index ab58b71972c..492f3ee15cd 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -130,6 +130,8 @@ class Categorie global $conf,$langs; $langs->load('categories'); + $error=0; + // Clean parameters if (empty($this->visible)) $this->visible=0; $this->parentId = ($this->id_mere) != "" ? intval($this->id_mere) : 0; @@ -209,6 +211,8 @@ class Categorie { global $conf, $langs; + $error=0; + // Clean parameters $this->label=trim($this->label); $this->description=trim($this->description); diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 32b51c8dd21..6b3337c4625 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -500,7 +500,8 @@ class CMailFile if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir { - $fp = fopen($dolibarr_main_data_root."/dolibarr_mail.log","w"); + $outputfile=$dolibarr_main_data_root."/dolibarr_mail.log"; + $fp = fopen($outputfile,"w"); if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') { diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index 658e09f2db3..4c0771ba7d8 100755 --- a/htdocs/core/class/CSMSFile.class.php +++ b/htdocs/core/class/CSMSFile.class.php @@ -198,7 +198,8 @@ class CSMSFile if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir { - $fp = fopen($dolibarr_main_data_root."/dolibarr_sms.log","w"); + $outputfile=$dolibarr_main_data_root."/dolibarr_sms.log"; + $fp = fopen($outputfile,"w"); fputs($fp, $this->message); @@ -218,7 +219,8 @@ class CSMSFile if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir { - $fp = fopen($dolibarr_main_data_root."/dolibarr_sms.log","a+"); + $outputfile=$dolibarr_main_data_root."/dolibarr_sms.log"; + $fp = fopen($outputfile,"a+"); fputs($fp, "\nResult id=".$result); diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index a8cf6927cef..1f2483fc91b 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -633,8 +633,8 @@ class Ldap //Create file $result=create_exdir($conf->ldap->dir_temp); - $file=$conf->ldap->dir_temp.'/ldapinput.in'; - $fp=fopen($file,"w"); + $outputfile=$conf->ldap->dir_temp.'/ldapinput.in'; + $fp=fopen($outputfile,"w"); if ($fp) { fputs($fp, $content); diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index bad2bc75e70..67e72ed3fc5 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -495,6 +495,8 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable global $conf, $user, $langs, $db; global $object; + $error=0; + $file_name = $dest_file; // If an upload error has been reported if ($uploaderrorcode) @@ -606,8 +608,6 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable dol_syslog("Functions.lib::dol_move_uploaded_file Failed to move ".$src_file." to ".$file_name, LOG_ERR); return -3; // Unknown error } - - return 1; } /** @@ -624,6 +624,8 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$notrigger=0,$objec { global $db, $conf, $user, $langs; + $error=0; + //print "x".$file." ".$disableglob; $ok=true; $file_osencoded=dol_osencode($file); // New filename encoded in OS filesystem encoding charset @@ -1003,8 +1005,6 @@ function dol_convert_file($file,$ext='png') { return -1; } - - return 1; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d34308792ee..9d6da6acf54 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4417,7 +4417,8 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode= function printCommonFooter($zone='private') { global $conf; - + global $micro_start_time; + if ($zone == 'private') print "\n".''."\n"; else print "\n".''."\n"; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 2e423d2c1a1..8ea11314e07 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -936,7 +936,7 @@ function dol_set_user_param($db, $conf, &$user, $tab) foreach ($tab as $key => $value) { // Set new parameters - if ($value && (! $url || in_array($key,array('sortfield','sortorder','begin','page')))) + if ($value) { $sql = "INSERT INTO ".MAIN_DB_PREFIX."user_param(fk_user,entity,param,value)"; $sql.= " VALUES (".$user->id.",".$conf->entity.","; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 31e90acfe3a..d557c73bf3d 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -806,6 +806,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl if ($object->lines[$i]->date_start || $object->lines[$i]->date_end) { + $format='day'; // Show duration if exists if ($object->lines[$i]->date_start && $object->lines[$i]->date_end) { diff --git a/htdocs/core/lib/report.lib.php b/htdocs/core/lib/report.lib.php index 79c3efb8dfc..02f982bcbb6 100644 --- a/htdocs/core/lib/report.lib.php +++ b/htdocs/core/lib/report.lib.php @@ -36,7 +36,7 @@ */ function report_header($nom,$variante='',$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array()) { - global $langs; + global $langs, $hselected; print "\n\n\n"; diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 26eb692c8bd..490fa576ace 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -131,8 +131,6 @@ function show_list_sending_receive($origin='commande',$origin_id,$filter='') if ($num) { - if ($somethingshown) print '
'; - if ($filter) print_titre($langs->trans("OtherSendingsForSameOrder")); else print_titre($langs->trans("SendingsAndReceivingForSameOrder")); @@ -191,7 +189,7 @@ function show_list_sending_receive($origin='commande',$origin_id,$filter='') else { print ""; - if ($type==1) $text = img_object($langs->trans('Service'),'service'); + if ($objp->fk_product_type==1) $text = img_object($langs->trans('Service'),'service'); else $text = img_object($langs->trans('Product'),'product'); print $text.' '.nl2br($objp->description);