Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
fe0fb41d04 | ||
|
220aa8e27c | ||
|
9a8a008d03 | ||
|
65831d3194 | ||
|
b63addf2a4 | ||
|
d1d3448e2d | ||
|
0e2ad852b2 | ||
|
442ded2379 | ||
|
71d9e899f9 | ||
|
2b9e237d31 | ||
|
bdc8be3670 | ||
|
a0ebfe4d14 | ||
|
5313c9265b | ||
|
3510df43e2 | ||
|
9eec98395b | ||
|
4a384d6f79 |
@ -852,6 +852,7 @@ class FinanceController extends Zend_Controller_Action
|
||||
$this->view->assign('raisonSociale', $entreprise->getRaisonSociale());
|
||||
$this->view->assign('siren', substr($this->siret, 0, 9));
|
||||
$this->view->assign('siret', $this->siret);
|
||||
$this->view->assign('idClient', $user->identity->idClient);
|
||||
|
||||
$this->view->haveLiasse = ($bilanList->nbReponses > 0) ? true : false;
|
||||
|
||||
@ -1069,7 +1070,7 @@ class FinanceController extends Zend_Controller_Action
|
||||
|
||||
|
||||
$entreprise = new Scores_Session_Entreprise($this->siret, $this->id);
|
||||
$this->view->assign('banques', $infos->result->item);
|
||||
$this->view->assign('banques', isset($infos->result->item)?$infos->result->item:array());
|
||||
$this->view->assign('raisonSociale', $entreprise->getRaisonSociale());
|
||||
$this->view->assign('siren', substr($this->siret, 0, 9));
|
||||
$this->view->assign('exportObjet', $infos);
|
||||
|
@ -407,6 +407,8 @@ class IdentiteController extends Zend_Controller_Action
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = 1;
|
||||
$pageNext = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
@ -1171,6 +1173,8 @@ class IdentiteController extends Zend_Controller_Action
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = 1;
|
||||
$pageNext = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
|
@ -154,6 +154,8 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = 1;
|
||||
$pageNext = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
@ -381,12 +383,9 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
$this->view->msg = "Erreur";
|
||||
} else {
|
||||
|
||||
$this->view->List = $response->List->item;
|
||||
$this->view->List = isset($response->List->item)?$response->List->item:null;
|
||||
// --- Pagination
|
||||
$nbReponsesTotal = $response->Nb;
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = null;
|
||||
$pageNext = null;
|
||||
if ($nbReponses < $nbReponsesTotal) {
|
||||
$pageTotal = ceil( $nbReponsesTotal / $nbReponses );
|
||||
$pageCurrent = $page;
|
||||
@ -398,6 +397,10 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
if( $pageNext > $pageTotal ) {
|
||||
$pageNext = $pageTotal;
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = 1;
|
||||
$pageNext = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
|
@ -806,6 +806,8 @@ class RechercheController extends Zend_Controller_Action
|
||||
//Calcul pagination
|
||||
$nbReponses = $reponse->nbReponses;
|
||||
$nbReponsesTotal = $reponse->nbReponsesTotal;
|
||||
$pagePrev=1;
|
||||
$pageNext=1;
|
||||
if ($nbReponses < $nbReponsesTotal) {
|
||||
$pageTotal = ceil( $nbReponsesTotal / $nbAffichage );
|
||||
$pageCurrent = $page;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -118,6 +118,7 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
|
||||
$page = $request->getParam('page');
|
||||
$from = $request->getParam('from');
|
||||
$q = $request->getParam('q');
|
||||
|
||||
$siret = $request->getParam('siret', '');
|
||||
$email = $request->getParam('email', '');
|
||||
@ -136,6 +137,8 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
}
|
||||
} elseif (isset($page)) {
|
||||
$this->redirect('surveillance/liste/page/'.$page);
|
||||
} elseif (isset($q)) {
|
||||
$this->redirect('surveillance/liste/q/'.$q);
|
||||
} else {
|
||||
$this->redirect('surveillance/liste');
|
||||
}
|
||||
@ -380,7 +383,7 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
$ws = new WsScores();
|
||||
$infos = $ws->getSurveillances($filtre, $position, $nbAffichage);
|
||||
|
||||
$surveillances = $infos->result->item;
|
||||
$surveillances = isset($infos->result->item)?$infos->result->item:null;
|
||||
|
||||
$listTrier = array();
|
||||
if ( count($surveillances)>0 ) {
|
||||
@ -422,10 +425,12 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = 1;
|
||||
$pageNext = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
$this->view->assign('PageNext', $pageNext);
|
||||
$this->view->assign('PagePrev', isset($pagePrev)?$pagePrev:1);
|
||||
$this->view->assign('PageNext', isset($pageNext)?$pageNext:1);
|
||||
$this->view->assign('PageCurrent', $pageCurrent);
|
||||
|
||||
$this->view->assign('nbReponses', empty($nbReponses) ? 0 : $nbReponses);
|
||||
@ -641,6 +646,8 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = 1;
|
||||
$pageNext = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
@ -1152,4 +1159,56 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
$html2pdf->WriteHTML(utf8_decode($output));
|
||||
$html2pdf->Output(str_replace('.csv', '.pdf', $nomFic), 'D');
|
||||
}
|
||||
|
||||
/**
|
||||
* Import surveillance en fichier csv
|
||||
*/
|
||||
public function surveillanceserieAction(){
|
||||
//echo 'coucou';die;
|
||||
$request = $this->getRequest();
|
||||
if($request->getParam('ref')>""){
|
||||
$cs=new Scores_Import_FileCsv();
|
||||
$verif=$cs->verifandupload($_FILES,$request);
|
||||
if($verif['success']){
|
||||
$this->view->assign('msg', 'Nous avons enregistré votre fichier de '.$verif['message'].' lignes.<br><br>Les surveillances seront enregistrées durant la nuit.');
|
||||
$this->view->assign('step', 2);
|
||||
}else{
|
||||
$this->view->assign('msg', $verif['message']);
|
||||
$this->view->assign('step', 2);
|
||||
}
|
||||
return;
|
||||
}
|
||||
//Affichage formulaire demande ref et email
|
||||
$this->_helper->layout->disableLayout();
|
||||
$source = $request->getParam('source', '');
|
||||
$encours = $request->getParam('encours', 0);
|
||||
$this->view->pathScript=$this->theme->pathScript;
|
||||
$this->view->pathStyle=$this->theme->pathStyle;
|
||||
$user = new Scores_Utilisateur();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$source = $request->getParam('source');
|
||||
|
||||
$tabSource = array();
|
||||
$user = new Scores_Utilisateur();
|
||||
|
||||
// Main email
|
||||
$email = $user->getEmail();
|
||||
$ref=$user->identity->id . 'surv'.Date('YmdHis');
|
||||
foreach ($this->sourceDroit as $s => $perm) {
|
||||
if ($user->checkPerm($perm)) {
|
||||
$tabSource[] = array(
|
||||
'value' => $s,
|
||||
'name' => $this->sourceTxt[$s],
|
||||
'select' => (!empty($source) && $source==$s) ? ' selected' : '',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->assign('tabSource', $tabSource);
|
||||
$this->view->assign('email', $email);
|
||||
$this->view->assign('ref', $ref);
|
||||
$this->view->assign('encours', $encours);
|
||||
$this->view->msg="Sélectionnez votre fichier";
|
||||
}
|
||||
}
|
@ -42,7 +42,7 @@
|
||||
<td valign="top" ><p style="text-decoration:underline;"><?=$relation->libBanque?></p>
|
||||
<?php if (empty($this->AutrePage) && $this->edition) {?>
|
||||
<a class="dialog" title="Edition RIB/IBAN" href="<?=$this->url(array('controller'=>'saisie','action'=>'ribiban','mode'=>'edit','siren'=>$this->siren, 'guichetMod'=>$relation->codeGuichet, 'banqueMod'=>$relation->codeBanque), null, true)?>"><img src="/themes/default/images/interfaces/editer.png" /></a>
|
||||
<a class="dialog" title="Supprimer RIB/IBAN" href="<?=$this->url(array('controller'=>'saisie','action'=>'ribiban','mode'=>'delete','siren'=>$this->siren,'siret'=>$this->siret), null, true)?>"><img src="/themes/default/images/interfaces/supprimer.png" /></a>
|
||||
<a class="dialog" title="Supprimer RIB/IBAN" href="<?=$this->url(array('controller'=>'saisie','action'=>'ribiban','mode'=>'delete','siren'=>$this->siren, 'guichetMod'=>$relation->codeGuichet, 'banqueMod'=>$relation->codeBanque), null, true)?>"><img src="/themes/default/images/interfaces/supprimer.png" /></a>
|
||||
<?php }?>
|
||||
</td>
|
||||
<td>
|
||||
|
@ -40,6 +40,15 @@
|
||||
</td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
<?php if (0 < $this->exportObjet->TOP_CONFIDENTIEL) : ?>
|
||||
<tr>
|
||||
<td width="30"> </td>
|
||||
<td colspan="2">
|
||||
<span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
|
||||
Ce bilan est confidentiel.
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif ?>
|
||||
<?php if ( $this->champType == 'S' ) {?>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
|
@ -92,9 +92,14 @@ switch ($type) {
|
||||
$date = new Zend_Date($element->dateExercicePre, 'yyyyMMdd');
|
||||
echo $date->toString('dd/MM/yyyy');
|
||||
} ?> - <?php if ($element->dureeExercicePre > 0) {?><?=$element->dureeExercicePre?> Mois<?php } ?></td>
|
||||
<td><a href="<?=$this->url(array('controller'=>'finance','action'=>'liasse',
|
||||
'siret'=>$this->siret,'id'=>$this->id, 'date'=> $type.$element->dateExercice), 'default', true)?>">
|
||||
Visualiser</a>
|
||||
<td><?php if (in_array($this->idClient, [1, 147]) || ($element->confidentielClient == $this->idClient || 0 == $element->confidentiel)) : ?>
|
||||
<a href="<?=$this->url(array('controller'=>'finance', 'action'=>'liasse',
|
||||
'siret'=>$this->siret, 'id'=>$this->id, 'date'=> $type.$element->dateExercice), 'default', true)?>">
|
||||
Visualiser
|
||||
</a>
|
||||
<?php else :?>
|
||||
Confidentiel
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php break;?>
|
||||
@ -150,9 +155,13 @@ switch ($type) {
|
||||
?>
|
||||
- <?php if ($element->dureeExercicePre > 0) {?><?=$element->dureeExercicePre?> Mois<?php } ?>
|
||||
</td>
|
||||
<td><a href="<?=$this->url(array('controller'=>'finance', 'action'=>'liasse', 'siret'=>$this->siret,
|
||||
'id'=>$this->id, 'date'=> $type.$element->dateExercice), 'default', true)?>">
|
||||
Visualiser</a>
|
||||
<td><?php if (in_array($this->idClient, [1, 147]) || ($element->confidentielClient == $this->idClient || 0 == $element->confidentiel)) : ?>
|
||||
<a href="<?=$this->url(array('controller'=>'finance', 'action'=>'liasse', 'siret'=>$this->siret,
|
||||
'id'=>$this->id, 'date'=> $type.$element->dateExercice), 'default', true)?>">
|
||||
Visualiser</a>
|
||||
<?php else :?>
|
||||
Confidentiel
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
|
@ -31,7 +31,7 @@ span.poste input { width:50px; }
|
||||
|
||||
<h2>Liasse</h2>
|
||||
<div class="paragraph">
|
||||
<?php if ($this->infos) {?>
|
||||
<?php if ($this->infos) { ?>
|
||||
<div class="content">
|
||||
<?php
|
||||
$params = array(
|
||||
|
@ -4,13 +4,19 @@ div#dialog fieldset {border:1px solid; padding:1px; }
|
||||
div#dialog fieldset legend {padding:5px; font-weight:bold; }
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<?php
|
||||
$bq=new Scores_Finance_Banques();
|
||||
$banques=$bq->getBDF_Etabs('php');
|
||||
$list_bq=json_encode($banques);
|
||||
$list_guichets=$bq->getBDF_Guichets();
|
||||
$lbanque = (array)json_decode($this->banques);
|
||||
//var_dump($lbanque);
|
||||
?>
|
||||
|
||||
<form name="saveRiban" action="<?=$this->url(array('controller'=>'saisie', 'action'=>'ribansave'),null, true)?>" method="post">
|
||||
<?php if($this->mode == add || $this->mode == edit){?>
|
||||
<input type="hidden" name="mode" value="<?=$this->mode?>" />
|
||||
<input type="hidden" name="siren" value="<?=$this->siren?>" />
|
||||
<?php if($this->mode == 'add' || $this->mode == 'edit'){?>
|
||||
<div class="fieldgrp">
|
||||
<label>Siren</label>
|
||||
<div class="field">
|
||||
@ -23,10 +29,12 @@ div#dialog fieldset legend {padding:5px; font-weight:bold; }
|
||||
<label>Situation RIB</label>
|
||||
<div class="field">
|
||||
<?php
|
||||
if ($this->actif==1){
|
||||
if ($this->actif==1 || (isset($lbanque['dateSuppr']) && $lbanque['dateSuppr']=='0000-00-00 00:00:00') ){
|
||||
$checkActive = 'checked';
|
||||
$checkInactive = '';
|
||||
} else {
|
||||
$checkInactive = 'checked';
|
||||
$checkActive = '';
|
||||
}
|
||||
?>
|
||||
<div style="float:left;">Active<input type="radio" name="actif" value="1" <?=$checkActive;?>/></div>
|
||||
@ -35,79 +43,127 @@ if ($this->actif==1){
|
||||
</div>
|
||||
|
||||
<div class="fieldgrp">
|
||||
|
||||
|
||||
<fieldset>
|
||||
<legend>Saisie RIB</legend>
|
||||
<div class="fieldgrp">
|
||||
<label>Banque</label>
|
||||
<div class="field" >
|
||||
<select name="Banque" style="width:160px;" >
|
||||
<select name="Banque" type="text" value="<?=$this->banqueMod?>" >
|
||||
<option value="<?=$this->banqueMod?>"><?=isset($banques[$this->banqueMod])?$banques[$this->banqueMod]:$this->banqueMod?></option>
|
||||
<?php foreach($banques as $num => $name):?>
|
||||
<option value="<?=$num?>"><?=substr($name,0,40)?></option>
|
||||
<?php endforeach;?>
|
||||
</select>
|
||||
<span id="denombque"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fieldgrp">
|
||||
<label>Guichet</label>
|
||||
<div class="field" >
|
||||
<select name="Guichet" style="width:160px;" >
|
||||
<option value=""><?=$this->banqueMod?></option>
|
||||
<?php foreach( $this->banques as $val ) {?>
|
||||
<option value="<?=$val->codeBanque?>"><?=$val->codeBanque?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fieldgrp">
|
||||
<label>Guichet</label>
|
||||
<div class="field" >
|
||||
<select name="Guichet" style="width:160px;" >
|
||||
<option value=""><?=$this->guichetMod?></option>
|
||||
<?php foreach( $this->banques as $val ) {?>
|
||||
<option value="<?=$val->codeGuichet?>"><?=$val->codeGuichet?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
<span id="denomgcht"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fieldgrp">
|
||||
<label>RIB</label>
|
||||
<div class="field">
|
||||
<input type="text" name="code_banque" size="4" value=""/>
|
||||
<input type="text" name="code_guichet" size="4" value=""/>
|
||||
<input type="text" name="num_compte" size="32" value=""/>
|
||||
<input type="text" name="code_banque" size="4" value="<?=(isset($lbanque['codeBanque'])?$lbanque['codeBanque']:'') ?>"/>
|
||||
<input type="text" name="code_guichet" size="4" value="<?=(isset($lbanque['codeGuichet'])?$lbanque['codeGuichet']:'') ?>"/>
|
||||
<input type="text" name="num_compte" size="32" value="<?=(isset($lbanque['numCompte'])?$lbanque['numCompte']:'') ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="fieldgrp">
|
||||
<fieldset>
|
||||
<legend>Saisie BIC/IBAN</legend>
|
||||
<div class="fieldgrp">
|
||||
<label>BIC/SWIFT</label>
|
||||
<div class="field">
|
||||
<input type="text" name="bic_swift" value="" size="20"/>
|
||||
<input type="text" name="bic_swift" value="<?=(isset($lbanque['bic'])?$lbanque['bic']:'') ?>" size="20"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="fieldgrp">
|
||||
<label>IBAN</label>
|
||||
<div class="field">
|
||||
<input type="text" name="iban" value="" size="47"/>
|
||||
<input type="text" name="iban" value="<?=(isset($lbanque['iban'])?$lbanque['iban']:'') ?>" size="47"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<?php }else {?>
|
||||
<input type="hidden" name="code_banque" value="<?=(isset($lbanque['codeBanque'])?$lbanque['codeBanque']:'') ?>" />
|
||||
<input type="hidden" name="code_guichet" value="<?=(isset($lbanque['codeGuichet'])?$lbanque['codeGuichet']:'') ?>" />
|
||||
<input type="hidden" name="num_compte" value="<?=(isset($lbanque['numCompte'])?$lbanque['numCompte']:'') ?>" />
|
||||
<input type="hidden" name="bic_swift" value="<?=(isset($lbanque['bic'])?$lbanque['bic']:'') ?>" />
|
||||
<input type="hidden" name="iban" value="<?=(isset($lbanque['iban'])?$lbanque['iban']:'') ?>" />
|
||||
<p>Voulez vous supprimer ce RIB ?</p>
|
||||
<?php }?>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
var tab_bqu=<?=$list_bq?>;
|
||||
var tab_guichet=<?=$list_guichets?>;
|
||||
var selecthtml1='<option value="<?=$this->banqueMod?>"><?=$this->banqueMod?></option>';
|
||||
$('select[name=Banque]').change(function(e){
|
||||
var num=$('select[name=Banque]').val();
|
||||
$('select[name=code_banque]').val(num);
|
||||
var selecthtml2=selecthtml1;
|
||||
for(var numg in tab_guichet[num]){
|
||||
selecthtml2+='<option value="'+numg+'">'+numg+'</option>';
|
||||
}
|
||||
$('select[name=Guichet]').html(selecthtml2);
|
||||
if($('input[name=code_banque]').val()==""){
|
||||
$('input[name=code_banque]').val(num);
|
||||
}
|
||||
});
|
||||
$('select[name=Guichet]').change(function(){
|
||||
var num=$('select[name=Banque]').val();
|
||||
var numg=$('select[name=Guichet]').val();
|
||||
$('#denomgcht').html(tab_guichet[num][numg]);
|
||||
if($('input[name=code_guichet]').val()==""){
|
||||
$('input[name=code_guichet]').val(numg);
|
||||
}
|
||||
});
|
||||
$('input[name=code_banque]').change(function(e){
|
||||
var num=$('input[name=code_banque]').val();
|
||||
$('select[name=Banque]').val(num);
|
||||
$('select[name=Banque]').change();
|
||||
});
|
||||
$('input[name=iban]').change(function(e){
|
||||
var regex = new RegExp(' ', "igm");
|
||||
var iban=$('input[name=iban]').val().replace(regex,"");
|
||||
$('input[name=iban]').val(iban);
|
||||
var num=iban.substr(4,5);
|
||||
$('select[name=Banque]').val(num);
|
||||
$('select[name=Banque]').change();
|
||||
var numg=iban.substr(9,5);
|
||||
$('select[name=Guichet]').val(num);
|
||||
$('select[name=Guichet]').change();
|
||||
});
|
||||
|
||||
$('#dialog').dialog({ buttons: [
|
||||
{ text: "Valider", click: function() {
|
||||
var form = $('form[name=saveRiban]');
|
||||
$.post(form.attr('action'), form.serialize(), function(data){
|
||||
form.replaceWith(data);
|
||||
}).done(function(data){ alert(data);
|
||||
}).fail(function(){ alert('Unknow error'); });
|
||||
} },
|
||||
{ text: "Annuler", click: function() { $(this).dialog("close"); } }
|
||||
|
@ -28,9 +28,14 @@ if ( empty($this->source) ){
|
||||
?>
|
||||
</div>
|
||||
|
||||
<h2>Extraction des surveillances</h2>
|
||||
<h2>Traitements de masse</h2>
|
||||
<div class="paragraph">
|
||||
<?=$this->action('surveillancecsv', 'surveillance')?>
|
||||
<p class="options">Demande de surveillance en série :
|
||||
<a class="dialogsurv" href="/surveillance/surveillanceserie" title="Demande de surveillance en série ">
|
||||
OK</a></p>
|
||||
|
||||
</div>
|
||||
<h2>Options de recherche</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
@ -152,7 +157,8 @@ par
|
||||
'siret' => $item['siren'].$item['nic'],
|
||||
'ref' => urlencode($surveillance['ref']),
|
||||
'email' => $surveillance['email'],
|
||||
'source' => $surveillance['source']
|
||||
'source' => $surveillance['source'],
|
||||
'q' => $this->q,
|
||||
))?>" title="Supprimer la surveillance <?=$surveillance['source']?>">
|
||||
<img src="/themes/default/images/interfaces/supprimer.png"/>
|
||||
</a>
|
||||
@ -295,4 +301,3 @@ $(function() {
|
||||
?>
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -0,0 +1,70 @@
|
||||
<div id="survForm">
|
||||
<link href="<?=$this->pathStyle?>/bsmain.css" media="all" rel="stylesheet" type="text/css">
|
||||
<?php if(intval($this->step==0)):?>
|
||||
<?php
|
||||
$cs=new Scores_Import_FileCsv();
|
||||
$msg=$cs->standardhelptext;
|
||||
?>
|
||||
<div id="msgintro" class="alert-sm alert-success"><?=$msg?>
|
||||
<br><br><center>
|
||||
<button id="btnstart" class="btn btn-sm btn-info">Le fichier est pret</button>
|
||||
</center><br><br>
|
||||
</div>
|
||||
|
||||
<?php endif;?>
|
||||
<?php if(intval($this->step==2)):?>
|
||||
<div id="center">
|
||||
<h1 class="titre">SURVEILLANCE</h1>
|
||||
<div class="paragraph">
|
||||
<div id="msgintro" class="alert-sm alert-warning"><?=$this->msg?>
|
||||
<br><br>
|
||||
|
||||
<br><br><center>
|
||||
<a href="<?=$this->url(array('controller' => 'surveillance', 'action' => 'liste'))?>" class="submit">Retour</a>
|
||||
</center><br><br>
|
||||
</div>
|
||||
|
||||
<?php endif;?>
|
||||
<div id="msg" class="alert-sm alert-danger"></div>
|
||||
<form enctype="multipart/form-data" id="fileform" action="<?=$this->url(array('controller' => 'surveillance', 'action' => 'surveillanceserie'))?>" method="POST">
|
||||
<input class="required" type="file" name="fichier" size="50000" >
|
||||
<div class="form-group">
|
||||
<?php foreach($this->tabSource as $s) : ?>
|
||||
<input type="checkbox" name="source[]" value="<?=$s['value']?>"<?=$s['select']?>/> <?=$s['name']?><br/>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="email">Adresse email du destinataire</label>
|
||||
<input class="required" name="email" type="text" value="<?=$this->email?>"/>
|
||||
</div>
|
||||
<input class="btn btn-sm btn-info" name="loadfile" value="Charger le fichier" type="submit">
|
||||
<input name="ref" type="hidden" value="<?=$this->ref?>"/></div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
$( "#fileform" ).hide();
|
||||
$('#btnstart').click(function( event ) {
|
||||
$( "#fileform" ).show();
|
||||
$( "#msgintro" ).hide();
|
||||
});
|
||||
$( "#fileform" ).submit(function( event ) {
|
||||
var ok=false;
|
||||
if($('input[name="source[]"]:checked').length > 0){
|
||||
ok=true;
|
||||
}
|
||||
if ( $( ".required" ).val().length === 0 ) {
|
||||
ok=false;
|
||||
}
|
||||
if(!ok){
|
||||
$('#msg').html('Merci de remplir tous les champs');
|
||||
}
|
||||
if ( $( "input[name=fichier]" ).val().substr(-4,4) != '.csv' ) {
|
||||
$('#msg').html('Format de fichier incorrect');
|
||||
ok=false;
|
||||
}
|
||||
if(!ok){
|
||||
event.preventDefault();
|
||||
}
|
||||
});</script>
|
73
composer.lock
generated
73
composer.lock
generated
@ -92,21 +92,21 @@
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/guzzle",
|
||||
"version": "6.2.2",
|
||||
"version": "6.2.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/guzzle.git",
|
||||
"reference": "ebf29dee597f02f09f4d5bbecc68230ea9b08f60"
|
||||
"reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/ebf29dee597f02f09f4d5bbecc68230ea9b08f60",
|
||||
"reference": "ebf29dee597f02f09f4d5bbecc68230ea9b08f60",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/8d6c6cc55186db87b7dc5009827429ba4e9dc006",
|
||||
"reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"guzzlehttp/promises": "^1.0",
|
||||
"guzzlehttp/psr7": "^1.3.1",
|
||||
"guzzlehttp/psr7": "^1.4",
|
||||
"php": ">=5.5"
|
||||
},
|
||||
"require-dev": {
|
||||
@ -150,7 +150,7 @@
|
||||
"rest",
|
||||
"web service"
|
||||
],
|
||||
"time": "2016-10-08T15:01:37+00:00"
|
||||
"time": "2017-02-28T22:50:30+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/promises",
|
||||
@ -205,16 +205,16 @@
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/psr7",
|
||||
"version": "1.3.1",
|
||||
"version": "1.4.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/psr7.git",
|
||||
"reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b"
|
||||
"reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/5c6447c9df362e8f8093bda8f5d8873fe5c7f65b",
|
||||
"reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b",
|
||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
|
||||
"reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -250,29 +250,36 @@
|
||||
"name": "Michael Dowling",
|
||||
"email": "mtdowling@gmail.com",
|
||||
"homepage": "https://github.com/mtdowling"
|
||||
},
|
||||
{
|
||||
"name": "Tobias Schultze",
|
||||
"homepage": "https://github.com/Tobion"
|
||||
}
|
||||
],
|
||||
"description": "PSR-7 message implementation",
|
||||
"description": "PSR-7 message implementation that also provides common utility methods",
|
||||
"keywords": [
|
||||
"http",
|
||||
"message",
|
||||
"request",
|
||||
"response",
|
||||
"stream",
|
||||
"uri"
|
||||
"uri",
|
||||
"url"
|
||||
],
|
||||
"time": "2016-06-24T23:00:38+00:00"
|
||||
"time": "2017-03-20T17:10:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
"version": "1.22.0",
|
||||
"version": "1.22.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Seldaek/monolog.git",
|
||||
"reference": "bad29cb8d18ab0315e6c477751418a82c850d558"
|
||||
"reference": "1e044bc4b34e91743943479f1be7a1d5eb93add0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/bad29cb8d18ab0315e6c477751418a82c850d558",
|
||||
"reference": "bad29cb8d18ab0315e6c477751418a82c850d558",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/1e044bc4b34e91743943479f1be7a1d5eb93add0",
|
||||
"reference": "1e044bc4b34e91743943479f1be7a1d5eb93add0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -337,7 +344,7 @@
|
||||
"logging",
|
||||
"psr-3"
|
||||
],
|
||||
"time": "2016-11-26T00:15:39+00:00"
|
||||
"time": "2017-03-13T07:08:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpoffice/phpexcel",
|
||||
@ -597,16 +604,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/browser-kit",
|
||||
"version": "v3.2.2",
|
||||
"version": "v3.2.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/browser-kit.git",
|
||||
"reference": "548f8230bad9f77463b20b15993a008f03e96db5"
|
||||
"reference": "2fe0caa60c1a1dfeefd0425741182687a9b382b8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/browser-kit/zipball/548f8230bad9f77463b20b15993a008f03e96db5",
|
||||
"reference": "548f8230bad9f77463b20b15993a008f03e96db5",
|
||||
"url": "https://api.github.com/repos/symfony/browser-kit/zipball/2fe0caa60c1a1dfeefd0425741182687a9b382b8",
|
||||
"reference": "2fe0caa60c1a1dfeefd0425741182687a9b382b8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -650,20 +657,20 @@
|
||||
],
|
||||
"description": "Symfony BrowserKit Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2017-01-02T20:32:22+00:00"
|
||||
"time": "2017-02-21T09:12:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/css-selector",
|
||||
"version": "v3.2.2",
|
||||
"version": "v3.2.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/css-selector.git",
|
||||
"reference": "f0e628f04fc055c934b3211cfabdb1c59eefbfaa"
|
||||
"reference": "a48f13dc83c168f1253a5d2a5a4fb46c36244c4c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/css-selector/zipball/f0e628f04fc055c934b3211cfabdb1c59eefbfaa",
|
||||
"reference": "f0e628f04fc055c934b3211cfabdb1c59eefbfaa",
|
||||
"url": "https://api.github.com/repos/symfony/css-selector/zipball/a48f13dc83c168f1253a5d2a5a4fb46c36244c4c",
|
||||
"reference": "a48f13dc83c168f1253a5d2a5a4fb46c36244c4c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -703,20 +710,20 @@
|
||||
],
|
||||
"description": "Symfony CssSelector Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2017-01-02T20:32:22+00:00"
|
||||
"time": "2017-02-21T09:12:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/dom-crawler",
|
||||
"version": "v3.2.2",
|
||||
"version": "v3.2.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/dom-crawler.git",
|
||||
"reference": "27d9790840a4efd3b7bb8f5f4f9efc27b36b7024"
|
||||
"reference": "403944e294cf4ceb3b8447f54cbad88ea7b99cee"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/27d9790840a4efd3b7bb8f5f4f9efc27b36b7024",
|
||||
"reference": "27d9790840a4efd3b7bb8f5f4f9efc27b36b7024",
|
||||
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/403944e294cf4ceb3b8447f54cbad88ea7b99cee",
|
||||
"reference": "403944e294cf4ceb3b8447f54cbad88ea7b99cee",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -759,7 +766,7 @@
|
||||
],
|
||||
"description": "Symfony DomCrawler Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2017-01-02T20:32:22+00:00"
|
||||
"time": "2017-02-21T09:12:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
|
8
library/Application/Model/CommandesSurveillance.php
Normal file
8
library/Application/Model/CommandesSurveillance.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
class Application_Model_CommandesSurveillance extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes_surveillance';
|
||||
|
||||
|
||||
|
||||
}
|
@ -81,7 +81,7 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
|
||||
public function authenticate()
|
||||
{
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) && in_array($ip, $this->listProxyIp)) {
|
||||
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && in_array($ip, $this->listProxyIp)) {
|
||||
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
}
|
||||
|
||||
@ -97,21 +97,25 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
|
||||
|
||||
$this->logger->info(__CLASS__ . ' : '.__METHOD__);
|
||||
$this->logger->info(print_r($InfosLogin,1));
|
||||
// --- Renvoi
|
||||
if ( is_string($InfosLogin) || $InfosLogin->error->errnum != 0 ) {
|
||||
|
||||
$identity = new stdClass();
|
||||
|
||||
// --- Erreur technique
|
||||
if ($InfosLogin === false) {
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_UNCATEGORIZED, $identity, array("Identification impossible"));
|
||||
}
|
||||
// --- Renvoi
|
||||
elseif (is_string($InfosLogin) || $InfosLogin->error->errnum != 0) {
|
||||
$message = $InfosLogin;
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, $identity, array($message));
|
||||
}
|
||||
// --- Assignation identity
|
||||
elseif ( $InfosLogin !== false && !empty($InfosLogin->result->login)) {
|
||||
$identity = new stdClass();
|
||||
elseif ($InfosLogin->result->login == $this->_username) {
|
||||
if ($this->_checkIp || $this->_checkHach) {
|
||||
$this->logger->info("IN");
|
||||
$identity->password = $this->_password;
|
||||
} else {
|
||||
$identity->password = md5($InfosLogin->result->login.'|'.$this->_password);
|
||||
}
|
||||
$this->logger->info($identity->password);
|
||||
$identity->username = $InfosLogin->result->login;
|
||||
$identity->email = $InfosLogin->result->email;
|
||||
$identity->profil = $InfosLogin->result->profil;
|
||||
@ -138,10 +142,12 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
|
||||
$identity->version = $InfosLogin->result->version;
|
||||
$identity->modeEdition = false;
|
||||
|
||||
$timeout = (!empty($InfosLogin->result->timeout)) ? $InfosLogin->result->timeout : $this->_timeout;
|
||||
$timeout = (!empty($InfosLogin->result->timeout)) ?
|
||||
$InfosLogin->result->timeout : $this->_timeout;
|
||||
$identity->timeout = $timeout;
|
||||
$identity->time = time() + $timeout;
|
||||
$lang = in_array($InfosLogin->result->lang, array('fr','en')) ? $InfosLogin->result->lang : 'fr';
|
||||
$lang = in_array($InfosLogin->result->lang, array('fr','en')) ?
|
||||
$InfosLogin->result->lang : 'fr';
|
||||
$identity->lang = $lang;
|
||||
$identity->langtmp = $lang;
|
||||
|
||||
@ -170,8 +176,9 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
|
||||
$this->_password = $identity->password;
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $identity);
|
||||
}
|
||||
// --- Fallback
|
||||
else {
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_UNCATEGORIZED, $identity, array("Identification impossible"));
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_UNCATEGORIZED, $identity, array("Identification impossible"));
|
||||
}
|
||||
}
|
||||
|
||||
|
26375
library/Scores/Finance/Banques.php
Normal file
26375
library/Scores/Finance/Banques.php
Normal file
File diff suppressed because one or more lines are too long
@ -1368,7 +1368,8 @@ class IdentiteEntreprise
|
||||
if($i==2) break;
|
||||
}
|
||||
switch($i){
|
||||
case 1: $unite = ' K'; break;
|
||||
case 0: $unite = ' '; break;
|
||||
case 1: $unite = ' K'; break;
|
||||
case 2: $unite = ' M'; break;
|
||||
}
|
||||
return number_format($number, 0, '', ' ').$unite;
|
||||
|
186
library/Scores/Import/FileCsv.php
Normal file
186
library/Scores/Import/FileCsv.php
Normal file
@ -0,0 +1,186 @@
|
||||
<?php
|
||||
class Scores_Import_FileCsv
|
||||
{
|
||||
private $filepath='';
|
||||
private $standardcolumns=array(
|
||||
'siren','nic','ref'
|
||||
);
|
||||
private $standarddelimiter=',';
|
||||
private $standardencoding='utf-8';
|
||||
public $standardhelptext='Le fichier attendu est un csv standard : fichier texte extension .csv contenant 3 colonnes (siren nic ref) séparées par des virgules';
|
||||
public function __construct()
|
||||
{
|
||||
$c = new Zend_Config_Ini(realpath(APPLICATION_PATH) . '/configs/application.ini');
|
||||
$ct = $c->toArray();
|
||||
$this->config=$ct[APPLICATION_ENV];
|
||||
//home/vhosts/data/extranet
|
||||
$this->filepath=$this->config['profil']['path']['shared'].'/persist/surveillance/';
|
||||
if(!is_dir($this->filepath)){
|
||||
mkdir($this->filepath);
|
||||
}
|
||||
}
|
||||
public function verifandupload($file,$request){
|
||||
$ref=$request->getParam('ref');
|
||||
$user = new Scores_Utilisateur();
|
||||
$this->login = $user->identity->username;
|
||||
//var_dump($user->identity);die;
|
||||
$this->email=$request->getParam('email');
|
||||
$this->sources=$request->getParam('source');
|
||||
|
||||
$fileinname=$file["fichier"]["name"];
|
||||
$fileType = pathinfo($fileinname,PATHINFO_EXTENSION);
|
||||
if($fileType!='csv'){
|
||||
return array('success' => false, 'message' => 'Extension incorrecte');
|
||||
}
|
||||
$fileoutname=$ref.'.csv';
|
||||
$target=$this->filepath.$fileinname;
|
||||
if (!move_uploaded_file($file["fichier"]["tmp_name"], $target)) {
|
||||
return array('success' => false, 'message' => 'Le fichier '
|
||||
. basename( $file["fichier"]["name"]). ' ne peut pas être chargé.');
|
||||
}
|
||||
$result=$this->verifyformat($fileinname,$fileoutname);
|
||||
if($result['success']){
|
||||
$row=$result['message'];
|
||||
}else{
|
||||
return $result;
|
||||
}
|
||||
$result=$this->sendtoftp($fileoutname);
|
||||
if(!$result['success']){
|
||||
return $result;
|
||||
}
|
||||
|
||||
$cmd=new Application_Model_CommandesSurveillance();
|
||||
foreach($sources as $source){
|
||||
$data= array(
|
||||
'ref' => $ref,
|
||||
'login' =>$this->login,
|
||||
'email' => $this->email,
|
||||
'filename' => $fileinname,
|
||||
'surv_source' => $source,
|
||||
'date_created' => Date('Y-m-d')
|
||||
);
|
||||
$cmd->insert($data);
|
||||
}
|
||||
$mail = new Zend_Mail('UTF-8');
|
||||
// --- Configuration du transport SMTP
|
||||
if ( $this->config['profil']['mail']['method'] == 'smtp' ) {
|
||||
$config = array();
|
||||
if ( isset($this->config['profil']['mail']['username']) ) {
|
||||
$config['username'] = $this->config['profil']['mail']['username'];
|
||||
}
|
||||
if ( isset($this->config['profil']['mail']['password']) ) {
|
||||
$config['password'] = $this->config['profil']['mail']['password'];
|
||||
}
|
||||
|
||||
if ( isset($this->config['profil']['mail']['port']) ) {
|
||||
$config['port'] = $c->profil->mail->port;
|
||||
}
|
||||
$tr = new Zend_Mail_Transport_Smtp($this->config['profil']['mail']['host'], $config);
|
||||
}
|
||||
// --- Configuration transport Sendmail
|
||||
if ( $this->config['profil']['mail']['method']== 'sendmail' ) {
|
||||
$tr = new Zend_Mail_Transport_Sendmail();
|
||||
}
|
||||
$mail->setDefaultTransport($tr);
|
||||
$mail->setBodyText(implode('###',$data));
|
||||
$mail->setFrom('support@scores-decisions.com', 'Extranet');
|
||||
$mail->addTo('supportdev@scores-decisions.com', 'Support');
|
||||
$mail->setSubject('Commande de surveillance '.$ref);
|
||||
try{
|
||||
$mail->send(); // Ne fonctionne pas en dev....
|
||||
}catch(Exception $e){
|
||||
// Ne fonctionne pas en dev.... voir en prod
|
||||
}
|
||||
|
||||
return array('success' => true, 'message' => $row);
|
||||
}
|
||||
private function verifyformat($fileinname,$fileoutname){
|
||||
$handle=fopen($this->filepath.$fileinname,'r');
|
||||
$h2=fopen($this->filepath.$fileoutname,'w');
|
||||
if(!$handle){
|
||||
return array('success' => false, 'message' => 'Fichier illisible.');
|
||||
}
|
||||
if(!$h2){
|
||||
return array('success' => false, 'message' => 'Un probleme technique est survenu merci de nous contacter avec le code erreur '.__LINE__);
|
||||
}
|
||||
ini_set("auto_detect_line_endings", true);
|
||||
$row=1;
|
||||
while (($data = fgetcsv($handle)) !== FALSE) {
|
||||
$num = count($data);
|
||||
if($num!=3){
|
||||
return array('success' => false, 'message' => 'Nombre de colonnes erronné à la ligne '.$row.'.');
|
||||
}
|
||||
if($data[0]=='siren' & $row==1){
|
||||
continue;
|
||||
}
|
||||
$data[0]=trim($data[0]);
|
||||
if(strlen($data[0])>9){
|
||||
return array('success' => false, 'message' => 'Siren mal formaté à la ligne '.$row.'.');
|
||||
}
|
||||
if(!is_numeric($data[0])){
|
||||
return array('success' => false, 'message' => 'Siren non numérique '.$data[0].' à la ligne '.$row.'.');
|
||||
}
|
||||
$siren=substr('000000000'.$data[0],-9,9);
|
||||
if(!$this->estValide($siren)){
|
||||
return array('success' => false, 'message' => 'Siren invalide '.$data[0].' à la ligne '.$row.'.');
|
||||
}
|
||||
$row++;
|
||||
$data[3]='';
|
||||
$data[4]=$this->login;
|
||||
$data[5]=$this->email;
|
||||
foreach($this->sources as $source){
|
||||
$data[3]=$source;
|
||||
fputcsv($h2,$data);
|
||||
}
|
||||
}
|
||||
fclose($handle);
|
||||
fclose($h2);
|
||||
|
||||
return array('success' => true, 'message' => $row);
|
||||
|
||||
}
|
||||
private function sendtoftp($filename){
|
||||
$connection = ftp_connect('ftp.scores-decisions.com',21);
|
||||
|
||||
$login = ftp_login($connection, 'internesd', 'internesd2017');
|
||||
|
||||
$dest='/send/'.$filename;
|
||||
|
||||
$source=$this->filepath.$filename;
|
||||
|
||||
if (!$connection || !$login) {
|
||||
return array('success' => false, 'message' => 'Un probleme technique est survenu merci de nous contacter avec le code erreur '.__LINE__);
|
||||
}
|
||||
|
||||
if(!ftp_pasv($connection, true)){
|
||||
return array('success' => false, 'message' => 'Un probleme technique est survenu merci de nous contacter avec le code erreur '.__LINE__);
|
||||
}
|
||||
$upload = ftp_put($connection, $dest, $source, FTP_BINARY);
|
||||
|
||||
if (!$upload) {
|
||||
return array('success' => false, 'message' => 'Un probleme technique est survenu merci de nous contacter avec le code erreur '.__LINE__);
|
||||
}
|
||||
|
||||
ftp_close($connection);
|
||||
return array('success' => true, 'message' => '');
|
||||
}
|
||||
private function estValide($siren){
|
||||
// Donc le SIREN est un numérique à 9 chiffres
|
||||
$somme = 0;
|
||||
for ($cpt = 0; $cpt<strlen($siren); $cpt++) {
|
||||
if (($cpt % 2) == 1) { // Les positions paires : 2ème, 4ème, 6ème et 8ème chiffre
|
||||
$tmp = substr($siren,$cpt,1) * 2; // On le multiplie par 2
|
||||
if ($tmp > 9)
|
||||
$tmp -= 9; // Si le résultat est supérieur à 9, on lui soustrait 9
|
||||
}
|
||||
else
|
||||
$tmp = substr($siren,$cpt,1);
|
||||
$somme += (int)$tmp;
|
||||
}
|
||||
if (($somme % 10) == 0)
|
||||
return true; // Si la somme est un multiple de 10 alors le SIREN est valide
|
||||
else
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
@ -10,5 +10,15 @@ return array(
|
||||
'errorMsg' => array('MSG'),
|
||||
'log' => 'mail',
|
||||
),
|
||||
'setRib' => array(
|
||||
'debug' => true,
|
||||
'errorMsg' => array('MSG'),
|
||||
'log' => 'mail',
|
||||
),
|
||||
'getRib' => array(
|
||||
'debug' => true,
|
||||
'errorMsg' => array('MSG'),
|
||||
'log' => 'mail',
|
||||
),
|
||||
)
|
||||
);
|
@ -405,24 +405,24 @@ class WsScores
|
||||
}
|
||||
}
|
||||
|
||||
public function getCatalogCity($id, $columns)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$params->columns = $columns;
|
||||
$client = $this->loadClient('catalog');
|
||||
try {
|
||||
$reponse = $client->getCity($params);
|
||||
return $reponse->getCityResult;
|
||||
} 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 getCatalogCity($id, $columns)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$params->columns = $columns;
|
||||
$client = $this->loadClient('catalog');
|
||||
try {
|
||||
$reponse = $client->getCity($params);
|
||||
return $reponse->getCityResult;
|
||||
} 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)
|
||||
@ -501,42 +501,42 @@ class WsScores
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Score Cut Off
|
||||
* @param string $siren
|
||||
* @return Cutoff values or False
|
||||
*/
|
||||
public function getScoreCutoff($siren)
|
||||
{
|
||||
/**
|
||||
* 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) {
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->getScoreCutoff($params);
|
||||
return $reponse->getScoreCutoffResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
return $fault->faultstring;
|
||||
}
|
||||
return $fault->faultstring;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Score Cut Off
|
||||
* @param string $siren
|
||||
* @return boolean
|
||||
*/
|
||||
public function delScoreCutoff($siren)
|
||||
{
|
||||
/**
|
||||
* 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) {
|
||||
$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) {
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
return $fault->faultstring;
|
||||
}
|
||||
return $fault->faultstring;
|
||||
}
|
||||
}
|
||||
|
||||
public function searchLogin($idClient, $query)
|
||||
@ -884,18 +884,18 @@ class WsScores
|
||||
$params->type = $type;
|
||||
$params->libelle = $libelle;
|
||||
$params->date = $date;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setActeAsso($params);
|
||||
return $reponse->setActeAssoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->logger->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;
|
||||
}
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setActeAsso($params);
|
||||
return $reponse->setActeAssoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->logger->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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -943,14 +943,14 @@ class WsScores
|
||||
$params->identifiant = $identifiant;
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('pieces');
|
||||
try {
|
||||
$reponse = $client->getBilans($params);
|
||||
return $reponse->getBilansResult;
|
||||
$client = $this->loadClient('pieces');
|
||||
try {
|
||||
$reponse = $client->getBilans($params);
|
||||
return $reponse->getBilansResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -964,21 +964,21 @@ class WsScores
|
||||
*/
|
||||
public function getPiecesBilan($siren, $type, $diffusion, $dateCloture, $reference = '')
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params = new stdClass();
|
||||
$params->identifiant = $siren;
|
||||
$params->dateCloture = $dateCloture;
|
||||
$params->type = $type;
|
||||
$params->diffusion = $diffusion;
|
||||
$params->reference = $reference;
|
||||
$client = $this->loadClient('pieces');
|
||||
try {
|
||||
$client = $this->loadClient('pieces');
|
||||
try {
|
||||
$reponse = $client->getBilan($params);
|
||||
$this->logger->info(print_r($reponse,1));
|
||||
return $reponse->getBilanResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
$this->logger->info(print_r($reponse,1));
|
||||
return $reponse->getBilanResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1103,15 +1103,15 @@ class WsScores
|
||||
*/
|
||||
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;
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1170,17 +1170,17 @@ class WsScores
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getGroupeInfos($params);
|
||||
return $reponse->getGroupeInfosResult;
|
||||
$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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1196,7 +1196,7 @@ class WsScores
|
||||
$filename.= '-0';
|
||||
if ($stopAtIsin === true) {
|
||||
$filename.= '-1';
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
@ -1214,7 +1214,7 @@ class WsScores
|
||||
try {
|
||||
$reponse = $client->getGroupesArbo($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getGroupesArboResult);
|
||||
}
|
||||
return $reponse->getGroupesArboResult;
|
||||
@ -1913,28 +1913,28 @@ class WsScores
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeDepartements
|
||||
* Liste des départements
|
||||
/**
|
||||
* getListeDepartements
|
||||
* Liste des départements
|
||||
*/
|
||||
public function getCatalogDepartements($id, $columns)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$params->columns = $columns;
|
||||
$client = $this->loadClient('catalog');
|
||||
try {
|
||||
$reponse = $client->getDepartements($params);
|
||||
return $reponse->getDepartementsResult;
|
||||
} 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 getCatalogDepartements($id, $columns)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$params->columns = $columns;
|
||||
$client = $this->loadClient('catalog');
|
||||
try {
|
||||
$reponse = $client->getDepartements($params);
|
||||
return $reponse->getDepartementsResult;
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2185,11 +2185,11 @@ class WsScores
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getAnnoncesNum($siren)
|
||||
{
|
||||
$filename = 'annoncesnum-'.$siren;
|
||||
$filename = 'annoncesnum-'.$siren;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
@ -2197,26 +2197,26 @@ class WsScores
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getAnnoncesNum($params);
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getAnnoncesNum($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getAnnoncesNumResult);
|
||||
}
|
||||
return $reponse->getAnnoncesNumResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
return $reponse->getAnnoncesNumResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getAnnoncesBalo($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
||||
{
|
||||
$filename = 'annoncesbalo-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
||||
$filename = 'annoncesbalo-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
@ -2224,30 +2224,30 @@ class WsScores
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$params->idAnn = $idAnn;
|
||||
$params->filtre = $filtre;
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getAnnoncesBalo($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getAnnoncesBaloResult);
|
||||
}
|
||||
return $reponse->getAnnoncesBaloResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
return $reponse->getAnnoncesBaloResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getAnnoncesBoamp($siren, $idAnn=null, $filtre = null, $position=0, $nbRep=20)
|
||||
{
|
||||
$filename = 'annoncesboamp-'.$siren.'-'.$filtre.'-'.$position.'-'.$nbRep;
|
||||
public function getAnnoncesBoamp($siren, $idAnn=null, $filtre = null, $position=0, $nbRep=20)
|
||||
{
|
||||
$filename = 'annoncesboamp-'.$siren.'-'.$filtre.'-'.$position.'-'.$nbRep;
|
||||
|
||||
if ($idAnn !== null) {
|
||||
$filename = 'annoncesboamp-'.$siren.'-'.$filtre.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
||||
@ -2259,38 +2259,38 @@ class WsScores
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$params->idAnn = $idAnn;
|
||||
|
||||
$params->filtre = null;
|
||||
if (!empty($filtre) && in_array($filtre,array('A','M'))) {
|
||||
$filtreStruct = new stdClass();
|
||||
$filtreStruct->key = 'type';
|
||||
$filtreStruct->key = 'type';
|
||||
$filtreStruct->value = $filtre;
|
||||
$params->filtre[] = $filtreStruct;
|
||||
}
|
||||
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getAnnoncesBoamp($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getAnnoncesBoampResult);
|
||||
}
|
||||
return $reponse->getAnnoncesBoampResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return $reponse->getAnnoncesBoampResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getAnnoncesAsso($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
||||
{
|
||||
$filename = 'annoncesasso-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
||||
public function getAnnoncesAsso($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
||||
{
|
||||
$filename = 'annoncesasso-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
@ -2298,30 +2298,30 @@ class WsScores
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$params->idAnn = $idAnn;
|
||||
$params->filtre = $filtre;
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getAnnoncesAsso($params);
|
||||
$params->filtre = $filtre;
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getAnnoncesAsso($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getAnnoncesAssoResult);
|
||||
}
|
||||
return $reponse->getAnnoncesAssoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return $reponse->getAnnoncesAssoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getAnnoncesLegales($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
||||
{
|
||||
$filename = 'annonceslegales-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
||||
public function getAnnoncesLegales($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
||||
{
|
||||
$filename = 'annonceslegales-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
@ -2329,28 +2329,28 @@ class WsScores
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$params->idAnn = $idAnn;
|
||||
$params->filtre = $filtre;
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getAnnoncesLegales($params);
|
||||
$this->logger->info(print_r($reponse,1));
|
||||
$params->filtre = $filtre;
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getAnnoncesLegales($params);
|
||||
$this->logger->info(print_r($reponse,1));
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getAnnoncesLegalesResult);
|
||||
}
|
||||
return $reponse->getAnnoncesLegalesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return $reponse->getAnnoncesLegalesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getAnnonces
|
||||
* @param string $siren
|
||||
@ -2457,24 +2457,11 @@ class WsScores
|
||||
*/
|
||||
public function getListeBilans($siren)
|
||||
{
|
||||
$filename = 'listebilans-'.$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('entreprise');
|
||||
try {
|
||||
$reponse = $client->getListeBilans($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getListeBilansResult);
|
||||
}
|
||||
return $reponse->getListeBilansResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
@ -2592,25 +2579,12 @@ class WsScores
|
||||
*/
|
||||
public function getRatios($siren, $page = 'ratios')
|
||||
{
|
||||
$filename = 'ratios-'.$siren.'-'.$page;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new StdClass();
|
||||
$params->siren = $siren;
|
||||
$params->page = $page;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getRatios($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getRatiosResult);
|
||||
}
|
||||
return $reponse->getRatiosResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
@ -2684,29 +2658,29 @@ class WsScores
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* setDirigeantsOp
|
||||
* @param array $infos
|
||||
*/
|
||||
public function setDirigeantsOp($infos, $mode, $id)
|
||||
{
|
||||
$params = new stdClass();
|
||||
/**
|
||||
* setDirigeantsOp
|
||||
* @param array $infos
|
||||
*/
|
||||
public function setDirigeantsOp($infos, $mode, $id)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->infos = $infos;
|
||||
$params->mode = $mode;
|
||||
$params->id = $id;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setDirigeantsOp($params);
|
||||
return $reponse->setDirigeantsOpResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->logger->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;
|
||||
}
|
||||
}
|
||||
$params->mode = $mode;
|
||||
$params->id = $id;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setDirigeantsOp($params);
|
||||
return $reponse->setDirigeantsOpResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->logger->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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3214,24 +3188,24 @@ class WsScores
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getScoreHistorique pour les derniers 5 ans
|
||||
* @param string $siret
|
||||
* @param string $type
|
||||
*/
|
||||
public function getScoresHisto($siret, $type = 'indiscore')
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siret = $siret;
|
||||
$params->type = $type;
|
||||
try {
|
||||
$client = $this->loadClient('interne');
|
||||
$reponse = $client->getScoresHisto($params);
|
||||
return $reponse->getScoresHistoResult;
|
||||
/**
|
||||
* getScoreHistorique pour les derniers 5 ans
|
||||
* @param string $siret
|
||||
* @param string $type
|
||||
*/
|
||||
public function getScoresHisto($siret, $type = 'indiscore')
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siret = $siret;
|
||||
$params->type = $type;
|
||||
try {
|
||||
$client = $this->loadClient('interne');
|
||||
$reponse = $client->getScoresHisto($params);
|
||||
return $reponse->getScoresHistoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3327,25 +3301,25 @@ class WsScores
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
1
public/themes/default/styles/bsmain.css
Normal file
1
public/themes/default/styles/bsmain.css
Normal file
@ -0,0 +1 @@
|
||||
@import url("./../../../libs/bootstrap-3.3.7/css/bootstrap.min.css");
|
Loading…
Reference in New Issue
Block a user