getMarques

This commit is contained in:
Michael RICOIS 2010-12-14 10:23:40 +00:00
parent a8ab0211ca
commit 36efaf05f2
6 changed files with 76 additions and 67 deletions

View File

@ -87,4 +87,5 @@ Type.85 = "ListeDroitsReturn"
Type.86 = "ListePrefsReturn"
Type.87 = "ListeFichierSurvReturn"
Type.88 = "ListeFichierSurv"
Type.89 = "MarquesReturn"
Type.90 = "Marque"

View File

@ -19,7 +19,6 @@ class DocumentationController extends Zend_Controller_Action
public function indexAction()
{
$ws = $this->_getParam('ws','WsEntreprise');
//Liste de webservice protégé
$protectedWs = array(
'WsInterne' => array('mricois', 'ylenaour', 'sbeaugrand')
@ -28,7 +27,7 @@ class DocumentationController extends Zend_Controller_Action
if ( array_key_exists($ws, $protectedWs) )
{
$auth = Zend_Auth::getInstance();
$username = $auth->getIdentity();
$username = $auth->getIdentity()->username;
if ( !in_array($username, $protectedWs[$ws]) )
{
$this->renderScript('documentation/nodoc.phtml');
@ -54,8 +53,6 @@ class DocumentationController extends Zend_Controller_Action
}
break;
}
//Affichage de la documentation
require_once 'Web/WebClassDoc.php';
$doc = new WebClassDoc($ws, $this->classmap);

View File

@ -3,9 +3,10 @@
<div id="menu">
<?php echo $this->navigation()->menu(); ?>
</div>
<div>
<div style="float:right;">
<?php echo $this->profileLink(); ?>
</div>
<div id="breadcrumbs">
<div id="breadcrumbs" style="clear:both;">
<?php /*echo $this->navigation()->breadcrumbs()->setMinDepth(0)->setLinkLast(true)->setSeparator(" >> ");*/ ?>
</div>
</div>

View File

@ -1333,3 +1333,34 @@ class ListeFichierSurv
public $UrlFichier;
}
class MarquesReturn
{
/** @var ErrorType */
public $error;
/** @var Marque[] */
public $result;
}
class Marque
{
/** @var string */
public $Marques;
/** @var string */
public $Date;
/** @var string */
public $Depot;
/** @var string */
public $IdLien;
/** @var string */
public $UrlLien;
/** @var string */
public $PdfDispo;
/** @var string */
public $Classes;
/** @var string */
public $Perimetre;
/** @var string */
public $DateExpir;
}

View File

@ -129,11 +129,9 @@ class WsEntreprise extends WsScore
'Ville' =>$entrep['Ville'],
'Pays' =>$entrep['Pays'], // Ajouté le 18 02 2008
'PaysIso2' =>$entrep['PaysIso2'],
'AdresseDom' =>$entrep['AdresseDom'],
'AdresseDomEnt' =>$entrep['AdresseDomEnt'],
'AdresseDomNb' =>$entrep['AdresseDomNb'],
'Civilite' =>$entrep['Civilite'],
'NbEtab' =>$entrep['NbEtab'],
'Tel' =>$entrep['Tel'],
@ -836,7 +834,7 @@ class WsEntreprise extends WsScore
$variables->CA_Y = $tabVar;
$result->tabVariables = $variables;
} else {
$result->{$key} = $value;
$result->${$key} = $value;
}
}
$output = new IndiscoreReturn();

View File

@ -2164,75 +2164,56 @@ class WsInterne extends WsScore
}
/**
* Enter description here...
* getMarques
* @param string $siren
* @param int $idDepot
* @return
* @return MarquesReturn
*/
protected function getMarques($siren, $idDepot=0) {
public function getMarques($siren, $idDepot=0)
{
$this->authenticate();
debugLog('I',"Liste des marques déposées pour le siren $siren",__LINE__,__FILE__, __FUNCTION__, __CLASS__);
$marques=array();
$iDb=new WDB();
if (empty($idDepot)) $idDepot = 0;
$error = new ErrorType();
$marques = array();
$iDb = new WDB();
require_once 'Metier/partenaires/classMMarques.php';
$iMarque=new MMarques();
$ret=$iMarque->getMarques($siren, $idDepot);
foreach ($ret as $i=>$marque) {
$iMarque = new MMarques();
$ret = $iMarque->getMarques($siren, $idDepot);
foreach ($ret as $marque) {
if (trim($marque['imgLink'])<>'') $idLien=$marque['numeroMarque'];
else $idLien='';
$marques[$i]=array( 'Marques' => prepareString($marque['nomMarque']),
'Date' => $marque['dateDepot'],
'Depot' => $marque['numeroMarque'],
'IdLien' => $idLien,
'UrlLien' => $marque['UrlLien'], // Rempli que si $idDepot<>0
'PdfDispo' => $marque['pdfLink'], // Nouveau
);
if ($idDepot==$marque['numeroMarque']) {
$marques[$i]['Classes'] = $marque['classesMarque']; // Nouveau
$marques[$i]['Perimetre'] = prepareString($marque['periMarque']); // Nouveau
$marques[$i]['DateExpir'] = $marque['dateExpir']; // Nouveau
return array('error'=>array('errnum'=>0, 'errmsg'=>''), 'result'=>array(end($marques)));
$marque = new Marque();
$marque->Marques = $marque['nomMarque'];
$marque->Date = $marque['dateDepot'];
$marque->Depot = $marque['numeroMarque'];
$marque->IdLien = $idLien;
$marque->UrlLien = $marque['UrlLien'];
$marque->PdfDispo = $marque['pdfLink'];
$marque->Classes = $marque['classesMarque'];
$marque->Perimetre = $marque['periMarque'];
$marque->DateExpir = $marque['dateExpir'];
$marques = array();
$marques[] = $marque;
break;
} else {
$marque = new Marque();
$marque->Marques = $marque['nomMarque'];
$marque->Date = $marque['dateDepot'];
$marque->Depot = $marque['numeroMarque'];
$marque->IdLien = $idLien;
$marque->UrlLien = $marque['UrlLien'];
$marque->PdfDispo = $marque['pdfLink'];
$marques[] = $marque;
}
}
/* $res=$iDb->select('marques', 'Marques,Date,Depot,IdLien, DATEDIFF(NOW(),dateUpdate) AS nbJourLastUpdate', "Siren=$siren ORDER BY `Date` DESC");
if (count($res)>0) {
foreach ($res as $i=>$marque) {
$marques[$i]=array( 'Marques'=>prepareString($marque['Marques']),
'Date' =>prepareString($marque['Date']),
'Depot' =>prepareString($marque['Depot']),
'IdLien' =>prepareString($marque['IdLien']),
);
if ($idDepot<>0) {
$marques[$i]['UrlLien']=DOC_WEB_URL."marques/$siren-$idDepot.jpg";
if ($marque['IdLien']==$idDepot) {
if (!file_exists(DOC_WEB_LOCAL."marques/$siren-$idDepot.jpg") ||
filesize(DOC_WEB_LOCAL."marques/$siren-$idDepot.jpg")<43) {
// $url=;
// filesize("/var/www/site_extranet/www/pdf/acte-$siren-$option.pdf")==0) {
$tdeb=microtime(true);
$page=getUrl("http://www.societe.com/cgi-bin/consultcgi?en=$idDepot", '', '', '', false, '', '',21);
$tfin=microtime(true);
$duree=$tfin-$tdeb;
$body=$page['body'];
$fp=@fopen(DOC_WEB_LOCAL."marques/$siren-$idDepot.jpg", 'w');
@fwrite($fp, $body);
@fclose($fp);
$fp=@fopen("/var/www/log/marques.log", "a");
@fwrite($fp, date('Y-m-d H:i:s').";$siren;$idDepot;$duree\n");
@fclose($fp);
}
return array('error'=>array('errnum'=>0, 'errmsg'=>''), 'result'=>array(end($marques)));
}
}
}
return array('error'=>array('errnum'=>0, 'errmsg'=>''), 'result'=>$marques);
}
*/
wsLog('marques',$siren);
return array('error'=>array('errnum'=>0, 'errmsg'=>''), 'result'=>$marques);
$output = new MarquesReturn();
$output->error = $error;
$output->result = $marques;
return $output;
}
/**