Fix warnings

This commit is contained in:
Laurent Destailleur 2020-12-24 02:48:32 +01:00
parent 11a122176d
commit ea0ae758a3
7 changed files with 28 additions and 28 deletions

View File

@ -122,7 +122,7 @@ $extrafield_array = null;
if (is_array($extrafields) && count($extrafields) > 0) {
$extrafield_array = array();
}
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -315,7 +315,7 @@ function getActionComm($authentication, $id)
//Get extrafield values
$actioncomm->fetch_optionals();
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -454,7 +454,7 @@ function createActionComm($authentication, $actioncomm)
// fetch optionals attributes and labels
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($elementtype, true);
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -551,7 +551,7 @@ function updateActionComm($authentication, $actioncomm)
// fetch optionals attributes and labels
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($elementtype, true);
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{

View File

@ -127,7 +127,7 @@ $extrafield_array = null;
if (is_array($extrafields) && count($extrafields) > 0) {
$extrafield_array = array();
}
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -319,7 +319,7 @@ function getContact($authentication, $id, $ref_ext)
//Get extrafield values
$contact->fetch_optionals();
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -424,7 +424,7 @@ function createContact($authentication, $contact)
// fetch optionals attributes and labels
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($elementtype, true);
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -671,7 +671,7 @@ function updateContact($authentication, $contact)
// fetch optionals attributes and labels
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($elementtype, true);
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{

View File

@ -120,7 +120,7 @@ $extrafield_line_array = null;
if (is_array($extrafields) && count($extrafields) > 0) {
$extrafield_line_array = array();
}
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -224,7 +224,7 @@ $extrafield_array = null;
if (is_array($extrafields) && count($extrafields) > 0) {
$extrafield_array = array();
}
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -705,7 +705,7 @@ function createOrder($authentication, $order)
// fetch optionals attributes and labels
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($elementtype, true);
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -743,7 +743,7 @@ function createOrder($authentication, $order)
// fetch optionals attributes and labels
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($elementtype, true);
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -948,7 +948,7 @@ function updateOrder($authentication, $order)
// fetch optionals attributes and labels
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($elementtype, true);
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{

View File

@ -142,7 +142,7 @@ $extrafield_array = null;
if (is_array($extrafields) && count($extrafields) > 0) {
$extrafield_array = array();
}
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -436,7 +436,7 @@ function getProductOrService($authentication, $id = '', $ref = '', $ref_ext = ''
//Get extrafield values
$product->fetch_optionals();
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -563,7 +563,7 @@ function createProductOrService($authentication, $product)
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($elementtype, true);
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -719,7 +719,7 @@ function updateProductOrService($authentication, $product)
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($elementtype, true);
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -1090,7 +1090,7 @@ function getProductsForCategory($authentication, $id, $lang = '')
//Get extrafield values
$tmpproduct->fetch_optionals();
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{

View File

@ -169,7 +169,7 @@ $extrafield_array = null;
if (is_array($extrafields) && count($extrafields) > 0) {
$extrafield_array = array();
}
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -277,7 +277,7 @@ function createProject($authentication, $project)
// fetch optionals attributes and labels
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($elementtype, true);
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -386,7 +386,7 @@ function getProject($authentication, $id = '', $ref = '')
$extrafields->fetch_name_optionals_label($elementtype, true);
//Get extrafield values
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
$project->fetch_optionals();
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)

View File

@ -130,7 +130,7 @@ $extrafield_array = null;
if (is_array($extrafields) && count($extrafields) > 0) {
$extrafield_array = array();
}
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -365,7 +365,7 @@ function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '')
//Get extrafield values
$thirdparty->fetch_optionals();
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -481,7 +481,7 @@ function createThirdParty($authentication, $thirdparty)
// fetch optionals attributes and labels
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($elementtype, true);
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -615,7 +615,7 @@ function updateThirdParty($authentication, $thirdparty)
// fetch optionals attributes and labels
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($elementtype, true);
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -723,7 +723,7 @@ function getListOfThirdParties($authentication, $filterthirdparty)
$extrafieldsOptions = array();
$obj = $db->fetch_object($resql);
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{

View File

@ -193,7 +193,7 @@ $extrafield_array = null;
if (is_array($extrafields) && count($extrafields) > 0) {
$extrafield_array = array();
}
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{
@ -599,7 +599,7 @@ function createUserFromThirdparty($authentication, $thirdpartywithuser)
// fetch optionals attributes and labels
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($elementtype, true);
if (is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafields->attributes[$elementtype]['label']) && count($extrafields->attributes[$elementtype]['label']))
{
foreach ($extrafields->attributes[$elementtype]['label'] as $key=>$label)
{