Fix remove warnings

This commit is contained in:
Laurent Destailleur 2017-06-22 11:04:29 +02:00
parent 64eef9f89c
commit c7a6a67e20
5 changed files with 31 additions and 33 deletions

View File

@ -53,7 +53,7 @@ class Categorie extends CommonObject
const TYPE_PROJECT = 6; const TYPE_PROJECT = 6;
const TYPE_BANK_LINE = 'bank_line'; const TYPE_BANK_LINE = 'bank_line';
public $picto = 'category'; public $picto = 'category';
/** /**
* @var array ID mapping from type string * @var array ID mapping from type string
@ -557,7 +557,7 @@ class Categorie extends CommonObject
$error++; $error++;
} }
} }
if (! $error) if (! $error)
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_lang"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_lang";
@ -814,7 +814,7 @@ class Categorie extends CommonObject
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
while ($rec = $this->db->fetch_array($resql)) while ($rec = $this->db->fetch_array($resql))
{ {
if ($onlyids) if ($onlyids)
{ {
@ -938,7 +938,7 @@ class Categorie extends CommonObject
* *
* @return array Array of categories. this->cats and this->motherof are set. * @return array Array of categories. this->cats and this->motherof are set.
*/ */
function get_full_arbo($type,$markafterid=0) function get_full_arbo($type, $markafterid=0)
{ {
global $conf, $langs; global $conf, $langs;
@ -1355,7 +1355,7 @@ class Categorie extends CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX."bank_class as a, ".MAIN_DB_PREFIX."bank_categ as c"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_class as a, ".MAIN_DB_PREFIX."bank_categ as c";
$sql.= " WHERE a.lineid=".$id." AND a.fk_categ = c.rowid"; $sql.= " WHERE a.lineid=".$id." AND a.fk_categ = c.rowid";
$sql.= " ORDER BY c.label"; $sql.= " ORDER BY c.label";
$res = $this->db->query($sql); $res = $this->db->query($sql);
if ($res) if ($res)
{ {
@ -1377,7 +1377,7 @@ class Categorie extends CommonObject
{ {
dol_print_error($this->db); dol_print_error($this->db);
return -1; return -1;
} }
} }
else else
{ {
@ -1385,7 +1385,7 @@ class Categorie extends CommonObject
$sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as ct, " . MAIN_DB_PREFIX . "categorie as c"; $sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as ct, " . MAIN_DB_PREFIX . "categorie as c";
$sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . $this->MAP_CAT_FK[$type] . " = " . (int) $id . " AND c.type = " . $this->MAP_ID[$type]; $sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . $this->MAP_CAT_FK[$type] . " = " . (int) $id . " AND c.type = " . $this->MAP_ID[$type];
$sql .= " AND c.entity IN (" . getEntity( 'category', 1 ) . ")"; $sql .= " AND c.entity IN (" . getEntity( 'category', 1 ) . ")";
$res = $this->db->query($sql); $res = $this->db->query($sql);
if ($res) if ($res)
{ {
@ -1408,7 +1408,7 @@ class Categorie extends CommonObject
return -1; return -1;
} }
} }
return $cats; return $cats;
} }
@ -1434,7 +1434,7 @@ class Categorie extends CommonObject
$cats = array(); $cats = array();
// For backward compatibility // For backward compatibility
if (is_numeric( $type )) { if (is_numeric($type)) {
// We want to reverse lookup // We want to reverse lookup
$map_type = array_flip( $this->MAP_ID ); $map_type = array_flip( $this->MAP_ID );
$type = $map_type[$type]; $type = $map_type[$type];
@ -1782,8 +1782,8 @@ class Categorie extends CommonObject
{ {
return ''; return '';
} }
/** /**
* Initialise an instance with random values. * Initialise an instance with random values.
* Used to build previews or test instances. * Used to build previews or test instances.

View File

@ -36,9 +36,8 @@ $langs->load("categories");
if (! $user->rights->categorie->lire) accessforbidden(); if (! $user->rights->categorie->lire) accessforbidden();
$id=GETPOST('id','int'); $id=GETPOST('id','int');
$type=(GETPOST('type') ? GETPOST('type') : Categorie::TYPE_PRODUCT); $type=(GETPOST('type','aZ09') ? GETPOST('type','aZ09') : Categorie::TYPE_PRODUCT);
$catname=GETPOST('catname','alpha'); $catname=GETPOST('catname','alpha');
$section=(GETPOST('section')?GETPOST('section'):0);
/* /*
@ -48,14 +47,15 @@ $section=(GETPOST('section')?GETPOST('section'):0);
$categstatic = new Categorie($db); $categstatic = new Categorie($db);
$form = new Form($db); $form = new Form($db);
if ($type == Categorie::TYPE_PRODUCT) $title=$langs->trans("ProductsCategoriesArea"); if ($type == Categorie::TYPE_PRODUCT) { $title=$langs->trans("ProductsCategoriesArea"); $typetext='product'; }
elseif ($type == Categorie::TYPE_SUPPLIER) $title=$langs->trans("SuppliersCategoriesArea"); elseif ($type == Categorie::TYPE_SUPPLIER) { $title=$langs->trans("SuppliersCategoriesArea"); $typetext='supplier'; }
elseif ($type == Categorie::TYPE_CUSTOMER) $title=$langs->trans("CustomersCategoriesArea"); elseif ($type == Categorie::TYPE_CUSTOMER) { $title=$langs->trans("CustomersCategoriesArea"); $typetext='customer'; }
elseif ($type == Categorie::TYPE_MEMBER) $title=$langs->trans("MembersCategoriesArea"); elseif ($type == Categorie::TYPE_MEMBER) { $title=$langs->trans("MembersCategoriesArea"); $typetext='member'; }
elseif ($type == Categorie::TYPE_CONTACT) $title=$langs->trans("ContactsCategoriesArea"); elseif ($type == Categorie::TYPE_CONTACT) { $title=$langs->trans("ContactsCategoriesArea"); $typetext='contact'; }
elseif ($type == Categorie::TYPE_ACCOUNT) $title=$langs->trans("AccountsCategoriesArea"); elseif ($type == Categorie::TYPE_ACCOUNT) { $title=$langs->trans("AccountsCategoriesArea"); $typetext='account'; }
elseif ($type == Categorie::TYPE_PROJECT) $title=$langs->trans("ProjectsCategoriesArea"); elseif ($type == Categorie::TYPE_USER) { $title=$langs->trans("UsersCategoriesArea"); $typetext='user'; }
else $title=$langs->trans("CategoriesArea"); elseif ($type == Categorie::TYPE_PROJECT) { $title=$langs->trans("ProjectsCategoriesArea"); $typetext='project'; }
else { $title=$langs->trans("CategoriesArea"); $typetext='unknown'; }
$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); $arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css'); $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
@ -104,7 +104,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
*/ */
if ($catname || $id > 0) if ($catname || $id > 0)
{ {
$cats = $categstatic->rechercher($id,$catname,$type); $cats = $categstatic->rechercher($id, $catname, $typetext);
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("FoundCats").'</td></tr>'; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("FoundCats").'</td></tr>';
@ -140,7 +140,7 @@ print '<div class="fichecenter"><br>';
// Charge tableau des categories // Charge tableau des categories
$cate_arbo = $categstatic->get_full_arbo($type); $cate_arbo = $categstatic->get_full_arbo($typetext);
// Define fulltree array // Define fulltree array
$fulltree=$cate_arbo; $fulltree=$cate_arbo;

View File

@ -447,7 +447,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
{ {
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("MailTo")), null, 'warnings'); setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("MailTo")), null, 'warnings');
dol_syslog('Try to send email with no recipiend defined', LOG_WARNING); dol_syslog('Try to send email with no recipient defined', LOG_WARNING);
$action = 'presend'; $action = 'presend';
} }
} }

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -20,7 +20,7 @@
/** /**
* \file htdocs/core/boxes/box_services_contracts.php * \file htdocs/core/boxes/box_services_contracts.php
* \ingroup produits,services * \ingroup produits,services
* \brief Module de generation de l'affichage de la box services_vendus * \brief Widget of sells products
*/ */
include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
@ -124,7 +124,7 @@ class box_services_contracts extends ModeleBoxes
$thirdpartytmp->id = $objp->socid; $thirdpartytmp->id = $objp->socid;
// Multilangs // Multilangs
if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active if (! empty($conf->global->MAIN_MULTILANGS) && $objp->product_id > 0) // if option multilang is on
{ {
$sqld = "SELECT label"; $sqld = "SELECT label";
$sqld.= " FROM ".MAIN_DB_PREFIX."product_lang"; $sqld.= " FROM ".MAIN_DB_PREFIX."product_lang";

View File

@ -255,14 +255,14 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
$out.= $s; $out.= $s;
} }
$out.= '</td>'; $out.= '</td>';
if (! empty($conf->use_javascript_ajax)) if (! empty($conf->use_javascript_ajax))
{ {
$sublink=''; $sublink='';
if (! empty($head['sublink'])) $sublink.= '<a href="'.$head['sublink'].'"'.(empty($head['target'])?' target="_blank"':'').'>'; if (! empty($head['sublink'])) $sublink.= '<a href="'.$head['sublink'].'"'.(empty($head['target'])?' target="_blank"':'').'>';
if (! empty($head['subpicto'])) $sublink.= img_picto($head['subtext'], $head['subpicto'], 'class="'.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"'); if (! empty($head['subpicto'])) $sublink.= img_picto($head['subtext'], $head['subpicto'], 'class="'.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"');
if (! empty($head['sublink'])) $sublink.= '</a>'; if (! empty($head['sublink'])) $sublink.= '</a>';
$out.= '<td class="nocellnopadd boxclose right nowraponall">'; $out.= '<td class="nocellnopadd boxclose right nowraponall">';
$out.=$sublink; $out.=$sublink;
// The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object // The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object
@ -273,7 +273,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
$out.= '<input type="hidden" id="boxlabelentry'.$this->box_id.'" value="'.dol_escape_htmltag($label).'">'; $out.= '<input type="hidden" id="boxlabelentry'.$this->box_id.'" value="'.dol_escape_htmltag($label).'">';
$out.= '</td></tr></table>'; $out.= '</td></tr></table>';
} }
$out.= "</tr>\n"; $out.= "</tr>\n";
} }
@ -285,10 +285,8 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
{ {
if (isset($contents[$i])) if (isset($contents[$i]))
{ {
// TR // TR
if (isset($contents[$i][0]['tr'])) $out.= '<tr valign="top" '.$contents[$i][0]['tr'].'>'; if (isset($contents[$i][0]['tr'])) $out.= '<tr class="tdtop" '.$contents[$i][0]['tr'].'>';
else $out.= '<tr class="oddeven">'; else $out.= '<tr class="oddeven">';
// Loop on each TD // Loop on each TD