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

@ -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

@ -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