Compare commits

..

1 Commits

Author SHA1 Message Date
benoitpotier
bc3b2ebaba suppression fichier library scores commun à library project 2017-03-31 16:19:50 +02:00
25 changed files with 578 additions and 28072 deletions

View File

@ -1070,7 +1070,7 @@ class FinanceController extends Zend_Controller_Action
$entreprise = new Scores_Session_Entreprise($this->siret, $this->id);
$this->view->assign('banques', isset($infos->result->item)?$infos->result->item:array());
$this->view->assign('banques', $infos->result->item);
$this->view->assign('raisonSociale', $entreprise->getRaisonSociale());
$this->view->assign('siren', substr($this->siret, 0, 9));
$this->view->assign('exportObjet', $infos);

View File

@ -407,8 +407,6 @@ class IdentiteController extends Zend_Controller_Action
}
} else {
$pageTotal = $pageCurrent = 1;
$pagePrev = 1;
$pageNext = 1;
}
$this->view->assign('PageTotal', $pageTotal);
$this->view->assign('PagePrev', $pagePrev);
@ -1173,8 +1171,6 @@ class IdentiteController extends Zend_Controller_Action
}
} else {
$pageTotal = $pageCurrent = 1;
$pagePrev = 1;
$pageNext = 1;
}
$this->view->assign('PageTotal', $pageTotal);
$this->view->assign('PagePrev', $pagePrev);

View File

@ -154,8 +154,6 @@ class JuridiqueController extends Zend_Controller_Action
}
} else {
$pageTotal = $pageCurrent = 1;
$pagePrev = 1;
$pageNext = 1;
}
$this->view->assign('PageTotal', $pageTotal);
$this->view->assign('PagePrev', $pagePrev);
@ -383,9 +381,12 @@ class JuridiqueController extends Zend_Controller_Action
$this->view->msg = "Erreur";
} else {
$this->view->List = isset($response->List->item)?$response->List->item:null;
$this->view->List = $response->List->item;
// --- Pagination
$nbReponsesTotal = $response->Nb;
$pageTotal = $pageCurrent = 1;
$pagePrev = null;
$pageNext = null;
if ($nbReponses < $nbReponsesTotal) {
$pageTotal = ceil( $nbReponsesTotal / $nbReponses );
$pageCurrent = $page;
@ -397,10 +398,6 @@ 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);

View File

@ -806,8 +806,6 @@ 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;

View File

@ -2910,21 +2910,15 @@ class SaisieController extends Zend_Controller_Action
$mode = $request->getParam('mode');
$guichetMod = $request->getParam('guichetMod');
$banqueMod = $request->getParam('banqueMod');
$result='';
if($mode!='add'){
$params= new stdClass();
$values=array(
'siren' => str_replace(' ', '',$request->getParam('siren')),
'codeBanque' => $banqueMod,
'codeGuichet' => $guichetMod,
);
$params->infos=json_encode($values);
$ws = new Scores_Ws_Client('saisie', '0.2');
$result = $ws->getRib($params);
}
$ws = new WsScores();
$result = $ws->getIdentite($siren);
$infos = $ws->getBanques($siren);
$this->view->assign('actif',$result->Actif);
$this->view->assign('siren', $siren);
$this->view->assign('mode', $mode);
$this->view->assign('banques', $result);
$this->view->assign('banques', $infos->result->item);
$this->view->assign('guichetMod', $guichetMod);
$this->view->assign('banqueMod', $banqueMod);
@ -2935,56 +2929,20 @@ class SaisieController extends Zend_Controller_Action
public function ribansaveAction(){
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$params= new stdClass();
$values=array(
'siren' => str_replace(' ', '',$request->getParam('siren')),
'codeBanque' => str_replace(' ', '',$request->getParam('code_banque')),
'codeGuichet' => str_replace(' ', '',$request->getParam('code_guichet')),
'numCompte' => str_replace(' ', '',$request->getParam('num_compte')),
'bic' => str_replace(' ', '',$request->getParam('bic_swift')),
'iban' => str_replace(' ', '',$request->getParam('iban')),
'mode' => $request->getParam('mode'),
);
$params->infos=json_encode($values);
$codeBanque = str_replace(' ', '',$request->getParam('code_banque'));
$codeGuichet = str_replace(' ', '',$request->getParam('code_guichet'));
$numCompte = str_replace(' ', '',$request->getParam('num_compte'));
$bicSwift = str_replace(' ', '',$request->getParam('bic_swift'));
$iban = str_replace(' ', '',$request->getParam('iban'));
$mode = $request->getParam('mode');
$ws = new Scores_Ws_Client('saisie', '0.2');
$result = $ws->setRib($params);
if($result){
echo 'Opération enregistrée';
}else {
echo 'Opération échouée ';
}
die;
}
public function testwsAction(){
$c = Zend_Registry::get('config');
$wsdl = 'http://webservice.sd.dev/saisie/v0.2?wsdl-auto';
$options = array( '0.2' => array(
'setRib' => array(
'debug' => true,
'log' => 'mail',
),
),
);
$options['features'] = SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS;
$options['compression'] = SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE;
$options['login'] = 'cdelbos';
$options['password'] = 'coucou';
if (APPLICATION_ENV == 'development'){
$options['cache_wsdl'] = WSDL_CACHE_NONE;
}
$options['trace'] = true;
$options['encoding'] = 'utf-8';
$client = false;
$client = new SoapClient($wsdl, $options);
$params = new stdClass();
$params->infos=json_encode(array('siren' => '809613144','mode' => 'add', 'codeBanque' => '20041'));
$reponse = $client->setRib($params);
var_dump($reponse);die;
$this->view->assign('code_banque', $guichetMod);
$this->view->assign('code_guichet', $codeGuichet);
$this->view->assign('num_compte', $numCompte);
$this->view->assign('bic_swift', $bicSwift);
$this->view->assign('iban', $iban);
}
}

View File

@ -118,7 +118,6 @@ 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', '');
@ -137,8 +136,6 @@ 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');
}
@ -383,7 +380,7 @@ class SurveillanceController extends Zend_Controller_Action
$ws = new WsScores();
$infos = $ws->getSurveillances($filtre, $position, $nbAffichage);
$surveillances = isset($infos->result->item)?$infos->result->item:null;
$surveillances = $infos->result->item;
$listTrier = array();
if ( count($surveillances)>0 ) {
@ -425,12 +422,10 @@ class SurveillanceController extends Zend_Controller_Action
}
} else {
$pageTotal = $pageCurrent = 1;
$pagePrev = 1;
$pageNext = 1;
}
$this->view->assign('PageTotal', $pageTotal);
$this->view->assign('PagePrev', isset($pagePrev)?$pagePrev:1);
$this->view->assign('PageNext', isset($pageNext)?$pageNext:1);
$this->view->assign('PagePrev', $pagePrev);
$this->view->assign('PageNext', $pageNext);
$this->view->assign('PageCurrent', $pageCurrent);
$this->view->assign('nbReponses', empty($nbReponses) ? 0 : $nbReponses);
@ -646,8 +641,6 @@ class SurveillanceController extends Zend_Controller_Action
}
} else {
$pageTotal = $pageCurrent = 1;
$pagePrev = 1;
$pageNext = 1;
}
$this->view->assign('PageTotal', $pageTotal);
$this->view->assign('PagePrev', $pagePrev);
@ -1159,56 +1152,4 @@ 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";
}
}

View File

@ -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, 'guichetMod'=>$relation->codeGuichet, 'banqueMod'=>$relation->codeBanque), 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,'siret'=>$this->siret), null, true)?>"><img src="/themes/default/images/interfaces/supprimer.png" /></a>
<?php }?>
</td>
<td>

View File

@ -4,19 +4,13 @@ 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">
@ -29,12 +23,10 @@ $lbanque = (array)json_decode($this->banques);
<label>Situation RIB</label>
<div class="field">
<?php
if ($this->actif==1 || (isset($lbanque['dateSuppr']) && $lbanque['dateSuppr']=='0000-00-00 00:00:00') ){
if ($this->actif==1){
$checkActive = 'checked';
$checkInactive = '';
} else {
$checkInactive = 'checked';
$checkActive = '';
}
?>
<div style="float:left;">Active<input type="radio" name="actif" value="1" <?=$checkActive;?>/></div>
@ -43,127 +35,79 @@ if ($this->actif==1 || (isset($lbanque['dateSuppr']) && $lbanque['dateSuppr']=='
</div>
<div class="fieldgrp">
<fieldset>
<legend>Saisie RIB</legend>
<div class="fieldgrp">
<label>Banque</label>
<div class="field" >
<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;" >
<select name="Banque" style="width:160px;" >
<option value=""><?=$this->banqueMod?></option>
<?php foreach( $this->banques as $val ) {?>
<option value="<?=$val->codeBanque?>"><?=$val->codeBanque?></option>
<?php }?>
</select>
<span id="denomgcht"></span>
</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>
</div>
</div>
<div class="fieldgrp">
<label>RIB</label>
<div class="field">
<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']:'') ?>"/>
<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=""/>
</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="<?=(isset($lbanque['bic'])?$lbanque['bic']:'') ?>" size="20"/>
<input type="text" name="bic_swift" value="" size="20"/>
</div>
</div>
<div class="fieldgrp">
<label>IBAN</label>
<div class="field">
<input type="text" name="iban" value="<?=(isset($lbanque['iban'])?$lbanque['iban']:'') ?>" size="47"/>
<input type="text" name="iban" value="" 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"); } }

View File

@ -28,14 +28,9 @@ if ( empty($this->source) ){
?>
</div>
<h2>Traitements de masse</h2>
<div class="paragraph">
<h2>Extraction des surveillances</h2>
<?=$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">
@ -157,8 +152,7 @@ par
'siret' => $item['siren'].$item['nic'],
'ref' => urlencode($surveillance['ref']),
'email' => $surveillance['email'],
'source' => $surveillance['source'],
'q' => $this->q,
'source' => $surveillance['source']
))?>" title="Supprimer la surveillance <?=$surveillance['source']?>">
<img src="/themes/default/images/interfaces/supprimer.png"/>
</a>
@ -301,3 +295,4 @@ $(function() {
?>
});
</script>

View File

@ -1,70 +0,0 @@
<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']?>/>&nbsp;<?=$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>

View File

@ -8,11 +8,18 @@
"setasign/fpdi": "^1.6",
"cybermonde/odtphp": "^1.7",
"fabpot/goutte": "^3.2",
"monolog/monolog": "^1.22"
"monolog/monolog": "^1.22",
"scores/library": "dev-master"
},
"require-dev": {
"ccampbell/chromephp": "^4.1"
},
"repositories": [
{
"type": "git",
"url": "git@gitlab.factory.insight.doubletrade.com:scores/library.git"
}
],
"include-path": ["library/"],
"autoload": {
"classmap": [
@ -21,7 +28,7 @@
"library/GenCourrier/",
"library/Giant/",
"library/Infogreffe/",
"library/Scores/",
"library/Scores/",
"library/WorldCheck/"
]
},

516
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "6c57b3ee229a68f4d482e680536a8f55",
"content-hash": "56cf98787986107c5603de8032378c7b",
"packages": [
{
"name": "cybermonde/odtphp",
@ -41,6 +41,475 @@
],
"time": "2015-06-02T07:28:25+00:00"
},
{
"name": "doctrine/annotations",
"version": "v1.2.7",
"source": {
"type": "git",
"url": "https://github.com/doctrine/annotations.git",
"reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535",
"reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535",
"shasum": ""
},
"require": {
"doctrine/lexer": "1.*",
"php": ">=5.3.2"
},
"require-dev": {
"doctrine/cache": "1.*",
"phpunit/phpunit": "4.*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Annotations\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Docblock Annotations Parser",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"annotations",
"docblock",
"parser"
],
"time": "2015-08-31T12:32:49+00:00"
},
{
"name": "doctrine/cache",
"version": "v1.6.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/cache.git",
"reference": "b6f544a20f4807e81f7044d31e679ccbb1866dc3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/cache/zipball/b6f544a20f4807e81f7044d31e679ccbb1866dc3",
"reference": "b6f544a20f4807e81f7044d31e679ccbb1866dc3",
"shasum": ""
},
"require": {
"php": "~5.5|~7.0"
},
"conflict": {
"doctrine/common": ">2.2,<2.4"
},
"require-dev": {
"phpunit/phpunit": "~4.8|~5.0",
"predis/predis": "~1.0",
"satooshi/php-coveralls": "~0.6"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.6.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Caching library offering an object-oriented API for many cache backends",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"cache",
"caching"
],
"time": "2016-10-29T11:16:17+00:00"
},
{
"name": "doctrine/collections",
"version": "v1.3.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/collections.git",
"reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a",
"reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Collections\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Collections Abstraction library",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"array",
"collections",
"iterator"
],
"time": "2015-04-14T22:21:58+00:00"
},
{
"name": "doctrine/common",
"version": "v2.6.2",
"source": {
"type": "git",
"url": "https://github.com/doctrine/common.git",
"reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/common/zipball/7bce00698899aa2c06fe7365c76e4d78ddb15fa3",
"reference": "7bce00698899aa2c06fe7365c76e4d78ddb15fa3",
"shasum": ""
},
"require": {
"doctrine/annotations": "1.*",
"doctrine/cache": "1.*",
"doctrine/collections": "1.*",
"doctrine/inflector": "1.*",
"doctrine/lexer": "1.*",
"php": "~5.5|~7.0"
},
"require-dev": {
"phpunit/phpunit": "~4.8|~5.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.7.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Common\\": "lib/Doctrine/Common"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Common Library for Doctrine projects",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"annotations",
"collections",
"eventmanager",
"persistence",
"spl"
],
"time": "2016-11-30T16:50:46+00:00"
},
{
"name": "doctrine/dbal",
"version": "v2.5.12",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
"reference": "7b9e911f9d8b30d43b96853dab26898c710d8f44"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/7b9e911f9d8b30d43b96853dab26898c710d8f44",
"reference": "7b9e911f9d8b30d43b96853dab26898c710d8f44",
"shasum": ""
},
"require": {
"doctrine/common": ">=2.4,<2.8-dev",
"php": ">=5.3.2"
},
"require-dev": {
"phpunit/phpunit": "4.*",
"symfony/console": "2.*||^3.0"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
},
"bin": [
"bin/doctrine-dbal"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.5.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\DBAL\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
}
],
"description": "Database Abstraction Layer",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"database",
"dbal",
"persistence",
"queryobject"
],
"time": "2017-02-08T12:53:47+00:00"
},
{
"name": "doctrine/inflector",
"version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/inflector.git",
"reference": "90b2128806bfde671b6952ab8bea493942c1fdae"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae",
"reference": "90b2128806bfde671b6952ab8bea493942c1fdae",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"require-dev": {
"phpunit/phpunit": "4.*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Inflector\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Common String Manipulations with regard to casing and singular/plural rules.",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"inflection",
"pluralize",
"singularize",
"string"
],
"time": "2015-11-06T14:35:42+00:00"
},
{
"name": "doctrine/lexer",
"version": "v1.0.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/lexer.git",
"reference": "83893c552fd2045dd78aef794c31e694c37c0b8c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c",
"reference": "83893c552fd2045dd78aef794c31e694c37c0b8c",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Lexer\\": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.",
"homepage": "http://www.doctrine-project.org",
"keywords": [
"lexer",
"parser"
],
"time": "2014-09-09T13:34:57+00:00"
},
{
"name": "fabpot/goutte",
"version": "v3.2.1",
@ -500,6 +969,41 @@
],
"time": "2016-10-10T12:19:37+00:00"
},
{
"name": "scores/library",
"version": "dev-master",
"source": {
"type": "git",
"url": "git@gitlab.factory.insight.doubletrade.com:scores/library.git",
"reference": "0b5d5b46854f79fba7b27301aa7b9d8977e3a750"
},
"require": {
"doctrine/dbal": "^2.5",
"monolog/monolog": "^1.22",
"zendframework/zendframework1": "^1.12"
},
"require-dev": {
"phpunit/phpunit": "^4.8"
},
"type": "library",
"autoload": {
"classmap": [
"src/Metier/",
"src/Scores/"
]
},
"include-path": [
"src/"
],
"authors": [
{
"name": "Scores et Decisions",
"email": "supportdev@scores-decisions.com"
}
],
"description": "library",
"time": "2017-03-31 13:12:30"
},
{
"name": "setasign/fpdi",
"version": "1.6.1",
@ -604,7 +1108,7 @@
},
{
"name": "symfony/browser-kit",
"version": "v3.2.7",
"version": "v3.2.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/browser-kit.git",
@ -661,7 +1165,7 @@
},
{
"name": "symfony/css-selector",
"version": "v3.2.7",
"version": "v3.2.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
@ -714,7 +1218,7 @@
},
{
"name": "symfony/dom-crawler",
"version": "v3.2.7",
"version": "v3.2.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/dom-crawler.git",
@ -985,7 +1489,9 @@
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"stability-flags": {
"scores/library": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],

View File

@ -1,8 +0,0 @@
<?php
class Application_Model_CommandesSurveillance extends Zend_Db_Table_Abstract
{
protected $_name = 'commandes_surveillance';
}

View File

@ -1,102 +0,0 @@
<?php
class Scores_Auth_Adapter_Db implements Zend_Auth_Adapter_Interface
{
protected $_username;
protected $_password;
protected $_hash;
protected $_timeout = 3600;
protected $checkWs = false;
protected $clients = array();
/**
*
* @param string $username
* @param string $password
* @param boolean $checkWs
*/
public function __construct($username, $password, $checkWs = false)
{
$this->_username = $username;
$this->_password = $password;
$this->_hash = md5($username.'|'.$password);
$this->checkWs = $checkWs;
}
/**
* Limit access to only client IDs
* @param array $id
*/
public function limitClient($id = null)
{
if (is_array($id) && count($id)>0) {
$this->clients = $id;
}
}
/**
* Override the timeout
* @param integer $seconds
*/
public function setTimeout($seconds = null)
{
if ($seconds===null)
return;
$this->_timeout = $seconds;
}
/**
* (non-PHPdoc)
* @see Zend_Auth_Adapter_Interface::authenticate()
*/
public function authenticate()
{
$userM = new Application_Model_Sdv1Utilisateurs();
$sql = $userM->select()
->setIntegrityCheck(false)
->from(array('u'=>'sdv1.utilisateurs'), array('u.idClient', 'u.id', 'u.login', 'u.password'))
->join(array('c'=>'sdv1.clients'), 'u.idClient = c.id', array('c.timeout'))
->where('u.login=?', $this->_username)
->where('u.actif=?', 1)
->where('u.deleted=?', 0)
->where('c.actif=?','Oui');
if ( count($this->clients) > 0 ) {
$sql->where('u.idClient IN('.join(',',$this->clients).')');
}
if ($this->checkWs) {
$sql->where('u.accesWS=?',1);
}
$result = $userM->fetchRow($sql);
$identity = new stdClass();
$identity->username = $this->_username;
$identity->hash = $this->_hash;
if ( null === $result ) {
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, $identity);
} else {
if ( $this->_password == $result->password
|| $this->_password == md5($result->login.'|'.$result->password) ) {
$identity->id = $result->id;
$identity->idClient = $result->idClient;
$timeout = (!empty($result->timeout)) ? $result->timeout : $this->_timeout;
$identity->timeout = $timeout;
$identity->time = time() + $timeout;
return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $identity);
} else {
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, $identity);
}
}
}
}

View File

@ -1,246 +0,0 @@
<?php
class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
{
/**
* Identifiant de l'utilisateur
* @var string
*/
protected $_username;
/**
* Password
* @var string
*/
protected $_password;
/**
* Timeout
* @var int
*/
protected $_timeout = 1800;
/**
* Marqueur de vérification IP (en iponly)
* @var boolean
*/
protected $_checkIp = false;
/**
* Marqueur de vérification de hach
* @var boolean
*/
protected $_checkHach = false;
/**
* Liste des IPs des frontends (proxy)
* @var array
*/
protected $listProxyIp = array(
'62.210.222.34',
);
/**
* Logger
* @var \Monolog\Logger
*/
protected $logger;
/**
* Authentification par WS
* @param string $username
* @param string $password
* @param string $mode
*/
public function __construct($username, $password, $mode = null)
{
$this->_username = $username;
$this->_password = $password;
if ($mode == 'hach') {
$this->_checkHach = true;
}
if ($mode == 'iponly'){
$ip = $_SERVER['REMOTE_ADDR'];
if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) && in_array($ip, $this->listProxyIp)) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
$this->_password = 'iponly:'.$ip;
$this->_checkIp = true;
}
if (Zend_Registry::isRegistered('logger')) {
$this->logger = Zend_Registry::get('logger');
}
}
/**
* (non-PHPdoc)
* @see Zend_Auth_Adapter_Interface::authenticate()
*/
public function authenticate()
{
$ip = $_SERVER['REMOTE_ADDR'];
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && in_array($ip, $this->listProxyIp)) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
$ws = new Scores_Ws_Client('gestion', '0.3');
$ws->setHttpLogin($this->_username);
$ws->setHttpPassword($this->_password);
$adressIp = $_SERVER['REMOTE_ADDR'];
$parameters = new stdClass();
$parameters->login = $this->_username;
$parameters->ipUtilisateur = $ip;
$parameters->from = 'auth';
$InfosLogin = $ws->getInfosLogin($parameters);
$this->logger->info(__CLASS__ . ' : '.__METHOD__);
$this->logger->info(print_r($InfosLogin,1));
$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->result->login == $this->_username) {
if ($this->_checkIp || $this->_checkHach) {
$identity->password = $this->_password;
} else {
$identity->password = md5($InfosLogin->result->login.'|'.$this->_password);
}
$identity->username = $InfosLogin->result->login;
$identity->email = $InfosLogin->result->email;
$identity->profil = $InfosLogin->result->profil;
$identity->pref = $InfosLogin->result->pref;
$identity->droits = $InfosLogin->result->droits;
$identity->droitsClients = $InfosLogin->result->droitsClients;
$identity->nom = $InfosLogin->result->nom;
$identity->prenom = $InfosLogin->result->prenom;
$identity->tel = $InfosLogin->result->tel;
$identity->fax = $InfosLogin->result->fax;
$identity->mobile = $InfosLogin->result->mobile;
$identity->id = $InfosLogin->result->id;
$identity->idClient = $InfosLogin->result->idClient;
$identity->reference = $InfosLogin->result->reference;
$identity->nbReponses = $InfosLogin->result->nbReponses;
$identity->typeScore = $InfosLogin->result->typeScore;
$identity->dateValidation = $InfosLogin->result->dateValidation;
$identity->nombreConnexions = $InfosLogin->result->nombreConnexions;
$identity->dateDerniereConnexion = $InfosLogin->result->dateDerniereConnexion;
$identity->dateDebutCompte = $InfosLogin->result->dateDebutCompte;
$identity->dateFinCompte = $InfosLogin->result->dateFinCompte;
$identity->acceptationCGU = $InfosLogin->result->acceptationCGU;
$identity->ip = $ip;
$identity->version = $InfosLogin->result->version;
$identity->modeEdition = false;
$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';
$identity->lang = $lang;
$identity->langtmp = $lang;
// --- Adresse Ip interdites
$ipInterdites =
'81.252.88.0-81.252.88.7' // CTE D AGGLOMERATION DE SOPHIA
. ';' . '195.200.187.163' // PacWan
. ';' . '213.11.81.41' // Verizon France SAS
. ';' . '83.206.171.252' // FR-BASE-D-INFORMATIONS-LEGALES-BI
. ';' . '81.255.32.139'
. ';' . '212.155.191.1*' // Satair A/S
. ';' . '217.70.1*.17' // OJSC "Sibirtelecom"
. ';' . '212.37.196.156' // GENERALE-MULTIMEDIA-SUD
. ';' . '80.245.60.121' // Planete Marseille - Mailclub
. ';' . '213.246.57.101' // IKOULA
. ';' . '193.104.158.0-193.104.158.255' // Altares.fr
. ';' . '195.6.3.0-195.6.3.255' // ORT
. ';' . '217.144.112.0-217.144.116.63' // Coface
;
if ( $this->checkPlagesIp($ipInterdites, $adressIp) ) {
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_UNCATEGORIZED, $identity);
}
// --- OK connecté
$this->_username = $identity->username;
$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"));
}
}
/**
* Controle si une adresse IP est dans une liste des IP communiquées sous la forme
* 192.168.3.5-192.68.3.10;192.168.3.*;192.168.3.10
* @param string $strPlageIP
* La plage d'adresses IP
* @param string $adresseIP
* L'adresse IP à tester
* @return boolean
*/
protected function checkPlagesIp($strPlageIP, $adresseIP)
{
$connected = false;
$tabIpAllowed = explode(';', trim($strPlageIP));
if (count($tabIpAllowed)==1 && $tabIpAllowed[0]=='') $tabIpAllowed = array();
foreach ($tabIpAllowed as $ip) {
$tabPlages = explode('-', $ip);
// C'est une plage d'adresse '-'
if (isset($tabPlages[1]))
$connected = $this->in_plage($tabPlages[0],$tabPlages[1],$adresseIP);
else {
// C'est une adresse avec ou sans masque '*'
if (preg_match('/^'.str_replace('*','.*',str_replace('.','\.',$ip)).'$/', $adresseIP) )
$connected=true;
}
if ($connected) break;
}
if (count($tabIpAllowed)==0) return false;
elseif (!$connected) {
return false;
}
return true;
}
/**
* Enter description here ...
* @param unknown_type $plage_1
* @param unknown_type $plage_2
* @param unknown_type $ip
* @return boolean
*/
protected function in_plage($plage_1,$plage_2,$ip)
{
$ip2 = $this->getIpNumber($ip);
if ($ip2>=$this->getIpNumber($plage_1) && $ip2<=$this->getIpNumber($plage_2))
return true;
else
return false;
}
/**
* Converti une IP en nombre
* @param string $ip Adresse IP
* @return integer
*/
protected function getIpNumber($ip)
{
$tab=explode('.', $ip);
return (($tab[0]*256*256*256) + ($tab[1]*256*256) + ($tab[2]*256) + ($tab[3]));
}
}

File diff suppressed because one or more lines are too long

View File

@ -1368,8 +1368,7 @@ class IdentiteEntreprise
if($i==2) break;
}
switch($i){
case 0: $unite = ' '; break;
case 1: $unite = ' K'; break;
case 1: $unite = ' K'; break;
case 2: $unite = ' M'; break;
}
return number_format($number, 0, '', ' ').$unite;

View File

@ -1,186 +0,0 @@
<?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;
}
}

View File

@ -1,87 +0,0 @@
<?php
/**
* Miscellaneous functions to clean string.
*/
class Scores_Locale_String
{
/**
* Clean up a string value.
*
* Resulting string contains only alphanumerics and separators.
*
* @param $string
* A string to clean.
* @param $clean_slash
* Whether to clean slashes from the given string.
* @return
* The cleaned string.
*/
public static function cleanstring($string)
{
$transliterate = TRUE;
$reduce_ascii = FALSE;
$output = $string;
// Remove accents and transliterate
if ($transliterate) {
static $i18n_loaded = false;
static $translations = array();
if (!$i18n_loaded) {
$path = realpath(dirname(__FILE__));
if (is_file($path .'/i18n-ascii.txt')) {
$translations = parse_ini_file($path .'/String/i18n-ascii.txt');
}
$i18n_loaded = true;
}
$output = strtr($output, $translations);
}
// Reduce to the subset of ASCII96 letters and numbers
if ($reduce_ascii) {
$pattern = '/[^a-zA-Z0-9\/]+/ ';
$output = preg_replace($pattern, $separator, $output);
}
return $output;
}
public static function cleanutf8($string)
{
$transliterate = TRUE;
$output = $string;
// Remove accents and transliterate
if ($transliterate) {
static $i18n_loaded = false;
static $translations = array();
if (!$i18n_loaded) {
$path = realpath(dirname(__FILE__));
if (is_file($path .'/i18n-ascii.txt')) {
$translations = parse_ini_file($path .'/String/i18n-ascii.txt');
}
$i18n_loaded = true;
}
$output = strtr($output, $translations);
}
return $output;
}
// Fixes the encoding to uf8
public static function fixEncoding($in_str)
{
$cur_encoding = mb_detect_encoding($in_str) ;
if($cur_encoding == "UTF-8" && mb_check_encoding($in_str,"UTF-8"))
return $in_str;
else
return utf8_encode($in_str);
} // fixEncoding
public static function cleanstring_deep($value)
{
$value = is_array($value) ?
array_map('self::cleanstring_deep', $value) :
cleanstring($value);
return $value;
}
}

View File

@ -1,564 +0,0 @@
; global transliteration
[default]
À = "A"
Á = "A"
 = "A"
à = "A"
Ä = "Ae"
Å = "A"
Æ = "A"
Ā = "A"
Ą = "A"
Ă = "A"
Ç = "C"
Ć = "C"
Č = "C"
Ĉ = "C"
Ċ = "C"
Ď = "D"
Đ = "D"
È = "E"
É = "E"
Ê = "E"
Ë = "E"
Ē = "E"
Ę = "E"
Ě = "E"
Ĕ = "E"
Ė = "E"
Ĝ = "G"
Ğ = "G"
Ġ = "G"
Ģ = "G"
Ĥ = "H"
Ħ = "H"
Ì = "I"
Í = "I"
Î = "I"
Ï = "I"
Ī = "I"
Ĩ = "I"
Ĭ = "I"
Į = "I"
İ = "I"
IJ = "IJ"
Ĵ = "J"
Ķ = "K"
Ľ = "K"
Ĺ = "K"
Ļ = "K"
Ŀ = "K"
Ł = "L"
Ñ = "N"
Ń = "N"
Ň = "N"
Ņ = "N"
Ŋ = "N"
Ò = "O"
Ó = "O"
Ô = "O"
Õ = "O"
Ö = "Oe"
Ø = "O"
Ō = "O"
Ő = "O"
Ŏ = "O"
Œ = "OE"
Ŕ = "R"
Ř = "R"
Ŗ = "R"
Ś = "S"
Ş = "S"
Ŝ = "S"
Ș = "S"
Š = "S"
Ť = "T"
Ţ = "T"
Ŧ = "T"
Ț = "T"
Ù = "U"
Ú = "U"
Û = "U"
Ü = "Ue"
Ū = "U"
Ů = "U"
Ű = "U"
Ŭ = "U"
Ũ = "U"
Ų = "U"
Ŵ = "W"
Ŷ = "Y"
Ÿ = "Y"
Ý = "Y"
Ź = "Z"
Ż = "Z"
Ž = "Z"
à = "a"
á = "a"
â = "a"
ã = "a"
ä = "ae"
ā = "a"
ą = "a"
ă = "a"
å = "a"
æ = "ae"
ç = "c"
ć = "c"
č = "c"
ĉ = "c"
ċ = "c"
ď = "d"
đ = "d"
è = "e"
é = "e"
ê = "e"
ë = "e"
ē = "e"
ę = "e"
ě = "e"
ĕ = "e"
ė = "e"
ƒ = "f"
ĝ = "g"
ğ = "g"
ġ = "g"
ģ = "g"
ĥ = "h"
ħ = "h"
ì = "i"
í = "i"
î = "i"
ï = "i"
ī = "i"
ĩ = "i"
ĭ = "i"
į = "i"
ı = "i"
ij = "ij"
ĵ = "j"
ķ = "k"
ĸ = "k"
ł = "l"
ľ = "l"
ĺ = "l"
ļ = "l"
ŀ = "l"
ñ = "n"
ń = "n"
ň = "n"
ņ = "n"
ʼn = "n"
ŋ = "n"
ò = "o"
ó = "o"
ô = "o"
õ = "o"
ö = "oe"
ø = "o"
ō = "o"
ő = "o"
ŏ = "o"
œ = "oe"
ŕ = "r"
ř = "r"
ŗ = "r"
ś = "s"
š = "s"
ş = "s"
ť = "t"
ţ = "t"
ù = "u"
ú = "u"
û = "u"
ü = "ue"
ū = "u"
ů = "u"
ű = "u"
ŭ = "u"
ũ = "u"
ų = "u"
ŵ = "w"
ÿ = "y"
ý = "y"
ŷ = "y"
ż = "z"
ź = "z"
ž = "z"
ß = "ss"
ſ = "ss"
Α = "A"
Ά = "A"
Ἀ = "A"
Ἁ = "A"
Ἂ = "A"
Ἃ = "A"
Ἄ = "A"
Ἅ = "A"
Ἆ = "A"
Ἇ = "A"
ᾈ = "A"
ᾉ = "A"
ᾊ = "A"
ᾋ = "A"
ᾌ = "A"
ᾍ = "A"
ᾎ = "A"
ᾏ = "A"
Ᾰ = "A"
Ᾱ = "A"
Ὰ = "A"
Ά = "A"
ᾼ = "A"
Β = "B"
Γ = "G"
Δ = "D"
Ε = "E"
Έ = "E"
Ἐ = "E"
Ἑ = "E"
Ἒ = "E"
Ἓ = "E"
Ἔ = "E"
Ἕ = "E"
Έ = "E"
Ὲ = "E"
Ζ = "Z"
Η = "I"
Ή = "I"
Ἠ = "I"
Ἡ = "I"
Ἢ = "I"
Ἣ = "I"
Ἤ = "I"
Ἥ = "I"
Ἦ = "I"
Ἧ = "I"
ᾘ = "I"
ᾙ = "I"
ᾚ = "I"
ᾛ = "I"
ᾜ = "I"
ᾝ = "I"
ᾞ = "I"
ᾟ = "I"
Ὴ = "I"
Ή = "I"
ῌ = "I"
Θ = "TH"
Ι = "I"
Ί = "I"
Ϊ = "I"
Ἰ = "I"
Ἱ = "I"
Ἲ = "I"
Ἳ = "I"
Ἴ = "I"
Ἵ = "I"
Ἶ = "I"
Ἷ = "I"
Ῐ = "I"
Ῑ = "I"
Ὶ = "I"
Ί = "I"
Κ = "K"
Λ = "L"
Μ = "M"
Ν = "N"
Ξ = "KS"
Ο = "O"
Ό = "O"
Ὀ = "O"
Ὁ = "O"
Ὂ = "O"
Ὃ = "O"
Ὄ = "O"
Ὅ = "O"
Ὸ = "O"
Ό = "O"
Π = "P"
Ρ = "R"
Ῥ = "R"
Σ = "S"
Τ = "T"
Υ = "Y"
Ύ = "Y"
Ϋ = "Y"
Ὑ = "Y"
Ὓ = "Y"
Ὕ = "Y"
Ὗ = "Y"
Ῠ = "Y"
Ῡ = "Y"
Ὺ = "Y"
Ύ = "Y"
Φ = "F"
Χ = "X"
Ψ = "PS"
Ω = "O"
Ώ = "O"
Ὠ = "O"
Ὡ = "O"
Ὢ = "O"
Ὣ = "O"
Ὤ = "O"
Ὥ = "O"
Ὦ = "O"
Ὧ = "O"
ᾨ = "O"
ᾩ = "O"
ᾪ = "O"
ᾫ = "O"
ᾬ = "O"
ᾭ = "O"
ᾮ = "O"
ᾯ = "O"
Ὼ = "O"
Ώ = "O"
ῼ = "O"
α = "a"
ά = "a"
ἀ = "a"
ἁ = "a"
ἂ = "a"
ἃ = "a"
ἄ = "a"
ἅ = "a"
ἆ = "a"
ἇ = "a"
ᾀ = "a"
ᾁ = "a"
ᾂ = "a"
ᾃ = "a"
ᾄ = "a"
ᾅ = "a"
ᾆ = "a"
ᾇ = "a"
ὰ = "a"
ά = "a"
ᾰ = "a"
ᾱ = "a"
ᾲ = "a"
ᾳ = "a"
ᾴ = "a"
ᾶ = "a"
ᾷ = "a"
β = "b"
γ = "g"
δ = "d"
ε = "e"
έ = "e"
ἐ = "e"
ἑ = "e"
ἒ = "e"
ἓ = "e"
ἔ = "e"
ἕ = "e"
ὲ = "e"
έ = "e"
ζ = "z"
η = "i"
ή = "i"
ἠ = "i"
ἡ = "i"
ἢ = "i"
ἣ = "i"
ἤ = "i"
ἥ = "i"
ἦ = "i"
ἧ = "i"
ᾐ = "i"
ᾑ = "i"
ᾒ = "i"
ᾓ = "i"
ᾔ = "i"
ᾕ = "i"
ᾖ = "i"
ᾗ = "i"
ὴ = "i"
ή = "i"
ῂ = "i"
ῃ = "i"
ῄ = "i"
ῆ = "i"
ῇ = "i"
θ = "th"
ι = "i"
ί = "i"
ϊ = "i"
ΐ = "i"
ἰ = "i"
ἱ = "i"
ἲ = "i"
ἳ = "i"
ἴ = "i"
ἵ = "i"
ἶ = "i"
ἷ = "i"
ὶ = "i"
ί = "i"
ῐ = "i"
ῑ = "i"
ῒ = "i"
ΐ = "i"
ῖ = "i"
ῗ = "i"
κ = "k"
λ = "l"
μ = "m"
ν = "n"
ξ = "ks"
ο = "o"
ό = "o"
ὀ = "o"
ὁ = "o"
ὂ = "o"
ὃ = "o"
ὄ = "o"
ὅ = "o"
ὸ = "o"
ό = "o"
π = "p"
ρ = "r"
ῤ = "r"
ῥ = "r"
σ = "s"
ς = "s"
τ = "t"
υ = "y"
ύ = "y"
ϋ = "y"
ΰ = "y"
ὐ = "y"
ὑ = "y"
ὒ = "y"
ὓ = "y"
ὔ = "y"
ὕ = "y"
ὖ = "y"
ὗ = "y"
ὺ = "y"
ύ = "y"
ῠ = "y"
ῡ = "y"
ῢ = "y"
ΰ = "y"
ῦ = "y"
ῧ = "y"
φ = "f"
χ = "x"
ψ = "ps"
ω = "o"
ώ = "o"
ὠ = "o"
ὡ = "o"
ὢ = "o"
ὣ = "o"
ὤ = "o"
ὥ = "o"
ὦ = "o"
ὧ = "o"
ᾠ = "o"
ᾡ = "o"
ᾢ = "o"
ᾣ = "o"
ᾤ = "o"
ᾥ = "o"
ᾦ = "o"
ᾧ = "o"
ὼ = "o"
ώ = "o"
ῲ = "o"
ῳ = "o"
ῴ = "o"
ῶ = "o"
ῷ = "o"
¨ = ""
΅ = ""
᾿ = ""
= ""
῍ = ""
῝ = ""
῎ = ""
῞ = ""
῏ = ""
῟ = ""
= ""
῁ = ""
΄ = ""
΅ = ""
= ""
῭ = ""
ͺ = ""
= ""
А = "A"
Б = "B"
В = "V"
Г = "G"
Д = "D"
Е = "E"
Ё = "E"
Ж = "ZH"
З = "Z"
И = "I"
Й = "I"
К = "K"
Л = "L"
М = "M"
Н = "N"
О = "O"
П = "P"
Р = "R"
С = "S"
Т = "T"
У = "U"
Ф = "F"
Х = "KH"
Ц = "TS"
Ч = "CH"
Ш = "SH"
Щ = "SHCH"
Ы = "Y"
Э = "E"
Ю = "YU"
Я = "YA"
а = "A"
б = "B"
в = "V"
г = "G"
д = "D"
е = "E"
ё = "E"
ж = "ZH"
з = "Z"
и = "I"
й = "I"
к = "K"
л = "L"
м = "M"
н = "N"
о = "O"
п = "P"
р = "R"
с = "S"
т = "T"
у = "U"
ф = "F"
х = "KH"
ц = "TS"
ч = "CH"
ш = "SH"
щ = "SHCH"
ы = "Y"
э = "E"
ю = "YU"
я = "YA"
Ъ = ""
ъ = ""
Ь = ""
ь = ""
ð = "d"
Ð = "D"
þ = "th"
Þ = "TH"

View File

@ -1,2 +0,0 @@
[default]
№ = "N°"

View File

@ -1,130 +0,0 @@
<?php
class Scores_Mail_Method extends Zend_Mail
{
protected $config;
protected $transport;
/**
* Gestion de l'envoi des mails en fonction de la configuration
* Fournir un objet de configuration ou utiliser la configuration de l'application
* method => smtp, sendmail, file
* Si method = smtp
* (host => IP, dns)
*
* Activer l'authentification
* (auth => login, plain, ....)
* (username => )
* (password => )
*/
public function __construct( $config = null )
{
if ($config === null) {
$c = Zend_Registry::get('config');
$this->config = $c->profil->mail;
} else {
$this->config = $config;
}
$this->_charset = 'ISO-8859-15';
// --- Configuration du transport SMTP
if ( $this->config->method == 'smtp' ) {
$config = array();
if ( isset($this->config->auth) ) {
$config['auth'] = $this->config->auth;
if ( isset($this->config->username) ) {
$config['username'] = $this->config->username;
}
if ( isset($this->config->password) ) {
$config['password'] = $this->config->password;
}
}
if ( isset($this->config->port) ) {
$config['port'] = $this->config->port;
}
$tr = new Zend_Mail_Transport_Smtp($this->config->host, $config);
}
// --- Configuration transport Sendmail
if ( $this->config->method == 'sendmail' ) {
$tr = new Zend_Mail_Transport_Sendmail();
}
// --- Configuration transport File
if ( $this->config->method == 'file' ) {
$tr = new Zend_Mail_Transport_File(array('callback' => array($this, 'recipientFilename')));
}
$this->transport = $tr;
}
/**
* Champ From en fonction de la clé de configuration
* @param string $configKey
*/
public function setFromKey($configKey)
{
$email = $this->config->email->$configKey;
$this->setFrom($email, ucfirst($configKey));
}
/**
* Champ To en fonction de la clé de configuration
* @param string $configKey
*/
public function addToKey($configKey)
{
$email = $this->config->email->$configKey;
$this->addTo($email, ucfirst($configKey));
}
/**
* Définit le sujet de l'email
* @param string $texte
*/
public function setSubjectC($texte = '')
{
$this->setSubject($this->txtConvert($texte));
}
/**
* Définit le corps de l'email au format texte
* @param string $texte
*/
public function setBodyTextC($texte = '')
{
$this->setBodyText($this->txtConvert($texte));
}
/**
* Définit le corps de l'email au format html
* @param string $html
*/
public function setBodyHtmlC($html = '')
{
$this->setBodyHtml($this->txtConvert($html));
}
/**
* Envoi de l'emai
*/
public function execute()
{
return $this->send($this->transport);
}
//We suppose that character encoding of strings is UTF-8 on PHP script.
protected function txtConvert($string)
{
return mb_convert_encoding($string, 'ISO-8859-15', 'UTF-8');
}
protected function recipientFilename($transport)
{
return $transport->recipients . '_' . mt_rand() . '.tmp';
}
}

View File

@ -1,54 +0,0 @@
<?php
class Scores_Wkhtml_Pdf
{
protected $wkhtml;
public function __construct()
{
$c = Zend_Registry::get('config');
$this->wkhtml = $c->profil->wkhtmltopdf->path;
}
/**
* Défini les options supplémentaires à l'execution de wkhtmltopdf
* -n, --disable-javascript Do not allow webpages to run javascript.
* --disable-internal-links Do no make local links
* --disable-external-links Do no make links to remote web pages
* --user-style-sheet <url> Specify a user style sheet, to load with every page.
* --print-media-type Use print media-type instead of screen.
* --header-left|right
* @param string $name
* @param string $value
*/
public function setOptions($name, $value = '')
{
$this->options[$name] = $value;
}
/**
* Imprime un fichier HTML en PDF avec l'utilitaire wkhtmltopdf
* @param string $fileIn
* @param string $fileOut
* @return string Nom du fichier
*/
public function exec($fileIn, $fileOut = '')
{
if (empty($fileOut)) {$fileOut = str_replace('.html', '.pdf', $fileIn); }
if(file_exists($fileOut)){ unlink($fileOut); }
$options = '--print-media-type';
$options.= ' --disable-internal-links';
if ( count($this->options) )
{
foreach ( $this->options as $name => $value )
{
$options.= ' --'.$name;
if ($value!= '') $options.= ' "'.$value.'"';
}
}
$cmd = $this->wkhtml.' '.$options.' "'.$fileIn.'" "'.$fileOut.'"';
exec( $cmd );
return $fileOut;
}
}

View File

@ -10,15 +10,5 @@ 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',
),
)
);

View File

@ -1 +0,0 @@
@import url("./../../../libs/bootstrap-3.3.7/css/bootstrap.min.css");