Fix: fix not initialized variables
This commit is contained in:
parent
a95934c6d8
commit
b0aff1c927
@ -41,12 +41,11 @@ class BoutiqueCommande
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $DB Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function BoutiqueCommande($DB)
|
function BoutiqueCommande($db)
|
||||||
{
|
{
|
||||||
$this->db = $DB;
|
$this->db = $db;
|
||||||
$this->id = $id;
|
|
||||||
|
|
||||||
$this->billing_adr = new Address();
|
$this->billing_adr = new Address();
|
||||||
$this->delivry_adr = new Address();
|
$this->delivry_adr = new Address();
|
||||||
@ -107,7 +106,8 @@ class BoutiqueCommande
|
|||||||
if ( $result )
|
if ( $result )
|
||||||
{
|
{
|
||||||
$num = $this->db->num_rows($result);
|
$num = $this->db->num_rows($result);
|
||||||
|
|
||||||
|
$i=0;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$array = $this->db->fetch_array($result);
|
$array = $this->db->fetch_array($result);
|
||||||
|
|||||||
@ -41,12 +41,11 @@ class Promotion
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $DB Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function Promotion($DB)
|
function Promotion($db)
|
||||||
{
|
{
|
||||||
$this->db = $DB;
|
$this->db = $db;
|
||||||
$this->id = $id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -130,6 +130,8 @@ class Categorie
|
|||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
$langs->load('categories');
|
$langs->load('categories');
|
||||||
|
|
||||||
|
$error=0;
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
if (empty($this->visible)) $this->visible=0;
|
if (empty($this->visible)) $this->visible=0;
|
||||||
$this->parentId = ($this->id_mere) != "" ? intval($this->id_mere) : 0;
|
$this->parentId = ($this->id_mere) != "" ? intval($this->id_mere) : 0;
|
||||||
@ -209,6 +211,8 @@ class Categorie
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
|
$error=0;
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
$this->label=trim($this->label);
|
$this->label=trim($this->label);
|
||||||
$this->description=trim($this->description);
|
$this->description=trim($this->description);
|
||||||
|
|||||||
@ -500,7 +500,8 @@ class CMailFile
|
|||||||
|
|
||||||
if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir
|
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')
|
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -198,7 +198,8 @@ class CSMSFile
|
|||||||
|
|
||||||
if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir
|
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);
|
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
|
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);
|
fputs($fp, "\nResult id=".$result);
|
||||||
|
|
||||||
|
|||||||
@ -633,8 +633,8 @@ class Ldap
|
|||||||
//Create file
|
//Create file
|
||||||
$result=create_exdir($conf->ldap->dir_temp);
|
$result=create_exdir($conf->ldap->dir_temp);
|
||||||
|
|
||||||
$file=$conf->ldap->dir_temp.'/ldapinput.in';
|
$outputfile=$conf->ldap->dir_temp.'/ldapinput.in';
|
||||||
$fp=fopen($file,"w");
|
$fp=fopen($outputfile,"w");
|
||||||
if ($fp)
|
if ($fp)
|
||||||
{
|
{
|
||||||
fputs($fp, $content);
|
fputs($fp, $content);
|
||||||
|
|||||||
@ -495,6 +495,8 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
|
|||||||
global $conf, $user, $langs, $db;
|
global $conf, $user, $langs, $db;
|
||||||
global $object;
|
global $object;
|
||||||
|
|
||||||
|
$error=0;
|
||||||
|
|
||||||
$file_name = $dest_file;
|
$file_name = $dest_file;
|
||||||
// If an upload error has been reported
|
// If an upload error has been reported
|
||||||
if ($uploaderrorcode)
|
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);
|
dol_syslog("Functions.lib::dol_move_uploaded_file Failed to move ".$src_file." to ".$file_name, LOG_ERR);
|
||||||
return -3; // Unknown error
|
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;
|
global $db, $conf, $user, $langs;
|
||||||
|
|
||||||
|
$error=0;
|
||||||
|
|
||||||
//print "x".$file." ".$disableglob;
|
//print "x".$file." ".$disableglob;
|
||||||
$ok=true;
|
$ok=true;
|
||||||
$file_osencoded=dol_osencode($file); // New filename encoded in OS filesystem encoding charset
|
$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;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4417,7 +4417,8 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
|
|||||||
function printCommonFooter($zone='private')
|
function printCommonFooter($zone='private')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
global $micro_start_time;
|
||||||
|
|
||||||
if ($zone == 'private') print "\n".'<!-- Common footer for private page -->'."\n";
|
if ($zone == 'private') print "\n".'<!-- Common footer for private page -->'."\n";
|
||||||
else print "\n".'<!-- Common footer for public page -->'."\n";
|
else print "\n".'<!-- Common footer for public page -->'."\n";
|
||||||
|
|
||||||
|
|||||||
@ -936,7 +936,7 @@ function dol_set_user_param($db, $conf, &$user, $tab)
|
|||||||
foreach ($tab as $key => $value)
|
foreach ($tab as $key => $value)
|
||||||
{
|
{
|
||||||
// Set new parameters
|
// 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 = "INSERT INTO ".MAIN_DB_PREFIX."user_param(fk_user,entity,param,value)";
|
||||||
$sql.= " VALUES (".$user->id.",".$conf->entity.",";
|
$sql.= " VALUES (".$user->id.",".$conf->entity.",";
|
||||||
|
|||||||
@ -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)
|
if ($object->lines[$i]->date_start || $object->lines[$i]->date_end)
|
||||||
{
|
{
|
||||||
|
$format='day';
|
||||||
// Show duration if exists
|
// Show duration if exists
|
||||||
if ($object->lines[$i]->date_start && $object->lines[$i]->date_end)
|
if ($object->lines[$i]->date_start && $object->lines[$i]->date_end)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
*/
|
*/
|
||||||
function report_header($nom,$variante='',$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array())
|
function report_header($nom,$variante='',$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array())
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs, $hselected;
|
||||||
|
|
||||||
print "\n\n<!-- debut cartouche rapport -->\n";
|
print "\n\n<!-- debut cartouche rapport -->\n";
|
||||||
|
|
||||||
|
|||||||
@ -131,8 +131,6 @@ function show_list_sending_receive($origin='commande',$origin_id,$filter='')
|
|||||||
|
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
if ($somethingshown) print '<br>';
|
|
||||||
|
|
||||||
if ($filter) print_titre($langs->trans("OtherSendingsForSameOrder"));
|
if ($filter) print_titre($langs->trans("OtherSendingsForSameOrder"));
|
||||||
else print_titre($langs->trans("SendingsAndReceivingForSameOrder"));
|
else print_titre($langs->trans("SendingsAndReceivingForSameOrder"));
|
||||||
|
|
||||||
@ -191,7 +189,7 @@ function show_list_sending_receive($origin='commande',$origin_id,$filter='')
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<td>";
|
print "<td>";
|
||||||
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');
|
else $text = img_object($langs->trans('Product'),'product');
|
||||||
print $text.' '.nl2br($objp->description);
|
print $text.' '.nl2br($objp->description);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user