From 1770a46519aaf4105c0170008357a39d6bb03c2d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Tue, 22 Nov 2011 14:00:03 +0100 Subject: [PATCH] Qual: Removed tons of warning --- htdocs/adherents/class/adherent.class.php | 3 +- htdocs/comm/propal/class/propal.class.php | 1 + htdocs/commande/class/commande.class.php | 5 ++- htdocs/compta/facture/class/facture.class.php | 2 ++ .../class/bon-prelevement.class.php | 6 ++-- htdocs/core/class/commonobject.class.php | 1 + htdocs/core/class/html.form.class.php | 2 +- htdocs/core/lib/company.lib.php | 15 ++++---- htdocs/core/lib/pdf.lib.php | 9 +++++ htdocs/core/lib/usergroups.lib.php | 27 ++++++--------- htdocs/core/menus/standard/empty.php | 4 +-- .../pdf/pdf_muscadet.modules.php | 2 +- htdocs/ftp/pre.inc.php | 15 +++++--- .../service/actions_card_service.class.php | 3 +- htdocs/societe/class/societe.class.php | 34 ------------------- 15 files changed, 57 insertions(+), 72 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 18673422697..694e696d6ee 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -435,7 +435,8 @@ class Adherent extends CommonObject include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); $hookmanager->callHooks(array('memberdao')); - $parameters=array('socid'=>$socid); + $parameters=array('id'=>$this->id); + $action=''; $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 4a3d30f1bd2..6450eab568f 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -921,6 +921,7 @@ class Propal extends CommonObject if (is_object($hookmanager)) { $parameters=array('objFrom'=>$objFrom); + $action=''; $reshook=$hookmanager->executeHooks('createfrom',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) $error++; } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 1c8214cd583..4734a881ed0 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -829,6 +829,7 @@ class Commande extends CommonObject if (is_object($hookmanager)) { $parameters=array('objFrom'=>$objFrom); + $action=''; $reshook=$hookmanager->executeHooks('createfrom',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) $error++; } @@ -924,6 +925,7 @@ class Commande extends CommonObject $hookmanager->callHooks(array('orderdao')); $parameters=array('objFrom'=>$object); + $action=''; $reshook=$hookmanager->executeHooks('createfrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) $error++; @@ -1580,7 +1582,8 @@ class Commande extends CommonObject $this->stocks = array(); // Tableau des id de produit de la commande - + $array_of_product=array(); + // Recherche total en stock pour chaque produit if (count($array_of_product)) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 6a7c2a2116b..899f5e49c04 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -570,6 +570,7 @@ class Facture extends CommonObject if (is_object($hookmanager)) { $parameters=array('objFrom'=>$objFrom); + $action=''; $reshook=$hookmanager->executeHooks('createfrom',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) $error++; } @@ -665,6 +666,7 @@ class Facture extends CommonObject $hookmanager->callHooks(array('invoicedao')); $parameters=array('objFrom'=>$object); + $action=''; $reshook=$hookmanager->executeHooks('createfrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) $error++; diff --git a/htdocs/compta/prelevement/class/bon-prelevement.class.php b/htdocs/compta/prelevement/class/bon-prelevement.class.php index 2f496754c29..8176aa153f9 100644 --- a/htdocs/compta/prelevement/class/bon-prelevement.class.php +++ b/htdocs/compta/prelevement/class/bon-prelevement.class.php @@ -715,15 +715,15 @@ class BonPrelevement extends CommonObject * Create a withdraw * * @param int $banque code of bank - * @param int $guichet code of banck office + * @param int $agence code of bank office (guichet) * @param string $mode real=do action, simu=test only * @return int <0 if KO, nbre of invoice withdrawed if OK */ - function Create($banque=0, $guichet=0, $mode='real') + function Create($banque=0, $agence=0, $mode='real') { global $conf,$langs; - dol_syslog("BonPrelevement::Create banque=$banque guichet=$guichet"); + dol_syslog("BonPrelevement::Create banque=$banque agence=$agence"); require_once (DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); require_once (DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e23d5694880..476d683c68e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2127,6 +2127,7 @@ abstract class CommonObject if (empty($line->fk_parent_line)) { $parameters=array('line'=>$line,'var'=>$var,'i'=>$i); + $action=''; $reshook=$hookmanager->executeHooks('printOriginObjectLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 27289b06b2b..9087c5bbd48 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1810,7 +1810,7 @@ class Form $tmparray[$obj->rowid]['label']=$label; $i++; } - $this->cache_demand_reason=dol_sort_array($tmparray,'label', $order='asc', $natsort, $case_sensitive); + $this->cache_demand_reason=dol_sort_array($tmparray,'label', $order='asc'); unset($tmparray); return 1; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 16059e6fbe3..17ed5593e2d 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -480,11 +480,12 @@ function show_projects($conf,$langs,$db,$object,$backtopage='') /** * Show html area for list of contacts - * @param conf Object conf - * @param langs Object langs - * @param db Database handler - * @param object Third party object - * @param backtopage Url to go once contact is created + * + * @param Conf $conf Object conf + * @param Translate $langs Object langs + * @param DoliDB $db Database handler + * @param Object $object Third party object + * @param string $backtopage Url to go once contact is created */ function show_contacts($conf,$langs,$db,$object,$backtopage='') { @@ -743,6 +744,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) /** * Show html area with actions done + * * @param conf Object conf * @param langs Object langs * @param db Object db @@ -837,6 +839,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) $numaction++; $i++; } + $db->free($resql); } else { @@ -967,8 +970,6 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) } $out.="</table>\n"; $out.="<br>\n"; - - $db->free($result); } if ($noprint) return $out; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 3db6fe164c8..7c94b19b66c 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -685,6 +685,7 @@ function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hide $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('pdf'=>$pdf,'i'=>$i,'outputlangs'=>$outputlangs,'w'=>$w,'h'=>$h,'posx'=>$posx,'posy'=>$posy,'hideref'=>$hideref,'hidedesc'=>$hidedesc,'issupplierline'=>$issupplierline,'special_code'=>$special_code); + $action=''; $reshook=$hookmanager->executeHooks('pdf_writelinedesc',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks } else @@ -929,6 +930,7 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0,$hookmanager= $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; return $hookmanager->executeHooks('pdf_getlinevatrate',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks } else @@ -959,6 +961,7 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0,$hookmanage $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; return $hookmanager->executeHooks('pdf_getlineupexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks } else @@ -985,6 +988,7 @@ function pdf_getlineqty($object,$i,$outputlangs,$hidedetails=0,$hookmanager=fals $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; return $hookmanager->executeHooks('pdf_getlineqty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks } else @@ -1013,6 +1017,7 @@ function pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails=0,$hookmanage $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; return $hookmanager->executeHooks('pdf_getlineqty_asked',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks } else @@ -1041,6 +1046,7 @@ function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0,$hookmana $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; return $hookmanager->executeHooks('pdf_getlineqty_shipped',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks } else @@ -1069,6 +1075,7 @@ function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0,$hookm $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; return $hookmanager->executeHooks('pdf_getlineqty_keeptoship',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks } else @@ -1099,6 +1106,7 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0,$hookma $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; return $hookmanager->executeHooks('pdf_getlineremisepercent',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks } else @@ -1136,6 +1144,7 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0,$hookman $special_code = $object->lines[$i]->special_code; if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); + $action=''; return $hookmanager->executeHooks('pdf_getlinetotalexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks } else diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index ed5b6bfeed1..001c1ca6c18 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -142,9 +142,10 @@ function group_prepare_head($object) /** * Show list of themes. Show all thumbs of themes - * @param fuser User concerned or '' for global theme - * @param edit 1 to add edit form - * @param foruserprofile Show for user profile view + * + * @param User $fuser User concerned or '' for global theme + * @param int $edit 1 to add edit form + * @param boolean $foruserprofile Show for user profile view */ function show_theme($fuser,$edit=0,$foruserprofile=false) { @@ -166,21 +167,21 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) // Title if ($foruserprofile) { - print '<tr class="liste_titre"><td width="25%">'.$langs->trans("Parameter").'</td><td width="25%">'.$langs->trans("DefaultValue").'</td>'; - print '<td colspan="2"> </td>'; + print '<tr class="liste_titre"><th width="25%">'.$langs->trans("Parameter").'</th><th width="25%">'.$langs->trans("DefaultValue").'</th>'; + print '<th colspan="2"> </th>'; print '</tr>'; } else { - print '<tr class="liste_titre"><td width="35%">'.$langs->trans("DefaultSkin").'</td>'; - print '<td align="right">'; + print '<tr class="liste_titre"><th width="35%">'.$langs->trans("DefaultSkin").'</th>'; + print '<th align="right">'; $url='http://www.dolistore.com/lang-en/4-skins'; if (preg_match('/fr/i',$langs->defaultlang)) $url='http://www.dolistore.com/lang-fr/4-themes'; //if (preg_match('/es/i',$langs->defaultlang)) $url='http://www.dolistore.com/lang-es/4-themes'; print '<a href="'.$url.'" target="_blank">'; print $langs->trans('DownloadMoreSkins'); print '</a>'; - print '</td></tr>'; + print '</th></tr>'; } $var=false; @@ -190,8 +191,8 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) print '<tr '.$bc[$var].'>'; print '<td>'.$langs->trans("DefaultSkin").'</td>'; print '<td>'.$conf->global->MAIN_THEME.'</td>'; - print '<td '.$bc[$var].' align="left" nowrap="nowrap" width="20%"><input '.$bc[$var].' name="check_MAIN_THEME"'.($edit?'':' disabled').' type="checkbox" '.($selected_theme?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>'; - print '<td '.$bc[$var].'> </td>'; + print '<td align="left" nowrap="nowrap" width="20%"><input '.$bc[$var].' name="check_MAIN_THEME"'.($edit?'':' disabled').' type="checkbox" '.($selected_theme?" checked":"").'> '.$langs->trans("UsePersonalValue").'</td>'; + print '<td> </td>'; print '</tr>'; } @@ -203,12 +204,6 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) print '</tr>'; } - if ($edit) - { - if ($subdir == $conf->global->MAIN_THEME) $title=$langs->trans("ThemeCurrentlyActive"); - else $title=$langs->trans("ShowPreview"); - } - $var=!$var; print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'; diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index e7ac7d0e6f4..6efd12367da 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -56,10 +56,10 @@ class MenuTop { $classname='class="tmenu"'; print_start_menu_entry_empty($idsel); - print '<a class="tmenuimage" href="'.dol_buildpath('/index.php',1).'?mainmenu=home&leftmenu="'.($atarget?" target=$atarget":"").'>'; + print '<a class="tmenuimage" href="'.dol_buildpath('/index.php',1).'?mainmenu=home&leftmenu="'.($this->atarget?' target="'.$this->atarget.'"':'').'>'; print '<div class="mainmenu '.$idsel.'"><span class="mainmenu_'.$idsel.' tmenuimage" id="mainmenuspan_'.$idsel.'"></span></div>'; print '</a>'; - print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($tabMenu[$i]['atarget']?" target='".$tabMenu[$i]['atarget']."'":($atarget?" target=$atarget":"")).'>'; + print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.DOL_URL_ROOT.'"'.($this->atarget?' target="'.$this->atarget.'"':'').'>'; print_text_menu_entry_empty($langs->trans("Home")); print '</a>'; print_end_menu_entry_empty(); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 625dbdee60c..bd78be5eb83 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -358,7 +358,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if ($deja_regle || $amount_credit_notes_included || $amount_deposits_included) { - $this->_tableau_versements($pdf, $fac, $posy); + $this->_tableau_versements($pdf, $object, $posy); } // Pied de page diff --git a/htdocs/ftp/pre.inc.php b/htdocs/ftp/pre.inc.php index 2fd4c498d2d..fac2eefa0fe 100644 --- a/htdocs/ftp/pre.inc.php +++ b/htdocs/ftp/pre.inc.php @@ -28,13 +28,18 @@ $user->getrights('ecm'); /** * Replace the default llxHeader function * - * @param string $head Optionnal head lines - * @param string $title HTML title - * @param string $help_url Link to online url help - * @param string $morehtml More content into html header + * @param string $head Optionnal head lines + * @param string $title HTML title + * @param string $help_url Link to online url help + * @param string $morehtml More content into html header + * @param string $target Force target on menu links + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array $arrayofjs Array of complementary js files + * @param array $arrayofcss Array of complementary css files * @return none */ -function llxHeader($head = '', $title='', $help_url='', $morehtml='') +function llxHeader($head = '', $title='', $help_url='', $morehtml='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='') { global $conf,$langs,$user; $langs->load("ftp"); diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index f43399e4670..dd3b7e1e98c 100755 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -282,7 +282,7 @@ class ActionsCardService extends Product } else { - dol_print_error($db,$sql); + dol_print_error($this->db,$sql); } } @@ -298,6 +298,7 @@ class ActionsCardService extends Product function LoadListDatas($limit, $offset, $sortfield, $sortorder) { global $conf; + global $search_categ,$sall,$sref,$sbarcode,$snom,$catid; $this->getFieldList(); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index f36853e6bae..3d1b5ac9f70 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1005,40 +1005,6 @@ class Societe extends CommonObject } - /** - * \brief Retournes les factures impayees de la societe - * \return array tableau des id de factures impayees - * - */ - function factures_impayes() - { - $facimp = array(); - /* - * Lignes - */ - $sql = "SELECT f.rowid"; - $sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = '".$this->id . "'"; - $sql .= " AND f.fk_statut = '1' AND f.paye = '0'"; - - $resql=$this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i = 0; - - while ($i < $num) - { - $objp = $this->db->fetch_object($resql); - $array_push($facimp, $objp->rowid); - $i++; - print $i; - } - - $this->db->free(); - } - return $facimp; - } - /** * Update record to set prefix */ -- GitLab