Protection item

This commit is contained in:
Michael RICOIS 2013-02-18 19:51:07 +00:00
parent 5ce405e224
commit dd681582f0

View File

@ -241,12 +241,15 @@ $tabDico = array(
'privilege',
'GPS',
),
'multiple' => array(
'liens',
),
);
//MetadataCache pour la base de données
$frontendOptions = array(
'lifetime' => 14400,
'automatic_serialization' => true
'lifetime' => 14400,
'automatic_serialization' => true
);
$backendOptions = array();
$cache = Zend_Cache::factory('Core','Apc', $frontendOptions, $backendOptions);
@ -665,29 +668,54 @@ foreach($tabIdentifiant as $item)
//Traitement par fonction
if( $element == 'data' )
{
foreach($select as $item)
foreach($select as $selectItem)
{
if ( isset(${$item.'Data'}) )
if ( isset(${$selectItem.'Data'}) )
{
$values = false;
if( ${$item.'Data'}!=false ){
$values = ${$item.'Data'};
if( ${$selectItem.'Data'}!=false ){
$values = ${$selectItem.'Data'};
}
$retour = call_user_func($item.'Data', $siren, $nicV, $values);
$retour = call_user_func($selectItem.'Data', $siren, $nicV, $values);
$tabData[$row] = $tabData[$row] + $retour;
}
}
} else {
//Traitement des libellés génériques
}
//Retour lignes multiples
elseif ( $element == 'multiple' )
{
foreach($select as $selectItem){
if ( in_array($selectItem, $tabEntete) ) {
break;
}
}
$retour = array();
if ( function_exists($selectItem) ) {
$retour = call_user_func($selectItem.'Multiple', $siren, $nicV);
}
if (count($retour)>0) {
$originalLine = $tabData[$row];
foreach($retour as $retourItem) {
//Ecrire la première ligne
//Multiplier le nombre de lignes
}
}
}
//Traitement des libellés génériques
else
{
foreach($select['cle'] as $cle => $values)
{
if ( in_array($cle.'Lib', $tabEntete) && isset(${'tab'.ucfirst($cle)}) )
{
$retour[$cle.'Lib'] = 'Non trouvé';
$codeFromData = $tabData[$row][$cle];
foreach( ${'tab'.ucfirst($cle)} as $item ) {
if ( $codeFromData == $item['code'] ) {
$retour[$cle.'Lib'] = $item['label'];
foreach( ${'tab'.ucfirst($cle)} as $cleItem ) {
if ( $codeFromData == $cleItem['code'] ) {
$retour[$cle.'Lib'] = $cleItem['label'];
break;
}
}
@ -1455,6 +1483,15 @@ function GPSData($siren, $nic, $values = false)
return $tabData;
}
function liensMultiple($siren, $nic)
{
require_once 'Metier/partenaires/classMLiens2.php';
return $tabData;
}
/* == FUNCTION == */