Reimport commit before conflict
This commit is contained in:
parent
0ce4fea9ee
commit
eb6769e435
2
application/autoload_classmap.php
Normal file
2
application/autoload_classmap.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
return array();
|
@ -589,6 +589,10 @@ class IdentiteController extends Zend_Controller_Action
|
||||
|
||||
if ($identite->PpPm=='PP') {
|
||||
$this->view->assign('PP', true);
|
||||
$this->view->assign('nom', $identite->nom);
|
||||
$this->view->assign('prenom', $identite->prenom);
|
||||
$this->view->assign('civilite', $identite->civilite);
|
||||
$this->view->assign('naissanceDate', $identite->naissanceDate);
|
||||
}
|
||||
|
||||
//Get links
|
||||
@ -626,6 +630,21 @@ class IdentiteController extends Zend_Controller_Action
|
||||
if ( ($session->getFormeJuridique()>=1000 && $session->getFormeJuridique()<=1999)
|
||||
|| ($session->getFormeJuridique()>=10 && $session->getFormeJuridique()<=19) ) {
|
||||
$this->view->assign('PP', true);
|
||||
|
||||
$result = $ws->searchLienRef($siren, 'siren');
|
||||
if (count($result->item)>0) {
|
||||
foreach ($result->item as $item) {
|
||||
$id = $item->id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$result = $ws->getSaisieLienRef($id);
|
||||
$items = json_decode($result, true);
|
||||
Zend_Registry::get('firebug')->info($items);
|
||||
$this->view->assign('nom', $items['nom']);
|
||||
$this->view->assign('prenom', $items['prenom']);
|
||||
$this->view->assign('civilite', $items['civilite']);
|
||||
$this->view->assign('naissanceDate', $items['naissance_date']);
|
||||
}
|
||||
|
||||
if ( in_array($session->getFormeJuridique(), array(5488,5498,5720)) ) {
|
||||
|
@ -47,6 +47,205 @@ class SaisieController extends Zend_Controller_Action
|
||||
array( "triId"=>"1790", "triCode"=>"CAYENL", "triNom"=>"Chambre Détachée de la Cour d'Appel de Fort de France à Cayenne", "triCP"=>"97300" ),
|
||||
array( "triId"=>"1798", "triCode"=>"AGENL", "triNom"=>"Cour d'Appel d'Agen", "triCP"=>"47916" ),
|
||||
);
|
||||
|
||||
protected $codVoie = array(
|
||||
'ABE' => "Abbaye",
|
||||
'AGL' => "Agglomération",
|
||||
'AIRE' => "Aire",
|
||||
'ALL' => "Allée",
|
||||
'ALL' => "Allee",
|
||||
'ACH' => "Ancien chemin",
|
||||
'ART' => "Ancienne route",
|
||||
'ANSE' => "Anse",
|
||||
'ARC' => "Arcade",
|
||||
'AUT' => "Autoroute",
|
||||
'AV' => "Avenue",
|
||||
'BRE' => "Barrière",
|
||||
'BCH' => "Bas chemin",
|
||||
'BSTD' => "Bastide",
|
||||
'BAST' => "Baston",
|
||||
'BEGI' => "Beguinage",
|
||||
'BER' => "Berge",
|
||||
'BOIS' => "Bois",
|
||||
'BCLE' => "Boucle",
|
||||
'BD' => "Boulevard",
|
||||
'BRG' => "Bourg",
|
||||
'BUT' => "Butte",
|
||||
'CALE' => "Cale",
|
||||
'CAMP' => "Camp",
|
||||
'CGNE' => "Campagne",
|
||||
'CPG' => "Camping",
|
||||
'CARR' => "Carré",
|
||||
'CAU' => "Carreau",
|
||||
'CAR' => "Carrefour",
|
||||
'CARE' => "Carrière",
|
||||
'CST' => "Castel",
|
||||
'CAV' => "Cavée",
|
||||
'CTRE' => "Central",
|
||||
'CTRE' => "Centre",
|
||||
'CHL' => "Chalet",
|
||||
'CHP' => "Chapelle",
|
||||
'CHI' => "Charmille",
|
||||
'CHT' => "Château",
|
||||
'CHS' => "Chaussée",
|
||||
'CHE' => "Chemin",
|
||||
'CHV' => "Chemin vicinaux",
|
||||
'CHV' => "Chemin vicinal",
|
||||
'CHEM' => "Cheminement",
|
||||
'CITE' => "Cîte",
|
||||
'CLOI' => "Cloître",
|
||||
'CLOS' => "Clos",
|
||||
'COL' => "Col",
|
||||
'COLI' => "Colline",
|
||||
'CTR' => "Contour",
|
||||
'COR' => "Corniche",
|
||||
'COTE' => "Côte",
|
||||
'COTT' => "Cottage",
|
||||
'COUR' => "Cour",
|
||||
'CRS' => "Cours",
|
||||
'DARS' => "Darse",
|
||||
'DEG' => "Degré",
|
||||
'DSG' => "Descente",
|
||||
'DSC' => "Descente",
|
||||
'DIG' => "Digue",
|
||||
'DOM' => "Domaine",
|
||||
'ECA' => "Ecart",
|
||||
'ECL' => "Ecluse",
|
||||
'EGL' => "Eglise",
|
||||
'EN' => "Enceinte",
|
||||
'ENV' => "Enclave",
|
||||
'ENC' => "Enclos",
|
||||
'ESC' => "Escalier",
|
||||
'ESPA' => "Espace",
|
||||
'ESP' => "Esplanade",
|
||||
'ETING' => "Etang",
|
||||
'FG' => "Faubourg",
|
||||
'FRM' => "Ferme",
|
||||
'FON' => "Fontaine",
|
||||
'FORT' => "Fort",
|
||||
'FORM' => "Forum",
|
||||
'FOS' => "Fosse",
|
||||
'FOYR' => "Foyer",
|
||||
'GAL' => "Galerie",
|
||||
'GARE' => "Gare",
|
||||
'GARN' => "Garenne",
|
||||
'GBD' => "Grand boulevard",
|
||||
'GDEN' => "Grande ensemble",
|
||||
'GR' => "Grande rue",
|
||||
'GRI' => "Grille",
|
||||
'GRIM' => "Grimpette",
|
||||
'GPE' => "Groupe",
|
||||
'GPT' => "Groupement",
|
||||
'HLE' => "Halle",
|
||||
'HAM' => "Hameau",
|
||||
'HCH' => "Haut chemin",
|
||||
'HIP' => "Hippodrome",
|
||||
'HLM' => "HLM",
|
||||
'ILE' => "Ile",
|
||||
'IMM' => "Immeuble",
|
||||
'IMP' => "Impasse",
|
||||
'JARD' => "Jardin",
|
||||
'JTE' => "Jetée",
|
||||
'LEVE' => "Levée",
|
||||
'LD' => "Lieu dit",
|
||||
'LD' => "Lieudit",
|
||||
'LOT' => "Lotissement",
|
||||
'MAIL' => "Mail",
|
||||
'MF' => "Maison forestière",
|
||||
'MAN' => "Manoir",
|
||||
'MAR' => "Marche",
|
||||
'MAS' => "Mas",
|
||||
'MET' => "Métro",
|
||||
'MTE' => "Montée",
|
||||
'MLN' => "Moulin",
|
||||
'MUS' => "Musée",
|
||||
'NTE' => "Nouvelle route",
|
||||
'PAL' => "Palais",
|
||||
'PARC' => "Parc",
|
||||
'PKG' => "Parking",
|
||||
'PRV' => "Parvis",
|
||||
'PAS' => "Passage",
|
||||
'PN' => "Passage à niveau",
|
||||
'PASS' => "Passe",
|
||||
'PLE' => "Passerelle",
|
||||
'PAT' => "Patio",
|
||||
'PAV' => "Pavillon",
|
||||
'PERI' => "Périphérique",
|
||||
'PSTY' => "Péristyle",
|
||||
'PTA' => "Petites allée",
|
||||
'PCH' => "Petit chemin",
|
||||
'PAE' => "Petite avenue",
|
||||
'PIM' => "Petite impasse",
|
||||
'PRT' => "Petite route",
|
||||
'PTR' => "Petite rue",
|
||||
'PL' => "Place",
|
||||
'PLCI' => "Placis",
|
||||
'PLAG' => "Plage",
|
||||
'PLN' => "Plaine",
|
||||
'PLAN' => "Plan",
|
||||
'PLT' => "Plateau",
|
||||
'PNT' => "Pointe",
|
||||
'PONT' => "Pont",
|
||||
'PCH' => "Porche",
|
||||
'PORT' => "Port",
|
||||
'PTE' => "Porte",
|
||||
'PORQ' => "Portique",
|
||||
'POT' => "Poterne",
|
||||
'POUR' => "Pourtour",
|
||||
'PRE' => "Pré",
|
||||
'PRQ' => "Presqu'île",
|
||||
'PROM' => "Promenade",
|
||||
'QU' => "Quai",
|
||||
'QUAI' => "Quai",
|
||||
'QUA' => "Quartier",
|
||||
'RAC' => "Raccourci",
|
||||
'RAID' => "Raidillon",
|
||||
'RPE' => "Rampe",
|
||||
'REM' => "Rempart",
|
||||
'RES' => "Résidence",
|
||||
'ROC' => "Roc",
|
||||
'ROC' => "Rocade",
|
||||
'RPT' => "Rond point",
|
||||
'ROQT' => "Roquet",
|
||||
'RTD' => "Rotonde",
|
||||
'RTE' => "Route",
|
||||
'R' => "Rue",
|
||||
'RUE' => "Rue",
|
||||
'RLE' => "Ruelle",
|
||||
'SEN' => "Sente",
|
||||
'SEN' => "Sentier",
|
||||
'SQ' => "Square",
|
||||
'STDE' => "Stade",
|
||||
'STA' => "Station",
|
||||
'TPL' => "Terre plein",
|
||||
'TRN' => "Terrain",
|
||||
'TSSE' => "Terrasse",
|
||||
'TRT' => "Tertre",
|
||||
'TOUR' => "Tour",
|
||||
'TRA' => "Traverse",
|
||||
'VAL' => "Vallon",
|
||||
'VAL' => "Vallée",
|
||||
'VEN' => "Venelle",
|
||||
'VIA' => "Via",
|
||||
'VTE' => "Vieille route",
|
||||
'VCHE' => "Vieux chemin",
|
||||
'VLA' => "Villa",
|
||||
'VGE' => "Village",
|
||||
'VLGE' => "Village",
|
||||
'VOI' => "Voie",
|
||||
'VOIE' => "Voie",
|
||||
'ZONE' => "Zone",
|
||||
'ZAC' => "Zone d'aménagement concerté",
|
||||
'Z A C' => "Zone d'aménagement concerté",
|
||||
'ZAD' => "Zone d'aménagement différé",
|
||||
'Z A D' => "Zone d'aménagement différé",
|
||||
'ZA' => "Zone artisanale",
|
||||
'Z A' => "Zone artisanale",
|
||||
'ZI' => "Zone industrielle",
|
||||
'Z I' => "Zone industrielle",
|
||||
'ZUP' => "Zone à urbaniser en priorité",
|
||||
'Z U P' => "Zone à urbaniser en priorité",
|
||||
);
|
||||
|
||||
/**
|
||||
* Retourne Fonctions de direction
|
||||
@ -2286,6 +2485,26 @@ class SaisieController extends Zend_Controller_Action
|
||||
|
||||
$this->view->assign('output', $output);
|
||||
}
|
||||
|
||||
public function codvoieAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$codvoie = $this->getRequest()->getParam('codvoie', null);
|
||||
$output = array();
|
||||
|
||||
if ( null !== $codvoie) {
|
||||
foreach($this->codVoie as $key=>$val){
|
||||
if (stripos($key, $codvoie)!==false || stripos($val, $codvoie)!==false){
|
||||
$output[] = array(
|
||||
'label' => $key.": ".$val,
|
||||
'value' => $key
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->view->assign('output', $output);
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit contact information
|
||||
|
@ -140,10 +140,15 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
$delete = $request->getParam('delete', false);
|
||||
$encours = $request->getParam('encours', 0);
|
||||
|
||||
$validateur = new Zend_Validate_EmailAddress();
|
||||
|
||||
//Vérification siret / email / ref
|
||||
if (empty($siret) || empty($email) | empty($ref)){
|
||||
if (empty($siret) || empty($email) || empty($ref)){
|
||||
$msg = 'Erreur email ou reférence non définie !';
|
||||
}
|
||||
elseif (!$validateur->isValid($email)) {
|
||||
$msg = "Email invalide.";
|
||||
}
|
||||
//Vérification de l'encours (chiffres)
|
||||
elseif (!preg_match('/([0-9]+)/', $encours)){
|
||||
$msg = 'Encours incorrect';
|
||||
|
@ -1,8 +1,10 @@
|
||||
<?php if (count($this->docs)==0) {?>
|
||||
Aucun document.
|
||||
<?php } else {?>
|
||||
|
||||
<?php foreach ( $this->docs as $doc ) {?>
|
||||
<?php } else {
|
||||
$limit = 3;
|
||||
foreach ( $this->docs as $key=>$doc ) {
|
||||
$class = ($key<$limit)?'first':'all';?>
|
||||
<div class="<?=$class?>" id="<?=$key ?>">
|
||||
<a target="_blank" href="/fichier/groupes/<?=$doc->url?>" id="<?=$doc->date?>" class="lienDocDate"><?=$doc->label?></a>
|
||||
<?php if ($this->edition) {?>
|
||||
<a class="dialog" title="Supprimer le document" href="<?=$this->url(array('controller'=>'saisie','action'=>'liendoc','mode'=>'delete','id'=>$doc->id), null, true)?>">
|
||||
@ -10,6 +12,29 @@ Aucun document.
|
||||
</a>
|
||||
<?php }?>
|
||||
<br/>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="affiche" id="show" style="cursor:pointer;">Afficher tous les documents</div><br/>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
if (<?=$key?> >2) {
|
||||
$("div.affiche").show();
|
||||
} else {
|
||||
$("div.affiche").hide();
|
||||
}
|
||||
$("div.all").hide();
|
||||
});
|
||||
|
||||
<?php }?>
|
||||
$("div.affiche").on("click", function(){
|
||||
if ($(this).attr("id")=="show") {
|
||||
$(this).attr("id", "hide");
|
||||
$(this).text("Afficher les <?=$limit?> derniers documents");
|
||||
$("div.all").show();
|
||||
} else {
|
||||
$(this).attr("id", "show");
|
||||
$(this).text("Afficher tous les documents");
|
||||
$("div.all").hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<?php }?>
|
@ -1,8 +1,8 @@
|
||||
<div>
|
||||
<?php if ($this->result->PpPm == 'PP') {?>
|
||||
|
||||
<?php if (!empty($this->result->civilite)) {?>
|
||||
<?=$this->result->civilite?>
|
||||
<?php $sexe=($this->result->civilite=='M')?'':'e';?>
|
||||
<?php }?>
|
||||
<?php if (!empty($this->result->nom)) {?>
|
||||
<?=$this->result->nom?>
|
||||
@ -14,7 +14,8 @@
|
||||
(<?=$this->result->nomUsage?>)
|
||||
<?php }?>
|
||||
<?php if (!empty($this->result->naissanceDate) && $this->result->naissanceDate!='0000-00-00') {?>
|
||||
<br/>Née le <?=$this->result->naissanceDate?>
|
||||
<?php $date = new Zend_Date($this->result->naissanceDate, 'YYYY-MM-dd')?>
|
||||
<br/>Né<?=$sexe;?> le <?=$date->toString('dd/MM/yyyy');?>
|
||||
<?php }?>
|
||||
<?php if (!empty($this->result->naissanceLieu)) {?>
|
||||
à <?=$this->result->naissanceLieu?>
|
||||
@ -87,4 +88,17 @@ else
|
||||
<?php foreach ($this->result->identification->item as $id) {?>
|
||||
<div><?=$id->label?> - <?=$id->num?></div>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
<?php if ($this->result->PpPm == 'PP') {
|
||||
$param = array(
|
||||
'controller'=>'recherche',
|
||||
'action'=>'dirigeant',
|
||||
'dirNom'=>$this->result->nom,
|
||||
'dirPrenom'=>$this->result->prenom,
|
||||
'dirDateNaissJJ' =>$date->get('dd'),
|
||||
'dirDateNaissMM' =>$date->get('MM'),
|
||||
'dirDateNaissAAAA' =>$date->get('YYYY')
|
||||
);
|
||||
?>
|
||||
<br/><a href="<?=$this->url($param,null,true);?>">Lancer une recherche dirigeant</a>
|
||||
<?php } ?>
|
@ -96,6 +96,26 @@
|
||||
<a class="confirm" title="Fiche suppression" href="<?=$hrefSuppr; ?>">Supprimer la fiche</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30"> </td>
|
||||
<td width="200" class="StyleInfoLib"></td>
|
||||
<td width="350" class="StyleInfoLib">
|
||||
<?php
|
||||
if ($this->PP) {
|
||||
$date = new Zend_Date($this->naissanceDate, 'YYYY-MM-dd');
|
||||
$param = array(
|
||||
'controller'=>'recherche',
|
||||
'action'=>'dirigeant',
|
||||
'dirNom'=>$this->nom,
|
||||
'dirPrenom'=>$this->prenom,
|
||||
'dirDateNaissJJ' =>$date->get('dd'),
|
||||
'dirDateNaissMM' =>$date->get('MM'),
|
||||
'dirDateNaissAAAA' =>$date->get('YYYY')
|
||||
);
|
||||
?>
|
||||
<a href="<?=$this->url($param,null,true);?>">Lancer une recherche dirigeant</a><?php }?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
</table>
|
||||
</div>
|
||||
|
21
application/views/default/scripts/layout.phtml
Normal file
21
application/views/default/scripts/layout.phtml
Normal file
@ -0,0 +1,21 @@
|
||||
<?php echo $this->doctype()?>
|
||||
<html>
|
||||
<head>
|
||||
<?php echo $this->headMeta()?>
|
||||
<?php echo $this->headTitle()?>
|
||||
<?php echo $this->headLink()?>
|
||||
<?php echo $this->headScript()?>
|
||||
</head>
|
||||
<body>
|
||||
<div id="global">
|
||||
<?php echo $this->render('header.phtml')?>
|
||||
<div id="content">
|
||||
<?php echo $this->layout()->content?>
|
||||
<div id="footer">
|
||||
<?php echo $this->render('footer.phtml')?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo $this->inlineScript()?>
|
||||
</body>
|
||||
</html>
|
1
application/views/default/scripts/saisie/codvoie.phtml
Normal file
1
application/views/default/scripts/saisie/codvoie.phtml
Normal file
@ -0,0 +1 @@
|
||||
<?=json_encode($this->output)?>
|
@ -312,6 +312,20 @@ $('a#google').on('click', function(e){
|
||||
window.open('https://www.google.fr/#q='+encodeURIComponent(val));
|
||||
});
|
||||
|
||||
$('input[name=adresse_codvoie]').autocomplete({
|
||||
minLength: 2,
|
||||
delay: 250,
|
||||
source: function(request, response) {
|
||||
var codvoie = $('input[name=adresse_codvoie]').val();
|
||||
$.getJSON('<?=$this->url(array('controller'=>'saisie','action'=>'codvoie'),null,true)?>', { codvoie: codvoie },
|
||||
function(data) { response(data); }
|
||||
);
|
||||
},
|
||||
select: function( event, ui ) {
|
||||
$('input[name=adresse_codvoie]').attr('value', ui.item.value);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
var code = $('select[name=adresse_pays]').val();
|
||||
$('span#indTel').text('+'+countries[code]['indTel']);
|
||||
|
@ -190,12 +190,12 @@ $('input[name=dateNbActions]').datepicker({ changeMonth: true, changeYear: true
|
||||
|
||||
$('input[name=isin]').change(function(e){
|
||||
$.post('/saisie/checkisin', {isin: $(this).val() }, function success(data) {
|
||||
if (data){$('input[name=isin]').css("border-color", "red");}
|
||||
if (data){$('input[name=isin]').css("border-color", "red");}
|
||||
else {$('input[name=isin]').css("border-color", "");}
|
||||
});
|
||||
});
|
||||
|
||||
function cpville(inputFld, outputFld, countrySel=null, countryVal=null) {
|
||||
function cpville(inputFld, outputFld, countrySel, countryVal) {
|
||||
$('input[name='+inputFld+']').autocomplete({
|
||||
minLength: 4,
|
||||
delay: 250,
|
||||
@ -214,13 +214,26 @@ function cpville(inputFld, outputFld, countrySel=null, countryVal=null) {
|
||||
$('input[name='+inputFld+']').attr('value', ui.item.value);
|
||||
$('input[name='+outputFld+']').attr('value', text);
|
||||
if (countrySel!=null && countryVal!=null){
|
||||
$('select[name='+countrySel+']').val(countryVal);
|
||||
$('select[name='+countrySel+']').val(countryVal);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
cpville('adresse_cp', 'adresse_ville');
|
||||
|
||||
$('input[name=adresse_codvoie]').autocomplete({
|
||||
minLength: 2,
|
||||
delay: 250,
|
||||
source: function(request, response) {
|
||||
var codvoie = $('input[name=adresse_codvoie]').val();
|
||||
$.getJSON('<?=$this->url(array('controller'=>'saisie','action'=>'codvoie'),null,true)?>', { codvoie: codvoie },
|
||||
function(data) { response(data); }
|
||||
);
|
||||
},
|
||||
select: function( event, ui ) {
|
||||
$('input[name=adresse_codvoie]').attr('value', ui.item.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php } else {?>
|
||||
|
@ -93,7 +93,7 @@ $('input[name=naissance_date]').datepicker({ changeMonth: true, changeYear: true
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function cpville(inputFld, outputFld, countrySel=null, countryVal=null) {
|
||||
function cpville(inputFld, outputFld, countrySel, countryVal) {
|
||||
$('input[name='+inputFld+']').autocomplete({
|
||||
minLength: 4,
|
||||
delay: 250,
|
||||
@ -105,21 +105,34 @@ function cpville(inputFld, outputFld, countrySel=null, countryVal=null) {
|
||||
},
|
||||
select: function( event, ui ) {
|
||||
var text = ui.item.label;
|
||||
text = text.replace(ui.item.value+': ','');
|
||||
text = text.replace(ui.item.value+': ','');
|
||||
if (inputFld==outputFld) {
|
||||
ui.item.value = text;
|
||||
}
|
||||
$('input[name='+inputFld+']').attr('value', ui.item.value);
|
||||
$('input[name='+outputFld+']').attr('value', text);
|
||||
$('input[name='+outputFld+']').attr('value', text);
|
||||
if (countrySel!=null && countryVal!=null){
|
||||
$('select[name='+countrySel+']').val(countryVal);
|
||||
$('select[name='+countrySel+']').val(countryVal);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
cpville('adresse_cp', 'adresse_ville', 'adresse_pays', 'FRA');
|
||||
cpville('naissance_lieu', 'naissance_lieu', 'naissance_dept_pays', 'FRA');
|
||||
|
||||
$('input[name=adresse_codvoie]').autocomplete({
|
||||
minLength: 2,
|
||||
delay: 250,
|
||||
source: function(request, response) {
|
||||
var codvoie = $('input[name=adresse_codvoie]').val();
|
||||
$.getJSON('<?=$this->url(array('controller'=>'saisie','action'=>'codvoie'),null,true)?>', { codvoie: codvoie },
|
||||
function(data) { response(data); }
|
||||
);
|
||||
},
|
||||
select: function( event, ui ) {
|
||||
$('input[name=adresse_codvoie]').attr('value', ui.item.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="fieldgrp">
|
||||
|
35
application/views/mobile/helpers/NewsDate.php
Normal file
35
application/views/mobile/helpers/NewsDate.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
Class Zend_View_Helper_NewsDate extends Zend_View_Helper_Abstract
|
||||
{
|
||||
protected $mois = array (
|
||||
'Jan' => 1,
|
||||
'Feb' => 2,
|
||||
'Mar' => 3,
|
||||
'Apr' => 4,
|
||||
'May' => 5,
|
||||
'Jun' => 6,
|
||||
'Jul' => 7,
|
||||
'Aug' => 8,
|
||||
'Sep' => 9,
|
||||
'Oct' => 10,
|
||||
'Nov' => 11,
|
||||
'Dev' => 12,
|
||||
);
|
||||
|
||||
public function NewsDate($date)
|
||||
{
|
||||
$tmp = explode(', ', $date);
|
||||
$tabDate = explode(' ', $tmp[1]);
|
||||
$tabTime = explode(':', $tabDate[3]);
|
||||
$timestamp = gmmktime(
|
||||
$tabTime[0]-1,
|
||||
$tabTime[1],
|
||||
$tabTime[2],
|
||||
$this->mois[$tabDate[1]],
|
||||
$tabDate[0],
|
||||
$tabDate[2]
|
||||
);
|
||||
$pubDate = date('d/m/Y à H:i', $timestamp);
|
||||
return $pubDate;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<div id="center">
|
||||
<h2 class="titre">LISTE DES ÉTABLISSEMNTS</h2>
|
||||
|
||||
|
||||
<h2>Établissements</h2>
|
||||
|
||||
|
||||
<?php if (empty($this->AutrePage)):?>
|
||||
<?=$this->render('cgu.phtml', $this->cgu)?>
|
||||
<?php endif;?>
|
||||
|
||||
</div>
|
35
application/views/mobile/scripts/identite/facade.phtml
Normal file
35
application/views/mobile/scripts/identite/facade.phtml
Normal file
@ -0,0 +1,35 @@
|
||||
<?php if ($this->source == 'google'):?>
|
||||
|
||||
<div id="infogeo_photo">
|
||||
<?=$this->action('streetview', 'identite', null, array(
|
||||
'lat' => $this->infos->GeoLat,
|
||||
'lon' => $this->infos->GeoLon,
|
||||
'siret' => $this->infos->Siret,
|
||||
));?>
|
||||
</div>
|
||||
|
||||
<?php elseif ($this->source == 'mappy'):?>
|
||||
<div><img id="pp-cb-thumb" width="300px" /></div>
|
||||
<script src="<?=$this->lienJs?>"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var photoService = new Mappy.api.visiocity.PhotoService();
|
||||
var geo = new Mappy.api.geolocation.Geocoder();
|
||||
|
||||
var address = "<?=$this->adresse?>";
|
||||
geo.geocode(address, function(result) {
|
||||
photoService.search(result[0], "f", serviceHandler);
|
||||
}, function(error) {});
|
||||
|
||||
var serviceHandler = function(result) {
|
||||
if (result instanceof Mappy.api.visiocity.Frontage) {
|
||||
var current = result.getCurrent();
|
||||
var img = $('<img src="' + current.getURL(320, null) +
|
||||
'" alt="' + current.getDescription() +
|
||||
'" width="300px" />');
|
||||
$('#pp-cb-thumb').replaceWith(img);
|
||||
}
|
||||
};
|
||||
});
|
||||
</script>
|
||||
<?php endif;?>
|
18
application/views/mobile/scripts/identite/fiche-item.phtml
Normal file
18
application/views/mobile/scripts/identite/fiche-item.phtml
Normal file
@ -0,0 +1,18 @@
|
||||
<?php if ( $this->texte ) {?>
|
||||
<tr>
|
||||
<td width="50" class="aide">
|
||||
<?php if ( !empty($this->aide) ) {?>
|
||||
<img src="/themes/default/images/interfaces/aideligne.png" width="16" height="16" style="display:none;"/>
|
||||
<div id="<?=$this->id?>" style="display:none;"><?=$this->aide?></div>
|
||||
<?php } ?></td>
|
||||
<td width="200" class="StyleInfoLib"><?=$this->label?></td>
|
||||
<?php
|
||||
if (!empty($this->titre)) {
|
||||
$titre = ' title="'.$this->titre.'"';
|
||||
} else {
|
||||
$titre = '';
|
||||
}
|
||||
?>
|
||||
<td width="350" class="StyleInfoData"<?=$titre?>><?=$this->texte?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
81
application/views/mobile/scripts/identite/fiche.phtml
Normal file
81
application/views/mobile/scripts/identite/fiche.phtml
Normal file
@ -0,0 +1,81 @@
|
||||
<div id="center">
|
||||
<?php if ( empty($this->AutrePage) ) {?>
|
||||
<h2 class="titre">FICHE D'IDENTITÉ</h2>
|
||||
<?php }?>
|
||||
|
||||
<div class="paragraph">
|
||||
<table>
|
||||
<?php
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Siret']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['SiretSiege']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['TvaNumero']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Isin']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Capitalisation']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->logo);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['NumRC']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['AutreId']);
|
||||
//echo $this->partial('identite/fiche-item.phtml', $this->dBlock['NumRM']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Actif']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['SituationJuridique']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['AutreSiren']);
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div data-role="content">
|
||||
<div data-role="collapsible-set">
|
||||
<div data-role="collapsible">
|
||||
<h3>Raison sociale & Coordonnées</h3>
|
||||
<table>
|
||||
<?php
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['RaisonSociale']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['NomCommercial']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['EnseigneSigle']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['FormeJuridique']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['DateImmat']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['DateCreaEn']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['DateCreaEt']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Adresse']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Zones']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Tel']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Fax']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Web']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Mail']);
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div data-role="collapsible">
|
||||
<h3>Activité(s) & Chiffre d'affaires</h3>
|
||||
<table>
|
||||
<?php
|
||||
//Remplace Siren pour texte
|
||||
//$this->dBlock['ActiviteEn']['texte'] = $this->RemplaceSiren($this->dBlock['ActiviteEn']['texte']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['ActiviteEn']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['ActiviteEt']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Naf4']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Nace']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['NatureActivite']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['SurfaceMagasin']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['OrigineFond']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['TypeExploitation']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Saisonnalite']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['NbEtabActif']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Capital']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['ChiffreAffaire']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Dirigeants']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['Effectif']);
|
||||
echo $this->partial('identite/fiche-item.phtml', $this->dBlock['EffectifEtab']);
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
<div data-role="collapsible">
|
||||
<h3>Localisation géographique</h3>
|
||||
<?=$this->action('geo', 'identite', null, array('infos' => $this->infos));?>
|
||||
</div>
|
||||
<div data-role="collapsible">
|
||||
<h3>Information presse (Source Google News ©)</h3>
|
||||
<?=$this->action('news', 'identite');?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
37
application/views/mobile/scripts/identite/geo.phtml
Normal file
37
application/views/mobile/scripts/identite/geo.phtml
Normal file
@ -0,0 +1,37 @@
|
||||
<h2>Localisation géographique</h2>
|
||||
<div class="paragraph">
|
||||
<div id="infogeo" class="clearfix">
|
||||
<div id="infogeo_txt">
|
||||
<?php if ( $this->infos->GeoLat && $this->infos->GeoLon ):?>
|
||||
<span id=geolocalisation>
|
||||
<b>Information géographique :</b><br/>
|
||||
Latitude : <?=$this->decLat?> (<?=$this->infos->GeoLat?>)<br />
|
||||
Longitude : <?=$this->decLon?> (<?=$this->infos->GeoLon?>)<br />
|
||||
</span>
|
||||
<a id="lien-google" href="<?=$this->mapsHref?>" target="_blank">
|
||||
Afficher l'adresse sur Google Map ©</a><br/>
|
||||
<br/>
|
||||
<?endif;?>
|
||||
<b>Code commune / Rivoli :</b><br/>
|
||||
<?=$this->infos->Dept.' '.$this->infos->codeCommune.' / '.$this->infos->Rivoli; ?>
|
||||
<?php
|
||||
if (count($this->infos->InfosIris)>0){
|
||||
$InfosIris = $this->infos->InfosIris;
|
||||
$codComIris = str_replace($InfosIris->codIris, '', $InfosIris->codComIris);
|
||||
?>
|
||||
<br/><br/><b>Iris :</b>
|
||||
<?php if (intval($InfosIris->codIris) == 0){ ?>
|
||||
<br/>Commune non découpée en Iris
|
||||
<?php } else {?>
|
||||
<br/>Code : <?=$codComIris?> <?=$InfosIris->codIris?>
|
||||
<br/>Libellé : <a title="Consulter le plan d'assemblage de la commune" href="<?=$this->url(array('controller'=>'identite', 'action'=>'iris', 'code'=>$codComIris), null, true)?>" target="_blank"><?=$InfosIris->libIris?></a>
|
||||
<img title="<?=$InfosIris->typIris?>" style="vertical-align:middle;" src="/themes/default/images/info.gif">
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</div>
|
||||
|
||||
<?php if($this->facade):?>
|
||||
<?=$this->action('facade', 'identite', null, array('infos' => $this->infos));?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1 @@
|
||||
<img src="/fichier/imgcache/<?php echo $this->name;?>" />
|
16
application/views/mobile/scripts/identite/news.phtml
Normal file
16
application/views/mobile/scripts/identite/news.phtml
Normal file
@ -0,0 +1,16 @@
|
||||
<?php if(!$this->disable):?>
|
||||
<div id="news">
|
||||
<h2>Information presse (Source Google News ©)</h2>
|
||||
<div id="paragraph">
|
||||
<ul>
|
||||
<?php foreach($this->items as $item):?>
|
||||
<li style="padding-top:2px;">
|
||||
<a target="_blank" href="<?=$item->link()?>">
|
||||
Le <?=$this->NewsDate($item->pubDate())?> - <?=$item->title()?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
17
application/views/mobile/scripts/identite/streetview.phtml
Normal file
17
application/views/mobile/scripts/identite/streetview.phtml
Normal file
@ -0,0 +1,17 @@
|
||||
<?php if ($this->url) {?>
|
||||
<div id="legende-photo">Cliché à l'approche de l'adresse postale.</div>
|
||||
<img id="pp-cb-thumb" src="<?=$this->url?>" width="320" height="320" />
|
||||
<div>
|
||||
<a class="street-heading" href="<?=$this->url(array(
|
||||
'controller'=>'identite','action'=>'streetview', 'lat'=>$this->lat, 'lon'=>$this->lon, 'heading'=>$this->pagePrec))?>"><</a>
|
||||
-
|
||||
<a class="street-heading" href="<?=$this->url(array(
|
||||
'controller'=>'identite','action'=>'streetview', 'lat'=>$this->lat, 'lon'=>$this->lon, 'heading'=>$this->pageSuiv))?>">></a>
|
||||
</div>
|
||||
<script>
|
||||
$('a.street-heading').click(function(e){
|
||||
e.preventDefault();
|
||||
$('#infogeo_photo').load($(this).attr('href'));
|
||||
});
|
||||
</script>
|
||||
<?php }?>
|
27
application/views/mobile/scripts/layout.phtml
Normal file
27
application/views/mobile/scripts/layout.phtml
Normal file
@ -0,0 +1,27 @@
|
||||
<?=$this->doctype()?>
|
||||
<html>
|
||||
<head>
|
||||
<?=$this->headMeta()?>
|
||||
<?=$this->headTitle()?>
|
||||
<?=$this->headStyle()?>
|
||||
<?=$this->headLink()?>
|
||||
<?=$this->headScript()?>
|
||||
</head>
|
||||
<body>
|
||||
<div data-role="page" data-theme="b">
|
||||
<div data-role="header">
|
||||
<a href="<?=$this->url(array('controller'=>'index'), null, true)?>" data-role="button"
|
||||
data-icon="home" data-iconpos="notext">Menu</a>
|
||||
<h1><?=$this->headTitle()?></h1>
|
||||
<a href="<?=$this->url(array('controller'=>'index'), null, true)?>" data-role="button"
|
||||
data-icon="search" data-iconpos="notext">Recherche</a>
|
||||
</div>
|
||||
<div data-role="content">
|
||||
<?=$this->layout()->content?>
|
||||
</div>
|
||||
<div data-role="footer" data-position="fixed">
|
||||
<h4>Menu</h4>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
161
bin/classmap_generator.php
Normal file
161
bin/classmap_generator.php
Normal file
@ -0,0 +1,161 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Loader
|
||||
* @subpackage Exception
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
/**
|
||||
* Generate class maps for use with autoloading.
|
||||
*
|
||||
* Usage:
|
||||
* --help|-h Get usage message
|
||||
* --library|-l [ <string> ] Library to parse; if none provided, assumes
|
||||
* current directory
|
||||
* --output|-o [ <string> ] Where to write autoload file; if not provided,
|
||||
* assumes "autoload_classmap.php" in library directory
|
||||
* --overwrite|-w Whether or not to overwrite existing autoload
|
||||
* file
|
||||
*/
|
||||
|
||||
$libPath = dirname(__FILE__) . '/../library';
|
||||
if (!is_dir($libPath)) {
|
||||
// Try to load StandardAutoloader from include_path
|
||||
if (false === include('Zend/Loader/StandardAutoloader.php')) {
|
||||
echo "Unable to locate autoloader via include_path; aborting" . PHP_EOL;
|
||||
exit(2);
|
||||
}
|
||||
} else {
|
||||
// Try to load StandardAutoloader from library
|
||||
if (false === include(dirname(__FILE__) . '/../library/Zend/Loader/StandardAutoloader.php')) {
|
||||
echo "Unable to locate autoloader via library; aborting" . PHP_EOL;
|
||||
exit(2);
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure library/ is on include_path
|
||||
set_include_path(implode(PATH_SEPARATOR, array(
|
||||
realpath($libPath),
|
||||
get_include_path(),
|
||||
)));
|
||||
|
||||
// Setup autoloading
|
||||
$loader = new Zend_Loader_StandardAutoloader();
|
||||
$loader->setFallbackAutoloader(true);
|
||||
$loader->register();
|
||||
|
||||
$rules = array(
|
||||
'help|h' => 'Get usage message',
|
||||
'library|l-s' => 'Library to parse; if none provided, assumes current directory',
|
||||
'output|o-s' => 'Where to write autoload file; if not provided, assumes "autoload_classmap.php" in library directory',
|
||||
'overwrite|w' => 'Whether or not to overwrite existing autoload file',
|
||||
);
|
||||
|
||||
try {
|
||||
$opts = new Zend_Console_Getopt($rules);
|
||||
$opts->parse();
|
||||
} catch (Zend_Console_Getopt_Exception $e) {
|
||||
echo $e->getUsageMessage();
|
||||
exit(2);
|
||||
}
|
||||
|
||||
if ($opts->getOption('h')) {
|
||||
echo $opts->getUsageMessage();
|
||||
exit();
|
||||
}
|
||||
|
||||
$path = $libPath;
|
||||
if (array_key_exists('PWD', $_SERVER)) {
|
||||
$path = $_SERVER['PWD'];
|
||||
}
|
||||
if (isset($opts->l)) {
|
||||
$path = $opts->l;
|
||||
if (!is_dir($path)) {
|
||||
echo "Invalid library directory provided" . PHP_EOL . PHP_EOL;
|
||||
echo $opts->getUsageMessage();
|
||||
exit(2);
|
||||
}
|
||||
$path = realpath($path);
|
||||
}
|
||||
|
||||
$usingStdout = false;
|
||||
$output = $path . DIRECTORY_SEPARATOR . 'autoload_classmap.php';
|
||||
if (isset($opts->o)) {
|
||||
$output = $opts->o;
|
||||
if ('-' == $output) {
|
||||
$output = STDOUT;
|
||||
$usingStdout = true;
|
||||
} elseif (!is_writeable(dirname($output))) {
|
||||
echo "Cannot write to '$output'; aborting." . PHP_EOL
|
||||
. PHP_EOL
|
||||
. $opts->getUsageMessage();
|
||||
exit(2);
|
||||
} elseif (file_exists($output)) {
|
||||
if (!$opts->getOption('w')) {
|
||||
echo "Autoload file already exists at '$output'," . PHP_EOL
|
||||
. "but 'overwrite' flag was not specified; aborting." . PHP_EOL
|
||||
. PHP_EOL
|
||||
. $opts->getUsageMessage();
|
||||
exit(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$strip = $path;
|
||||
|
||||
if (!$usingStdout) {
|
||||
echo "Creating class file map for library in '$path'..." . PHP_EOL;
|
||||
}
|
||||
|
||||
// Get the ClassFileLocator, and pass it the library path
|
||||
$l = new Zend_File_ClassFileLocator($path);
|
||||
|
||||
// Iterate over each element in the path, and create a map of
|
||||
// classname => filename, where the filename is relative to the library path
|
||||
$map = new stdClass;
|
||||
$strip .= DIRECTORY_SEPARATOR;
|
||||
function createMap(Iterator $i, $map, $strip) {
|
||||
$file = $i->current();
|
||||
$namespace = empty($file->namespace) ? '' : $file->namespace . '\\';
|
||||
$filename = str_replace($strip, '', $file->getRealpath());
|
||||
|
||||
// Windows portability
|
||||
$filename = str_replace(array('/', '\\'), "' . DIRECTORY_SEPARATOR . '", $filename);
|
||||
|
||||
$map->{$namespace . $file->classname} = $filename;
|
||||
|
||||
return true;
|
||||
}
|
||||
iterator_apply($l, 'createMap', array($l, $map, $strip));
|
||||
|
||||
// Create a file with the class/file map.
|
||||
// Stupid syntax highlighters make separating < from PHP declaration necessary
|
||||
$dirStore = 'dirname_' . uniqid();
|
||||
$content = '<' . "?php\n"
|
||||
. '$' . $dirStore . " = dirname(__FILE__);\n"
|
||||
. 'return ' . var_export((array) $map, true) . ';';
|
||||
|
||||
// Prefix with dirname(__FILE__); modify the generated content
|
||||
$content = preg_replace('#(=> )#', '$1$' . $dirStore . ' . DIRECTORY_SEPARATOR . ', $content);
|
||||
$content = str_replace("\\'", "'", $content);
|
||||
|
||||
// Write the contents to disk
|
||||
file_put_contents($output, $content);
|
||||
|
||||
if (!$usingStdout) {
|
||||
echo "Wrote classmap file to '" . realpath($output) . "'" . PHP_EOL;
|
||||
}
|
44
bin/zf.bat
Normal file
44
bin/zf.bat
Normal file
@ -0,0 +1,44 @@
|
||||
@ECHO off
|
||||
REM Zend Framework
|
||||
REM
|
||||
REM LICENSE
|
||||
REM
|
||||
REM This source file is subject to the new BSD license that is bundled
|
||||
REM with this package in the file LICENSE.txt.
|
||||
REM It is also available through the world-wide-web at this URL:
|
||||
REM http://framework.zend.com/license/new-bsd
|
||||
REM If you did not receive a copy of the license and are unable to
|
||||
REM obtain it through the world-wide-web, please send an email
|
||||
REM to license@zend.com so we can send you a copy immediately.
|
||||
REM
|
||||
REM Zend
|
||||
REM Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
REM http://framework.zend.com/license/new-bsd New BSD License
|
||||
|
||||
|
||||
REM Test to see if this was installed via pear
|
||||
SET ZTMPZTMPZTMPZ=@ph
|
||||
SET TMPZTMPZTMP=%ZTMPZTMPZTMPZ%p_bin@
|
||||
REM below @php_bin@
|
||||
FOR %%x IN ("@php_bin@") DO (if %%x=="%TMPZTMPZTMP%" GOTO :NON_PEAR_INSTALLED)
|
||||
|
||||
GOTO PEAR_INSTALLED
|
||||
|
||||
:NON_PEAR_INSTALLED
|
||||
REM Assume php.exe is executable, and that zf.php will reside in the
|
||||
REM same file as this one
|
||||
SET PHP_BIN=php.exe
|
||||
SET PHP_DIR=%~dp0
|
||||
GOTO RUN
|
||||
|
||||
:PEAR_INSTALLED
|
||||
REM Assume this was installed via PEAR and use replacements php_bin & php_dir
|
||||
SET PHP_BIN=@php_bin@
|
||||
SET PHP_DIR=@php_dir@
|
||||
GOTO RUN
|
||||
|
||||
:RUN
|
||||
SET ZF_SCRIPT=%PHP_DIR%\zf.php
|
||||
"%PHP_BIN%" -d safe_mode=Off -f "%ZF_SCRIPT%" -- %*
|
||||
|
||||
|
624
bin/zf.php
Normal file
624
bin/zf.php
Normal file
@ -0,0 +1,624 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Tool
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
* ZF
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Tool
|
||||
* @subpackage Framework
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class ZF
|
||||
{
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $_clientLoaded = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_mode = 'runTool';
|
||||
|
||||
/**
|
||||
* @var array of messages
|
||||
*/
|
||||
protected $_messages = array();
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_homeDirectory = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_storageDirectory = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_configFile = null;
|
||||
|
||||
/**
|
||||
* main()
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function main()
|
||||
{
|
||||
$zf = new self();
|
||||
$zf->bootstrap();
|
||||
$zf->run();
|
||||
}
|
||||
|
||||
/**
|
||||
* bootstrap()
|
||||
*
|
||||
* @return ZF
|
||||
*/
|
||||
public function bootstrap()
|
||||
{
|
||||
// detect settings
|
||||
$this->_mode = $this->_detectMode();
|
||||
$this->_homeDirectory = $this->_detectHomeDirectory();
|
||||
$this->_storageDirectory = $this->_detectStorageDirectory();
|
||||
$this->_configFile = $this->_detectConfigFile();
|
||||
|
||||
// setup
|
||||
$this->_setupPHPRuntime();
|
||||
$this->_setupToolRuntime();
|
||||
}
|
||||
|
||||
/**
|
||||
* run()
|
||||
*
|
||||
* @return ZF
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
switch ($this->_mode) {
|
||||
case 'runError':
|
||||
$this->_runError();
|
||||
$this->_runInfo();
|
||||
break;
|
||||
case 'runSetup':
|
||||
if ($this->_runSetup() === false) {
|
||||
$this->_runInfo();
|
||||
}
|
||||
break;
|
||||
case 'runInfo':
|
||||
$this->_runInfo();
|
||||
break;
|
||||
case 'runTool':
|
||||
default:
|
||||
$this->_runTool();
|
||||
break;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* _detectMode()
|
||||
*
|
||||
* @return ZF
|
||||
*/
|
||||
protected function _detectMode()
|
||||
{
|
||||
$arguments = $_SERVER['argv'];
|
||||
|
||||
$mode = 'runTool';
|
||||
|
||||
if (!isset($arguments[0])) {
|
||||
return $mode;
|
||||
}
|
||||
|
||||
if ($arguments[0] == $_SERVER['PHP_SELF']) {
|
||||
$this->_executable = array_shift($arguments);
|
||||
}
|
||||
|
||||
if (!isset($arguments[0])) {
|
||||
return $mode;
|
||||
}
|
||||
|
||||
if ($arguments[0] == '--setup') {
|
||||
$mode = 'runSetup';
|
||||
} elseif ($arguments[0] == '--info') {
|
||||
$mode = 'runInfo';
|
||||
}
|
||||
|
||||
return $mode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* _detectHomeDirectory() - detect the home directory in a variety of different places
|
||||
*
|
||||
* @param bool $mustExist Should the returned value already exist in the file system
|
||||
* @param bool $returnMessages Should it log messages for output later
|
||||
* @return string
|
||||
*/
|
||||
protected function _detectHomeDirectory($mustExist = true, $returnMessages = true)
|
||||
{
|
||||
$homeDirectory = null;
|
||||
|
||||
$homeDirectory = getenv('ZF_HOME'); // check env var ZF_HOME
|
||||
if ($homeDirectory) {
|
||||
$this->_logMessage('Home directory found in environment variable ZF_HOME with value ' . $homeDirectory, $returnMessages);
|
||||
if (!$mustExist || ($mustExist && file_exists($homeDirectory))) {
|
||||
return $homeDirectory;
|
||||
} else {
|
||||
$this->_logMessage('Home directory does not exist at ' . $homeDirectory, $returnMessages);
|
||||
}
|
||||
}
|
||||
|
||||
$homeDirectory = getenv('HOME'); // HOME environment variable
|
||||
|
||||
if ($homeDirectory) {
|
||||
$this->_logMessage('Home directory found in environment variable HOME with value ' . $homeDirectory, $returnMessages);
|
||||
if (!$mustExist || ($mustExist && file_exists($homeDirectory))) {
|
||||
return $homeDirectory;
|
||||
} else {
|
||||
$this->_logMessage('Home directory does not exist at ' . $homeDirectory, $returnMessages);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$homeDirectory = getenv('HOMEPATH');
|
||||
|
||||
if ($homeDirectory) {
|
||||
$this->_logMessage('Home directory found in environment variable HOMEPATH with value ' . $homeDirectory, $returnMessages);
|
||||
if (!$mustExist || ($mustExist && file_exists($homeDirectory))) {
|
||||
return $homeDirectory;
|
||||
} else {
|
||||
$this->_logMessage('Home directory does not exist at ' . $homeDirectory, $returnMessages);
|
||||
}
|
||||
}
|
||||
|
||||
$homeDirectory = getenv('USERPROFILE');
|
||||
|
||||
if ($homeDirectory) {
|
||||
$this->_logMessage('Home directory found in environment variable USERPROFILE with value ' . $homeDirectory, $returnMessages);
|
||||
if (!$mustExist || ($mustExist && file_exists($homeDirectory))) {
|
||||
return $homeDirectory;
|
||||
} else {
|
||||
$this->_logMessage('Home directory does not exist at ' . $homeDirectory, $returnMessages);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* _detectStorageDirectory() - Detect where the storage directory is from a variaty of possiblities
|
||||
*
|
||||
* @param bool $mustExist Should the returned value already exist in the file system
|
||||
* @param bool $returnMessages Should it log messages for output later
|
||||
* @return string
|
||||
*/
|
||||
protected function _detectStorageDirectory($mustExist = true, $returnMessages = true)
|
||||
{
|
||||
$storageDirectory = false;
|
||||
|
||||
$storageDirectory = getenv('ZF_STORAGE_DIR');
|
||||
if ($storageDirectory) {
|
||||
$this->_logMessage('Storage directory path found in environment variable ZF_STORAGE_DIR with value ' . $storageDirectory, $returnMessages);
|
||||
if (!$mustExist || ($mustExist && file_exists($storageDirectory))) {
|
||||
return $storageDirectory;
|
||||
} else {
|
||||
$this->_logMessage('Storage directory does not exist at ' . $storageDirectory, $returnMessages);
|
||||
}
|
||||
}
|
||||
|
||||
$homeDirectory = ($this->_homeDirectory) ? $this->_homeDirectory : $this->_detectHomeDirectory(true, false);
|
||||
|
||||
if ($homeDirectory) {
|
||||
$storageDirectory = $homeDirectory . '/.zf/';
|
||||
$this->_logMessage('Storage directory assumed in home directory at location ' . $storageDirectory, $returnMessages);
|
||||
if (!$mustExist || ($mustExist && file_exists($storageDirectory))) {
|
||||
return $storageDirectory;
|
||||
} else {
|
||||
$this->_logMessage('Storage directory does not exist at ' . $storageDirectory, $returnMessages);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* _detectConfigFile() - Detect config file location from a variety of possibilities
|
||||
*
|
||||
* @param bool $mustExist Should the returned value already exist in the file system
|
||||
* @param bool $returnMessages Should it log messages for output later
|
||||
* @return string
|
||||
*/
|
||||
protected function _detectConfigFile($mustExist = true, $returnMessages = true)
|
||||
{
|
||||
$configFile = null;
|
||||
|
||||
$configFile = getenv('ZF_CONFIG_FILE');
|
||||
if ($configFile) {
|
||||
$this->_logMessage('Config file found environment variable ZF_CONFIG_FILE at ' . $configFile, $returnMessages);
|
||||
if (!$mustExist || ($mustExist && file_exists($configFile))) {
|
||||
return $configFile;
|
||||
} else {
|
||||
$this->_logMessage('Config file does not exist at ' . $configFile, $returnMessages);
|
||||
}
|
||||
}
|
||||
|
||||
$homeDirectory = ($this->_homeDirectory) ? $this->_homeDirectory : $this->_detectHomeDirectory(true, false);
|
||||
if ($homeDirectory) {
|
||||
$configFile = $homeDirectory . '/.zf.ini';
|
||||
$this->_logMessage('Config file assumed in home directory at location ' . $configFile, $returnMessages);
|
||||
if (!$mustExist || ($mustExist && file_exists($configFile))) {
|
||||
return $configFile;
|
||||
} else {
|
||||
$this->_logMessage('Config file does not exist at ' . $configFile, $returnMessages);
|
||||
}
|
||||
}
|
||||
|
||||
$storageDirectory = ($this->_storageDirectory) ? $this->_storageDirectory : $this->_detectStorageDirectory(true, false);
|
||||
if ($storageDirectory) {
|
||||
$configFile = $storageDirectory . '/zf.ini';
|
||||
$this->_logMessage('Config file assumed in storage directory at location ' . $configFile, $returnMessages);
|
||||
if (!$mustExist || ($mustExist && file_exists($configFile))) {
|
||||
return $configFile;
|
||||
} else {
|
||||
$this->_logMessage('Config file does not exist at ' . $configFile, $returnMessages);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* _setupPHPRuntime() - parse the config file if it exists for php ini values to set
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _setupPHPRuntime()
|
||||
{
|
||||
// set php runtime settings
|
||||
ini_set('display_errors', true);
|
||||
|
||||
// support the changing of the current working directory, necessary for some providers
|
||||
$cwd = getenv('ZEND_TOOL_CURRENT_WORKING_DIRECTORY');
|
||||
if ($cwd != '' && realpath($cwd)) {
|
||||
chdir($cwd);
|
||||
}
|
||||
|
||||
if (!$this->_configFile) {
|
||||
return;
|
||||
}
|
||||
$zfINISettings = parse_ini_file($this->_configFile);
|
||||
$phpINISettings = ini_get_all();
|
||||
foreach ($zfINISettings as $zfINIKey => $zfINIValue) {
|
||||
if (substr($zfINIKey, 0, 4) === 'php.') {
|
||||
$phpINIKey = substr($zfINIKey, 4);
|
||||
if (array_key_exists($phpINIKey, $phpINISettings)) {
|
||||
ini_set($phpINIKey, $zfINIValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* _setupToolRuntime() - setup the tools include_path and load the proper framwork parts that
|
||||
* enable Zend_Tool to work.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _setupToolRuntime()
|
||||
{
|
||||
|
||||
$includePathPrepend = getenv('ZEND_TOOL_INCLUDE_PATH_PREPEND');
|
||||
$includePathFull = getenv('ZEND_TOOL_INCLUDE_PATH');
|
||||
|
||||
// check if the user has not provided anything
|
||||
if (!($includePathPrepend || $includePathFull)) {
|
||||
if ($this->_tryClientLoad()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// if ZF is not in the include_path, but relative to this file, put it in the include_path
|
||||
if ($includePathPrepend || $includePathFull) {
|
||||
if (isset($includePathPrepend) && ($includePathPrepend !== false)) {
|
||||
set_include_path($includePathPrepend . PATH_SEPARATOR . get_include_path());
|
||||
} elseif (isset($includePathFull) && ($includePathFull !== false)) {
|
||||
set_include_path($includePathFull);
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->_tryClientLoad()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$zfIncludePath['relativePath'] = dirname(__FILE__) . '/../library/';
|
||||
if (file_exists($zfIncludePath['relativePath'] . 'Zend/Tool/Framework/Client/Console.php')) {
|
||||
set_include_path(realpath($zfIncludePath['relativePath']) . PATH_SEPARATOR . get_include_path());
|
||||
}
|
||||
|
||||
if (!$this->_tryClientLoad()) {
|
||||
$this->_mode = 'runError';
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* _tryClientLoad() - Attempt to load the Zend_Tool_Framework_Client_Console to enable the tool to run.
|
||||
*
|
||||
* This method will return false if its not loaded to allow the consumer to alter the environment in such
|
||||
* a way that it can be called again to try loading the proper file/class.
|
||||
*
|
||||
* @return bool if the client is actuall loaded or not
|
||||
*/
|
||||
protected function _tryClientLoad()
|
||||
{
|
||||
$this->_clientLoaded = false;
|
||||
$fh = @fopen('Zend/Tool/Framework/Client/Console.php', 'r', true);
|
||||
if (!$fh) {
|
||||
return $this->_clientLoaded; // false
|
||||
} else {
|
||||
fclose($fh);
|
||||
unset($fh);
|
||||
include 'Zend/Tool/Framework/Client/Console.php';
|
||||
$this->_clientLoaded = class_exists('Zend_Tool_Framework_Client_Console');
|
||||
}
|
||||
|
||||
return $this->_clientLoaded;
|
||||
}
|
||||
|
||||
/**
|
||||
* _runError() - Output the error screen that tells the user that the tool was not setup
|
||||
* in a sane way
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _runError()
|
||||
{
|
||||
|
||||
echo <<<EOS
|
||||
|
||||
***************************** ZF ERROR ********************************
|
||||
In order to run the zf command, you need to ensure that Zend Framework
|
||||
is inside your include_path. There are a variety of ways that you can
|
||||
ensure that this zf command line tool knows where the Zend Framework
|
||||
library is on your system, but not all of them can be described here.
|
||||
|
||||
The easiest way to get the zf command running is to give it the include
|
||||
path via an environment variable ZEND_TOOL_INCLUDE_PATH or
|
||||
ZEND_TOOL_INCLUDE_PATH_PREPEND with the proper include path to use,
|
||||
then run the command "zf --setup". This command is designed to create
|
||||
a storage location for your user, as well as create the zf.ini file
|
||||
that the zf command will consult in order to run properly on your
|
||||
system.
|
||||
|
||||
Example you would run:
|
||||
|
||||
$ ZEND_TOOL_INCLUDE_PATH=/path/to/library zf --setup
|
||||
|
||||
Your are encourged to read more in the link that follows.
|
||||
|
||||
EOS;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* _runInfo() - this command will produce information about the setup of this script and
|
||||
* Zend_Tool
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _runInfo()
|
||||
{
|
||||
echo 'Zend_Tool & CLI Setup Information' . PHP_EOL
|
||||
. '(available via the command line "zf --info")'
|
||||
. PHP_EOL;
|
||||
|
||||
echo ' * ' . implode(PHP_EOL . ' * ', $this->_messages) . PHP_EOL;
|
||||
|
||||
echo PHP_EOL;
|
||||
|
||||
echo 'To change the setup of this tool, run: "zf --setup"';
|
||||
|
||||
echo PHP_EOL;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* _runSetup() - parse the request to see which setup command to run
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _runSetup()
|
||||
{
|
||||
$setupCommand = (isset($_SERVER['argv'][2])) ? $_SERVER['argv'][2] : null;
|
||||
|
||||
switch ($setupCommand) {
|
||||
case 'storage-directory':
|
||||
$this->_runSetupStorageDirectory();
|
||||
break;
|
||||
case 'config-file':
|
||||
$this->_runSetupConfigFile();
|
||||
break;
|
||||
default:
|
||||
$this->_runSetupMoreInfo();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* _runSetupStorageDirectory() - if the storage directory does not exist, create it
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _runSetupStorageDirectory()
|
||||
{
|
||||
$storageDirectory = $this->_detectStorageDirectory(false, false);
|
||||
|
||||
if (file_exists($storageDirectory)) {
|
||||
echo 'Directory already exists at ' . $storageDirectory . PHP_EOL
|
||||
. 'Cannot create storage directory.';
|
||||
return;
|
||||
}
|
||||
|
||||
mkdir($storageDirectory);
|
||||
|
||||
echo 'Storage directory created at ' . $storageDirectory . PHP_EOL;
|
||||
}
|
||||
|
||||
/**
|
||||
* _runSetupConfigFile()
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _runSetupConfigFile()
|
||||
{
|
||||
$configFile = $this->_detectConfigFile(false, false);
|
||||
|
||||
if (file_exists($configFile)) {
|
||||
echo 'File already exists at ' . $configFile . PHP_EOL
|
||||
. 'Cannot write new config file.';
|
||||
return;
|
||||
}
|
||||
|
||||
$includePath = get_include_path();
|
||||
|
||||
$contents = 'php.include_path = "' . $includePath . '"';
|
||||
|
||||
file_put_contents($configFile, $contents);
|
||||
|
||||
$iniValues = ini_get_all();
|
||||
if ($iniValues['include_path']['global_value'] != $iniValues['include_path']['local_value']) {
|
||||
echo 'NOTE: the php include_path to be used with the tool has been written' . PHP_EOL
|
||||
. 'to the config file, using ZEND_TOOL_INCLUDE_PATH (or other include_path setters)' . PHP_EOL
|
||||
. 'is no longer necessary.' . PHP_EOL . PHP_EOL;
|
||||
}
|
||||
|
||||
echo 'Config file written to ' . $configFile . PHP_EOL;
|
||||
}
|
||||
|
||||
/**
|
||||
* _runSetupMoreInfo() - return more information about what can be setup, and what is setup
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _runSetupMoreInfo()
|
||||
{
|
||||
$homeDirectory = $this->_detectHomeDirectory(false, false);
|
||||
$storageDirectory = $this->_detectStorageDirectory(false, false);
|
||||
$configFile = $this->_detectConfigFile(false, false);
|
||||
|
||||
echo <<<EOS
|
||||
|
||||
ZF Command Line Tool - Setup
|
||||
----------------------------
|
||||
|
||||
Current Paths (Existing or not):
|
||||
Home Directory: {$homeDirectory}
|
||||
Storage Directory: {$storageDirectory}
|
||||
Config File: {$configFile}
|
||||
|
||||
Important Environment Variables:
|
||||
ZF_HOME
|
||||
- the directory this tool will look for a home directory
|
||||
- directory must exist
|
||||
ZF_STORAGE_DIR
|
||||
- where this tool will look for a storage directory
|
||||
- directory must exist
|
||||
ZF_CONFIG_FILE
|
||||
- where this tool will look for a configuration file
|
||||
ZF_TOOL_INCLUDE_PATH
|
||||
- set the include_path for this tool to use this value
|
||||
ZF_TOOL_INCLUDE_PATH_PREPEND
|
||||
- prepend the current php.ini include_path with this value
|
||||
|
||||
Search Order:
|
||||
Home Directory:
|
||||
- ZF_HOME, then HOME (*nix), then HOMEPATH (windows)
|
||||
Storage Directory:
|
||||
- ZF_STORAGE_DIR, then {home}/.zf/
|
||||
Config File:
|
||||
- ZF_CONFIG_FILE, then {home}/.zf.ini, then {home}/zf.ini,
|
||||
then {storage}/zf.ini
|
||||
|
||||
Commands:
|
||||
zf --setup storage-directory
|
||||
- setup the storage directory, directory will be created
|
||||
zf --setup config-file
|
||||
- create the config file with some default values
|
||||
|
||||
|
||||
EOS;
|
||||
}
|
||||
|
||||
/**
|
||||
* _runTool() - This is where the magic happens, dispatch Zend_Tool
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _runTool()
|
||||
{
|
||||
|
||||
$configOptions = array();
|
||||
if (isset($this->_configFile) && $this->_configFile) {
|
||||
$configOptions['configOptions']['configFilepath'] = $this->_configFile;
|
||||
}
|
||||
if (isset($this->_storageDirectory) && $this->_storageDirectory) {
|
||||
$configOptions['storageOptions']['directory'] = $this->_storageDirectory;
|
||||
}
|
||||
|
||||
// ensure that zf.php loads the Zend_Tool_Project features
|
||||
$configOptions['classesToLoad'] = 'Zend_Tool_Project_Provider_Manifest';
|
||||
|
||||
$console = new Zend_Tool_Framework_Client_Console($configOptions);
|
||||
$console->dispatch();
|
||||
}
|
||||
|
||||
/**
|
||||
* _logMessage() - Internal method used to log setup and information messages.
|
||||
*
|
||||
* @param string $message
|
||||
* @param bool $storeMessage
|
||||
* @return void
|
||||
*/
|
||||
protected function _logMessage($message, $storeMessage = true)
|
||||
{
|
||||
if (!$storeMessage) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->_messages[] = $message;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!getenv('ZF_NO_MAIN')) {
|
||||
ZF::main();
|
||||
}
|
45
bin/zf.sh
Normal file
45
bin/zf.sh
Normal file
@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
|
||||
#############################################################################
|
||||
# Zend Framework
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# This source file is subject to the new BSD license that is bundled
|
||||
# with this package in the file LICENSE.txt.
|
||||
# It is also available through the world-wide-web at this URL:
|
||||
# http://framework.zend.com/license/new-bsd
|
||||
# If you did not receive a copy of the license and are unable to
|
||||
# obtain it through the world-wide-web, please send an email
|
||||
# to license@zend.com so we can send you a copy immediately.
|
||||
#
|
||||
# Zend
|
||||
# Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
# http://framework.zend.com/license/new-bsd New BSD License
|
||||
#############################################################################
|
||||
|
||||
|
||||
# find php: pear first, command -v second, straight up php lastly
|
||||
if test "@php_bin@" != '@'php_bin'@'; then
|
||||
PHP_BIN="@php_bin@"
|
||||
elif command -v php 1>/dev/null 2>/dev/null; then
|
||||
PHP_BIN=`command -v php`
|
||||
else
|
||||
PHP_BIN=php
|
||||
fi
|
||||
|
||||
# find zf.php: pear first, same directory 2nd,
|
||||
if test "@php_dir@" != '@'php_dir'@'; then
|
||||
PHP_DIR="@php_dir@"
|
||||
else
|
||||
SELF_LINK="$0"
|
||||
SELF_LINK_TMP="$(readlink "$SELF_LINK")"
|
||||
while test -n "$SELF_LINK_TMP"; do
|
||||
SELF_LINK="$SELF_LINK_TMP"
|
||||
SELF_LINK_TMP="$(readlink "$SELF_LINK")"
|
||||
done
|
||||
PHP_DIR="$(dirname "$SELF_LINK")"
|
||||
fi
|
||||
|
||||
"$PHP_BIN" -d safe_mode=Off -f "$PHP_DIR/zf.php" -- "$@"
|
||||
|
10
docs/README
10
docs/README
@ -135,6 +135,16 @@ Session
|
||||
|
||||
Application must override the session.save_path, soap.wsdl_cache_dir to define it's own path.
|
||||
|
||||
Project Configuration
|
||||
---------------------
|
||||
|
||||
- Autoloader
|
||||
See in the public/index.php. We use Classmpap Autloader which store Class Key and his file
|
||||
path.
|
||||
To generate classmap file use bin/classmap_generator.php
|
||||
|
||||
-
|
||||
|
||||
|
||||
WKHTMLTOPDF
|
||||
-----------
|
||||
|
@ -35,7 +35,7 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
|
||||
$view = $bootstrap->bootstrap('View')->getResource('View');
|
||||
$view->setBasePath($viewPath);
|
||||
$layout = $bootstrap->bootstrap('Layout')->getResource('Layout');
|
||||
$layout->setLayout('main');
|
||||
$layout->setLayout('layout');
|
||||
$layout->setLayoutPath($layoutPath);
|
||||
|
||||
//Load default style and javascript files for the selected theme
|
||||
|
17
library/Application/autoload_classmap.php
Normal file
17
library/Application/autoload_classmap.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
$dirname_530d9a175fd52 = dirname(__FILE__);
|
||||
return array (
|
||||
'Application_Controller_Plugin_Auth' => $dirname_530d9a175fd52 . DIRECTORY_SEPARATOR . 'Controller' . DIRECTORY_SEPARATOR . 'Plugin' . DIRECTORY_SEPARATOR . 'Auth.php',
|
||||
'Application_Controller_Plugin_Cgu' => $dirname_530d9a175fd52 . DIRECTORY_SEPARATOR . 'Controller' . DIRECTORY_SEPARATOR . 'Plugin' . DIRECTORY_SEPARATOR . 'Cgu.php',
|
||||
'Application_Controller_Plugin_Lang' => $dirname_530d9a175fd52 . DIRECTORY_SEPARATOR . 'Controller' . DIRECTORY_SEPARATOR . 'Plugin' . DIRECTORY_SEPARATOR . 'Lang.php',
|
||||
'Application_Controller_Plugin_Menu' => $dirname_530d9a175fd52 . DIRECTORY_SEPARATOR . 'Controller' . DIRECTORY_SEPARATOR . 'Plugin' . DIRECTORY_SEPARATOR . 'Menu.php',
|
||||
'Application_Controller_Plugin_Pdf' => $dirname_530d9a175fd52 . DIRECTORY_SEPARATOR . 'Controller' . DIRECTORY_SEPARATOR . 'Plugin' . DIRECTORY_SEPARATOR . 'Pdf.php',
|
||||
'Application_Controller_Plugin_Theme' => $dirname_530d9a175fd52 . DIRECTORY_SEPARATOR . 'Controller' . DIRECTORY_SEPARATOR . 'Plugin' . DIRECTORY_SEPARATOR . 'Theme.php',
|
||||
'Application_Controller_Plugin_Xml' => $dirname_530d9a175fd52 . DIRECTORY_SEPARATOR . 'Controller' . DIRECTORY_SEPARATOR . 'Plugin' . DIRECTORY_SEPARATOR . 'Xml.php',
|
||||
'Application_Form_Login' => $dirname_530d9a175fd52 . DIRECTORY_SEPARATOR . 'Form' . DIRECTORY_SEPARATOR . 'Login.php',
|
||||
'Application_Form_RechercheActionnaire' => $dirname_530d9a175fd52 . DIRECTORY_SEPARATOR . 'Form' . DIRECTORY_SEPARATOR . 'RechercheActionnaire.php',
|
||||
'Application_Form_RechercheDirigeant' => $dirname_530d9a175fd52 . DIRECTORY_SEPARATOR . 'Form' . DIRECTORY_SEPARATOR . 'RechercheDirigeant.php',
|
||||
'Application_Form_RechercheEnquete' => $dirname_530d9a175fd52 . DIRECTORY_SEPARATOR . 'Form' . DIRECTORY_SEPARATOR . 'RechercheEnquete.php',
|
||||
'Application_Form_RechercheEntreprise' => $dirname_530d9a175fd52 . DIRECTORY_SEPARATOR . 'Form' . DIRECTORY_SEPARATOR . 'RechercheEntreprise.php',
|
||||
'Application_Form_RechercheWorldcheck' => $dirname_530d9a175fd52 . DIRECTORY_SEPARATOR . 'Form' . DIRECTORY_SEPARATOR . 'RechercheWorldcheck.php',
|
||||
);
|
@ -22,7 +22,7 @@ class Scores_Utilisateur
|
||||
* @return stdClass
|
||||
*/
|
||||
public function updateProfil($InfosLogin, $password = null)
|
||||
{
|
||||
{
|
||||
$identity = new stdClass;
|
||||
$identity->username = $InfosLogin->result->login;
|
||||
if ($password === null) {
|
||||
@ -60,12 +60,12 @@ class Scores_Utilisateur
|
||||
$identity->lang = $lang;
|
||||
$identity->langtmp = $lang;
|
||||
$identity->browser = $this->getBrowserInfo();
|
||||
|
||||
|
||||
$this->identity = $identity;
|
||||
|
||||
|
||||
return $identity;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if user is log in
|
||||
* @return boolean
|
||||
@ -273,7 +273,7 @@ class Scores_Utilisateur
|
||||
{
|
||||
return $this->identity->lang;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retourne la langue de l'interface du client
|
||||
*/
|
||||
@ -281,7 +281,7 @@ class Scores_Utilisateur
|
||||
{
|
||||
return $this->identity->langtmp;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets interface's language new value
|
||||
* @param $langtmp
|
||||
|
160
library/Scores/Ws.php
Normal file
160
library/Scores/Ws.php
Normal file
@ -0,0 +1,160 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Load User Info
|
||||
*/
|
||||
require_once 'Scores/Utilisateur.php';
|
||||
|
||||
|
||||
/**
|
||||
* Distribute Scores Webservice
|
||||
*/
|
||||
class Scores_Ws
|
||||
{
|
||||
/**
|
||||
* User login
|
||||
* @var string
|
||||
*/
|
||||
protected $login = null;
|
||||
|
||||
/**
|
||||
* Password
|
||||
* @var string
|
||||
*/
|
||||
protected $password = null;
|
||||
|
||||
/**
|
||||
* Enable/Disable Cache
|
||||
* @var boolean
|
||||
*/
|
||||
protected $cache = true;
|
||||
|
||||
/**
|
||||
* Enable/Disable cache writing
|
||||
* Override the cache flag
|
||||
* @var boolean
|
||||
*/
|
||||
protected $cacheWrite = true;
|
||||
|
||||
/**
|
||||
* Number of response
|
||||
* @var int
|
||||
*/
|
||||
protected $nbReponses = 20;
|
||||
|
||||
protected $obj = null;
|
||||
|
||||
/**
|
||||
* Scores_Ws
|
||||
* @param string $login
|
||||
* @param string $password
|
||||
*/
|
||||
public function __construct($login = null, $password = null)
|
||||
{
|
||||
if ( !empty($login) && !empty($password) ){
|
||||
$this->login = $login;
|
||||
$this->password = $password;
|
||||
} else {
|
||||
$user = new Scores_Utilisateur();
|
||||
$this->login = $user->getLogin();
|
||||
$this->password = $user->getPassword();
|
||||
$this->nbReponses = $user->getNbRep();
|
||||
if ( $user->checkModeEdition() ) {
|
||||
//Disable cache
|
||||
$this->cache = false;
|
||||
//Don't write cache
|
||||
if ( APPLICATION_ENV == 'staging' ) {
|
||||
$this->cacheWrite = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Distribute call on each separate class for each service
|
||||
* Schema for $name is {Class}_{Method}
|
||||
* @param string $name
|
||||
* @param array $args
|
||||
* @return mixed
|
||||
*/
|
||||
public function __call($name, $args)
|
||||
{
|
||||
$response = false;
|
||||
|
||||
$pos = strpos($name, '_');
|
||||
$className = substr($name, 0, $pos);
|
||||
$methodName = substr($name, $pos+1);
|
||||
|
||||
$objR = new ReflectionClass('Scores_Ws_'.$className);
|
||||
|
||||
$this->obj = $objR->newInstance($methodName);
|
||||
$this->obj->setSoapClientOption('login', $this->login);
|
||||
$this->obj->setSoapClientOption('password', $this->password);
|
||||
|
||||
//Check cache
|
||||
if ($this->cacheWrite && $this->obj->getCache()) {
|
||||
$filename = $this->obj->getFilename();
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
$response = $cache->getBlock();
|
||||
}
|
||||
}
|
||||
//Execute the request
|
||||
else {
|
||||
call_user_func_array(array($this->obj, $methodName), $args);
|
||||
if ( !$this->obj->isError() || !$this->obj->isMessage() ) {
|
||||
$response = $obj->getSoapResponse();
|
||||
//Put in cache the response
|
||||
if ($this->cacheWrite && $obj->getCache()) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($responses);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Type du retour
|
||||
* @return string
|
||||
* ERR or MSG
|
||||
*/
|
||||
public function getResponseType()
|
||||
{
|
||||
if ( $this->obj->isError() ) {
|
||||
return 'ERR';
|
||||
} elseif ( $this->obj->isMessage() ) {
|
||||
return 'MSG';
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Message de retour pour affichage
|
||||
* @return string
|
||||
*/
|
||||
public function getResponseMsg()
|
||||
{
|
||||
return $this->obj->getMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne les éléments pour debuggage
|
||||
* @return object
|
||||
*/
|
||||
public function getError()
|
||||
{
|
||||
$error = new stdClass();
|
||||
$error->service = $this->obj->getServiceName();
|
||||
$error->method = $this->obj->getMethodName();
|
||||
//Request Parameter
|
||||
$error->args = $this->obj->getParams();
|
||||
$error->faultCode = $this->obj->getFaultCode();
|
||||
$error->faultMessage = $this->obj->getMessage();
|
||||
|
||||
return $error;
|
||||
}
|
||||
}
|
254
library/Scores/Ws/Abstract.php
Normal file
254
library/Scores/Ws/Abstract.php
Normal file
@ -0,0 +1,254 @@
|
||||
<?php
|
||||
require_once 'Scores/Ws/Config.php';
|
||||
|
||||
/** @see Scores_Ws_Interface */
|
||||
require_once 'Scores/Ws/Interface.php';
|
||||
|
||||
/**
|
||||
* Abstract class for Scores_Ws.
|
||||
*/
|
||||
abstract class Scores_Ws_Abstract implements Scosres_Ws_Interface
|
||||
{
|
||||
/**
|
||||
* Service name
|
||||
* @var string
|
||||
*/
|
||||
protected $service = null;
|
||||
|
||||
/**
|
||||
* Method Name
|
||||
* @var string
|
||||
*/
|
||||
protected $method = null;
|
||||
|
||||
/**
|
||||
* Params for soap call as stdClass
|
||||
* @var stdClass
|
||||
*/
|
||||
protected $params = null;
|
||||
|
||||
/**
|
||||
* Default max response
|
||||
* @var int
|
||||
*/
|
||||
protected $nbReponses = 20;
|
||||
|
||||
/**
|
||||
* Set to false to disable cache for one method
|
||||
* @var boolean
|
||||
*/
|
||||
protected $cache = true;
|
||||
|
||||
/**
|
||||
* WSDL URI
|
||||
* @var string
|
||||
*/
|
||||
protected $wsdl = null;
|
||||
|
||||
/**
|
||||
* Options for WSDL
|
||||
* @var array
|
||||
*/
|
||||
protected $options = array();
|
||||
|
||||
/**
|
||||
* Soap Response
|
||||
* @var object
|
||||
*/
|
||||
protected $response = null;
|
||||
|
||||
/**
|
||||
* 0 = no error
|
||||
* 1 = error
|
||||
* 2 = message
|
||||
* @var int
|
||||
*/
|
||||
protected $error = 0;
|
||||
|
||||
/**
|
||||
* Error / Message
|
||||
* @var string
|
||||
*/
|
||||
protected $message = '';
|
||||
|
||||
/**
|
||||
* Original soap fault code
|
||||
* @var string
|
||||
*/
|
||||
protected $faultcode = null;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$config = new Scores_Ws_Config();
|
||||
$config->setLocation('local');
|
||||
$serviceConfig = $config->getService($this->service);
|
||||
|
||||
$this->setSoapClientWsdl($serviceConfig['wsdl']);
|
||||
|
||||
foreach ( $serviceConfig['options'] as $name => $value ) {
|
||||
$this->setSoapClientOption($name, $value);
|
||||
}
|
||||
|
||||
$this->setSoapClientOption('features', SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS);
|
||||
$this->setSoapClientOption('compression', SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE);
|
||||
$this->setSoapClientOption('trace', true);
|
||||
$this->setSoapClientOption('encoding', 'utf-8');
|
||||
|
||||
if (APPLICATION_ENV == 'development'){
|
||||
$this->setSoapClientOption('cache_wsdl', WSDL_CACHE_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::setService()
|
||||
*/
|
||||
public function setService($name)
|
||||
{
|
||||
$this->service = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Interface::getServiceName()
|
||||
*/
|
||||
public function getServiceName()
|
||||
{
|
||||
return $this->service;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Interface::getMethodName()
|
||||
*/
|
||||
public function getMethodName()
|
||||
{
|
||||
return $this->method;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Interface::getParams()
|
||||
*/
|
||||
public function getParams()
|
||||
{
|
||||
return var_export($this->params, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Interface::getFaultCode()
|
||||
*/
|
||||
public function getFaultCode()
|
||||
{
|
||||
return $this->faultcode;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::setNbReponses()
|
||||
*/
|
||||
public function setNbReponses($nb)
|
||||
{
|
||||
$this->nbReponses = $nb;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::setSoapClientWsdl()
|
||||
*/
|
||||
public function setSoapClientWsdl($wsdl = null)
|
||||
{
|
||||
$this->wsdl = $wsdl;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::setSoapClientOption()
|
||||
*/
|
||||
public function setSoapClientOption($name = null , $value = null)
|
||||
{
|
||||
$this->options[$name] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::getSoapClient()
|
||||
*/
|
||||
public function getSoapClient()
|
||||
{
|
||||
$client = false;
|
||||
try {
|
||||
$client = new SoapClient($this->wsdl, $this->options);
|
||||
} catch (Exception $e) {
|
||||
throw new Exception('Application Error');
|
||||
}
|
||||
return $client;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::isError()
|
||||
*/
|
||||
public function isError()
|
||||
{
|
||||
if ( $this->error == 1 ) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::isMessage()
|
||||
*/
|
||||
public function isMessage()
|
||||
{
|
||||
if ( $this->error == 2 ) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::getSoapResponse()
|
||||
*/
|
||||
public function getSoapResponse()
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::getMessage()
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
/**
|
||||
* (non-PHPdoc)
|
||||
* @see Scores_Ws_Service_Interface::getFilename()
|
||||
*/
|
||||
public function getFilename($method, $args)
|
||||
{
|
||||
$filename = $this->service . '-' . $method . '-' . implode('-', $args);
|
||||
return $filename;
|
||||
}
|
||||
|
||||
public function getCache()
|
||||
{
|
||||
return $this->cache;
|
||||
}
|
||||
|
||||
public function setCache($enable = true)
|
||||
{
|
||||
$this->cache = $enable;
|
||||
}
|
||||
|
||||
}
|
183
library/Scores/Ws/Catalog.php
Normal file
183
library/Scores/Ws/Catalog.php
Normal file
@ -0,0 +1,183 @@
|
||||
<?php
|
||||
|
||||
require_once 'Scores/Ws/Abstract.php';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Scores_Ws_Catalog extends Scores_Ws_Abstract
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->setService('catalog');
|
||||
$this->cache = false;
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filename for a mathod
|
||||
* @param string $method
|
||||
* @param array $args
|
||||
*/
|
||||
public function getFilename($method, $args){}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param unknown $id
|
||||
* @param unknown $columns
|
||||
*/
|
||||
public function getEvent($id, $columns)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$params->columns = $columns;
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getEvent($params);
|
||||
$this->response = $response->getEventResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->message = $fault->faultstring;
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
$this->error = 2;
|
||||
} else {
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getCatalogCurrency()
|
||||
{
|
||||
$filename = 'catalog-currency';
|
||||
$cache = new Cache($filename);
|
||||
if ( $cache->exist() ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->id = null;
|
||||
$client = $this->loadClient('catalog');
|
||||
try {
|
||||
$reponse = $client->getCurrency($params);
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getCurrencyResult);
|
||||
return $reponse->getCurrencyResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getCatalogCountry()
|
||||
{
|
||||
$filename = 'catalog-country';
|
||||
$cache = new Cache($filename);
|
||||
if ( $cache->exist() ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->id = null;
|
||||
$params->columns = array(
|
||||
'codPays3',
|
||||
'libPays',
|
||||
'devise',
|
||||
'indTel',
|
||||
);
|
||||
$client = $this->loadClient('catalog');
|
||||
try {
|
||||
$reponse = $client->getCountry($params);
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getCountryResult);
|
||||
return $reponse->getCountryResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getCatalogEvent($id, $columns)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$params->columns = $columns;
|
||||
$client = $this->loadClient('catalog');
|
||||
try {
|
||||
$reponse = $client->getEvent($params);
|
||||
return $reponse->getEventResult;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
echo $client->__getLastResponse();
|
||||
//$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getCatalogNaf5($id, $columns)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$params->columns =$columns;
|
||||
$client = $this->loadClient('catalog');
|
||||
try {
|
||||
$reponse = $client->getNaf5($params);
|
||||
return $reponse->getNaf5Result;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
echo $client->__getLastResponse();
|
||||
//$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getCatalogFctDir($id, $columns)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$params->columns =$columns;
|
||||
$client = $this->loadClient('catalog');
|
||||
try {
|
||||
$reponse = $client->getDirFonction($params);
|
||||
return $reponse->getDirFonctionResult;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
echo $client->__getLastResponse();
|
||||
//$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getCatalogLegalForm($id, $columns)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$params->columns =$columns;
|
||||
$client = $this->loadClient('catalog');
|
||||
try {
|
||||
$reponse = $client->getLegalForm($params);
|
||||
return $reponse->getLegalFormResult;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
echo $client->__getLastResponse();
|
||||
//$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
229
library/Scores/Ws/Config.php
Normal file
229
library/Scores/Ws/Config.php
Normal file
@ -0,0 +1,229 @@
|
||||
<?php
|
||||
/**
|
||||
* WebService Configuration
|
||||
*/
|
||||
class Scores_Ws_Config
|
||||
{
|
||||
protected $location = null;
|
||||
|
||||
protected $services = array(
|
||||
//Local
|
||||
'local' => array(
|
||||
'interne' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.dev/interne/v0.6?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'entreprise' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.dev/entreprise/v0.8?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'gestion' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.dev/gestion/v0.3?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'saisie' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.dev/saisie/v0.2?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'pieces' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.dev/pieces/v0.1?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'catalog' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.dev/catalog/v0.1?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
//Development
|
||||
'development' => array(
|
||||
'interne' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.lan/interne/v0.6?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'entreprise' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.lan/entreprise/v0.8?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'gestion' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.lan/gestion/v0.3?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'saisie' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.lan/saisie/v0.2?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'pieces' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.lan/pieces/v0.1?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'catalog' => array(
|
||||
'wsdl' => "http://webservice-2.4.sd.lan/catalog/v0.1?wsdl-auto",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
//sd-25137
|
||||
'sd-25137' => array(
|
||||
'interne' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/interne/v0.6?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'entreprise' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/entreprise/v0.8?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'gestion' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/gestion/v0.3?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'saisie' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/saisie/v0.2?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'pieces' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/pieces/v0.1?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'catalog' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/catalog/v0.1?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
//Celeste
|
||||
'celeste' => array(
|
||||
'interne' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/interne/v0.6?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'entreprise' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/entreprise/v0.8?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'gestion' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/gestion/v0.3?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'saisie' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/saisie/v0.2?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'pieces' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/pieces/v0.1?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'catalog' => array(
|
||||
'wsdl' => "http://wse.scores-decisions.com:8081/catalog/v0.1?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
//Celeste Staging
|
||||
'celeste-staging' => array(
|
||||
'interne' => array(
|
||||
'wsdl' => "http://wsrec.scores-decisions.com:8000/interne/v0.6?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'entreprise' => array(
|
||||
'wsdl' => "http://wsrec.scores-decisions.com:8000/interne/v0.6?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'gestion' => array(
|
||||
'wsdl' => "http://wsrec.scores-decisions.com:8000/interne/v0.6?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'saisie' => array(
|
||||
'wsdl' => "http://wsrec.scores-decisions.com:8000/interne/v0.6?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'pieces' => array(
|
||||
'wsdl' => "http://wsrec.scores-decisions.com:8000/interne/v0.6?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
'catalog' => array(
|
||||
'wsdl' => "http://wsrec.scores-decisions.com:8000/interne/v0.6?wsdl",
|
||||
'options' => array(
|
||||
'soap_version' => SOAP_1_2
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function setLocation($name)
|
||||
{
|
||||
$this->location = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return service parameters
|
||||
* @param string $name
|
||||
* @return array
|
||||
*/
|
||||
public function getService($name)
|
||||
{
|
||||
return $this->services[$this->location][$name];
|
||||
}
|
||||
|
||||
}
|
952
library/Scores/Ws/Entreprise.php
Normal file
952
library/Scores/Ws/Entreprise.php
Normal file
@ -0,0 +1,952 @@
|
||||
<?php
|
||||
require_once 'Scores/Ws/Abstract.php';
|
||||
|
||||
class Scores_Ws_Entreprise extends Scores_Ws_Abstract
|
||||
{
|
||||
public function __construct($method = null)
|
||||
{
|
||||
//Set service to use
|
||||
$this->setService('entreprise');
|
||||
|
||||
//Prepare method configuration
|
||||
if(null !== $method && method_exists($this, $method)) {
|
||||
$this->{$method.'Params'}();
|
||||
}
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* getAnnonces
|
||||
* @param string $siren
|
||||
* @param integer $filtre
|
||||
* @param string $idAnn
|
||||
* @param integer $position
|
||||
* @param integer $nbRep
|
||||
* @void
|
||||
*/
|
||||
public function getAnnonces($siren, $filtre=0, $idAnn='', $position=0, $nbRep=100)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->filtre = $filtre;
|
||||
$this->params->idAnn = $idAnn;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getAnnonces($this->params);
|
||||
$this->response = $response->getAnnoncesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getAnnoncesAsso
|
||||
* @param string $siren
|
||||
* @param string $idAnn
|
||||
* @param string $filtre
|
||||
* @param number $position
|
||||
* @param number $nbRep
|
||||
*/
|
||||
public function getAnnoncesAsso($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->idAnn = $idAnn;
|
||||
$this->params->filtre = $filtre;
|
||||
$this->params->position = $position;
|
||||
$this->params->nbRep = $nbRep;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getAnnoncesAsso($this->params);
|
||||
$this->response = $response->getAnnoncesAssoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getAnnoncesBalo
|
||||
* @param string $siren
|
||||
* @param string $idAnn
|
||||
* @param string $filtre
|
||||
* @param number $position
|
||||
* @param number $nbRep
|
||||
* @void
|
||||
*/
|
||||
public function getAnnoncesBalo($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->idAnn = $idAnn;
|
||||
$this->params->filtre = $filtre;
|
||||
$this->params->position = $position;
|
||||
$this->params->nbRep = $nbRep;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getAnnoncesBalo($this->params);
|
||||
$this->response = $response->getAnnoncesBaloResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getAnnoncesBoamp
|
||||
* @param string $siren
|
||||
* @param string $idAnn
|
||||
* @param string $filtre
|
||||
* @param number $position
|
||||
* @param number $nbRep
|
||||
* @void
|
||||
*/
|
||||
public function getAnnoncesBoamp($siren, $idAnn=null, $filtre = null, $position=0, $nbRep=20)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->idAnn = $idAnn;
|
||||
$this->params->filtre = null;
|
||||
if (!empty($filtre) && in_array($filtre,array('A','M'))) {
|
||||
$filtreStruct = new stdClass();
|
||||
$filtreStruct->key = 'type';
|
||||
$filtreStruct->value = $filtre;
|
||||
$this->params->filtre[] = $filtreStruct;
|
||||
}
|
||||
$this->params->position = $position;
|
||||
$this->params->nbRep = $nbRep;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getAnnoncesBoamp($this->params);
|
||||
$this->response = $response->getAnnoncesBoampResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getAnnoncesLegales
|
||||
* @param string $siren
|
||||
* @param string $idAnn
|
||||
* @param string $filtre
|
||||
* @param number $position
|
||||
* @param number $nbRep
|
||||
* @void
|
||||
*/
|
||||
public function getAnnoncesLegales($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->idAnn = $idAnn;
|
||||
$this->params->filtre = $filtre;
|
||||
$this->params->position = $position;
|
||||
$this->params->nbRep = $nbRep;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getAnnoncesLegales($this->params);
|
||||
$this->response = $response->getAnnoncesLegalesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getAnnoncesNum
|
||||
* @param string $siren
|
||||
* @void
|
||||
*/
|
||||
public function getAnnoncesNum($siren)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getAnnoncesNum($this->params);
|
||||
$this->response = $response->getAnnoncesNumResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getBanques
|
||||
* @param string $siren
|
||||
* @void
|
||||
*/
|
||||
public function getBanques($siren)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getBanques($this->params);
|
||||
$this->response = $response->getBanquesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getBilan
|
||||
* @param string $siren
|
||||
* @param string $millesime
|
||||
* @param string $typeBilan
|
||||
* @param string $ref
|
||||
* @void
|
||||
*/
|
||||
public function getBilan($siren, $millesime, $typeBilan, $ref)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->millesime = $millesime;
|
||||
$this->params->typeBilan = $typeBilan;
|
||||
$this->params->ref = $ref;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getBilan($this->params);
|
||||
$this->response = $response->getBilanResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getIdentiteParams
|
||||
* @void
|
||||
*/
|
||||
public function getIdentiteParams()
|
||||
{
|
||||
$this->setCache(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* getIdentite
|
||||
* @param string $siret
|
||||
* @param int $id
|
||||
* @void
|
||||
*/
|
||||
public function getIdentite($siret, $id = 0)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siret = $siret;
|
||||
$this->params->id = $id;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getIdentite($this->params);
|
||||
$this->response = $response->getIdentiteResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
if ( in_array($fault->getCode(), array('1020')) ){
|
||||
$this->error = 2;
|
||||
} else {
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getIdentiteProcol
|
||||
* @param string $siret
|
||||
* @param int $id
|
||||
* @void
|
||||
*/
|
||||
public function getIdentiteProcol($siret, $id = 0)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siret = $siret;
|
||||
$this->params->id = $id;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getIdentiteProcol($this->params);
|
||||
$this->response = $response->getIdentiteProcolResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getIndiScore
|
||||
* @param string $siren
|
||||
* @param string $nic
|
||||
* @param integer $niveau
|
||||
* @param boolean $plus
|
||||
* @param string $ref
|
||||
* @param integer $encours
|
||||
* @param string $email
|
||||
*/
|
||||
public function getIndiScore($siren, $nic=0, $niveau=2, $plus=false, $ref='', $encours=0, $email='')
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->nic = $nic;
|
||||
$this->params->niveau = $niveau;
|
||||
$this->params->plus = $plus;
|
||||
$this->params->ref = $ref;
|
||||
$this->params->encours = $encours;
|
||||
$this->params->email = $email;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getIndiScore($this->params);
|
||||
$this->response = $response->getIndiScoreResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
if ( in_array($fault->getCode(), array('1020')) ){
|
||||
$this->error = 2;
|
||||
} else {
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getInfosBourse
|
||||
* @param string $siren
|
||||
* @void
|
||||
*/
|
||||
public function getInfosBourse($siren)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getInfosBourse($this->params);
|
||||
$this->response = $response->getInfosBourseResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
if ( in_array($fault->getCode(), array('1030')) ){
|
||||
$this->error = 2;
|
||||
} else {
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getInfosReg
|
||||
* @param string $siren
|
||||
* @param mixed $id
|
||||
* @void
|
||||
*/
|
||||
public function getInfosReg($siren, $id = false)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->id = $id;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getInfosReg($this->params);
|
||||
$this->response = $response->getInfosRegResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
if ( in_array($fault->getCode(), array('1030')) ){
|
||||
$this->error = 2;
|
||||
} else {
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getDirigeants
|
||||
* @param string $siren
|
||||
* @param boolean $histo
|
||||
* @void
|
||||
*/
|
||||
public function getDirigeants($siren, $histo=false)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->histo = $histo;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getDirigeants($this->params);
|
||||
$this->response = $response->getDirigeantsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getLienRef
|
||||
* @param string $id
|
||||
* @void
|
||||
*/
|
||||
public function getLienRef($id)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->id = $id;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getLienRef($this->params);
|
||||
$this->response = $response->getLienRefResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
if ( in_array($fault->getCode(), array('ERR','MSG')) ){
|
||||
$this->error = 2;
|
||||
} else {
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getLiens
|
||||
* @param string $siren
|
||||
* @void
|
||||
*/
|
||||
public function getLiens($siren)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getLiens($this->params);
|
||||
$this->response = $response->getLiensResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
if ( in_array($fault->getCode(), array('MSG')) ){
|
||||
$this->error = 2;
|
||||
} else {
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getLiensById
|
||||
* @param int $id
|
||||
* @void
|
||||
*/
|
||||
public function getLiensById($id)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->id = $id;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getLiensById($this->params);
|
||||
$this->response = $response->getLiensByIdResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
if ( in_array($fault->getCode(), array('MSG')) ){
|
||||
$this->error = 2;
|
||||
} else {
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeBilans
|
||||
* @param string $siren
|
||||
*/
|
||||
public function getListeBilans($siren)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getListeBilans($this->params);
|
||||
$this->response = $response-getListeBilansResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeCompetences
|
||||
* @param string $siret
|
||||
* @param string $type
|
||||
* @param string $codeInsee
|
||||
*/
|
||||
public function getListeCompetences($siret, $type, $codeInsee)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siret = $siret;
|
||||
$this->params->type = $type;
|
||||
$this->params->codeInsee = $codeInsee;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getListeCompetences($this->params);
|
||||
$this->response = $response->getListeCompetencesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeEtablissements
|
||||
* @param string $siren
|
||||
* @void
|
||||
*/
|
||||
public function getListeEtablissements($siren, $actif = -1, $position = 0)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$params->siren = $siren;
|
||||
$params->actif = $actif;
|
||||
$params->position = $position;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getListeEtablissements($this->params);
|
||||
$this->response = $response->getListeEtablissementsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeEvenements
|
||||
* @param string $siren
|
||||
* @param string $nic
|
||||
* @param integer $position
|
||||
* @param integer $nbRep
|
||||
* @void
|
||||
*/
|
||||
public function getListeEvenements($siren, $nic=0, $position=0, $nbRep=200)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$params->siren = $siren;
|
||||
$params->nic = $nic;
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getListeEvenements($this->params);
|
||||
$this->response = $response->getListeEvenementsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getRapport
|
||||
* @param string $siren
|
||||
* @param integer $niveau
|
||||
* @param integer $id
|
||||
* @param boolean $plus
|
||||
* @param string $ref
|
||||
* @param integer $encours
|
||||
* @param string $email
|
||||
* @void
|
||||
*/
|
||||
public function getRapport($siren, $niveau=3, $id=0, $plus=false, $ref='', $encours=0, $email='')
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->niveau = $niveau;
|
||||
$this->params->d = $id;
|
||||
$this->params->plus = $plus;
|
||||
$this->params->ref = $ref;
|
||||
$this->params->encours = $encours;
|
||||
$this->params->email = $email;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getRapport($this->params);
|
||||
$this->response = $response->getRapportResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getRatios
|
||||
* @param string $siren
|
||||
* @param string $page
|
||||
*/
|
||||
public function getRatios($siren, $page = 'ratios')
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
$this->params->page = $page;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getRapport($this->params);
|
||||
$this->response = $response->getRapportResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getSurveillancesParams
|
||||
*/
|
||||
public function getSurveillancesParams()
|
||||
{
|
||||
$this->setCache(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* getSurveillances
|
||||
* @param object $filtre
|
||||
* @param integer $deb
|
||||
* @param integer $nbRep
|
||||
* @param string $tri
|
||||
*/
|
||||
public function getSurveillances($filtre, $deb=0, $nbRep=100)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->filtre = $filtre;
|
||||
$this->params->position = $deb;
|
||||
$this->params->nbRep = $nbRep;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getSurveillances($this->params);
|
||||
$this->response = $response->getSurveillancesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getValo
|
||||
* @param string $siren
|
||||
* @void
|
||||
*/
|
||||
public function getValo($siren)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->getValo($this->params);
|
||||
$this->response = $response->getValoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
if ( in_array($fault->getCode(), array('1020')) ){
|
||||
$this->error = 2;
|
||||
} else {
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* isSirenExistant
|
||||
* @param string $siren
|
||||
*/
|
||||
public function isSirenExistant($siren)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siren = $siren;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->isSirenExistant($this->params);
|
||||
$this->response = $response->isSirenExistantResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* rechercheAnnonceParams
|
||||
* @void
|
||||
*/
|
||||
public function rechercheAnnonceParams()
|
||||
{
|
||||
$this->setCache(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recherche Annonce
|
||||
* @param string $source
|
||||
* @param string $dateAnnee
|
||||
* @param integer $numParution
|
||||
* @param integer $numAnnonce
|
||||
*/
|
||||
public function rechercheAnnonce($source, $dateAnnee, $numParution, $numAnnonce)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->source = $source;
|
||||
$this->params->dateAnnee = $dateAnnee;
|
||||
$this->params->numParution = $numParution;
|
||||
$this->params->numAnnonce = $numAnnonce;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->rechercheAnnonce($this->params);
|
||||
$this->response = $response->rechercheAnnonceResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* searchEntrepriseParams
|
||||
* @void
|
||||
*/
|
||||
public function searchEntrepriseParams()
|
||||
{
|
||||
$this->setCache(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* searchEntreprise
|
||||
* @param array $criteres
|
||||
* @param int $position
|
||||
* @param int $nbRep
|
||||
* @param int $actif
|
||||
*/
|
||||
public function searchEntreprise($criteres, $position = 0, $nbRep = null)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->criteres = new StdClass;
|
||||
$this->params->criteres->identifiant = $criteres['identifiant'];
|
||||
$this->params->criteres->raisonSociale = $criteres['raisonSociale'];
|
||||
$this->params->criteres->adresse = $criteres['adresse'];
|
||||
$this->params->criteres->codePostal = $criteres['codePostal'];
|
||||
$this->params->criteres->ville = $criteres['ville'];
|
||||
$this->params->criteres->telFax = $criteres['telFax'];
|
||||
$this->params->criteres->naf = $criteres['naf'];
|
||||
$this->params->criteres->siege = false;
|
||||
$this->params->criteres->actif = in_array($criteres['actif'], array(0,1,2)) ? $criteres['actif'] : 2;
|
||||
$this->params->criteres->fj = $criteres['fj'];
|
||||
$this->params->position = $position;
|
||||
$this->params->nbRep = empty($nbRep) ? $this->nbReponses : $nbRep ;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->searchEntreprise($this->params);
|
||||
$this->response = $response->searchEntrepriseeResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* searchDirParams
|
||||
* @void
|
||||
*/
|
||||
public function searchDirParams()
|
||||
{
|
||||
$this->setCache(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recherche par dirigeants
|
||||
* @param array $criteres
|
||||
* @param integer $deb
|
||||
* @param integer $nbRep
|
||||
* @param integer $maxRep
|
||||
*/
|
||||
public function searchDir($criteres, $deb=0, $nbRep=20, $maxRep=200)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->criteres->nom = $criteres['dirNom'];
|
||||
$this->params->criteres->prenom = $criteres['dirPrenom'];
|
||||
$this->params->criteres->dateNaiss = $criteres['dirDateNaiss'];
|
||||
$this->params->criteres->lieuNaiss = $criteres['lieuNaiss'];
|
||||
$this->params->criteres->pertinence = ($criteres['pertinence']===true) ? true : false ;
|
||||
$this->params->deb = $deb;
|
||||
$this->params->nbRep = $nbRep;
|
||||
$this->params->maxRep = $maxRep;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->searchDir($this->params);
|
||||
$this->response = $response->searchDirResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* searchRefClientParams
|
||||
* @void
|
||||
*/
|
||||
public function searchRefClientParams()
|
||||
{
|
||||
$this->setCache(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recherche par référence client
|
||||
* @param string $search
|
||||
* @param integer $position
|
||||
* @param integer $nbRep
|
||||
*/
|
||||
public function searchRefClient($search, $position=0, $nbRep=20)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->search = $search;
|
||||
$this->params->position = $position;
|
||||
$this->params->nbRep = $nbRep;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->searchRefClient($this->params);
|
||||
$this->response = $response->searchRefClientResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* setSurveillance
|
||||
* @param string $siret
|
||||
* @param string $email
|
||||
* @param string $ref
|
||||
* @param string $source
|
||||
* @param boolean $delete
|
||||
* @param integer $encoursClient
|
||||
* @void
|
||||
*/
|
||||
public function setSurveillance($siret, $email, $ref = '', $source='annonces', $delete=false, $encoursClient=0)
|
||||
{
|
||||
$this->method = __METHOD__;
|
||||
|
||||
$this->params = new StdClass();
|
||||
$this->params->siret = $siret;
|
||||
$this->params->email = $email;
|
||||
$this->params->ref = $ref;
|
||||
$this->params->source = $source;
|
||||
$this->params->delete = $delete;
|
||||
$this->params->encoursClient = $encoursClient;
|
||||
|
||||
$client = $this->getSoapClient();
|
||||
try {
|
||||
$response = $client->setSurveillance($this->params);
|
||||
$this->response = $response->setSurveillanceResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->faultcode = $fault->getCode();
|
||||
$this->message = $fault->getMessage();
|
||||
$this->error = 1;
|
||||
}
|
||||
}
|
||||
}
|
459
library/Scores/Ws/Gestion.php
Normal file
459
library/Scores/Ws/Gestion.php
Normal file
@ -0,0 +1,459 @@
|
||||
<?php
|
||||
class Scores_Ws_Gestion extends Scores_Ws_Abstract
|
||||
{
|
||||
|
||||
/**
|
||||
* getCategory
|
||||
*/
|
||||
public function getCategory()
|
||||
{
|
||||
$filename = 'category';
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock('category');
|
||||
}
|
||||
try {
|
||||
$client = $this->loadClient('gestion');
|
||||
$reponse = $client->getCategory();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getCategoryResult);
|
||||
return $reponse->getCategoryResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
//Placer exception pour affichage message
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getListeDroits
|
||||
*/
|
||||
public function getListeDroits()
|
||||
{
|
||||
$filename = 'droits';
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock('droits');
|
||||
}
|
||||
try {
|
||||
$client = $this->loadClient('gestion');
|
||||
$reponse = $client->getListeDroits();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getListeDroitsResult);
|
||||
return $reponse->getListeDroitsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
//Placer exception pour affichage message
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getNextLogin
|
||||
* @param int $idClient
|
||||
*/
|
||||
public function getNextLogin($idClient)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->idClient = $idClient;
|
||||
try {
|
||||
$client = $this->loadClient('gestion');
|
||||
$reponse = $client->getNextLogin($params);
|
||||
Zend_Registry::get('firebug')->info($reponse);
|
||||
return $reponse->getNextLoginResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
Zend_Registry::get('firebug')->info($fault);
|
||||
//Placer exception pour affichage message
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getLogs
|
||||
*/
|
||||
public function getLogs()
|
||||
{
|
||||
$filename = 'logs';
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock('logs');
|
||||
}
|
||||
try {
|
||||
$client = $this->loadClient('gestion');
|
||||
$reponse = $client->getLogs();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getLogsResult);
|
||||
return $reponse->getLogsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
//Placer exception pour affichage message
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListePrefs
|
||||
*/
|
||||
public function getListePrefs()
|
||||
{
|
||||
$filename = 'prefs';
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock('prefs');
|
||||
}
|
||||
try {
|
||||
$client = $this->loadClient('gestion');
|
||||
$reponse = $client->getListePrefs();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getListePrefsResult);
|
||||
return $reponse->getListePrefsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
//Placer exception pour affichage message
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enregistre ou modifie un client
|
||||
* @param unknown_type $infos
|
||||
* @return boolean
|
||||
*/
|
||||
public function setClient($infos)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->infos = json_encode($infos);
|
||||
try {
|
||||
$client = $this->loadClient('gestion');
|
||||
$reponse = $client->setClient($params);
|
||||
return $reponse->setClientResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
Zend_Registry::get('firebug')->info($fault);
|
||||
//Placer exception pour affichage message
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* setInfosLogin
|
||||
* @param string $login
|
||||
* @param string $action
|
||||
* @param array $infos
|
||||
*/
|
||||
public function setInfosLogin($login, $action, $infos = null)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->login = $login;
|
||||
$params->action = $action;
|
||||
if ($infos !== null ) {
|
||||
$params->infos = json_encode($infos);
|
||||
}
|
||||
try {
|
||||
$client = $this->loadClient('gestion');
|
||||
$reponse = $client->setInfosLogin($params);
|
||||
return $reponse->setInfosLoginResult;
|
||||
} catch (SoapFault $fault) {
|
||||
if (in_array($fault->getCode(),array('MSG','ERR'))) {
|
||||
return $fault->getMessage();
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
Zend_Registry::get('firebug')->info($fault);
|
||||
//Placer exception pour affichage message
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getInfosLogin
|
||||
* @param string $login
|
||||
* @param string $ipUtilisateur
|
||||
*/
|
||||
public function getInfosLogin($login, $ipUtilisateur = '')
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->login = $login;
|
||||
$params->ipUtilisateur = $ipUtilisateur;
|
||||
try {
|
||||
$client = $this->loadClient('gestion');
|
||||
$reponse = $client->getInfosLogin($params);
|
||||
return $reponse->getInfosLoginResult;
|
||||
} catch (SoapFault $fault) {
|
||||
if (substr($fault->faultcode,0,1)=='0'){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeUtilisateurs
|
||||
* Enter description here ...
|
||||
* @param string $login
|
||||
* @param integer $idClient
|
||||
*/
|
||||
public function getListeUtilisateurs($login, $idClient = -1)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->login = $login;
|
||||
$params->idClient = $idClient;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->getListeUtilisateurs($params);
|
||||
return $reponse->getListeUtilisateursResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeClients
|
||||
* @param unknown_type $idClient
|
||||
*/
|
||||
public function getListeClients($idClient=false)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->idClient = $idClient;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->getListeClients($params);
|
||||
return $reponse->getListeClientsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getLogsClients
|
||||
* @param unknown_type $mois
|
||||
* @param unknown_type $detail
|
||||
* @param unknown_type $idClient
|
||||
* @param unknown_type $login
|
||||
* @param unknown_type $all
|
||||
*/
|
||||
public function getLogsClients($mois, $detail=0, $idClient=0, $login='', $all=0)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->mois = $mois;
|
||||
$params->detail = $detail;
|
||||
$params->idClient = $idClient;
|
||||
$params->login = $login;
|
||||
$params->all = $all;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->getLogsClients($params);
|
||||
return $reponse->getLogsClientsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function setCGU()
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->application ='';
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->setCGU($params);
|
||||
Zend_Registry::get('firebug')->info($reponse);
|
||||
return $reponse->setCGUResult;
|
||||
} catch(SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all infos for a user (Admin)
|
||||
* @param string $login
|
||||
*/
|
||||
public function getUser($login)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->login = $login;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->getUser($params);
|
||||
return $reponse->getUserResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getServiceUsers($idClient, $service)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->idClient = $idClient;
|
||||
$params->serviceCode = $service;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->getServiceUsers($params);
|
||||
Zend_Registry::get('firebug')->info($reponse);
|
||||
return $reponse->getServiceUsersResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getServices($idClient)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->idClient = $idClient;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->getServices($params);
|
||||
return $reponse->getServicesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function setClientTarif($idClient, $log, $service, $type, $priceUnit, $limit, $date, $duree, $doublon)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->idClient = $idClient;
|
||||
$params->tarif->log = $log;
|
||||
$params->tarif->service = $service;
|
||||
$params->tarif->type = $type;
|
||||
$params->tarif->priceUnit = $priceUnit;
|
||||
$params->tarif->limit = $limit;
|
||||
$params->tarif->date = $date;
|
||||
$params->tarif->duree = $duree;
|
||||
$params->tarif->doublon = $doublon;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->setClientTarif($params);
|
||||
return $reponse->setClientTarifResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getClientTarifs($idClient, $service = null)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->idClient = $idClient;
|
||||
$params->service = $service;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->getClientTarifs($params);
|
||||
return $reponse->getClientTarifsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function setService($idClient, $infos)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->idClient = $idClient;
|
||||
$params->infos = $infos;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->setService($params);
|
||||
return $reponse->setServiceResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function searchLogin($idClient, $query)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->idClient = $idClient;
|
||||
$params->query = $query;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->searchLogin($params);
|
||||
return $reponse->searchLoginResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function setSurveillancesMail($login, $email)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->login = $login;
|
||||
$params->email = $email;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->setSurveillancesMail($params);
|
||||
return $reponse->setSurveillancesMailResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function setUserService($login, $code)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->login = $login;
|
||||
$params->code = $code;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->setUserService($params);
|
||||
return $reponse->setUserServiceResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
88
library/Scores/Ws/Interface.php
Normal file
88
library/Scores/Ws/Interface.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* Interface class for Scores_Ws
|
||||
*/
|
||||
interface Scores_Ws_Interface
|
||||
{
|
||||
/**
|
||||
* Define service name
|
||||
* @param string $name
|
||||
*/
|
||||
public function setService($name);
|
||||
|
||||
/**
|
||||
* Get the service name
|
||||
* @void
|
||||
*/
|
||||
public function getServiceName();
|
||||
|
||||
/**
|
||||
* Get Method name
|
||||
* @void
|
||||
*/
|
||||
public function getMethodName();
|
||||
|
||||
/**
|
||||
* Get Params
|
||||
* @void
|
||||
*/
|
||||
public function getParams();
|
||||
|
||||
/**
|
||||
* Get fault code
|
||||
* @void
|
||||
*/
|
||||
public function getFaultCode();
|
||||
|
||||
/**
|
||||
* Set the default for max responses
|
||||
* @param int $nb
|
||||
*/
|
||||
public function setNbReponses($nb);
|
||||
|
||||
/**
|
||||
* Define WSDL URI
|
||||
* @param string $wsdl
|
||||
*/
|
||||
public function setSoapClientWsdl($wsdl = null);
|
||||
|
||||
/**
|
||||
* Define options for SoapClient
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
*/
|
||||
public function setSoapClientOption($name = null , $value = null);
|
||||
|
||||
/**
|
||||
* Instantiate Soap Client
|
||||
*/
|
||||
public function getSoapClient();
|
||||
|
||||
/**
|
||||
* Get Soap Response
|
||||
*/
|
||||
public function getSoapResponse();
|
||||
|
||||
/**
|
||||
* True if the response is an error
|
||||
*/
|
||||
public function isError();
|
||||
|
||||
/**
|
||||
* True if the response is a message
|
||||
*/
|
||||
public function isMessage();
|
||||
|
||||
/**
|
||||
* Return message (error)
|
||||
*/
|
||||
public function getMessage();
|
||||
|
||||
/**
|
||||
* Get the filename for a mathod
|
||||
* @param string $method
|
||||
* @param array $args
|
||||
*/
|
||||
public function getFilename($method, $args);
|
||||
|
||||
}
|
654
library/Scores/Ws/Interne.php
Normal file
654
library/Scores/Ws/Interne.php
Normal file
@ -0,0 +1,654 @@
|
||||
<?php
|
||||
class Scores_Ws_Interne extends Scores_Ws_Abstract
|
||||
{
|
||||
|
||||
/**
|
||||
* setCmdAsso
|
||||
* @param unknown_type $infosCommande
|
||||
* @param unknown_type $infosDemandeur
|
||||
* @return boolean
|
||||
*/
|
||||
public function setCmdAsso($infosCommande, $infosDemandeur)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->infosCommande = $infosCommande;
|
||||
$params->infosDemandeur = $infosDemandeur;
|
||||
try {
|
||||
$client = $this->loadClient('interne');
|
||||
$reponse = $client->setCmdAsso($params);
|
||||
return $reponse->setCmdAssoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
Zend_Registry::get('firebug')->info($fault);
|
||||
//Placer exception pour affichage message
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getIdentiteLight
|
||||
* @param string $siret
|
||||
* @param int $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function getIdentiteLight($siret, $id = 0)
|
||||
{
|
||||
$filename = 'identitelight-'.$siret.'-'.$id;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new StdClass();
|
||||
$params->siret = $siret;
|
||||
$params->id = $id;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getIdentiteLight($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getIdentiteLightResult);
|
||||
}
|
||||
return $reponse->getIdentiteLightResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getDirigeantsOp
|
||||
* @param string $siren
|
||||
*/
|
||||
public function getDirigeantsOp($siren)
|
||||
{
|
||||
$filename = 'dirigeantsop-'.$siren;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new StdClass();
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getDirigeantsOp($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getDirigeantsOpResult);
|
||||
}
|
||||
return $reponse->getDirigeantsOpResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getPortefeuille
|
||||
* @param object $filtre
|
||||
* @param integer $position
|
||||
* @param integer $nbAffichage
|
||||
*/
|
||||
public function getPortefeuille($filtre, $position = 0, $nbAffichage = 100)
|
||||
{
|
||||
$params = new StdClass;
|
||||
$params->filtre = $filtre;
|
||||
$params->deb = $position;
|
||||
$params->nbRep = $nbAffichage;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getPortefeuille($params);
|
||||
return $reponse->getPortefeuilleResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeConventions
|
||||
* Enter description here ...
|
||||
* @param string $siren
|
||||
*/
|
||||
public function getListeConventions($siren)
|
||||
{
|
||||
$filename = 'conventions-'.$siren;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getListeConventions($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getListeConventionsResult);
|
||||
}
|
||||
return $reponse->getListeConventionsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getMarques
|
||||
* Enter description here ...
|
||||
* @param string $siren
|
||||
* @param integer $idDepot
|
||||
*/
|
||||
public function getMarques($siren, $idDepot = 0)
|
||||
{
|
||||
$filename = 'marques-'.$siren.'-'.$idDepot;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$params->idDepot = $idDepot;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getMarques($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getMarquesResult);
|
||||
}
|
||||
return $reponse->getMarquesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getPrivilegesDetail
|
||||
* Enter description here ...
|
||||
* @param unknown_type $siren
|
||||
* @param unknown_type $tabTypes
|
||||
*/
|
||||
public function getPrivilegesDetail($siren, $tabTypes = array() )
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$params->tabTypes = $tabTypes;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getPrivilegesDetail($params);
|
||||
return $reponse->getPrivilegesDetailResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getDevises
|
||||
* Enter description here ...
|
||||
* @param unknown_type $codeIsoDevise
|
||||
*/
|
||||
public function getDevises($codeIsoDevise = '')
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->codeIsoDevise = $codeIsoDevise;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getDevises($params);
|
||||
return $reponse->getDevisesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getPrivilegesCumul
|
||||
* Enter description here ...
|
||||
* @param unknown_type $siren
|
||||
* @param unknown_type $tabTypes
|
||||
*/
|
||||
public function getPrivilegesCumul($siren, $tabTypes = array() )
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$params->tabTypes = $tabTypes;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getPrivilegesCumul($params);
|
||||
return $reponse->getPrivilegesCumulResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getTribunaux
|
||||
* Enter description here ...
|
||||
* @param unknown_type $tabTypes
|
||||
*/
|
||||
public function getTribunaux($tabTypes = array())
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->tabTypes = $tabTypes;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getTribunaux($params);
|
||||
return $reponse->getTribunauxResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeJalCollecte
|
||||
* Enter description here ...
|
||||
*/
|
||||
public function getListeJalCollecte()
|
||||
{
|
||||
$filename = 'listejalcollecte';
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
$params = new stdClass();
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getListeJalCollecte();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getListeJalCollecteResult);
|
||||
return $reponse->getListeJalCollecteResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Recherche Actionnaire
|
||||
* @param unknown_type $nom
|
||||
* @param unknown_type $cpVille
|
||||
* @param unknown_type $siren
|
||||
* @param unknown_type $pays
|
||||
* @param unknown_type $pctMin
|
||||
* @param unknown_type $pctMax
|
||||
* @param unknown_type $deb
|
||||
* @param unknown_type $nbRep
|
||||
* @param unknown_type $maxRep
|
||||
* @param unknown_type $pertinence
|
||||
*/
|
||||
public function searchAct($nom, $cpVille='', $siren='', $pays='', $pctMin=0, $pctMax=100, $deb=0)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->nom = $nom;
|
||||
$params->cpVille = $cpVille;
|
||||
$params->siren = $siren;
|
||||
$params->pays = $pays;
|
||||
$params->pctMin = $pctMin;
|
||||
$params->pctMax= $pctMax;
|
||||
$params->pertinence = false;
|
||||
$params->deb = $deb;
|
||||
$params->nbRep = $this->nbReponses;
|
||||
//$params->maxRep = $maxRep;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->searchAct($params);
|
||||
return $reponse->searchActResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Recherche Historique
|
||||
* @param string $recherche
|
||||
* @param string $annee
|
||||
* @param string $typeBod
|
||||
* @param integer $deb
|
||||
*/
|
||||
public function rechercheHisto($recherche, $annee, $typeBod, $deb = 0)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->recherche = $recherche;
|
||||
$params->annee = $annee;
|
||||
$params->typeBod = $typeBod;
|
||||
$params->deb = $deb;
|
||||
$params->nbRep = $this->nbReponses;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->rechercheHisto($params);
|
||||
return $reponse->rechercheHistoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* searchMandataires
|
||||
* @param unknown_type $nom
|
||||
* @param unknown_type $type
|
||||
* @param unknown_type $cpDep
|
||||
*/
|
||||
public function searchMandataires($nom, $type=array(), $cpDep=0)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->nom = $nom;
|
||||
$params->type = $type;
|
||||
$params->cpDep = $cpDep;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->searchMandataires($params);
|
||||
return $reponse->searchMandatairesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* setMandataire
|
||||
* Enter description here ...
|
||||
* @param unknown_type $infos
|
||||
*/
|
||||
public function setMandataire($infos)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->infos->id = $infos['id'];
|
||||
$params->infos->sirenGrp = $infos['sirenGrp'];
|
||||
$params->infos->sirenMand = $infos['sirenMand'];
|
||||
$params->infos->Nom = $infos['Nom'];
|
||||
$params->infos->Prenom = $infos['Prenom'];
|
||||
$params->infos->type = $infos['type'];
|
||||
$params->infos->stagiaire = $infos['stagiaire'];
|
||||
$params->infos->coursAppel = $infos['coursAppel'];
|
||||
$params->infos->coursAppel2 = $infos['coursAppel2'];
|
||||
$params->infos->tribunal = $infos['tribunal'];
|
||||
$params->infos->Statut = $infos['Statut'];
|
||||
$params->infos->adresse = $infos['adresse'];
|
||||
$params->infos->adresseComp = $infos['adresseComp'];
|
||||
$params->infos->cp = $infos['cp'];
|
||||
$params->infos->ville = $infos['ville'];
|
||||
$params->infos->tel = $infos['tel'];
|
||||
$params->infos->fax = $infos['fax'];
|
||||
$params->infos->email = $infos['email'];
|
||||
$params->infos->web = $infos['web'];
|
||||
$params->infos->contact = $infos['contact'];
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->setMandataire($params);
|
||||
return $reponse->setMandataireResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getIdCourAppel
|
||||
* @param string $codeTribunal
|
||||
*/
|
||||
public function getIdCoursAppel($codeTribunal)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->codeTribunal = $codeTribunal;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getIdCoursAppel($params);
|
||||
return $reponse->getIdCoursAppelResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* setLog
|
||||
* @param string $page
|
||||
* @param string $siret
|
||||
* @param string $id
|
||||
* @param string $ref
|
||||
*/
|
||||
public function setLog ($page, $siret, $id=0, $ref = '')
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->page = $page;
|
||||
$params->siret = $siret;
|
||||
$params->id = $id;
|
||||
$params->ref = $ref;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->setLog($params);
|
||||
return true;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeSurveillanceCsv
|
||||
* @param unknown_type $source
|
||||
* @param unknown_type $login
|
||||
* @param unknown_type $idClient
|
||||
*/
|
||||
public function getListeSurveillancesCsv($source='', $login='', $idClient=0)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->source = $source;
|
||||
$params->login = $login;
|
||||
$params->idClient = $idClient;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getListeSurveillancesCsv($params);
|
||||
return $reponse->getListeSurveillancesCsvResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getPortefeuilleCsv
|
||||
* @param unknown_type $login
|
||||
* @param unknown_type $idClient
|
||||
*/
|
||||
public function getPortefeuilleCsv($login='', $idClient=0)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->login = $login;
|
||||
$params->idClient = $idClient;
|
||||
|
||||
//@todo : Seulement pour aider Altysis
|
||||
$c = Zend_Registry::get('config');
|
||||
$location = $c->profil->webservice->location;
|
||||
|
||||
$cWS = new Zend_Config_Ini(realpath(dirname(__FILE__)) . '/webservices.ini');
|
||||
$config = $cWS->toArray();
|
||||
$this->webservices = $config[$location]['webservices'];
|
||||
//@todo
|
||||
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getPortefeuilleCsv($params);
|
||||
return $reponse->getPortefeuilleCsvResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enter description here ...
|
||||
* @param string $idAnn
|
||||
* @param string $siret
|
||||
*/
|
||||
public function getAnnonceCollecte($idAnn, $siret)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->idAnn= $idAnn;
|
||||
$params->siret = $siret;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getAnnonceCollecte($params);
|
||||
return $reponse->getAnnonceCollecteResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enter description here ...
|
||||
* @param unknown_type $siren
|
||||
* @return Ambigous <boolean, mixed>|boolean
|
||||
*/
|
||||
public function getListeDepots($siren)
|
||||
{
|
||||
$filename = 'listedepots-'.$siren;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getListeDepots($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getListeDepotsResult);
|
||||
}
|
||||
return $reponse->getListeDepotsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Commande d'une enquete intersud
|
||||
* @param string $siren
|
||||
* @param array $infoEnq
|
||||
* @param array $infoUser
|
||||
*/
|
||||
public function commandeEnquete($siren, $infoEnq, $infoUser)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$params->infoEnq = json_encode($infoEnq);
|
||||
$params->infoDemande = json_encode($infoUser);
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->commandeEnquete($params);
|
||||
return $reponse->commandeEnqueteResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne l'arborescence d'un groupe
|
||||
* @param string $siren
|
||||
* @param int pctMin
|
||||
* @param int $nbNiveaux
|
||||
*/
|
||||
public function getGroupesArbo($siren, $pctMin=33, $nbNiveaux=10)
|
||||
{
|
||||
$filename = 'groupesarbo-'.$siren.'-'.$pctMin;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new StdClass;
|
||||
$params->siren = $siren;
|
||||
$params->pctMin = $pctMin;
|
||||
$params->nbNiveaux = $nbNiveaux;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getGroupesArbo($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getGroupesArboResult);
|
||||
}
|
||||
return $reponse->getGroupesArboResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne les infos du groupe
|
||||
* @param string $siren
|
||||
*/
|
||||
public function getGroupeInfos($siren)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getGroupeInfos($params);
|
||||
return $reponse->getGroupeInfosResult;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('Error')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getCountryId($code)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->codeCountry = $code;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getCountryId($params);
|
||||
return $reponse->getCountryIdResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
73
library/Scores/Ws/Pieces.php
Normal file
73
library/Scores/Ws/Pieces.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
class Scores_Ws_Pieces extends Scores_Ws_Abstract
|
||||
{
|
||||
/**
|
||||
* Récupération des kbis
|
||||
*/
|
||||
public function getKbis($siren)
|
||||
{
|
||||
$params = new StdClass;
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('pieces');
|
||||
try {
|
||||
$reponse = $client->getKbis($params);
|
||||
return $reponse->getKbisResult;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('0000', 'MSG')) ){
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Liste des bilans
|
||||
* @param string $siren
|
||||
* @todo : Cache
|
||||
*/
|
||||
public function getPiecesBilans($siren)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->identifiant = $siren;
|
||||
$client = $this->loadClient('pieces');
|
||||
try {
|
||||
$reponse = $client->getBilans($params);
|
||||
return $reponse->getBilansResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Bilan URL
|
||||
* @param string $siren
|
||||
* @param string $diffusion
|
||||
* @param string $dateCloture
|
||||
* @param string $reference
|
||||
*/
|
||||
public function getPiecesBilan($siren, $diffusion, $dateCloture, $reference)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->identifiant = $siren;
|
||||
$params->diffusion = $diffusion;
|
||||
$params->dateCloture = $dateCloture;
|
||||
$params->reference = $reference;
|
||||
$client = $this->loadClient('pieces');
|
||||
try {
|
||||
$reponse = $client->getBilan($params);
|
||||
Zend_Registry::get('firebug')->info($reponse);
|
||||
return $reponse->getBilanResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
456
library/Scores/Ws/Saisie.php
Normal file
456
library/Scores/Ws/Saisie.php
Normal file
@ -0,0 +1,456 @@
|
||||
<?php
|
||||
class Scores_Ws_Saisie extends Scores_Ws_Abstract
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* getMandataire
|
||||
* @param string $idMand
|
||||
*/
|
||||
public function getMandataire($idMand)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $idMand;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->getMandataire($params);
|
||||
return $reponse->getMandataireResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* dupliqueAnnonce
|
||||
* @param integer $source
|
||||
* @param string $idAnn
|
||||
* @param string $siretIn
|
||||
* @param string $siretOut
|
||||
* @return boolean
|
||||
*/
|
||||
public function dupliqueAnnonce($source, $idAnn, $siretIn = '', $siretOut = '')
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->source= $source;
|
||||
$params->idAnn= $idAnn;
|
||||
$params->siretIn = $siretIn;
|
||||
$params->siretOut = $siretOut;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->dupliqueAnnonce($params);
|
||||
return $reponse->dupliqueAnnonceResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enter description here ...
|
||||
* @param string $siret
|
||||
* @param integer $id
|
||||
* @param array $infos
|
||||
* @return boolean
|
||||
*/
|
||||
public function setInfosEntrep($siret, $id, $infos)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siret = $siret;
|
||||
$params->idEntreprise = $siret;
|
||||
$params->infos = json_encode($infos);
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setInfosEntrep($params);
|
||||
return $reponse->setInfosEntrepResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enter description here ...
|
||||
* @param unknown_type $idAnn
|
||||
* @param unknown_type $siret
|
||||
*/
|
||||
public function supprAnnonceCollecte($idAnn, $siret = '')
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->idAnn= $idAnn;
|
||||
$params->siret= $siret;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->supprAnnonceCollecte($params);
|
||||
return $reponse->supprAnnonceCollecteResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* supprAnnonce
|
||||
* @param integer $source
|
||||
* @param string $idAnn
|
||||
* @param string $siret
|
||||
*/
|
||||
public function supprAnnonce($source, $idAnn, $siret = '')
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->source= $source;
|
||||
$params->idAnn= $idAnn;
|
||||
$params->siret = $siret;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->supprAnnonce($params);
|
||||
return $reponse->supprAnnonceResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enter description here ...
|
||||
* @param unknown_type $siren
|
||||
* @param unknown_type $id
|
||||
* @param unknown_type $codeEven
|
||||
*/
|
||||
public function setAnnonceEven($siren, $id, $codeEven)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$params->id = $id;
|
||||
$params->codeEven = $codeEven;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setAnnonceEven($params);
|
||||
return $reponse->setAnnonceEvenResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function setActeAsso($siren, $waldec, $type, $libelle, $date)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$params->waldec = $waldec;
|
||||
$params->type = $type;
|
||||
$params->libelle = $libelle;
|
||||
$params->date = $date;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setActeAsso($params);
|
||||
return $reponse->setActeAssoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function setBilan($siren, $unite, $dateCloture, $dureeMois, $dateCloturePre, $dureeMoisPre, $typeBilan, $postes, $step = 'normal')
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$params->data->unite = $unite;
|
||||
$params->data->dateCloture = $dateCloture;
|
||||
$params->data->dureeMois = $dureeMois;
|
||||
$params->data->dateCloturePre = $dateCloturePre;
|
||||
$params->data->dureeMoisPre = $dureeMoisPre;
|
||||
$params->data->typeBilan = $typeBilan;
|
||||
$params->data->postes = $postes;
|
||||
$params->step = $step;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setBilan($params);
|
||||
return $reponse->setBilanResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function setLienRef($infos, $id = null)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->infos = $infos;
|
||||
$params->id = $id;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setLienRef($params);
|
||||
return $reponse->setLienRefResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function searchLienRef($query, $type = null)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->query = $query;
|
||||
$params->type = $type;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->searchLienRef($params);
|
||||
return $reponse->searchLienRefResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function setLienDoc($infos, $id = null)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->infos = $infos;
|
||||
$params->id = $id;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setLienDoc($params);
|
||||
return $reponse->setLienDocResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function setLien($infos, $id = null)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->infos = $infos;
|
||||
$params->id = $id;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setLien($params);
|
||||
return $reponse->setLienResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getSaisieLienRef($id)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->getLienRef($params);
|
||||
return $reponse->getLienRefResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getSaisieLien($id)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->getLien($params);
|
||||
return $reponse->getLienResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function setBourse($isin, $infos)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->isin = $isin;
|
||||
$params->infos = $infos;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setBourse($params);
|
||||
return $reponse->setBourseResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getSaisieBourse($isin)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->isin = $isin;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->getBourse($params);
|
||||
return $reponse->getBourseResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Score Cut Off
|
||||
* @param string $siren
|
||||
* @return Cutoff values or False
|
||||
*/
|
||||
public function getScoreCutoff($siren)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->getScoreCutoff($params);
|
||||
return $reponse->getScoreCutoffResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
return $fault->faultstring;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Score Cut Off
|
||||
* @param string $siren
|
||||
* @return boolean
|
||||
*/
|
||||
public function delScoreCutoff($siren)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->delScoreCutoff($params); //change name when webservice is ready
|
||||
return $reponse->delScoreCutoffResult; //change name when webservice is ready
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
return $fault->faultstring;
|
||||
}
|
||||
}
|
||||
|
||||
public function setLienChange($action, $idLien, $id)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->action = $action;
|
||||
$params->idLien = $idLien;
|
||||
$params->id = $id;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setLienChange($params);
|
||||
return $reponse->setLienChangeResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Score Cut Off
|
||||
* @param string $siren
|
||||
* @param int $encours
|
||||
* @param int $scoreSolv
|
||||
* @param int $scoreDir
|
||||
* @param int $scoreConf
|
||||
* @param string $remarque
|
||||
* @param boolean delete
|
||||
* @return boolean
|
||||
*/
|
||||
public function setScoreCutoff($siren, $encours, $scoreSolv, $scoreDir, $scoreConf, $remarque, $delete)
|
||||
{
|
||||
$infos = array(
|
||||
'siren' => $siren,
|
||||
'encours' => $encours,
|
||||
'scoreSolv' => $scoreSolv,
|
||||
'scoreDir' => $scoreDir,
|
||||
'scoreConf' => $scoreConf,
|
||||
'remarque' => $remarque,
|
||||
);
|
||||
$params = new stdClass();
|
||||
$params->infos = json_encode($infos);
|
||||
$params->delete = $delete;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setScoreCutoff($params);
|
||||
return $reponse->setScoreCutoffResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
return $fault->faultstring;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getLienDoc($id, $type = null, $groupe = false)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$params->type = $type;
|
||||
$params->groupe = $groupes;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->getLienDoc($params);
|
||||
return $reponse->getLienDocResult;
|
||||
} catch (SoapFault $fault) {
|
||||
Zend_Registry::get('firebug')->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
45
library/Scores/autoload_classmap.php
Normal file
45
library/Scores/autoload_classmap.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
$dirname_530d9a41d779e = dirname(__FILE__);
|
||||
return array (
|
||||
'Annonces' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Annonces.php',
|
||||
'Scores_Auth_Adapter_Db' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Auth' . DIRECTORY_SEPARATOR . 'Adapter' . DIRECTORY_SEPARATOR . 'Db.php',
|
||||
'Scores_Auth_Adapter_Ws' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Auth' . DIRECTORY_SEPARATOR . 'Adapter' . DIRECTORY_SEPARATOR . 'Ws.php',
|
||||
'BDF' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Bdf.php',
|
||||
'Cache' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Cache.php',
|
||||
'Scores_Export_ArrayCsv' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Export' . DIRECTORY_SEPARATOR . 'ArrayCsv.php',
|
||||
'Scores_Export_Print' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Export' . DIRECTORY_SEPARATOR . 'Print.php',
|
||||
'Scores_Finance_Liasse_XLS' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Finance' . DIRECTORY_SEPARATOR . 'Liasse' . DIRECTORY_SEPARATOR . 'XLS.php',
|
||||
'Scores_Finance_Liasse' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Finance' . DIRECTORY_SEPARATOR . 'Liasse.php',
|
||||
'Scores_Finance_Ratios_Data' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Finance' . DIRECTORY_SEPARATOR . 'Ratios' . DIRECTORY_SEPARATOR . 'Data.php',
|
||||
'Scores_Finance_Ratios_Graph' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Finance' . DIRECTORY_SEPARATOR . 'Ratios' . DIRECTORY_SEPARATOR . 'Graph.php',
|
||||
'GestionCommande' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'GestionCommandes.php',
|
||||
'Scores_Google_Maps' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Google' . DIRECTORY_SEPARATOR . 'Maps.php',
|
||||
'Scores_Google_Streetview' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Google' . DIRECTORY_SEPARATOR . 'Streetview.php',
|
||||
'IdentiteEntreprise' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'IdentiteEntreprise.php',
|
||||
'IdentiteProcol' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'IdentiteProcol.php',
|
||||
'Scores_Insee_AvisSituation' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Insee' . DIRECTORY_SEPARATOR . 'AvisSituation.php',
|
||||
'Scores_Insee_Iris' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Insee' . DIRECTORY_SEPARATOR . 'Iris.php',
|
||||
'Logo' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Logo.php',
|
||||
'Scores_Mail' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Mail.php',
|
||||
'Mappy' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Mappy.php',
|
||||
'Scores_Menu' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Menu.php',
|
||||
'Scores_Mobile_Detect' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Mobile' . DIRECTORY_SEPARATOR . 'Detect.php',
|
||||
'RapportComment' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'RapportComment.php',
|
||||
'Scores_Serializer_Adapter_Xml' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Serializer' . DIRECTORY_SEPARATOR . 'Adapter' . DIRECTORY_SEPARATOR . 'Xml.php',
|
||||
'Scores_Session_Entreprise' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Session' . DIRECTORY_SEPARATOR . 'Entreprise.php',
|
||||
'Scores_Session_Recherche' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Session' . DIRECTORY_SEPARATOR . 'Recherche.php',
|
||||
'Siren' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Siren.php',
|
||||
'Scores_Utilisateur' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Utilisateur.php',
|
||||
'Scores_Wkhtml_Pdf' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Wkhtml' . DIRECTORY_SEPARATOR . 'Pdf.php',
|
||||
'Scores_Ws_Abstract' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Ws' . DIRECTORY_SEPARATOR . 'Abstract.php',
|
||||
'Scores_Ws_Catalog' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Ws' . DIRECTORY_SEPARATOR . 'Catalog.php',
|
||||
'Scores_Ws_Config' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Ws' . DIRECTORY_SEPARATOR . 'Config.php',
|
||||
'Scores_Ws_Entreprise' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Ws' . DIRECTORY_SEPARATOR . 'Entreprise.php',
|
||||
'Scores_Ws_Gestion' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Ws' . DIRECTORY_SEPARATOR . 'Gestion.php',
|
||||
'Scores_Ws_Interface' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Ws' . DIRECTORY_SEPARATOR . 'Interface.php',
|
||||
'Scores_Ws_Interne' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Ws' . DIRECTORY_SEPARATOR . 'Interne.php',
|
||||
'Scores_Ws_Pieces' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Ws' . DIRECTORY_SEPARATOR . 'Pieces.php',
|
||||
'Scores_Ws_Saisie' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Ws' . DIRECTORY_SEPARATOR . 'Saisie.php',
|
||||
'Scores_Ws' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'Ws.php',
|
||||
'WsScores' => $dirname_530d9a41d779e . DIRECTORY_SEPARATOR . 'WsScores.php',
|
||||
);
|
2497
library/Zend/autoload_classmap.php
Normal file
2497
library/Zend/autoload_classmap.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -7,26 +7,50 @@ defined('APPLICATION_PATH')
|
||||
defined('APPLICATION_ENV')
|
||||
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
|
||||
|
||||
// Check APC parameters
|
||||
if (ini_get('apc.enabled')!=1) {
|
||||
switch ( APPLICATION_ENV ) {
|
||||
case 'production':
|
||||
echo "Erreur technique.";
|
||||
break;
|
||||
default:
|
||||
echo "APC is not enabled !";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure library/ is on include_path
|
||||
set_include_path(implode(PATH_SEPARATOR, array(
|
||||
realpath(APPLICATION_PATH . '/../library'),
|
||||
get_include_path(),
|
||||
)));
|
||||
|
||||
/** Zend_Application */
|
||||
require_once 'Zend/Application.php';
|
||||
if (APPLICATION_ENV != 'production'){
|
||||
ini_set("soap.wsdl_cache_enabled", "0");
|
||||
}
|
||||
|
||||
// Check APC parameters
|
||||
if (ini_get('apc.enabled')!=1) {
|
||||
switch ( APPLICATION_ENV ) {
|
||||
case 'production':
|
||||
echo "Erreur technique.";
|
||||
break;
|
||||
default:
|
||||
echo "APC is not enabled !";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Use classmap autoloader - useful with opcode and realpath cache
|
||||
require_once 'Zend/Loader/AutoloaderFactory.php';
|
||||
require_once 'Zend/Loader/ClassMapAutoloader.php';
|
||||
Zend_Loader_AutoloaderFactory::factory(array(
|
||||
'Zend_Loader_ClassMapAutoloader' => array(
|
||||
__DIR__ . '/../library/Zend/autoload_classmap.php',
|
||||
__DIR__ . '/../library/Application/autoload_classmap.php',
|
||||
__DIR__ . '/../library/Scores/autoload_classmap.php',
|
||||
__DIR__ . '/../application/autoload_classmap.php',
|
||||
),
|
||||
'Zend_Loader_StandardAutoloader' => array(
|
||||
'prefixes' => array(
|
||||
'Zend' => __DIR__ . '/../library/Zend',
|
||||
'Application' => __DIR__ . '/../library/Application',
|
||||
'Scores' => __DIR__ . '/../library/Scores',
|
||||
),
|
||||
'fallback_autoloader' => true
|
||||
)
|
||||
));
|
||||
|
||||
// Zend_Application - Use it if you don't have autoloaders
|
||||
//require_once 'Zend/Application.php';
|
||||
|
||||
// Create application, bootstrap, and run
|
||||
$application = new Zend_Application(
|
||||
|
@ -18,11 +18,9 @@ resources.frontController.plugins.Pdf = "Application_Controller_Plugin_Pdf"
|
||||
resources.frontController.plugins.Xml = "Application_Controller_Plugin_Xml"
|
||||
resources.frontController.plugins.Cgu = "Application_Controller_Plugin_Cgu"
|
||||
resources.frontController.params.displayExceptions = 0
|
||||
resources.layout.layout = "main"
|
||||
resources.layout.layout = "layout"
|
||||
resources.layout.layoutPath = APPLICATION_PATH "/views/default"
|
||||
resources.view.basePath = APPLICATION_PATH "/views/default"
|
||||
autoloaderNamespaces[] = "Application_"
|
||||
autoloaderNamespaces[] = "Scores_"
|
||||
|
||||
; Scores configuration
|
||||
profil.server.name = sdsrvdev01
|
||||
|
@ -18,11 +18,9 @@ resources.frontController.plugins.Pdf = "Application_Controller_Plugin_Pdf"
|
||||
resources.frontController.plugins.Xml = "Application_Controller_Plugin_Xml"
|
||||
resources.frontController.plugins.Cgu = "Application_Controller_Plugin_Cgu"
|
||||
resources.frontController.params.displayExceptions = 0
|
||||
resources.layout.layout = "main"
|
||||
resources.layout.layout = "layout"
|
||||
resources.layout.layoutPath = APPLICATION_PATH "/views/default"
|
||||
resources.view.basePath = APPLICATION_PATH "/views/default"
|
||||
autoloaderNamespaces[] = "Application_"
|
||||
autoloaderNamespaces[] = "Scores_"
|
||||
|
||||
; Scores configuration
|
||||
profil.server.name = development
|
||||
|
@ -18,11 +18,9 @@ resources.frontController.plugins.Pdf = "Application_Controller_Plugin_Pdf"
|
||||
resources.frontController.plugins.Xml = "Application_Controller_Plugin_Xml"
|
||||
resources.frontController.plugins.Cgu = "Application_Controller_Plugin_Cgu"
|
||||
resources.frontController.params.displayExceptions = 0
|
||||
resources.layout.layout = "main"
|
||||
resources.layout.layout = "layout"
|
||||
resources.layout.layoutPath = APPLICATION_PATH "/views/default"
|
||||
resources.view.basePath = APPLICATION_PATH "/views/default"
|
||||
autoloaderNamespaces[] = "Application_"
|
||||
autoloaderNamespaces[] = "Scores_"
|
||||
|
||||
; Scores configuration
|
||||
profil.server.name = ns359466
|
||||
|
@ -18,11 +18,9 @@ resources.frontController.plugins.Pdf = "Application_Controller_Plugin_Pdf"
|
||||
resources.frontController.plugins.Xml = "Application_Controller_Plugin_Xml"
|
||||
resources.frontController.plugins.Cgu = "Application_Controller_Plugin_Cgu"
|
||||
resources.frontController.params.displayExceptions = 0
|
||||
resources.layout.layout = "main"
|
||||
resources.layout.layout = "layout"
|
||||
resources.layout.layoutPath = APPLICATION_PATH "/views/default"
|
||||
resources.view.basePath = APPLICATION_PATH "/views/default"
|
||||
autoloaderNamespaces[] = "Application_"
|
||||
autoloaderNamespaces[] = "Scores_"
|
||||
|
||||
; Scores configuration
|
||||
profil.server.name = sd-13408
|
||||
|
@ -18,11 +18,9 @@ resources.frontController.plugins.Pdf = "Application_Controller_Plugin_Pdf"
|
||||
resources.frontController.plugins.Xml = "Application_Controller_Plugin_Xml"
|
||||
resources.frontController.plugins.Cgu = "Application_Controller_Plugin_Cgu"
|
||||
resources.frontController.params.displayExceptions = 0
|
||||
resources.layout.layout = "main"
|
||||
resources.layout.layout = "layout"
|
||||
resources.layout.layoutPath = APPLICATION_PATH "/views/default"
|
||||
resources.view.basePath = APPLICATION_PATH "/views/default"
|
||||
autoloaderNamespaces[] = "Application_"
|
||||
autoloaderNamespaces[] = "Scores_"
|
||||
|
||||
; Scores configuration
|
||||
profil.server.name = sd-46528
|
||||
|
Loading…
Reference in New Issue
Block a user