Import change and correction after the staging release

This commit is contained in:
Michael RICOIS 2013-11-06 16:26:14 +00:00
parent dcaae4acfc
commit 5b5270159c
10 changed files with 71 additions and 472 deletions

View File

@ -1821,7 +1821,7 @@ class SaisieController extends Zend_Controller_Action
$date = new Zend_Date($identite->Bilan->Cloture, 'yyyyMMdd');
$dateCapital = $date->toString('dd/MM/yyyy');
}
$infos = array(
'siren' => $siren,
'actif' => 1,
@ -1896,8 +1896,8 @@ class SaisieController extends Zend_Controller_Action
if (!file_exists($path)) { mkdir($path); }
$date = new Zend_Date($params['fileDate'],'yyyyMMdd');
$name = 'INTERNE-'.$params['idNum'].'-'.$params['fileType'].'-'.$date->toString('dd/MM/yyyy');
$date = new Zend_Date($params['fileDate'],'dd/MM/yyyy');
$name = 'INTERNE-'.$params['idNum'].'-'.$params['fileType'].'-'.$date->toString('yyyyMMdd');
$n = $_FILES['fichier']['name'];
$s = $_FILES['fichier']['size'];
@ -1918,7 +1918,7 @@ class SaisieController extends Zend_Controller_Action
'idNum' => $params['idNum'],
'periDoc' => $params['periDoc'],
'docRef' => $name,
'dateDocRef' => $date,
'dateDocRef' => $date->toString('yyyyMMdd'),
);
$ws = new WsScores();

View File

@ -1,92 +1,51 @@
<style type="text/css">
ul.relation {
list-style-type: none;
}
ul.relation li {
clear: both;
}
.banque {
text-decoration: underline;
width: 35%;
float: left;
margin-bottom: 10px;
}
.adresse {
width: 30%;
float: left;
margin-bottom: 10px;
}
.codeBanque {
width: 10%;
float: left
}
.codeGuichet {
width: 10%;
float: left;
}
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
</style>
<div id="center">
<h1 class="titre">RELATIONS BANCAIRES</h1>
<div class="paragraph">
<table class="identite">
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">
Num&eacute;ro identifiant Siren
</td>
<td width="350" class="StyleInfoData">
<?=$this->SirenTexte($this->siren)?>
</td>
</tr>
<tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Num&eacute;ro identifiant Siren</td>
<td width="350" class="StyleInfoData"><?=$this->SirenTexte($this->siren)?></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Raison Sociale</td>
<td width="350" class="StyleInfoData"><?=$this->raisonSociale?></td>
</tr>
</tr>
</table>
</div>
<h2>Liste des relations bancaires</h2>
<div class="paragraph">
<?php
if(count($this->banques)>0)
{
?>
<ul class="relation clearfix">
<?php
foreach($this->banques as $relation)
{
?>
<li>
<div class="banque"><?=$relation->libBanque?></div>
<div class="adresse"><?php if($relation->adresse1!='') {?>
<?=$relation->adresse1?><br />
<?php } ?> <?php if($relation->adresse2!='') {?>
<?=$relation->adresse2?><br />
<?php } ?> <?=$relation->cp?> <?=$relation->ville?></div>
<div class="codeBanque"><?php if( $relation->codeBanque*1!=0 ){ echo $relation->codeBanque; } ?></div>
<div class="codeGuichet"><?php if( $relation->codeGuichet*1!=0 ){ echo $relation->codeGuichet; }?></div>
</li>
<?php
}
?>
</ul>
<?php
} else {
?>
<?php if(count($this->banques)>0) { ?>
<table class="data">
<thead>
<tr>
<th>Nom de la Banque</th>
<th>Adresse</th>
<th>Code Banque</th>
<th>Code Guichet</th>
</tr>
</thead>
<tbody>
<?php foreach($this->banques as $relation) { ?>
<tr>
<td valign="top" style="text-decoration:underline;"><?=$relation->libBanque?></td>
<td>
<?php if($relation->adresse1!='') {?>
<?=$relation->adresse1?><br />
<?php } ?>
<?php if($relation->adresse2!='') {?>
<?=$relation->adresse2?><br />
<?php } ?> <?=$relation->cp?> <?=$relation->ville?>
</td>
<td align="center"><?php if( $relation->codeBanque*1!=0 ){ echo $relation->codeBanque; } ?></td>
<td align="center"><?php if( $relation->codeGuichet*1!=0 ){ echo $relation->codeGuichet; }?></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php } else { ?>
<p>Aucune information.</p>
<?php } ?>
</div>

View File

@ -3,6 +3,8 @@ README
- System Requirements
- Installation
- Project
- Library
Note : Project are define to be use on Linux Server, so take care about path and file name.
Also some script (CLI) don't work on Windows.
@ -11,12 +13,12 @@ Note : Project are define to be use on Linux Server, so take care about path and
SYSTEM REQUIREMENTS
===================
- Apache 2.2
- PHP 5.3.x
- APC
- Chartdir library
- browscap.ini (http://tempdownloads.browserscap.com/, http://browscap.org/)
- wkhtmltopdf (http://code.google.com/p/wkhtmltopdf/)
- Apache 2.2
- PHP 5.3.x
- APC
- Chartdir library
- browscap.ini (http://tempdownloads.browserscap.com/, http://browscap.org/)
- wkhtmltopdf (http://code.google.com/p/wkhtmltopdf/)
INSTALLATION
@ -146,11 +148,14 @@ Partners
PROJECT
=======
This application is a frontend for the WebService and it's display information graphically.
LIBRARY
=======

View File

@ -634,12 +634,12 @@ class Infogreffe
Zend_Registry::get('firebug')->info($result);
$fichier = $this->pathData.$this->actePath($ref).$result->file;
Zend_Registry::get('firebug')->info($fichier);
$dateDepot = new Zend_Date($depot['date_depot'],'yyyy-MM-dd');
if ( file_exists($fichier) )
{
Zend_Registry::get('firebug')->info($acte);
if ($result->type != $acte['type_acte'] && $result->type2 == '') {
Zend_Registry::get('firebug')->info('Update Database');
$dateDepot = new Zend_Date($depot['date_depot'],'yyyy-MM-dd');
//Add to the database
try {
$actesM->update(array(
@ -702,7 +702,7 @@ class Infogreffe
$tabActe['type'] = $acte['type_acte'];
$tabActe['type_lib'] = $acte['type_acte_libelle'];
$tabActe['decision'] = $acte['decision']['libelle'];
$tabActe['date_acte'] = ($date!='') ? $dateF->toString('dd/MM/yyyy') : '';
$tabActe['date_acte'] = $dateF->toString('dd/MM/yyyy');
$tabActe['mode'] = $mode;
$tabActe['ref'] = $ref;

View File

@ -228,8 +228,12 @@ class Annonces
*/
protected function dateAnnonce($date)
{
$dateS = new Zend_Date($date, 'yyyy-MM-dd');
return $dateS->toString('dd/MM/yyyy');
if ( $date!='' ) {
$dateS = new Zend_Date($date, 'yyyy-MM-dd');
return $dateS->toString('dd/MM/yyyy');
}
return '';
}
protected function logoTitleAnnonce($ann)

View File

@ -531,12 +531,14 @@ class IdentiteEntreprise
public function getDateCreaEnTexte()
{
$dateCreationEn = str_replace('-', '', $this->identite->DateCreaEn);
if (substr($dateCreationEn, -2) * 1 == 0) {
$date = new Zend_Date($dateCreationEn, 'yyyyMMdd');
$data = $date->toString('MM/yyyy');
} else {
$date = new Zend_Date($dateCreationEn, 'yyyyMMdd');
$data = $date->toString('dd/MM/yyyy');
if ( $dateCreationEn!='' ) {
if (substr($dateCreationEn, -2) * 1 == 0) {
$date = new Zend_Date($dateCreationEn, 'yyyyMMdd');
$data = $date->toString('MM/yyyy');
} else {
$date = new Zend_Date($dateCreationEn, 'yyyyMMdd');
$data = $date->toString('dd/MM/yyyy');
}
}
return $data;
}

View File

@ -1,39 +0,0 @@
<?
class WChiffes {
private static $tabChiffresEnLEttres = array( 0=>'zéro',
1=>'un',
2=>'deux',
3=>'trois',
4=>'quatre',
5=>'cinq',
6=>'six',
7=>'sept',
8=>'huit',
9=>'neuf',
10=>'dix',
11=>'onze',
12=>'douze',
13=>'treize',
14=>'quatorze',
15=>'quinze',
16=>'seize',
17=>'dix sept',
18=>'dix huit',
19=>'dix neuf',
20=>'vingt',
30=>'trente',
40=>'quarante',
50=>'cinquante',
60=>'soixante',
70=>'soixante dix',
80=>'quatre vingt',
90=>'quatre vingt dix');
public function ChiffresEnLettres($chiffre) {
return array_search($chiffre, self::$tabChiffresEnLEttres);
}
}
?>

View File

@ -1,189 +0,0 @@
<?
/** Parse une page Html et retourne son contenu dans un tableau :
** "code" => Code réponse Serveur
** "header" => Headers du serveur
** "body" => Page HTML
**/
function parse_response($this_response)
{
// Split response into header and body sections
list($response_headers, $response_body) =
explode("\r\n\r\n", $this_response, 2);
$response_header_lines = explode("\r\n", $response_headers);
// First line of headers is the HTTP response code
$http_response_line = array_shift($response_header_lines);
if (preg_match('@^HTTP/[0-9]\.[0-9] ([0-9]{3})@', $http_response_line,
$matches)) {
$response_code = $matches[1];
}
// put the rest of the headers in an array
$response_header_array = array();
$nbRMID = 0;
foreach ($response_header_lines as $header_line) {
$e_header_line = explode(': ', $header_line, 2);
if(count($e_header_line)>1){
list($header, $value) = $e_header_line;
}else{
list($header) = $e_header_line;
}
if (isset($header) == false || isset($value) == false) {
continue;
}
if ($header == 'Set-cookie' &&
substr($value,0,5) == 'RMID=' && $nbRMID < 5) {
// echo ("Je gicle le RMID n°$nbRMID\r\n");}
$nbRMID++;
} else {
if (isset($response_header_array[$header]) == false) {
$response_header_array[$header] = '';
}
$response_header_array[$header] .= $value."\n";
}
}
return array('code' => $response_code,
'header' => $response_header_array,
'body' => $response_body);
}
/** Récupère une page HTML en fonction des paramètres :
** $url Url distante de la page à récupérer
** $strCookies Chaine de caractère contenant les cookies
** $postData Tableau des données à passer en POST uniquement
** $referer Referer à indiquer lors de l'appel de la page
** $debug Activer le débogage (True/False)
**
** ... et retourne son contenu dans un tableau :
** "code" => Code réponse Serveur
** "header" => Headers du serveur
** "body" => Page HTML
**/
function getUrl($url, $strCookies='', $postData='', $referer='', $debug=false, $host='', $proxy='', $timeout=0, $acceptRedir=0) {
$ch = curl_init();
if ($host=='') {
$tabTmp = parse_url($url);
$hostUrl = $tabTmp['host'];
$this_header = array('Host: '. $hostUrl);
} else
$this_header = array('Host: '. $host);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 1);
if ($proxy<>'') curl_setopt($ch, CURLOPT_PROXY, $proxy);
//curl_setopt($ch, CURLOPT_PROXYUSERPWD, 'username:password'); // Pas nécessaire en authentification NT
if (((int)$timeout)<>0) curl_setopt($ch, CURLOPT_TIMEOUT, (int)$timeout);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if ($acceptRedir>0) {
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_MAXREDIRS, $acceptRedir);
}
$user_agent = 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)';
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_REFERER, $referer);
// Add each cookie that has been returned in the response
// If cookies need to be added/deleted or value changed, then add code here
if ($strCookies!='') {
//die('"'.$strCookies.'"');
//echo $strCookies."\r\n";
$cookies = explode("\n", $strCookies);
// Create the basic header
foreach($cookies as $this_cookie) {
if (trim($this_cookie)<>'')
array_push($this_header, 'Cookie: '.$this_cookie);
}
}
if ($postData!='') {
if (is_array($postData))
$post_data=$postData;
$o="";
foreach ($post_data as $k=>$v)
{
$o.= "$k=".utf8_encode($v)."&";
}
$post_data=substr($o,0,-1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
//if in_array('',$this_header
/*array_push($this_header, "Content-type: application/x-www-form-urlencoded");
array_push($this_header, "Content-Length: 44");*/
}
curl_setopt($ch, CURLOPT_HTTPHEADER, $this_header);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
//print_r($this_header);
$page=curl_exec($ch);
if($page === false) {
if (curl_errno($ch) == 28) //TIMEOUT
$response=array('code' =>408, 'header' =>array(), 'body' =>'Connexion impossible au site du partenaire');
else
$response=array('code' =>400, 'header' =>array(), 'body' =>'Erreur Curl : ' . curl_error($ch));
} else {
$response = parse_response($page);
}
if ($debug){
$url2=str_replace('http://', '', $url);
$url2=str_replace('/', '_', $url2);
$url2=str_replace('?', '(param)', $url2);
$url2=str_replace('&', '(et)', $url2);
$fp=fopen('insee/'. date('Ymd-His') .'-'. microtime_float(true) .'-'. $url2 . '.html', 'a');
fwrite($fp, $url."\r\n");
fwrite($fp, $page);
fclose($fp);
//echo strip_tags(html_entity_decode($response['body']), '<td>');
}
//print_r(curl_getinfo($ch));
curl_close($ch);
return $response;
}
/** Recherche un texte dans une page HTML
**
**/
function getTextInHtml($pageHtml, $strToFind, $strDeb, $strEnd, $include_strDeb=false, $include_strEnd=false, $ltrim=true, $rtrim=true, &$fin, $nbOcc=1) {
$tabRet=array();
$deb=$nbOccTrouve=0;
while( is_int(($deb=strpos($pageHtml,$strToFind,$fin))) ) {
$deb++;
$deb2 = strpos($pageHtml,$strDeb, $deb);
$fin = strpos($pageHtml,$strEnd, $deb2);
if (!$include_strDeb)
$deb2+=strlen($strDeb);
$s_temp = substr($pageHtml, $deb2, ($fin-$deb2));
if ($ltrim) $s_temp=ltrim($s_temp);
if ($rtrim) $s_temp=rtrim($s_temp);
if ($nbOcc==1) return $s_temp;
//echo $s_temp."\r\n";
//$a_temp = explode('" class="basic">', $s_temp);
$tabUrl[$nbOccTrouve]=$s_temp;
$nbOccTrouve++;
if ($nbOcc==$nbOccTrouve) {
// echo "j'ai trouvé le nb demandé, je sort\r\n";
break;
};
}
return $tabUrl;
/*<span class="mongrasvert">
<li>Le type de voie a été modifié<br>
<li>L'orthographe du mot directeur a été modifiée<br>
<li>Le code postal a été forcé à partir du département et de la localité<br> </span>
*/
}
?>

View File

@ -1,144 +0,0 @@
<?
include_once('chiffres.php');
/**
* Classe de gestion des méthodes relatives à la date et à l'heure
*
* <p>détail de la classe</p>
*
* @name nom de la classe
* @author Nom de l'auteur <adresse@Email.dom>
* @link
* @copyright Prénom Nom Année
* @version 1.0.0
* @package Nom du package
*/
class WDate {
private static $tabMoisEnLettres = array( 1=>'Janvier',
2=>'Février',
3=>'Mars',
4=>'Avril',
5=>'Mai',
6=>'Juin',
7=>'Juillet',
8=>'Août',
9=>'Septembre',
10=>'Octobre',
11=>'Novembre',
12=>'Décembre');
/** Retourne le numéro du mois donné au format texte (janvier, mars, etc...)
* @param string Mois en toute lettres (janvier, mars, etc...)
* @return string Mois en Chiffe (1, 3, 12) / false en cas d'erreur
*/
public function getNumMois($moisEnLettres) {
foreach (self::$tabMoisEnLettres as $num=>$mois)
$tabMoisSansAccents[$num]=strtr($mois, 'ééû','eeu');
return array_search(ucfirst(strtolower(strtr($moisEnLettres, 'ééû','eeu'))), $tabMoisSansAccents);
}
/** Retourne le libellé nu numéro du mois passé en paramètre
* @param int $moisEnChiffre
* @return string Libellé du mois / false si le mois passé en paramètre est invalide
*/
public function getLibelleMois($moisEnChiffre) {
if ($moisEnChiffre>0 && $moisEnChiffre<13)
return self::$tabMoisEnLettres[$moisEnChiffre];
return false;
}
/**
* Conversion de formats de dates selon les formats de dates définits en php
* @param string Format de la date d'entrée
* @param string Format de la date de sortie
* @param string Date d'entrée
* @return string Date formatée
*/
public function dateT($formatIN, $formatOUT, $date)
{
$M='';
switch ($formatIN)
{
case 'd M Y':
$tmp=explode(' ', $date); $d=str_replace('1er', '1', $tmp[0]);
$m=getNumMois($tmp[1]); $Y=$tmp[2];
break;
case 'dMY':
$Y = substr($date,-4);
if (substr($date,0,3)=='1er') { $d=1; $posM=3; }
elseif (is_numeric(substr($date,1,1))) { $d=substr($date,0,2); $posM=2; }
else { $d=substr($date,0,1); $posM=1; }
$M = substr($date, $posM, strlen($date)-4-$posM);
$m = self::getNumMois($M);
break;
case 'Ymd':
$d = substr($date,6,2);
$m = substr($date,4,2);
$Y = substr($date,0,4);
break;
case 'Y-m-d':
$d = substr($date,8,2);
$m = substr($date,5,2);
$Y = substr($date,0,4);
break;
case 'd/m/Y':
$d = substr($date,0,2);
$m = substr($date,3,2);
$Y = substr($date,6,4);
break;
default: return $date;
}
if ($m*1>0 && $m*1<10) $m='0'.($m*1);
if ($d*1>0 && $d*1<10) $d='0'.($d*1);
switch ($formatOUT)
{
case 'd/m/Y': return $d.'/'.$m.'/'.$Y; break;
case 'm/Y': return $m.'/'.$Y; break;
//case 'M Y': return $this->tabMoisEnLettres[$m].' '.$Y; break;
case 'Y': return $Y; break;
case 'm': return $m; break;
case 'd': return $d; break;
case 'Ym': return $Y.$m; break;
case 'Ymd': return $Y.$m.$d; break;
case 'Y-m-d': return $Y.'-'.$m.'-'.$d; break;
case 'Y/m/d': return $Y.'/'.$m.'/'.$d; break;
default: return $date;
}
}
/** Calcul de la date après application de la période textuelle (deux ans, six mois, quinze jours, etc...)
* @todo Fonction ne fonctionnant qu'avec un chiffre en un seul mot du genre dix mais pas quatre vingt dix !!!
* @param date $dateIN au format Ymd
* @param string $period (ex : cinq mois, six ans, un jour)
* @return date
*/
function period2Days($dateIN, $period) {
$dateV=self::dateT('Ymd', 'Ymd', $dateIN);
if ($dateV<>$dateIN) return NULL;
$d=substr($dateIN,6,2);
$m=substr($dateIN,4,2);
$Y=substr($dateIN,0,4);
$period=trim(strtr($period, "-.,", ' '));
if ($period=='') return NULL;
$tabP=explode(' ', $period);
$chiffre=WChiffes::ChiffresEnLettres($tabP[0]);
switch (end($tabP)) {
case 'mois': $dateOUT=date('Ymd', mktime(0, 0, 0, $m+$chiffre, $d, $Y)); break;
case 'an':
case 'ans': $dateOUT=date('Ymd', mktime(0, 0, 0, $m, $d, $Y+$chiffre)); break;
case 'jour':
case 'jours': $dateOUT=date('Ymd', mktime(0, 0, 0, $m, $d+$chiffre, $Y)); break;
default: $dateOUT=NULL;
}
return $dateOUT;
}
}
?>

View File

@ -416,6 +416,7 @@ a:hover {color: #000066; text-decoration:none;}
table.identite {border-collapse:separate;border-spacing:4px;}
table.data {width:100%;}
table.data td {border:1px solid #ccc; padding:5px;}
table.data th {border:1px solid #ccc; padding:5px;}
.confidentiel {border-top:1px solid; padding-top:5px; font-style:italic; font-size:9px;}
.ui-dialog {text-align:left;}
.ui-widget {font-size: 1em;}