Merge from trunk

This commit is contained in:
Michael RICOIS 2015-04-09 13:48:14 +00:00
commit 041141eb8c
45 changed files with 1272 additions and 1019 deletions

View File

@ -0,0 +1,29 @@
<?php
class AccountController extends Zend_Controller_Action
{
/**
* Liste des clients
* Accès SuperAdmin uniquement
*/
public function clientsAction(){}
/**
* Fiche du client
* Accès administrateur
* Afficher du Commercial
* Liste des Services => utilisateurs, consommation, contrats
*/
public function clientAction()
{
}
/**
* Fiche du service
*/
public function serviceAction(){}
public function consoAction(){}
public function usersAction(){}
public function userAction(){}
}

View File

@ -688,128 +688,119 @@ class FinanceController extends Zend_Controller_Action
}
/**
* Envoi de bilan pour saisie
* L'envoi se déroule en plusieurs étapes
* 1 - Saisie des informations
* 2 - Validation du formulaire
* 3 -
* Commande de la saisie de bilan
* Enregistrement des caractéristiques, obtention référence commande puis upload fichier
*/
public function saisiebilanAction()
{
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$user = new Scores_Utilisateur();
$params = $request->getParams();
$request = $this->getRequest();
$user = new Scores_Utilisateur();
$params = $request->getParams();
$bilanSaisie = new Application_Model_BilanSaisie();
$this->view->assign('email', $user->getEmail());
$this->view->assign('siren', $params['siren']);
$ref = $params['ref'];
if ($request->isPost())
{
//Validation du formulaire
$valideField = true;
if ( empty($params['siren']))
{
$valideField = false;
}
if ( empty($params['dateCloture'])
&& !preg_match('/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}/', $params['dateCloture'])
&& !checkdate(substr($params['dateCloture'],3,2),substr($params['dateCloture'],0,2),substr($params['dateCloture'],6,2)))
{
$valideField = false;
}
if ( empty($params['dureeExercice']))
{
$valideField = false;
}
if ($valideField === true)
{
$ws = new Scores_Ws_Client('order', '0.1');
$parameters = new stdClass();
$parameters->siren = $params['siren'];
$parameters->date = substr($params['dateCloture'],6,4).'-'.substr($params['dateCloture'],3,2).'-'.substr($params['dateCloture'],0,2);
$parameters->type = $params['format'];
$parameters->source = 'extranet';
$parameters->private = $params['confidentiel'];
$result = $ws->setBilanInput($parameters);
if ($result === false) {
$this->view->msg = "Erreur lors de l'enregistrement des informations";
} else {
Zend_Registry::get('firebug')->info($result);
$this->view->ref = strtoupper($result);
$this->view->fileref = $params['siren'] . '_' . $params['format'] . '_' .
substr($params['dateCloture'],6,4) . substr($params['dateCloture'],3,2) .
substr($params['dateCloture'],0,2) . '_' . strtoupper($result);
$session = new Scores_Session_Entreprise($params['siren']);
$this->view->raisonSociale = $session->getRaisonSociale();
$this->view->bilanCloture = $params['dateCloture'];
$this->view->bilanDuree = $params['dureeExercice'];
switch($params['format']){
case 'C':
$this->view->type = 'consolidé';
break;
case 'N':
$this->view->type = 'réel normal (liasse 2050)';
break;
case 'S':
$this->view->type = 'simplifié (liasse 2033)';
break;
}
}
} else {
$this->view->msg = "Formulaire invalide.";
}
}
}
//Annulation de la saisie
if ($params['annule'])
{
$data = array( 'fichier' => '' );
$bilanSaisie->update($data, "ref='$ref'");
echo 'Saisie bilan annulé';
exit;
}
//Envoi du fichier @todo ça passe pas
elseif ($params['upload'])
{
if ( count($_FILES)==1 ){
$n = $_FILES['fichier']['name'];
$s = $_FILES['fichier']['size'];
$tmp_name = $_FILES['fichier']['tmp_name'];
//Vérifier que l'extension du fichier est bien correcte
$extValide = array('pdf', 'tiff');
$extension = strrchr($n,'.');
$extension = strtolower(substr($extension,1));
if ( in_array($extension, $extValide) ) {
//Lecture dans la bdd des informations
$infos = $bilanSaisie->getInfosBilan($ref);
$name = $infos['ref'].'-'.$infos['siren'].'.'.$extension;
$c = Zend_Registry::get('config');
$file = realpath($c->profil->path->data).'/bilanclient/'.$name;
if ( move_uploaded_file($tmp_name, $file) ){
$bilanSaisie->setFilename($ref, $name);
switch($infos['format']){
case 'C':
$type = 'consolidé';
break;
case 'N':
$type = 'réel normal';
break;
case 'S':
$type = 'simplifié';
break;
}
$session = new Scores_Session_Entreprise($params['siren']);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
$this->view->assign('size', filesize($file));
$this->view->assign('name', $name);
$this->view->assign('infos', $infos);
$this->view->assign('ref', $ref);
$this->view->assign('upload', true);
} else {
$this->view->assign('upload', false);
$this->view->assign('errMsg', "<br/>Erreur lors de l'envoi du fichier!");
}
} else {
$this->view->assign('upload', false);
$this->view->assign('errMsg', "Extension de fichier invalide.");
}
} else {
$this->view->assign('upload', false);
$this->view->assign('errMsg', "<br/>Erreur.");
}
$this->renderScript('finance/saisiebilan-upload.phtml');
}
//Validation du formulaire
elseif (isset($params['method']))
{
$valideField = true;
if ( empty($params['email'])) {
$valideField = false;
}
if ( empty($params['method'])) {
$valideField = false;
}
if ( empty($params['siren'])) {
$valideField = false;
}
if ( empty($params['dateCloture'])
&& !preg_match('/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}/', $params['dateCloture'])
&& checkdate(substr($params['dateCloture'],3,2),substr($params['dateCloture'],0,2),substr($params['dateCloture'],6,2))){
$valideField = false;
}
if ( empty($params['dureeExercice'])) {
$valideField = false;
}
if ($valideField){
$ref = $bilanSaisie->setInformations(
$user->getIdClient(),
$user->getId(),
$user->getLogin(),
$params['email'],
$params['method'],
$params['confidentiel'],
$params['siren'],
$params['dateCloture'],
$params['format'],
$params['dureeExercice']
);
$this->view->assign('ref', $ref);
if ($params['method']=='courrier'){
$this->renderScript('finance/saisiebilan-courrier.phtml');
} elseif ($params['method']=='fichier') {
$this->renderScript('finance/saisiebilan-upload.phtml');
}
}
}
public function saisiebilanupAction()
{
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$ref = $request->getParam('ref');
$fileref = $request->getParam('fileref');
if ($request->isPost()) {
if (count($_FILES)==1 ) {
$n = $_FILES['fichier']['name'];
$s = $_FILES['fichier']['size'];
$tmp_name = $_FILES['fichier']['tmp_name'];
//Vérifier que l'extension du fichier est bien correcte
$extValide = array('pdf', 'tiff');
$extension = strrchr($n,'.');
$extension = strtolower(substr($extension,1));
if ( in_array($extension, $extValide) ) {
$name = $fileref.'.'.$extension;
$c = Zend_Registry::get('config');
$file = realpath($c->profil->path->data).'/bilanclient/'.$name;
if ( move_uploaded_file($tmp_name, $file) ) {
$ws = new Scores_Ws_Client('order', '0.1');
$parameters = new stdClass();
$parameters->ref = $ref;
$parameters->filename = $name;
$result = $ws->setBilanInputFile($parameters);
$this->view->assign('upload', true);
$this->view->file = $name;
} else {
$this->view->assign('upload', false);
$this->view->assign('errMsg', "<br/>Erreur lors de l'envoi du fichier!");
}
} else {
$this->view->assign('upload', false);
$this->view->assign('errMsg', "Extension de fichier invalide.");
}
} else {
$this->view->assign('upload', false);
$this->view->assign('errMsg', "<br/>Erreur.");
}
}
}
/**

View File

@ -459,12 +459,13 @@ class IdentiteController extends Zend_Controller_Action
}
$marks[] = array(
'address' => $adresse,
'title' => $titre,
'text' => $texte,
'type' => $type,
'icon' => $icone,
'gps' => $gps,
'siret' => $siren.$etab->Nic,
'address' => $adresse,
'title' => $titre,
'text' => $texte,
'type' => $type,
'icon' => $icone,
'gps' => $gps,
);
}
Zend_Registry::get('firebug')->info($marks);
@ -673,7 +674,7 @@ class IdentiteController extends Zend_Controller_Action
}
$infos = $ws->getLiens($siren);
if (is_string($infos) || $infos === false) $this->_forward('soap', 'error');
if (is_string($infos) || $infos === false) $this->forward('soap', 'error');
}
if (isset($session)) {
@ -2004,19 +2005,13 @@ class IdentiteController extends Zend_Controller_Action
}
$pdf->setColorArray('text', array(0,0,0));
$pdf->Cell(0, 0, "Dénomination sociale : ".$Nom, 0, 1, 'L');
if( empty($Sigle) ) {
$pdf->Cell(0, 0, "Sigle : -", 0, 1, 'L');
} else {
if( !empty($Sigle) ) {
$pdf->Cell(0, 0, "Sigle : ".$Sigle, 0, 1, 'L');
}
if( empty($Enseigne) ) {
$pdf->Cell(0, 0, "Enseigne : -", 0, 1, 'L');
} else {
if( !empty($Enseigne) ) {
$pdf->Cell(0, 0, "Enseigne : ".$Enseigne, 0, 1, 'L');
}
if( empty($NomCommercial) ) {
$pdf->Cell(0, 0, "Nom Commercial : -", 0, 1, 'L');
} else {
if( !empty($NomCommercial) ) {
$pdf->Cell(0, 0, "Nom Commercial : ".$NomCommercial, 0, 1, 'L');
}
$pdf->Cell(0, 0, "Numéro d'identification : ".$Siren." RCS ".$Tribunal, 0, 1, 'L');
@ -2122,6 +2117,15 @@ class IdentiteController extends Zend_Controller_Action
$pdf->Cell(0, 0, "", 0, 1, 'L');
$pdf->Cell(0, 0, "Fin de l'avis de situation", 0, 1, 'C');
$pdf->Cell(0, 0, "", 0, 1, 'L');
$avertissement = "Les données figurant dans le présent avis RNCS sont (à l'exception de l'activité ".
"déclarée au BODACC) exclusivement issues du RNCS. L'avis de situation RNCS n'a pas la vocation ".
"à ce soustraire à un kbis qui demeure la seule pièce officielle opposable lors d'une procédure ".
"judiciaire (kbis original de moins de 3 mois sur papier tramée avec sceau du Greffe).";
$pdf->SetFont('times', 'I', 8);
$pdf->MultiCell(0, 0, $avertissement, 0, 'L', 0, 1);
$pdf->Cell(0, 0, "", 0, 1, 'L');
$cgu = "Informations légales issues des données du Registre National du Commerce et des Sociétés".
"issues de licence 2 dite de distribution RNCS IMR pour Scores & Decisions SAS contractée le 20 novembre 2009\n".
"Scores & Decisions SAS est rediffuseur officiel du RNCS et propose un service privé, distinct du Registre public cité.";

View File

@ -32,64 +32,75 @@ class PiecesController extends Zend_Controller_Action
*/
public function cmdassociationAction()
{
$user = new Scores_Utilisateur();
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$email = $request->getParam('email', '');
$reference = $request->getParam('reference');
if (empty($email)) {
$message="ERREUR : Veuillez saisir une adresse email valide pour la commande de pièces.";
} elseif (empty($reference)) {
$message="ERREUR : Veuillez saisir une référence pour la commande de pièces.";
} else {
$c = Zend_Registry::get('config');
$fp=fopen(realpath($c->profil->path->data).'/log/commande_asso.csv', 'a');
fwrite($fp, date('Y/m/d H:i:s').";$siren;".$email.';'.$login.';'.$user->getEmail().';'.$user->getIpAddress()."\n");
fclose($fp);
$siren = substr($this->siret, 0, 9);
$infoAsso = new stdClass();
$infoAsso->siren = $siren;
$infoAsso->waldec = '';
$infoAsso->idEntreprise = $this->id;
$infoAsso->raisonSociale = $session->getRaisonSociale();
$infoDemande = new stdClass();
$infoDemande->reference = $request->getParam('reference');
$infoDemande->email = $email;
$infoDemande->tel = $request->getParam('tel');
$infoDemande->fax = '';
$infoDemande->nom = '';
$infoDemande->service = '';
$infoDemande->societe = '';
$infoDemande->adresse = '';
$infoDemande->cp = '';
$infoDemande->ville = '';
$ws = new WsScores();
$reponse = $ws->setCmdAsso($infoAsso, $infoDemande); //@todo : vérfier les logs de facturation
Zend_Registry::get('firebug')->info($reponse);
$annee = substr($reponse->commande->dateCommande,0,4);
$mois = substr($reponse->commande->dateCommande,4,2);
$jour = substr($reponse->commande->dateCommande,6,2);
$heure = substr($reponse->commande->dateCommande,8,2);
$minutes = substr($reponse->commande->dateCommande,10,2);
$ref = $reponse->commande->refCmd;
if( isset($ref) && !empty($ref) ) {
$message = 'Votre demande à été prise en compte le '.$jour.'/'.$mois.'/'.$annee.' à '.$heure.' h '.$minutes.' sous la référence <b>'.$ref.'</b>.';
} else {
$message = 'Une erreur s\'est produite lors du passage de votre commande.';
}
}
$this->view->assign('message', $message);
$this->view->assign('siren', substr($this->siret, 0,9));
$this->view->assign('siret', $this->siret);
$this->view->assign('id', $this->id);
$this->view->assign('raisonSociale', $session->getRaisonSociale());
if ($request->isPost()) {
$siren = $request->getParam('siren');
$ws = new Scores_Ws_Client('pieces', '0.1');
$parameters = new stdClass();
$parameters->companyId = $siren;
$parameters->type = 'siren';
$result = $ws->setAssoStatut($parameters);
if ($result === false) {
$this->view->msg = "Erreur lors de l'enregistrement des informations";
} else {
$this->view->ref = strtoupper($result);
}
} else {
$user = new Scores_Utilisateur();
$this->view->UserEmail = $user->getEmail();
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$this->view->siren = substr($this->siret, 0,9);
$this->view->siret = $this->siret;
$this->view->id = $this->id;
$this->view->raisonSociale = $session->getRaisonSociale();
}
}
/**
* Commande de privilege
*/
public function privilegeAction()
{
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$type = $request->getParam('type');
$siren = $request->getParam('siren');
if ($request->isPost()) {
try {
$ws = new Scores_Ws_Client('pieces', '0.1');
$parameters = new stdClass();
$parameters->companyId = $siren;
$parameters->doc = $type;
$result = $ws->setPrivileges($parameters);
if ($result === false) {
$this->view->msg = "Erreur lors de l'enregistrement des informations";
} else {
$this->view->ref = strtoupper($result);
}
} catch (Zend_Db_Exception $e) {
$this->view->msg = $e->getMessage();
}
} else {
$this->view->type = $type;
$user = new Scores_Utilisateur();
$this->view->UserEmail = $user->getEmail();
$session = new Scores_Session_Entreprise($this->siret, $this->id);
$this->view->siren = $siren;
$this->view->raisonSociale = $session->getRaisonSociale();
}
}
/**
@ -390,23 +401,30 @@ class PiecesController extends Zend_Controller_Action
}
$user = new Scores_Utilisateur();
$this->view->assign('isAuthorize', $user->checkPerm('BILANENTER'));
$this->view->assign('isAuthorize', $user->checkPerm('UPLOADBILAN'));
$siren = $request->getParam('siren');
$date = $request->getParam('date');
$type = $request->getParam('type');
if ( $request->isPost() ) {
$ws = new WsScores();
$cmdRef = $ws->setPiecesBilanEnterCmd($siren, $date, $type, 'infogreffe', 0);
if ( $cmdRef === false ) {
$this->view->assign('err', 'Erreur lors du passage de la commande.');
$ws = new Scores_Ws_Client('order', '0.1');
$parameters = new stdClass();
$parameters->siren = $siren;
$parameters->date = $date;
$parameters->type = $type;
$parameters->source = 'infogreffe';
$parameters->private = 0;
$result = $ws->setBilanInput($parameters);
if ($result === false) {
$this->view->msg = "Erreur lors du passage de la commande";
} else {
$this->view->assign('msg', $cmdRef);
$this->view->msg = "Commande enregistré sous la référence ".strtoupper($result);
}
} else {
$this->view->assign('form', 'display');
$this->view->assign('siren', $siren);
$this->view->assign('date', $date);
@ -418,6 +436,7 @@ class PiecesController extends Zend_Controller_Action
}
$this->view->assign('type', $type);
}
}
/**
@ -790,8 +809,8 @@ class PiecesController extends Zend_Controller_Action
}
/**
* Affichage status association
*/
* Affichage status association
*/
public function associationactesAction()
{
$user = new Scores_Utilisateur();
@ -1085,44 +1104,6 @@ class PiecesController extends Zend_Controller_Action
$this->view->assign('formEmail', true);
$this->view->assign('refCommande', $response);
$this->view->assign('msg',"Enregistrement de votre commande sous la référence ".strtoupper($response).".");
//== Send email to operators - to be removed
$email = explode(';',$user->getEmail());
$session = new Scores_Session_Entreprise();
//Envoi de l'email
$mail = new Scores_Mail();
$mail->setFrom('contact');
$mail->addToKey('support');
$mail->setSubject('[COMMANDE PIECES] - KBIS par email');
$mail->setBodyTexte(
'COMMANDE DE PIECES - Demande de kbis par email'.PHP_EOL.
'Demande pour recevoir le KBIS de SIREN :'.
'<a href="'.$this->view->url(array('controller'=>'identite', 'action'=>'fiche', 'siret'=> $this->siret), 'default', true).'">'.
$this->siret.'</a>'.PHP_EOL.
'pour login '.$user->getLogin().'('.$email.')<br/>'.PHP_EOL.
'Référence Client : '.$ref.PHP_EOL.
'Référence Backoffice : '.strtoupper($response)
);
$mail->send();
//Enregistrement dans la bdd
$commandesKbis = new Application_Model_CommandesKbis();
$data = array(
'idUser' => $user->getId(),
'login' => $user->getLogin(),
'email' => $email,
'societe' => '',
'nom' => '',
'adresse' => '',
'cp' => '',
'ville' => '',
'siren' => $siren,
'raisonSociale' => $session->getRaisonSociale(),
'type' => 'M',
'dateCommande' => date('Y-m-d H:i:s'),
);
$commandesKbis->insert($data);
//== Send email to operators - to be removed
}
}
@ -1165,51 +1146,6 @@ class PiecesController extends Zend_Controller_Action
} else {
$this->view->assign('refCommande', $response);
$this->view->assign('msg',"Enregistrement de votre commande sous la référence ".strtoupper($response).".");
//== Send email to operators - to be removed
$email = explode(';', $user->getEmail());
$session = new Scores_Session_Entreprise();
//Envoi du mail
$mail = new Scores_Mail();
$mail->setFrom('contact');
$mail->addToKey('support');
$mail->setSubject('[COMMANDE PIECES] - KBIS par courrier');
$mail->setBodyTexte(
'COMMANDE DE PIECES - Demande de kbis par courrier'.EOL.
'Demande pour recevoir le kbis de SIREN : '.
'<a href="'.$this->view->url(array('controller'=>'identite', 'action'=>'fiche', 'siret'=> $this->siret), 'default', true).'">'.
$this->siret.'</a><br/>'.PHP_EOL.
'pour login '.$user->getLogin().
'('.$email.')'.'<br/>'.PHP_EOL.
'Référence Client : '.$ref.PHP_EOL.
'Référence Backoffice : '.strtoupper($response).PHP_EOL.
'Societe :'.$params['societe'].'<br/>'.PHP_EOL.
'Nom : '.$params['nom'].'<br/>'.PHP_EOL.
'Prenom : '.$params['prenom'].'<br/>'.PHP_EOL.
'Adresse : '.$params['adresse'].'<br/>'.PHP_EOL.
'CP : '.$params['cp'].'<br/>'.PHP_EOL.
'Ville : '.$params['ville']
);
$mail->send();
//Enregistrement dans la bdd
$commandesKbis = new Application_Model_CommandesKbis();
$data = array(
'idUser' => $user->getId(),
'login' => $user->getLogin(),
'email' => $email,
'societe' => $params['societe'],
'nom' => $params['nom'].' '.$$params['prenom'],
'adresse' => $params['adresse'],
'cp' => $params['cp'],
'ville' => $params['ville'],
'siren' => $siren,
'raisonSociale' => $session->getRaisonSociale(),
'type' => 'C',
'dateCommande' => date('Y-m-d H:i:s'),
);
$commandesKbis->insert($data);
//== Send email to operators - to be removed
}
} else {
$this->view->assign('message','<font color="red">'.$this->view->translate('Erreur : Tous les champs doivent être renseigner.').'</font>');

View File

@ -170,9 +170,8 @@ class RechercheController extends Zend_Controller_Action
} else {
require_once 'i18n/cleanchar.php';
//Suppression des caractères accentués
$txt = cleanstring($params['formA']['txt']);
$txt = Scores_Locale_String::cleanstring($params['formA']['txt']);
//Remplacement du caractère § par ~
$txt = str_replace('$', '~', $txt);
// Recherche siren tenant compte des anomalies d'OCR
@ -423,14 +422,12 @@ class RechercheController extends Zend_Controller_Action
//Criteres recherche entreprise
if ( $type=='ent' ) {
require_once 'i18n/cleanchar.php';
// Type de recherche = entreprises
$telFax = trim(preg_replace('/[^0-9]/', '', $params['telFax']));
$naf = trim(preg_replace('/[^0-9A-Z]/i', '', $params['naf']));
// Traitement des données formulaire
$raisonSociale = cleanutf8($params['raisonSociale']);
$raisonSociale = Scores_Locale_String::cleanutf8($params['raisonSociale']);
$raisonSociale = str_replace(array('(',')', '/'), array('', '', ' '), $raisonSociale);
$numVoie = preg_replace('/[^0-9]/', '', $params['numero']);
@ -438,10 +435,10 @@ class RechercheController extends Zend_Controller_Action
$numVoie = '';
}
$libVoie = cleanutf8($params['voie']);
$libVoie = Scores_Locale_String::cleanutf8($params['voie']);
$libVoie = str_replace(array('(',')', '/'), array('', '', ' '), $libVoie);
$cpVille = cleanutf8($params['cpVille']);
$cpVille = Scores_Locale_String::cleanutf8($params['cpVille']);
$cpVille = str_replace(array('(',')', '/'), array('', '', ' '), $cpVille);
@ -1108,8 +1105,6 @@ class RechercheController extends Zend_Controller_Action
//Criteres recherche entreprise
if ($type=='ent'){
require_once 'i18n/cleanchar.php';
// Type de recherche = entreprises
$telFax = trim(preg_replace('/[^0-9]/', '', $params['telFax']));
$naf = trim(preg_replace('/[^0-9A-Z]/i', '', $params['naf']));
@ -1123,8 +1118,8 @@ class RechercheController extends Zend_Controller_Action
die('Numéro de voie incorrecte !');
}
$libVoie = cleanutf8($params['voie']);
$cpVille = cleanutf8($params['cpVille']);
$libVoie = Scores_Locale_String::cleanutf8($params['voie']);
$cpVille = Scores_Locale_String::cleanutf8($params['cpVille']);
if (preg_match("/^([0-9]{2,5})([\D]*)/i", $cpVille, $matches)) {
$cp = trim($matches[1]);

View File

@ -5,53 +5,6 @@ class SaisieController extends Zend_Controller_Action
protected $currencies;
/**
* Enter description here ...
* @var unknown_type
*/
/**
* Cours d'appel codée en dur
* @todo vérifier si table à jour
*/
protected $coursAppel = array(
array( "triId"=>"1756", "triCode"=>"AIXPRL", "triNom"=>"Cour d'Appel d'Aix-en-Provence", "triCP"=>"13616" ),
array( "triId"=>"1757", "triCode"=>"AMIENL", "triNom"=>"Cour d'Appel d'Amiens", "triCP"=>"80027" ),
array( "triId"=>"1758", "triCode"=>"ANGERL", "triNom"=>"Cour d'Appel d'Angers", "triCP"=>"49043" ),
array( "triId"=>"1759", "triCode"=>"BASSEL", "triNom"=>"Cour d'Appel de Basse-Terre", "triCP"=>"97109" ),
array( "triId"=>"1760", "triCode"=>"BASTIL", "triNom"=>"Cour d'Appel de Bastia", "triCP"=>"20407" ),
array( "triId"=>"1761", "triCode"=>"BESANL", "triNom"=>"Cour d'Appel de Besançon", "triCP"=>"25017" ),
array( "triId"=>"1762", "triCode"=>"BORDEL", "triNom"=>"Cour d'Appel de Bordeaux", "triCP"=>"33077" ),
array( "triId"=>"1763", "triCode"=>"BOURGL", "triNom"=>"Cour d'Appel de Bourges", "triCP"=>"18023" ),
array( "triId"=>"1764", "triCode"=>"CAENL", "triNom"=>"Cour d'Appel de Caen", "triCP"=>"14050" ),
array( "triId"=>"1765", "triCode"=>"CHAMBL", "triNom"=>"Cour d'Appel de Chambéry", "triCP"=>"73018" ),
array( "triId"=>"1766", "triCode"=>"COLMAL", "triNom"=>"Cour d'Appel de Colmar", "triCP"=>"68027" ),
array( "triId"=>"1767", "triCode"=>"DIJONL", "triNom"=>"Cour d'Appel de Dijon", "triCP"=>"21034" ),
array( "triId"=>"1768", "triCode"=>"DOUAIL", "triNom"=>"Cour d'Appel de Douai", "triCP"=>"59507" ),
array( "triId"=>"1769", "triCode"=>"FORTFL", "triNom"=>"Cour d'Appel de Fort-de-France", "triCP"=>"97200" ),
array( "triId"=>"1770", "triCode"=>"GRENOL", "triNom"=>"Cour d'Appel de Grenoble", "triCP"=>"38019" ),
array( "triId"=>"1771", "triCode"=>"LIMOGL", "triNom"=>"Cour d'Appel de Limoges", "triCP"=>"87031" ),
array( "triId"=>"1772", "triCode"=>"LYONL", "triNom"=>"Cour d'Appel de Lyon", "triCP"=>"69321" ),
array( "triId"=>"1773", "triCode"=>"METZL", "triNom"=>"Cour d'Appel de Metz", "triCP"=>"57036" ),
array( "triId"=>"1774", "triCode"=>"MONTPL", "triNom"=>"Cour d'Appel de Montpellier", "triCP"=>"34023" ),
array( "triId"=>"1775", "triCode"=>"NANCYL", "triNom"=>"Cour d'Appel de Nancy", "triCP"=>"54035" ),
array( "triId"=>"1776", "triCode"=>"NIMESL", "triNom"=>"Cour d'Appel de Nîmes", "triCP"=>"30031" ),
array( "triId"=>"1777", "triCode"=>"NOUMEL", "triNom"=>"Cour d'Appel de Nouméa", "triCP"=>"98848" ),
array( "triId"=>"1778", "triCode"=>"PAPEEL", "triNom"=>"Cour d'Appel de Papeete", "triCP"=>"98714" ),
array( "triId"=>"1779", "triCode"=>"PARISL", "triNom"=>"Cour d'Appel de Paris", "triCP"=>"75055" ),
array( "triId"=>"1780", "triCode"=>"PAUL", "triNom"=>"Cour d'Appel de Pau", "triCP"=>"64034" ),
array( "triId"=>"1781", "triCode"=>"POITIL", "triNom"=>"Cour d'Appel de Poitiers", "triCP"=>"86020" ),
array( "triId"=>"1782", "triCode"=>"REIMSL", "triNom"=>"Cour d'Appel de Reims", "triCP"=>"51096" ),
array( "triId"=>"1783", "triCode"=>"RENNEL", "triNom"=>"Cour d'Appel de Rennes", "triCP"=>"35064" ),
array( "triId"=>"1784", "triCode"=>"RIOML", "triNom"=>"Cour d'Appel de Riom", "triCP"=>"63201" ),
array( "triId"=>"1785", "triCode"=>"ROUENL", "triNom"=>"Cour d'Appel de Rouen", "triCP"=>"76037" ),
array( "triId"=>"1786", "triCode"=>"STDENL", "triNom"=>"Cour d'Appel de Saint-Denis-de-La Réunion", "triCP"=>"97488" ),
array( "triId"=>"1787", "triCode"=>"TOULOL", "triNom"=>"Cour d'Appel de Toulouse", "triCP"=>"31068" ),
array( "triId"=>"1788", "triCode"=>"VERSAL", "triNom"=>"Cour d'Appel de Versailles", "triCP"=>"78011" ),
array( "triId"=>"1789", "triCode"=>"ORLEAL", "triNom"=>"Cour d'Appel d'Orléans", "triCP"=>"45044" ),
array( "triId"=>"1790", "triCode"=>"CAYENL", "triNom"=>"Chambre Détachée de la Cour d'Appel de Fort de France à Cayenne", "triCP"=>"97300" ),
array( "triId"=>"1798", "triCode"=>"AGENL", "triNom"=>"Cour d'Appel d'Agen", "triCP"=>"47916" ),
);
/**
* test de type de voie
* @todo vérifier si type de voie à jour
@ -534,7 +487,7 @@ class SaisieController extends Zend_Controller_Action
}
$this->view->assign('ListeTribunaux', $listeTribunaux);
/**
* table des événements en dur
* table des événements en dur
* @todo verifier si liste à jour
*/
$selectEvent = array(
@ -1054,8 +1007,8 @@ class SaisieController extends Zend_Controller_Action
if ( !empty($selection) ) {
list($date, $type) = explode(':', $selection);
// --- Correction d'un bilan
if ($date!='NEW') {
$milDate = $milDatePre = null;
$listBilans = $ws->getListeBilans($siren);
if ( count($listBilans->result->item) > 0 ) {
@ -1401,14 +1354,16 @@ class SaisieController extends Zend_Controller_Action
);
if (!empty($infos)) {
//Default value
// --- Default value pour les nouveaux bilans
if ( is_string($infos) && $infos == 'NEW' ) {
$dateCloture = (date('Y')-1).'1231';
$dureeMois = '12';
$dateCloturePre = 'AAAAMMJJ';
$dureeMoisPre = '0';
$unite = 'U';
} else {
}
// --- Default value pour l' edition de bilan
else {
$dateCloture = ($infos->dateCloture!='') ? $infos->dateCloture : $date;
$dureeMois = ($infos->dureeMois!='') ? $infos->dureeMois : '12';
$dateCloturePre = empty($infos->dateCloturePre) ? 'AAAAMMJJ' : $infos->dateCloturePre ;
@ -1417,7 +1372,7 @@ class SaisieController extends Zend_Controller_Action
$this->view->assign('liasse', $postes);
}
//Formattage date
// --- Formattage date
$dateCloture = substr($dateCloture,6,2).'/'.substr($dateCloture,4,2).'/'.substr($dateCloture,0,4);
$dateCloturePre = substr($dateCloturePre,6,2).'/'.substr($dateCloturePre,4,2).'/'.substr($dateCloturePre,0,4);
@ -1452,11 +1407,20 @@ class SaisieController extends Zend_Controller_Action
substr($params['dateCloturePre'],3,2).
substr($params['dateCloturePre'],0,2);
$originalDateCloture = substr($params['originalDateCloture'],6,4).
substr($params['originalDateCloture'],3,2).
substr($params['originalDateCloture'],0,2);
$originalTypeBilan = $params['originalTypeBilan'];
if (isset($params['originalDateCloture'])) {
$originalDateCloture = substr($params['originalDateCloture'],6,4).
substr($params['originalDateCloture'],3,2).
substr($params['originalDateCloture'],0,2);
} else {
$originalDateCloture = $dateCloture;
}
if (isset($params['originalTypeBilan'])) {
$originalTypeBilan = $params['originalTypeBilan'];
} else {
$originalTypeBilan = $params['typeBilan'];
}
$ws = new WsScores();
$response = $ws->setBilan(
$params['siren'],
@ -2976,5 +2940,43 @@ class SaisieController extends Zend_Controller_Action
}
}
}
/**
* Enregistrement des informations de geocodage
*/
public function geocodeAction()
{
$request = $this->getRequest();
if ( $request->isXmlHttpRequest() ) {
$this->_helper->layout()->disableLayout();
}
Zend_Registry::get('firebug')->info($request->getParams());
$mode = $request->getParam('mode');
// --- Diplay form to re-validate geocode
if ( $mode == 'form' ) {
}
// --- No return
else {
// --- Parametres
$data = array(
'source' => 'google',
'lat' => $request->getParam('lat'),
'lng' => $request->getParam('lng'),
'alt' => $request->getParam('alt'),
'address' => $request->getParam('address'),
'precis' => $request->getParam('precis'),
);
// --- Execute
$ws = new Scores_Ws_Client('saisie', '0.2');
$p = new stdClass();
$p->companyId = $request->getParam('siret');
$p->type = 'siren';
$p->data = json_encode($data);
$p->override = false;
$ws->setGeoCode($p);
}
}
}

View File

@ -1,7 +0,0 @@
Votre référence : BS<?=$this->ref?>
<br/><br/>
Merci d'envoyer votre courrier à l'adresse suivante :<br/>
Scores & Décisions,<br/>
Service Production, BS<?=$this->ref?><br/>
1 rue de Clairefontaine,<br/>
78120 Rambouillet

View File

@ -1,62 +0,0 @@
<?php if (isset($this->upload) && $this->upload == true){?>
<br/>Résumé de la demande : <br/>
Saisie du bilan de la Société <?=$this->raisonSociale?>
clôturé le <?=$this->infos['bilanCloture']?> (<?=$this->infos['bilanDuree']?> mois)
au format <?=$this->type?>. Merci de vérifier votre fichier en cliquant sur le lien.<br/>
<a href="<?=$this->url(array('controller'=>'fichier', 'action'=>'bilanclient', 'fichier'=>$this->name))?>" target="_blank"><?=$this->name?></a> (<?=$this->size?> octets)
<br/><br/>
Si le fichier ne correspond pas ou que vous avez fait une erreur,
<a id="annule" href="<?=$this->url(array('controller'=>'finance', 'action'=>'saisiebilan', 'annule'=> 1, 'ref'=>$this->ref))?>">merci de l'annuler en cliquant ici.</a>
<script>
$('#annule').click(function(e){
e.preventDefault();
var url = $(this).attr('href');
$.post(url, null, function (data, textStatus) {
if (textStatus == 'success'){
$('#dialogbilanclient').html(data);
}
});
});
</script>
<?php } elseif (isset($this->upload) && $this->upload == false) {?>
<?=$this->errMsg?>
<?php } else {?>
Votre référence : BS<?=$this->ref?>
<br/><br/>
<style>
#progressbar { border:none; }
.ui-progressbar-value { background-image: url(/themes/default/images/finance/pbar-ani.gif); }
</style>
<form id="uploadForm" name="uploadForm" action="<?=$this->url(array('controller'=>'finance', 'action'=>'saisiebilan'))?>" method="POST" enctype="multipart/form-data">
<input type="hidden" name="siren" value="<?=$this->siren?>" />
<input type="hidden" name="ref" value="<?=$this->ref?>" />
<input type="hidden" name="MAX_FILE_SIZE" value="50000000" />
Votre fichier : <input type="file" name="fichier" />
<input type="submit" name="upload" value="Envoyer" />
</form>
<div id="progressbar"></div>
<div id="uploadOutput"></div>
<script type="text/javascript" src="/libs/form/jquery.form.min.js"/>
<script>
$('#uploadForm').ajaxForm({
beforeSubmit: function() {
$('#progressbar').progressbar({value: 100});
$('#uploadOutput').html('Envoi en cours...');
},
success: function(data) {
$('#progressbar').progressbar('destroy');
$('#uploadOutput').html(data);
}
});
$('#dialogbilanclient').dialog({ buttons: [ {
text: "Quitter",
click: function() { $(this).dialog("close"); }
} ] });
</script>
<?php }?>

View File

@ -1,28 +1,61 @@
<form id="formEnvoiBilan" name="formEnvoiBilan" method="post" action="<?=$this->url(array('controller'=>'finance', 'action'=>'saisiebilan'), 'default', true)?>">
<input type="hidden" name="siren" value="<?=$this->siren?>" />
<label>Votre email :</label>
<input type="text" name="email" size="40" value="<?=$this->email?>">
<?php if ($this->msg) {?>
<div style="padding: 0 .7em;" class="ui-state-error ui-corner-all">
<p><span style="float: left; margin-right: .3em;" class="ui-icon ui-icon-alert"></span>
<strong>Alert:</strong> <?=$this->msg?></p>
</div>
<?php }?>
<?php if ($this->ref) {?>
Votre référence : BS-<?=strtoupper($this->ref)?>
<br/><br/>
Saisie du bilan de la Société <?=$this->raisonSociale?> clôturé le <?=$this->bilanCloture?> au format <?=$this->type?>
<br/><br/>
<form id="uploadForm" name="uploadForm" action="<?=$this->url(array('controller'=>'finance', 'action'=>'saisiebilanup'))?>" method="post" enctype="multipart/form-data">
<input type="hidden" name="ref" value="<?=$this->ref?>" />
<input type="hidden" name="fileref" value="<?=$this->fileref?>" />
<input type="hidden" name="MAX_FILE_SIZE" value="50000000" />
Votre fichier : <input type="file" name="fichier" />
<input type="submit" name="upload" value="Envoyer" />
</form>
<div id="uploadOutput"></div>
<script type="text/javascript" src="/libs/form/jquery.form.min.js"/>
<script>
$('#uploadForm').ajaxForm({
beforeSubmit: function() {
$('#uploadOutput').html('Envoi en cours...');
},
success: function(data) {
$('#uploadOutput').html(data);
}
});
$('#dialogbilanclient').dialog({ buttons: [ {
text: "Quitter",
click: function() { $(this).dialog("close"); }
} ] });
</script>
<?php } else {?>
<form id="formEnvoiBilan" name="formEnvoiBilan" method="post" action="<?=$this->url(array('controller'=>'finance',
'action'=>'saisiebilan'), 'default', true)?>">
<input type="hidden" name="mode" value="order" />
<input type="hidden" name="siren" value="<?=$this->siren?>" />
<label>Format : </label><br/>
<input type="radio" name="format" value="N" checked> Réel normal (Liasse 2050)<br/>
<input type="radio" name="format" value="S"> Simplifé (Liasse 2033)<br/>
<input type="radio" name="format" value="C"> Consolidé <span style="color:gray;">
(Ne peut être utilisé dans l'évaluation des enrtreprises.)</span><br/>
<br/>
<label>Date de clôture du bilan : </label>
<input type="text" name="dateCloture" value="" size="10" maxlength="10" id="datepicker">
(JJ/MM/AAAA)
<br/><br/>
<label>Format : </label>
<input type="radio" name="format" value="N" checked> Réel normal (Liasse 2050)
<input type="radio" name="format" value="S" checked> Simplifié (Liasse 2033)
<input type="radio" name="format" value="C"> Consolidé
<br/><br/>
<label>Durée de l'exercice (en mois) : </label>
<select name="dureeExercice">
<?php
for ( $i=0; $i<23; $i++){
$select = '';
if ($i==11) $select = 'selected';
?>
<option value="<?=$i+1?>" <?=$select?>><?=$i+1?></option>
<?php
}
?>
<?php for ($i=1; $i<24; $i++) { $select = ''; if ($i == 12) { $select = 'selected'; } ?>
<option value="<?=$i?>" <?=$select?>><?=$i?></option>
<?php } ?>
</select>
<br/><br/>
<label>Confidentialité : </label><br/>
@ -31,29 +64,33 @@ Ce bilan n'est pas confidentiel (saisie gratuite)
<br/>
<input type="radio" name="confidentiel" value="1">
Ce bilan est confidentiel et ne doit être utilisé que pour les utilisateurs
de votre société (+5€ HT par bilan saisi)
<br/><br/>
<label>Mode d'envoi du bilan : </label><br/>
<input type="radio" name="method" value="fichier" checked>
Instantané par le site : envoi du bilan au format numérique
<br/>
<input type="radio" name="method" value="courrier">
Par courrier
de votre société (+7€ HT par bilan saisi)
<br/><br/>
<span><i>
Vous obtiendrez une référence à l'étape suivante avec au choix l'adresse du
service Production de Scores & Décisions pour un envoi postal ou la possibilité
Vous obtiendrez une référence à l'étape suivante avec la possibilité
de nous transmettre directement par Internet votre bilan au format numérique (PDF, TIFF)
</i></span>
<br/>
<br/><br/>
<span><i>
Si le bilan communiqué n'est pas conforme aux formulaires CERFA de la DGI des
frais de traitement de 10€ vous seront facturés en sus.
</i></span>
</form>
<script type="text/javascript" src="/libs/form/jquery.form.min.js"/>
<script type="text/javascript">
$('#dialogbilanclient').dialog({ buttons: {
'Valider': function() {
var url = $('#dialogbilanclient form#formEnvoiBilan').attr('action');
$.post(url, $('#dialogbilanclient form#formEnvoiBilan').serialize(), function(data){
$('div#dialogbilanclient.ui-dialog-content').html(data);
});
},
'Annuler': function() { $(this).dialog('close'); }
}, });
$('#datepicker').datepicker( $.datepicker.regional['fr'] );
$('#datepicker').datepicker( "option", "dateFormat", 'dd/mm/yy' );
$('#datepicker').datepicker( "option", "defaultDate", '31/12/<?=date('Y')-1?>' );
</script>
</script>
<?php }?>

View File

@ -0,0 +1,19 @@
<?php if (isset($this->upload) && $this->upload == true){?>
<strong>Fichier envoyé <a href="<?=$this->url(array('controller'=>'fichier', 'action'=>'bilanclient',
'fichier'=>$this->file),'default',true)?>"></a></strong>
<script>
$('#dialogbilanclient').dialog({ buttons: [ {
text: "Quitter",
click: function() { $(this).dialog("close"); }
} ] });
</script>
<?php } elseif (isset($this->upload) && $this->upload == false) {?>
<div style="padding: 0 .7em;" class="ui-state-error ui-corner-all">
<p><span style="float: left; margin-right: .3em;" class="ui-icon ui-icon-alert"></span>
<strong>Alert:</strong> <?=$this->errMsg?></p>
</div>
<?php } ?>

View File

@ -1,68 +1,128 @@
<div id="carte" style="width:100%;height:500px"></div>
<div id="carte" style="width:100%;height:500px">Préparation de la carte ...</div>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
<?php echo 'var marks = '.$this->marks.';'?>
$(document).ready(function(){
var timer;
var timerSecondInterval = 5;
var timerSecondMax = 300;
var timeCount = 0;
var marksNb = marks.length;
var markDone = 1;
var map;
var zoneMarker;
var geocoder = new google.maps.Geocoder();
var zoneMarker = new google.maps.LatLngBounds();
// --- Wait GeoCoding to launch Google Map
function waitGeoCode() {
timeCount = timeCount + timerSecondInterval;
if (timeCount >= timerSecondMax || markDone == marksNb) {
clearInterval(timer);
loadGoogleMap();
}
}
//Create the map
var geocoder = new google.maps.Geocoder();
var initCenter = new google.maps.LatLng(46.227638,2.213749);
//--- Create Marker
function createMarker(m) {
// --- Marker options
var marker = new google.maps.Marker({
map: map,
position: m.location,
title: m.title,
icon: m.icon,
});
// --- Info Window
var infowindow = new google.maps.InfoWindow({
content: m.text
});
// --- Create event marker
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map, marker);
});
// --- Extend map by adding marker
zoneMarker.extend(marker.getPosition());
// --- Geocode
if (m.gps.lat && m.gps.lon) {
// --- Do nothing
} else {
var locations = [];
locations.push(m.location);
// --- Create an ElevationService
var elevator = new google.maps.ElevationService();
// Create a LocationElevationRequest object using the array's one value
var positionalRequest = {
'locations': locations
}
// Initiate the location request
elevator.getElevationForLocations(positionalRequest, function(results, status) {
if (status == google.maps.ElevationStatus.OK) {
if (results[0]) {
var alt = results[0].elevation;
if (results[0].elevation<-500) {
alt = 0;
}
if (results[0].resolution>500) {
alt = 0;
}
$.post('/saisie/geocode', {
siret: m.siret,
lat: m.locationLat,
lng: m.locationLng,
alt: alt,
address: m.locationAddress,
precis: m.locationType
});
}
}
});
}
}
// --- Load Google Map
function loadGoogleMap() {
var mapOptions = {
zoom: 10,
center: initCenter,
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById('carte'), mapOptions);
var length = marks.length;
for (var i = 0; i < length; i++) {
if ( marks[i]['gps']['lat'] && marks[i]['gps']['lon']) {
//console.log("GPS OK " + marks[i]['address'] + ' - CACHE');
var location = new google.maps.LatLng(marks[i]['gps']['lat'],marks[i]['gps']['lon']);
createMarker(marks[i], location);
} else {
codeAddress(marks[i]);
map = new google.maps.Map(document.getElementById('carte'), mapOptions);
zoneMarker = new google.maps.LatLngBounds();
$.each(marks, function (i, item){
if (item.location) {
createMarker(item);
}
});
if (zoneMarker.isEmpty()) {
//console.log('ZoneMarker is empty');
} else {
map.fitBounds(zoneMarker);
}
}
map.fitBounds(zoneMarker);
//Bounds the maps
function codeAddress(mark) {
geocoder.geocode( {'address': mark['address'], region:'FR'}, function(results, status) {
//console.log("GPS KO " + mark['address'] + ' - ' + status);
if (status == google.maps.GeocoderStatus.OK) {
var location = results[0].geometry.location;
//Query to set the GPS coord in our database
createMarker(mark,location);
}
});
}
//Create Marker
function createMarker(m, location){
//Create marker
var marker = new google.maps.Marker({
map: map,
position: location,
title: m['title'],
icon: m['icon'],
});
zoneMarker.extend(marker.getPosition());
//Create event marker
google.maps.event.addListener(marker, 'click', function() {
var infowindow = new google.maps.InfoWindow({
content: m['text']
// --- Wait the document is ready
$(document).ready(function(){
// --- Start timer
timer = setInterval(waitGeoCode, timerSecondInterval);
// --- Get location and geocode address if needed
$.each(marks, function (i, item){
if (item.gps.lat && item.gps.lon) {
marks[i].location = new google.maps.LatLng(item.gps.lat, item.gps.lon);
markDone++;
} else {
geocoder.geocode({ address:item.address, region:'FR' }, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
if (results[0]) {
// --- Set location to the marker
marks[i].location = results[0].geometry.location;
marks[i].locationLat = results[0].geometry.location.lat();
marks[i].locationLng = results[0].geometry.location.lng();
marks[i].locationType = results[0].geometry.location_type;
marks[i].locationAddress = results[0].formatted_address
}
}
markDone++;
//console.log("GeoCode: " + status + ' - index: ' + i);
});
var pos = new google.maps.Marker({
position: location
});
infowindow.open(map, pos);
});
}
}
});
});
</script>

View File

@ -46,8 +46,8 @@
<?php if($this->edition) { ?>
<br/>
<a class="dialogFiche" title="Edition fiche" href="<?=$this->url(array('controller'=>'saisie', 'action'=>'lienfiche', 'idFiche'=>$this->idFiche),'default',true)?>">
Editer la fiche</a>
<a class="dialogFiche" title="Edition fiche" href="<?=$this->url(array('controller'=>'saisie', 'action'=>'lienfiche',
'idFiche'=>$this->idFiche),'default',true)?>">Editer la fiche</a>
<script>
$('a.dialogFiche').on('click', function(e){
e.preventDefault();

View File

@ -68,9 +68,9 @@
<td width="350" class="StyleInfoLib">
<?php
if ($this->siren) {
$href = $this->url(array('controller'=>'saisie','action'=>'liendoc','siren'=>$this->siren, 'type'=>'Entreprise'), null, true);
$href = $this->url(array('controller'=>'saisie','action'=>'liendoc','siren'=>$this->siren, 'type'=>'Entreprise'), 'default', true);
} else {
$href = $this->url(array('controller'=>'saisie','action'=>'liendoc','idLien'=>$this->lienref, 'type'=>'Entreprise'), null, true);
$href = $this->url(array('controller'=>'saisie','action'=>'liendoc','idLien'=>$this->lienref, 'type'=>'Entreprise'), 'default', true);
}
?>
<a class="dialog" title="Lier un document" href="<?=$href?>">

View File

@ -25,43 +25,34 @@
<p>Nous ne disposons pas de l'intégralité des statuts des associations en ligne,
mais il est possible de commander les derniers statuts à jour de l'association
(d&eacute;lai approximatif de 15 jours)</p>
<style>
.fieldgrp label {width:200px;}
</style>
<form name="commandeAsso" action="<?=$this->url(array('controller'=>'pieces', 'action'=>'cmdassociation'))?>" method="post">
<input type="hidden" name="siret" value="<?=$this->siret?>" />
<input type="hidden" name="id" value="<?=$this->id?>" />
<div class="fieldgrp">
<label>Votre Référence</label>
<div class="field">
<input type="text" class="longfield" name="reference" value="">
</div>
</div>
<a id="asso-statut" title="Statut Association" href="<?=$this->url(array('controller'=>'pieces',
'action'=>'cmdassociation'))?>">Commander les statuts de l'association...</a>
<script type="text/javascript">
$('#asso-statut').on('click', function(e){
e.preventDefault();
var url = $(this).attr('href');
var title = $(this).attr('title');
var dialogOpts = {
bgiframe: true,
title: title,
width: 550,
height: 250,
modal: true,
open: function(event, ui) {
$(this).html('Chargement...');
$(this).load(url);
},
buttons: {
Annuler: function() { $(this).dialog('close'); }
},
close: function() { $('#dialog').remove(); }
};
$('<div id="dialog"></div>').dialog(dialogOpts);
return false;
});
</script>
<div class="fieldgrp">
<label>Votre téléphone</label>
<div class="field">
<input type="text" name="tel" value="" maxlength="14" />
</div>
</div>
<div class="fieldgrp">
<label>Adresse email du destinataire</label>
<div class="field">
<input name="email" type="text" value="<?=$this->email?>" size="50"/>
</div>
</div>
<div class="fieldgrp">
<label>&nbsp;</label>
<div class="field">
<input type="submit" class="button" name="kbis" value="Valider" title="Commander les statuts de l'association...">
</div>
</div>
</form>
<?php if (count($this->actes)!=0){?>
<table class="greffe">
<thead>
@ -73,13 +64,13 @@
<tr>
<td class="date"><?=$acte['date']?></td>
<td class="type"><?=$acte['type']?>
<span class="fichier">
<a href="<?=$acte['href']?>" title="<?=$acte['title']?>">
<img alt="PDF" src="/themes/default/images/interfaces/icone_pdf.gif"/>
</a>
</span>
<td></td>
<span class="fichier">
<a href="<?=$acte['href']?>" title="<?=$acte['title']?>">
<img alt="PDF" src="/themes/default/images/interfaces/icone_pdf.gif"/>
</a>
</span>
</td>
<td></td>
</tr>
<?php endforeach;?>
</tbody>

View File

@ -1,53 +1,46 @@
<?php if ( $this->form == 'display') {?>
<p>Commande de la saisie des chiffres du bilan <?=substr($this->date,8,2).'/'.substr($this->date,5,2).'/'.
substr($this->date,0,4)?> pour intégration et calcul dans les éléments financiers.<p>
<p>Commande de la saisie des chiffres du bilan <?=substr($this->date,8,2).'/'.substr($this->date,5,2).'/'.
substr($this->date,0,4)?> pour intégration et calcul dans les éléments financiers.<p>
<?php if ( $this->isAuthorize ) {?>
<div id="output">
<small>Des frais supplémentaires peuvent s'appliquer suivant vos accords contractuels.</small>
<form method="post" name="cmd" action="<?=$this->url(array('controller'=>'pieces','action'=>'bilanenter'),'default',true)?>">
<input type="hidden" name="siren" value="<?=$this->siren?>"/>
<input type="hidden" name="date" value="<?=$this->date?>"/>
<input type="hidden" name="type" value="<?=$this->type?>"/>
</div>
</form>
<script>
$('#dialogcmd').dialog({ buttons: [
{ text: "Commander", click: function() {
var url = $('form[name=cmd]').attr('action');
var formdata = $('form[name=cmd]').serialize();
$('#dialogcmd > #output').html("Enregistrement en cours...");
$.post(url, formdata, function(data){
$('#dialogcmd > #output').html(data);
});
}
},
{ text: "Fermer", click: function() { $(this).dialog("close"); } }
] });
</script>
<?php } else {?>
<script>
$('#dialogcmd').dialog({ buttons: [
{ text: "Fermer", click: function() { $(this).dialog("close"); } }
] });
</script>
<?php }?>
<?php } else {?>
<?php if ( $this->err ) {?>
<?=$this->err?>
<?php if ( $this->isAuthorize ) {?>
<div id="output">
<small>Des frais supplémentaires peuvent s'appliquer suivant vos accords contractuels.</small>
<form method="post" name="cmd" action="<?=$this->url(array('controller'=>'pieces','action'=>'bilanenter'),'default',true)?>">
<input type="hidden" name="siren" value="<?=$this->siren?>"/>
<input type="hidden" name="date" value="<?=$this->date?>"/>
<input type="hidden" name="type" value="<?=$this->type?>"/>
</form>
</div>
<script>
$('#dialogcmd').dialog({ buttons: [{
text: "Commander", click: function() {
var url = $('form[name=cmd]').attr('action');
var formdata = $('form[name=cmd]').serialize();
$('#dialogcmd > #output').html("Enregistrement en cours...");
$.post(url, formdata, function(data){ $('#dialogcmd > #output').html(data); });
}}, {
text: "Fermer", click: function() { $(this).dialog("close"); } }
]});
</script>
<?php } else {?>
Commande enregistrée sous la référence <?=$this->msg?>
<script>
$('#dialogcmd').dialog({ buttons: [
{ text: "Fermer", click: function() { $(this).dialog("close"); } }
] });
</script>
<?php }?>
<?php } else {?>
<?=$this->msg?>
<script>
$('#dialogcmd').dialog({ buttons: [
{ text: "Fermer", click: function() { $(this).dialog("close"); } }

View File

@ -89,9 +89,9 @@ Les éléments disponibles ci-dessous en téléchargement ou commande peuvent fa
<i><?=$bilan['saisie']?></i>
<?php }?>
<?php if ( $bilan['isEnter']==0 && $bilan['mode']=='T' ) {?>
<a class="dialogcmd" href="<?=$this->url(array('controller'=>'pieces', 'action'=>'bilanenter',
'siren'=>$this->siren, 'date'=>$bilan['dateIso'], 'type'=>$bilan['typeCode']), 'default', true)?>">
Demander la saisie du bilan</a>
<a class="dialogcmd" title="Commande de saisie de bilan" href="<?=$this->url(array('controller'=>'pieces',
'action'=>'bilanenter', 'siren'=>$this->siren, 'date'=>$bilan['dateIso'], 'type'=>$bilan['typeCode']),
'default', true)?>">Demander la saisie du bilan</a>
<?php }?>
<?php if ( $this->ModeEdition ) {?>
<br/><a href="<?=$bilan['factice']?>" target="_blank">Créer une commande factice.</a>

View File

@ -1,28 +1,43 @@
<div id="center">
<?php if ($this->msg) {?>
<div style="padding: 0 .7em;" class="ui-state-error ui-corner-all">
<p><span style="float: left; margin-right: .3em;" class="ui-icon ui-icon-alert"></span>
<strong>Alert:</strong> <?=$this->msg?></p>
</div>
<?php } else if ($this->ref) {?>
<h1>PI&Egrave;CES OFFICIELLES</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>
<td width="30">&nbsp;</td>
<td width="200" class="StyleInfoLib">Dénomination Sociale</td>
<td width="350" class="StyleInfoData"><?=$this->raisonSociale?></td>
</tr>
</table>
</div>
Votre référence : <?=strtoupper($this->ref)?>
<script>
$('#dialog').dialog({
buttons: [ {"Quitter": function() { $(this).dialog("close"); }} ]
});
</script>
<h2>Actes & Status</h2>
<div class="paragraph">
<?=$this->message?>
</div>
<?php } else {?>
</div>
<p>Voulez vous commandez les derniers statuts à jour de l'association ? </p>
<p><strong><?=$this->raisonSociale?></strong></p>
<p><i>(délai approximatif de 15 jours)</i></p>
<p></p>
<p>Votre email : <?=$this->UserEmail?></p>
<form id="cmd" name="cmd" method="post" action="<?=$this->url(array('controller'=>'pieces',
'action'=>'cmdassociation'), 'default', true)?>">
<input type="hidden" name="siren" value="<?=$this->siren?>" />
</form>
<script type="text/javascript">
$('#dialog').dialog({ buttons: {
'Valider': function() {
var url = $('#dialog form#cmd').attr('action');
var formValue = $('#dialog form#cmd').serialize();
$('div#dialog.ui-dialog-content').html("Commande en cours....");
$.post(url, formValue, function(data){
$('div#dialog.ui-dialog-content').html(data);
}).fail(function() {
$('div#dialog.ui-dialog-content').html("Error.");
});
},
'Annuler': function() { $(this).dialog('close'); }
}});
</script>
<?php }?>

View File

@ -69,72 +69,75 @@
<h2>PRIVIL&Eacute;GES &amp; NANTISSEMENTS</h2>
<div class="paragraph">
<?php if ( $this->permPriv ) {?>
<form name="privileges" method="post" action="<?=$this->url(array('controller'=>'pieces', 'action'=>'commande'))?>">
<input type="hidden" name="siret" value="<?=$this->siret?>"/>
<input type="hidden" name="op" value="privileges"/>
<div class="fieldgrp">
<?php
$disponible = true;
if($this->KbisErreurCJ || $this->KbisErreurDEP){
$disponible = false;
}
if ( $disponible ) { ?>
<?php if( $this->permSurvPriv ) { ?>
<input class="noborder type" type="checkbox" name="privileges[]" value="SprivSurv" <?=is_array($this->privileges) && in_array('SprivSurv',$this->privileges) ? 'checked' : ''?>/><b>Privilèges de la sécurité sociale et des régimes complémentaires et Trésor Public <br/>(avec surveillance, retour sous 48 à 72h)</b><br/>
<br/>
<?php
$disponible = true;
if($this->KbisErreurCJ || $this->KbisErreurDEP){
$disponible = false;
}
?>
<?php if( $this->permSurvPriv ) { ?>
<a href="">Commander la mise en suivi des privilèges</a>(surveillance des privilèges auprès du greffe, retour sous 48 à 72h)
</div>
<?php } ?>
<input class="noborder type" type="checkbox" name="privileges[]" value="privSecu" <?=is_array($this->privileges) && in_array('privSecu',$this->privileges) ? 'checked' : ''?>/>Privilèges de la sécurité sociale et des régimes complémentaires (mail sous 12h ouvrées)<br/>
<input class="noborder type" type="checkbox" name="privileges[]" value="privTres" <?=is_array($this->privileges) && in_array('privTres',$this->privileges) ? 'checked' : ''?>/>Privilèges du Trésor Public (mail sous 12h ouvrées)<br/>
<br/>
<input class="noborder type" type="checkbox" name="privileges[]" value="nantFond" <?=is_array($this->privileges) && in_array('nantFond',$this->privileges) ? 'checked' : ''?>/>Nantissements du fonds de commerce ou du fonds artisanal (conventionnels et judiciaires)<br/>
<input class="noborder type" type="checkbox" name="privileges[]" value="nantVend" <?=is_array($this->privileges) && in_array('nantVend',$this->privileges) ? 'checked' : ''?>/>Privilèges du vendeur de fonds de commerce et d'action résolutoire<br/>
<div class="paragraph">
<p>Privilèges de la sécurité sociale et des régimes complémentaires - <a class="cmdprivilege"
title="Commande de privilèges sécurité sociale et des régimes complémentaires" href="<?=$this->url(array(
'controller'=>'pieces', 'action'=>'privilege', 'siren'=>$this->siren, 'type'=>'privsecu'), 'default', true)?>">Commander</a> </p>
<p>Privilèges du Trésor Public - <a class="cmdprivilege" title="Commande de privilèges du Trésor Public"
href="<?=$this->url(array('controller'=>'pieces', 'action'=>'privilege', 'siren'=>$this->siren, 'type'=>'privtres'),
'default', true)?>">Commander</a></p>
<p>Nantissements du fonds de commerce ou du fonds artisanal (conventionnels et judiciaires) - <a class="cmdprivilege"
title="Commande de nantissements du fonds de commerce" href="<?=$this->url(array('controller'=>'pieces',
'action'=>'privilege', 'siren'=>$this->siren, 'type'=>'nantfond'), 'default', true)?>">Commander</a></p>
<p>Déclarations de créances - <a class="cmdprivilege" title="Commande de déclarations de créances"
href="<?=$this->url(array('controller'=>'pieces', 'action'=>'privilege', 'siren'=>$this->siren, 'type'=>'declcrea'),
'default', true)?>">Commander</a></p>
<script type="text/javascript">
$('a.cmdprivilege').on('click', function(e){
e.preventDefault();
var url = $(this).attr('href');
var title = $(this).attr('title');
var dialogOpts = {
bgiframe: true,
title: title,
width: 550,
height: 250,
modal: true,
open: function(event, ui) {
$(this).html('Chargement...');
$(this).load(url);
},
buttons: {
Annuler: function() { $(this).dialog('close'); }
},
close: function() { $('#dialog').remove(); }
};
$('<div id="dialog"></div>').dialog(dialogOpts);
return false;
});
</script>
<?php if ( !$disponible ) { ?>
<p><i>Les pièces demandées seront commandées par courrier auprès du greffe. Prévoir un délai de 2 à 3 semaines.</i></p>
<?php } else {?>
<p><i>Les pièces demandées seront commandées auprès du greffe, et vous seront transmises dans un delai approximatif de 48h.</i></p>
<?php }?>
<input class="noborder type" type="checkbox" name="privileges[]" value="declCrea" <?=is_array($this->privileges) && in_array('declCrea',$this->privileges) ? 'checked' : ''?>/>Déclarations de créances<br/>
<?php } else { ?>
<input class="noborder type" type="checkbox" name="privileges[]" value="privSecu" <?=is_array($this->privileges) && in_array('privSecu',$this->privileges) ? 'checked' : ''?>/>Privilèges de la sécurité sociale et des régimes complémentaires<br/>
<input class="noborder type" type="checkbox" name="privileges[]" value="privTres" <?=is_array($this->privileges) && in_array('privTres',$this->privileges) ? 'checked' : ''?>/>Privilèges du Trésor Public<br/>
<input class="noborder type" type="checkbox" name="privileges[]" value="nantCompl" <?=is_array($this->privileges) && in_array('nantCompl',$this->privileges) ? 'checked' : ''?>/>Etat complet des nantissements<br/>
<?php } ?>
<br/>
<?php if ( !$disponible ) { ?>
<p><i>Les pièces demandées seront commandées par courrier auprès du greffe. Prévoir un délai de 2 à 3 semaines.</i></p>
<?php } ?>
</div>
<div id="privilegesM">
<div class="fieldgrp">
<label>E-mail</label>
<div class="field">
<input type="text" class="longfield" name="email" value="<?=$this->user->getEmail()?>">
<span>Précisez votre e-mail pour recevoir la commande.</span>
</div>
</div>
<div class="fieldgrp">
<label>Référence</label>
<div class="field">
<input type="text" class="longfield" name="ref" value="<?=$this->ref?>">
<span>Votre référence.</span>
</div>
</div>
<div class="fieldgrp">
<label>&nbsp;</label>
<div class="field"><input type="submit" name="submit" value="Valider" class="button"></div>
</div>
</div>
</form>
</div>
<?php } else {?>
<div class="paragraph">
<p class="marge"><?=$this->translate("Vous n'avez pas les droits d'accès pour cette fonctionalité."); ?></p>
<?php }?>
</div>
<?php }?>
</div>

View File

@ -0,0 +1,62 @@
<?php if ($this->msg) {?>
<div style="padding: 0 .7em;" class="ui-state-error ui-corner-all">
<p><span style="float: left; margin-right: .3em;" class="ui-icon ui-icon-alert"></span>
<strong>Alert:</strong> <?=$this->msg?></p>
</div>
<?php } else if ($this->ref) {?>
Votre référence : <?=strtoupper($this->ref)?>
<script>
$('#dialog').dialog({ buttons: [ {
text: "Quitter",
click: function() { $(this).dialog("close"); }
} ] });
</script>
<?php } else {?>
<p>Voulez vous commandez les <?php
switch ($this->type) {
case 'privsecu':
echo "privilèges de la sécurité sociale et des régimes complémentaires";
break;
case 'privtres':
echo "privilèges du Trésor Public";
break;
case 'nantfond':
echo "Nantissements du fonds de commerce ou du fonds artisanal";
break;
case 'declcrea':
echo "Déclarations de créances";
break;
}
?> ?</p>
<p><strong><?=$this->raisonSociale?></strong></p>
<p><i>(délai approximatif de 48 h)</i></p>
<p></p>
<p>Votre email : <?=$this->UserEmail?></p>
<form id="cmd" name="cmd" method="post" action="<?=$this->url(array('controller'=>'pieces',
'action'=>'privilege'), 'default', true)?>">
<input type="hidden" name="siren" value="<?=$this->siren?>" />
<input type="hidden" name="type" value="<?=$this->type?>" />
</form>
<script type="text/javascript">
$('#dialog').dialog({ buttons: {
'Valider': function() {
var url = $('#dialog form#cmd').attr('action');
var formValue = $('#dialog form#cmd').serialize();
$('div#dialog.ui-dialog-content').html("Commande en cours....");
$.post(url, formValue, function(data){
$('div#dialog.ui-dialog-content').html(data);
}).fail(function() {
$('div#dialog.ui-dialog-content').html("Error.");
});
},
'Annuler': function() { $(this).dialog('close'); }
}});
</script>
<?php }?>

View File

@ -0,0 +1 @@

View File

@ -52,8 +52,10 @@ span.poste input { width:50px; }
?>
</div>
<div id="saveMsg" style="text-align:center;width:100%;height:30px;clear:both;"></div>
<?php if ( $this->infos == 'NEW' ) {?>
<input type="hidden" name="originalDateCloture" value="<?=$this->dateCloture?>"/>
<input type="hidden" name="originalTypeBilan" value="<?=$this->typeBilan?>"/>
<?php }?>
<div style="text-align:center;">
<input type="submit" class="button" id=onlycheck name="onlycheck" value="Verifier" />
<input type="submit" class="button" id="normal" name="normal" value="Publier" />

View File

@ -8,67 +8,74 @@ class Application_Controller_Plugin_Menu extends Zend_Controller_Plugin_Abstract
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$layout = Zend_Layout::getMVCInstance();
$controller = $request->getControllerName();
$action = $request->getActionName();
$user = new Scores_Utilisateur();
//Disable display of menu
$activateLayout = true;
if ( $request->isXmlHttpRequest() ) {
$activateLayout = false;
}
if ( $controller == 'user' && in_array($action, array('login', 'logout')) ) {
$activateLayout = false;
}
if ( $controller == 'print' ) {
$activateLayout = false;
}
if ( $user->isLog() && $layout->isEnabled() && $request->getControllerName()!='print' )
{
$controller = $request->getControllerName();
$action = $request->getActionName();
//Layout enable - start displaying menu
if ( $layout->isEnabled() && $activateLayout ) {
//Override SIRET to complete with zero by left
$siret = $request->getParam('siret');
if ( intval($siret)>100 ) {
$request->setParam('siret', str_pad($siret, 9, '0', STR_PAD_LEFT));
}
$view = $layout->getView();
//Génération du menu
$computeMenu = new Scores_Menu($request->getParams());
$menu = $computeMenu->getMenu();
$view = $layout->getView();
$view->navigation($menu);
//Create menu from config
$config = include APPLICATION_PATH . '/configs/menu.config.php';
$container = new Zend_Navigation($config);
//Génération identifiant Menu
$view->menuId = $computeMenu->getIdMenu($controller, $action);
//Apply specific parameters - needed to have an global id
//@todo : Vérifier que l'on a bien uniquement ces paramètres - session ?
$id = $request->getParam('id');
$siret = $request->getParam('siret');
foreach ( $container->getPages() as $level1 ) {
foreach ( $level1->getPages() as $page ) {
$page->setParams(array(
'siret' => $siret,
'id' => $id,
));
}
}
//Test if the user has the right to access the page
$hasPerm = true;
$permPage = $computeMenu->getPagePermission($controller, $action);
if ( !empty($permPage) ) {
$hasPerm = false;
if (is_array($permPage)){
$list = $permPage;
} else if (is_string($permPage)){
$list = (array)$permPage;
}
foreach($list as $permission){
if ($user->checkPerm($permission)){
$hasPerm = true;
break;
}
}
}
//Assign menu to the view
if ( Zend_Registry::isRegistered('acl') ) {
$acl = Zend_Registry::get('acl');
$view->navigation($container)->setAcl($acl)->setRole($user->getProfil());
} else {
$view->navigation($container);
}
if ( !$hasPerm ) {
//Gestion affichage Lien Print / PDF / XML
$page = new Scores_Export_Print($controller, $action);
$request->setModuleName('default')
->setControllerName('error')
->setActionName('perms');
if ( $page->exportable('print') ){
$view->print = $page->filename('print', $request->getParams());
}
if ( $page->exportable('pdf') ){
$view->pdf = $page->filename('pdf', $request->getParams());
}
if ( $page->exportable('xml') && in_array($user->getIdClient(), array(1,147) ) ){
$view->xml = $page->filename('xml', $request->getParams());
}
} else {
}
//Gestion affichage Lien Print / PDF / XML
$page = new Scores_Export_Print($controller, $action);
if ($page->exportable('print')){
$view->print = $page->filename('print', $request->getParams());
}
if ($page->exportable('pdf')){
$view->pdf = $page->filename('pdf', $request->getParams());
}
if ($page->exportable('xml') && in_array($user->getIdClient(), array(1,147)) ){
$view->xml = $page->filename('xml', $request->getParams());
}
}
}
//Icone d'aide
if ($layout->isEnabled() && $request->getControllerName()!='recherche')
{
//$view->aide = true;
}
}
}

View File

@ -14,6 +14,13 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
$controller = $request->getControllerName();
$action = $request->getActionName();
//Load bootstrap
$bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
//Get useragent and device informations
$userAgent = $bootstrap->getResource('useragent');
$device = $userAgent->getDevice();
//Sauvegarde des paramètres du themes pour gérer les scripts et styles à utiliser
$paramsTheme = new stdClass();
$paramsTheme->name = $theme;
@ -21,38 +28,49 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
$paramsTheme->pathScript = '/themes/'.$theme.'/scripts';
$paramsTheme->pathImg = '/themes/'.$theme.'/images';
Zend_Registry::set('theme', $paramsTheme);
//Module default de l'application
$layoutPath = APPLICATION_PATH . '/views/' . $theme;
$viewPath = APPLICATION_PATH . '/views/' . $theme;
//Load bootstrap
$bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
//Get useragent and device informations
$userAgent = $bootstrap->getResource('useragent');
$device = $userAgent->getDevice();
//Override path for view and layout
$view = $bootstrap->bootstrap('View')->getResource('View');
$view = $bootstrap->bootstrap('View')->getResource('View');
$view->setBasePath($viewPath);
$layout = $bootstrap->bootstrap('Layout')->getResource('Layout');
$layout->setLayout('layout');
$view->theme = $paramsTheme;
$layout = $bootstrap->bootstrap('Layout')->getResource('Layout');
$layout->setLayout('layout');
$layout->setLayoutPath($layoutPath);
//Load default style and javascript files for the selected theme
switch ( $theme )
{
// --- Action, Controller condition
$UserLogin = false;
if ( $controller == 'user' && ( $action == 'login' || $action == 'logout' ) ) {
$UserLogin = true;
}
if ( $controller == 'auth' ) {
$UserLogin = true;
}
// --- IE6 Detection
$isIE6 = false;
if ( $device->getFeature('browser_name')=='Internet Explorer'
&& $device->getFeature('browser_version')=='6.0' ) {
$isIE6 = true;
}
// --- Load default style and javascript files for the selected theme
switch ( $theme )
{
/**
* Default theme
*/
case 'default':
default:
case 'default':
default:
$view->doctype('HTML5');
$view->doctype('HTML5');
$view->headMeta()
->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
$view->headMeta()
->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
->appendHttpEquiv('Content-Language', 'fr-FR');
//Favicon - Touch icon for iOS 2.0+ and Android 2.1+
@ -65,19 +83,19 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
'rel' => 'icon',
'type' => 'image/png',
'href' => '/favicon-32.png'
));
));
$view->headLink()->headLink(array(
'rel' => 'shortcut icon',
'type' => 'image/x-icon',
'href' => '/favicon.ico')
);
/**
* ===> Standard Styles
*/
if ( $UserLogin ) {
$view->headLink()
->appendStylesheet('/libs/bootstrap-3.3.2/css/bootstrap.min.css', 'all')
->appendStylesheet('/libs/bootstrap-3.3.4/css/bootstrap.min.css', 'all')
->appendStylesheet('/themes/default/styles/user-login.css', 'all');
} else {
$view->headLink()->appendStylesheet($paramsTheme->pathStyle.'/main.css', 'all');
@ -103,7 +121,7 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
->appendFile('/libs/respond.min.js', 'text/javascript', array('conditional' => 'lt IE 9'))
->appendFile('/libs/jquery/jquery-1.11.2.min.js', 'text/javascript')
->appendFile('/libs/jquery/jquery.placeholder.js', 'text/javascript')
->appendFile('/libs/bootstrap-3.3.2/js/bootstrap.min.js', 'text/javascript');
->appendFile('/libs/bootstrap-3.3.4/js/bootstrap.min.js', 'text/javascript');
} else {
$view->headScript()
->appendFile('/libs/jquery/jquery-1.11.2.min.js', 'text/javascript');
@ -125,7 +143,7 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
->appendFile('/libs/qtip/jquery.qtip.min.js', 'text/javascript')
->appendFile($paramsTheme->pathScript.'/script.js', 'text/javascript');
}
/**
* ===> Specific Style and Script by Controller/Action
* Specialized Controller - Action javascript
@ -197,11 +215,11 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
}
break;
/**
* New bootstrap theme
* New theme with bootstrap for 2015
*/
case 'bootstrap':
case 'default2015':
$view->doctype('HTML5');
@ -229,31 +247,38 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
);
/**
* ===> Standard Styles
*/
$view->headLink()->appendStylesheet('/libs/bootstrap-3.3.1/css/bootstrap.min.css', 'all');
$view->headLink()->appendStylesheet('/libs/ui-1.10.4/themes/smoothness/jquery-ui.min.css', 'all');
if ( !$UserLogin ) {
$view->headLink()
->appendStylesheet('/libs/qtip/jquery.qtip.min.css', 'all')
->appendStylesheet($paramsTheme->pathStyle.'/default.css', 'all');
}
* ===> Standard Styles
*/
$view->headLink()
->appendStylesheet('/libs/bootstrap-3.3.4/css/bootstrap.min.css', 'all')
->appendStylesheet('/libs/font-awesome-4.3.0/css/font-awesome.min.css', 'all')
->appendStylesheet('/libs/ui-1.11.3/themes/smoothness/jquery-ui.min.css', 'all')
->appendStylesheet('/libs/qtip/jquery.qtip.min.css', 'all');
if ( $UserLogin ) {
$view->headLink()
->appendStylesheet('/themes/default/styles/user-login.css', 'all');
} else {
$view->headLink()
->appendStylesheet($paramsTheme->pathStyle.'/main.css', 'all');
}
/**
* ===> Standard Javascript
*/
$view->headScript()
->appendFile('/libs/html5shiv.min.js', 'text/javascript', array('conditional' => 'lt IE 9'))
->appendFile('/libs/respond.min.js', 'text/javascript', array('conditional' => 'lt IE 9'))
->appendFile('/libs/jquery/jquery-1.11.2.min.js', 'text/javascript')
->appendFile('/libs/bootstrap-3.3.1/js/bootstrap.min.js', 'text/javascript')
->appendFile('/libs/ui-1.10.4/jquery-ui.min.js', 'text/javascript')
->appendFile('/libs/ui-1.10.4/jquery-ui-i18n.min.js', 'text/javascript');
if ( !$UserLogin ) {
$view->headScript()
->appendFile('/libs/qtip/jquery.qtip.min.js', 'text/javascript');
}
/**
* ===> Standard Javascript
*/
$view->headScript()
->appendFile('/libs/html5shiv.min.js', 'text/javascript', array('conditional' => 'lt IE 9'))
->appendFile('/libs/respond.min.js', 'text/javascript', array('conditional' => 'lt IE 9'))
->appendFile('/libs/jquery/jquery-1.11.2.min.js', 'text/javascript')
->appendFile('/libs/bootstrap-3.3.4/js/bootstrap.min.js', 'text/javascript')
->appendFile('/libs/ui-1.11.3/jquery-ui.min.js', 'text/javascript')
->appendFile('/libs/ui-1.11.3/i18n/datepicker-fr.js', 'text/javascript')
->appendFile('/libs/qtip/jquery.qtip.min.js', 'text/javascript');
if ( $UserLogin ) {
} else {
$view->headScript()
->appendFile($paramsTheme->pathScript.'/script.js', 'text/javascript');
}
break;
@ -286,17 +311,17 @@ class Application_Controller_Plugin_Theme extends Zend_Controller_Plugin_Abstrac
'href' => '/favicon.ico')
);
//Style
$view->headLink()
->appendStylesheet('/libs/mobile/1.4.2/jquery.mobile-1.4.2.min.css', 'all');
//JavaScript
//Style
$view->headLink()
->appendStylesheet('/libs/mobile/1.4.2/jquery.mobile-1.4.2.min.css', 'all');
//JavaScript
$view->headScript()
->appendFile('/libs/jquery/jquery-1.11.1.min.js', 'text/javascript')
->appendFile('/libs/jquery/jquery-2.1.0.min.js', 'text/javascript')
->appendFile('/libs/mobile/1.4.2/jquery.mobile-1.4.2.min.js', 'text/javascript')
->appendFile($paramsTheme->pathScript.'/script.js', 'text/javascript');
break;
break;
}
}
}

View File

@ -45,8 +45,7 @@ class Application_Form_RechercheEntreprise extends Zend_Form
//siret
$this->addElement('text', 'siret', array(
'filters' => array('StringTrim'),
'label' => 'Identifiant',
'description' => 'SIREN, SIRET, N° TVA, N° RC, R.N.A., ISIN',
'label' => 'SIREN',
'required' => 'true',
'decorators' => $this->elementDecorators,
'attribs' => array(
@ -58,8 +57,7 @@ class Application_Form_RechercheEntreprise extends Zend_Form
//raisonSocial
$this->addElement('text', 'raisonSociale', array(
'filters' => array('StringTrim'),
'label' => 'NOM',
'description' => 'Dénomination Sociale, Enseigne, Sigle',
'label' => 'Nom',
'required' => 'true',
'decorators' => $this->elementDecorators,
'attribs' => array(
@ -112,7 +110,7 @@ class Application_Form_RechercheEntreprise extends Zend_Form
'required' => 'true',
'decorators' => $this->elementDecorators,
'attribs' => array(
'size' => 18,
'size' => 20,
'maxlength' => 100,
),
));
@ -121,7 +119,7 @@ class Application_Form_RechercheEntreprise extends Zend_Form
//cpVille
$this->addElement('text', 'cpVille', array(
'filters' => array('StringTrim'),
'label' => 'CP OU DÉP. / VILLE',
'label' => 'CP ou DÉP. / Ville',
'required' => 'true',
'decorators' => $this->elementDecorators,
'attribs' => array(
@ -133,7 +131,7 @@ class Application_Form_RechercheEntreprise extends Zend_Form
//telFax
$this->addElement('text', 'telFax', array(
'filters' => array('StringTrim'),
'label' => 'TÉL / FAX',
'label' => 'Tél / Fax',
'required' => 'true',
'decorators' => $this->elementDecorators,
'attribs' => array(

View File

@ -0,0 +1,11 @@
<?php
class Application_Model_BilanInput extends Zend_Db_Table_Abstract
{
protected $_name = 'bilaninput';
public function setFlagSent($file)
{
$data = array('sent' => 1);
return $this->update($data, "file='$file'");
}
}

View File

@ -0,0 +1,87 @@
<?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

@ -79,7 +79,7 @@
Ù = "U"
Ú = "U"
Û = "U"
Ü = "U"
Ü = "Ue"
Ū = "U"
Ů = "U"
Ű = "U"

View File

@ -410,7 +410,7 @@ class Scores_Menu
),
),
array(
'label' => 'Options',
'label' => 'Tableau de bord',
'pages' => array(
array(
'label' => 'Nouveautés',
@ -418,24 +418,24 @@ class Scores_Menu
'action' => 'newliste',
),
array(
'label' => "Mes options",
'label' => "Paramètres",
'controller' => 'user',
'action' => 'index',
'permission' => 'MONPROFIL'
),
array(
'label' => "Mes surveillances",
'label' => "Surveillances",
'controller' => 'surveillance',
'action' => 'liste',
'permission' => 'SURVLISTE'
),
array(
'label' => "Surveillances fichier",
'label' => "Surveillances Fichier",
'controller' => 'surveillance',
'action' => 'fichier',
),
array(
'label' => "Mon portefeuille",
'label' => "Portefeuille",
'controller' => 'surveillance',
'action' => 'portefeuille',
'permission' => 'PORTEFEUILLE',
@ -446,12 +446,7 @@ class Scores_Menu
'action' => 'liste',
),
array(
'label' => "Surveillances",
'controller' => '',
'action' => '',
),
array(
'label' => "Se déconnecter",
'label' => "Déconnexion",
'controller' => 'user',
'action' => 'logout',
),

View File

@ -37,7 +37,7 @@ class RapportComment
}
if (count($BilansInfos->item)>0) {
foreach($BilansInfos->item as $item) {
if ($item->typeBilan == 'N') {
if (in_array($item->typeBilan, array('N','S'))) {
$this->bilansInfos[$item->dateCloture] = $item;
foreach($item->RatiosEntrep->item as $ratiosItem) {
$this->ratiosEntrep[$item->dateCloture][$ratiosItem->id] = $ratiosItem->val;
@ -497,7 +497,8 @@ class RapportComment
Zend_Registry::get('firebug')->info('Histo - id : '.$id);
Zend_Registry::get('firebug')->info('Histo - titre : '.$titre);
Zend_Registry::get('firebug')->info('Histo - strRatios : '.$strRatios);
//Gestion des couleurs
Zend_Registry::get('firebug')->info($this->ratiosEntrep);
// --- Gestion des couleurs
if(count($this->graphCouleurs)>0){
$couleurs = $this->graphCouleurs;
} else {
@ -507,11 +508,11 @@ class RapportComment
$data = array();
$dataInfos = array();
$nbRatio = 0;
//Détection des ratios
// --- Détection des ratios
$patternR = '/(Rs?)\[(.*)]#(.{1})/';
$patternP = '/(.*)_Y#(.{1})/';
foreach ( $ratios as $ratio ) {
//Ratios secteur et entreprise
// --- Ratios secteur et entreprise
if( preg_match($patternR, $ratio, $matches) ){
$typeRatio = $matches[1];
$numRatio = $matches[2];
@ -529,13 +530,13 @@ class RapportComment
break;
}
//Informations données
// --- Informations données
$dataInfos[$nbRatio] = array(
'titre' => $titreRatio,
'style' => $matches[3],
);
//Assignation données
// --- Assignation données
$xPrec = 0;
foreach ( $tabRatio as $key => $valRatio ){
$index = substr($key,0,4);
@ -555,7 +556,7 @@ class RapportComment
$xPrec = $index;
}
$nbRatio++;
//Ratios de projection
// --- Ratios de projection
} elseif ( preg_match($patternP, $ratio, $matches) ){
$titreRatio = $matches[1];
@ -574,7 +575,7 @@ class RapportComment
}
if ( !isset($unite) ) { $unite = 'EUR'; }
Zend_Registry::get('firebug')->info($data);
//Graphique
// --- Graphique
if ( count($data)<=1 ){
$output = false;
} else {

View File

@ -137,11 +137,6 @@ class Scores_Ws_Client extends Zend_Soap_Client
throw new Exception("Method $name not exist");
}
//@todo : gestion des paramètres envoyés sous forme d'array
if( is_array($arguments) ) {
}
$methodConfig = $this->config[$name];
//Cache
@ -198,7 +193,6 @@ class Scores_Ws_Client extends Zend_Soap_Client
//Gestion des SOAP fault
if ( array_key_exists('errorMsg', $methodConfig) ) {
if ( in_array($fault->faultcode, $methodConfig['errorMsg']) ) {
//throw new Exception($fault->faultstring, 'MSG');
throw new Exception($fault->faultstring);
}
}

View File

@ -0,0 +1,9 @@
<?php
return array(
'0.1' => array(
'setBilanInput' => array(
'debug' => true,
),
'setBilanInputFile' => null,
)
);

View File

@ -0,0 +1,12 @@
<?php
return array(
'0.1' => array(
'setAssoStatut' => array(
'debug' => true,
),
'setPrivileges' => array(
'debug' => true,
'errorMsg' => array('0902'),
),
)
);

View File

@ -0,0 +1,8 @@
<?php
return array(
'0.2' => array(
'setGeoCode' => array(
'debug' => true,
),
)
);

View File

@ -1,45 +1,40 @@
<?php
// Generated by ZF's ./bin/classmap_generator.php
return array(
'Annonces' => dirname(__FILE__) . '/Annonces.php',
'Scores_Auth_Adapter_Db' => dirname(__FILE__) . '/Auth/Adapter/Db.php',
'Scores_Auth_Adapter_Ws' => dirname(__FILE__) . '/Auth/Adapter/Ws.php',
'BDF' => dirname(__FILE__) . '/Bdf.php',
'Cache' => dirname(__FILE__) . '/Cache.php',
'Scores_Export_ArrayCsv' => dirname(__FILE__) . '/Export/ArrayCsv.php',
'Scores_Export_Print' => dirname(__FILE__) . '/Export/Print.php',
'Scores_Finance_Liasse_XLS' => dirname(__FILE__) . '/Finance/Liasse/XLS.php',
'Scores_Finance_Liasse' => dirname(__FILE__) . '/Finance/Liasse.php',
'Scores_Finance_Ratios_Data' => dirname(__FILE__) . '/Finance/Ratios/Data.php',
'Scores_Finance_Ratios_Graph' => dirname(__FILE__) . '/Finance/Ratios/Graph.php',
'GestionCommande' => dirname(__FILE__) . '/GestionCommandes.php',
'Scores_Google_Maps' => dirname(__FILE__) . '/Google/Maps.php',
'Scores_Google_Streetview' => dirname(__FILE__) . '/Google/Streetview.php',
'IdentiteEntreprise' => dirname(__FILE__) . '/IdentiteEntreprise.php',
'IdentiteProcol' => dirname(__FILE__) . '/IdentiteProcol.php',
'Scores_Insee_AvisSituation' => dirname(__FILE__) . '/Insee/AvisSituation.php',
'Scores_Insee_Iris' => dirname(__FILE__) . '/Insee/Iris.php',
'Logo' => dirname(__FILE__) . '/Logo.php',
'Scores_Mail' => dirname(__FILE__) . '/Mail.php',
'Mappy' => dirname(__FILE__) . '/Mappy.php',
'Scores_Menu' => dirname(__FILE__) . '/Menu.php',
'Scores_Mobile_Detect' => dirname(__FILE__) . '/Mobile/Detect.php',
'RapportComment' => dirname(__FILE__) . '/RapportComment.php',
'Scores_Serializer_Adapter_Xml' => dirname(__FILE__) . '/Serializer/Adapter/Xml.php',
'Scores_Session_Entreprise' => dirname(__FILE__) . '/Session/Entreprise.php',
'Scores_Session_Recherche' => dirname(__FILE__) . '/Session/Recherche.php',
'Siren' => dirname(__FILE__) . '/Siren.php',
'Scores_Utilisateur' => dirname(__FILE__) . '/Utilisateur.php',
'Scores_Wkhtml_Pdf' => dirname(__FILE__) . '/Wkhtml/Pdf.php',
'Scores_Ws_Abstract' => dirname(__FILE__) . '/Ws/Abstract.php',
'Scores_Ws_Catalog' => dirname(__FILE__) . '/Ws/Catalog.php',
'Scores_Ws_Config' => dirname(__FILE__) . '/Ws/Config.php',
'Scores_Ws_Entreprise' => dirname(__FILE__) . '/Ws/Entreprise.php',
'Scores_Ws_Gestion' => dirname(__FILE__) . '/Ws/Gestion.php',
'Scores_Ws_Interface' => dirname(__FILE__) . '/Ws/Interface.php',
'Scores_Ws_Interne' => dirname(__FILE__) . '/Ws/Interne.php',
'Scores_Ws_Pieces' => dirname(__FILE__) . '/Ws/Pieces.php',
'Scores_Ws_Saisie' => dirname(__FILE__) . '/Ws/Saisie.php',
'Scores_Ws' => dirname(__FILE__) . '/Ws.php',
'WsScores' => dirname(__FILE__) . '/WsScores.php',
'Annonces' => dirname(__FILE__) . '//Annonces.php',
'Scores_Auth_Adapter_Db' => dirname(__FILE__) . '//Auth/Adapter/Db.php',
'Scores_Auth_Adapter_Ws' => dirname(__FILE__) . '//Auth/Adapter/Ws.php',
'BDF' => dirname(__FILE__) . '//Bdf.php',
'Cache' => dirname(__FILE__) . '//Cache.php',
'Scores_Export_ArrayCsv' => dirname(__FILE__) . '//Export/ArrayCsv.php',
'Scores_Export_Print' => dirname(__FILE__) . '//Export/Print.php',
'Scores_Finance_Liasse_XLS' => dirname(__FILE__) . '//Finance/Liasse/XLS.php',
'Scores_Finance_Liasse' => dirname(__FILE__) . '//Finance/Liasse.php',
'Scores_Finance_Ratios_Data' => dirname(__FILE__) . '//Finance/Ratios/Data.php',
'Scores_Finance_Ratios_Graph' => dirname(__FILE__) . '//Finance/Ratios/Graph.php',
'GestionCommande' => dirname(__FILE__) . '//GestionCommandes.php',
'Scores_Google_Maps' => dirname(__FILE__) . '//Google/Maps.php',
'Scores_Google_Streetview' => dirname(__FILE__) . '//Google/Streetview.php',
'IdentiteEntreprise' => dirname(__FILE__) . '//IdentiteEntreprise.php',
'IdentiteProcol' => dirname(__FILE__) . '//IdentiteProcol.php',
'Scores_Insee_AvisSituation' => dirname(__FILE__) . '//Insee/AvisSituation.php',
'Scores_Insee_Iris' => dirname(__FILE__) . '//Insee/Iris.php',
'Scores_Locale_String' => dirname(__FILE__) . '//Locale/String.php',
'Logo' => dirname(__FILE__) . '//Logo.php',
'Scores_Mail' => dirname(__FILE__) . '//Mail.php',
'Mappy' => dirname(__FILE__) . '//Mappy.php',
'Scores_Menu' => dirname(__FILE__) . '//Menu.php',
'Scores_Mobile_Detect' => dirname(__FILE__) . '//Mobile/Detect.php',
'Scores_Pdf_Fpdi' => dirname(__FILE__) . '//Pdf/Fpdi.php',
'Scores_Pdf_Page' => dirname(__FILE__) . '//Pdf/Page.php',
'Scores_Pdf_Tcpdf' => dirname(__FILE__) . '//Pdf/Tcpdf.php',
'RapportComment' => dirname(__FILE__) . '//RapportComment.php',
'Scores_Serializer_Adapter_Xml' => dirname(__FILE__) . '//Serializer/Adapter/Xml.php',
'Scores_Session_Entreprise' => dirname(__FILE__) . '//Session/Entreprise.php',
'Scores_Session_Recherche' => dirname(__FILE__) . '//Session/Recherche.php',
'Siren' => dirname(__FILE__) . '//Siren.php',
'Scores_Utilisateur' => dirname(__FILE__) . '//Utilisateur.php',
'Scores_Wkhtml_Pdf' => dirname(__FILE__) . '//Wkhtml/Pdf.php',
'Scores_Ws_Client' => dirname(__FILE__) . '//Ws/Client.php',
'WsScores' => dirname(__FILE__) . '//WsScores.php',
);

View File

@ -1,92 +0,0 @@
<?php
/**
* @file
* Miscellaneous functions to clean 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.
*/
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 .'/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;
}
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 .'/i18n-ascii.txt');
}
$i18n_loaded = true;
}
$output = strtr($output, $translations);
}
return $output;
}
// Fixes the encoding to uf8
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
function cleanstring_deep($value)
{
$value = is_array($value) ?
array_map('cleanstring_deep', $value) :
cleanstring($value);
return $value;
}
?>

View File

@ -62,7 +62,6 @@ $(document).ready(function()
$(this).load(url);
},
buttons: {
Valider: function() { formEnvoiBilanSubmit(); },
Annuler: function() { $(this).dialog('close'); }
},
close: function() { $('#dialogbilanclient').remove(); }

View File

@ -0,0 +1,19 @@
--
-- Structure de la table `bilaninput`
--
CREATE TABLE IF NOT EXISTS `bilaninput` (
`file` varchar(255) NOT NULL COMMENT 'Nom du fichier',
`sent` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1 si fichier envoyé',
`dateUpdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Liste des bilans à transférer pour la saisie';
--
-- Index pour les tables exportées
--
--
-- Index pour la table `bilaninput`
--
ALTER TABLE `bilaninput`
ADD PRIMARY KEY (`file`), ADD KEY `sent` (`sent`);

View File

@ -1,20 +0,0 @@
--
-- Structure de la table `commandes`
--
CREATE TABLE IF NOT EXISTS `commandes` (
`idCommande` int(11) NOT NULL AUTO_INCREMENT,
`idUser` int(11) NOT NULL DEFAULT '0',
`login` varchar(32) NOT NULL DEFAULT '',
`emailCommande` varchar(80) NOT NULL DEFAULT '',
`siren` int(9) unsigned zerofill NOT NULL DEFAULT '000000000',
`refDocument` varchar(255) NOT NULL DEFAULT '',
`libDocument` varchar(255) NOT NULL DEFAULT '',
`typeCommande` varchar(255) NOT NULL,
`statutCommande` tinyint(4) NOT NULL DEFAULT '0',
`commentaire` varchar(255) NOT NULL DEFAULT '',
`dateCommande` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`dateReception` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`idCommande`),
KEY `dateReception` (`dateReception`)
) DEFAULT CHARSET=utf8;

View File

@ -1,24 +0,0 @@
--
-- Structure de la table `commandes_kbis`
--
CREATE TABLE IF NOT EXISTS `commandes_kbis` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idUser` int(11) NOT NULL,
`login` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(82) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`societe` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`nom` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`adresse` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`cp` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`ville` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`siren` int(9) NOT NULL,
`raisonSociale` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`type` char(1) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`document` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
`statutCommande` int(11) NOT NULL DEFAULT '0',
`info` varchar(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
`dateCommande` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`dateReception` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8 COMMENT='Kbis original courrier';

View File

@ -1,19 +0,0 @@
--
-- Structure de la table `commandes_pieces`
--
CREATE TABLE IF NOT EXISTS `commandes_pieces` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idUser` int(11) NOT NULL,
`login` varchar(32) NOT NULL,
`email` varchar(80) NOT NULL,
`raisonSociale` varchar(200) NOT NULL,
`siren` varchar(9) NOT NULL,
`type` char(1) NOT NULL,
`document` varchar(200) NOT NULL,
`info` text NOT NULL,
`statutCommande` int(11) NOT NULL,
`dateCommande` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`dateReception` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;

View File

@ -81,7 +81,6 @@ if(isset($opts->install))
);
$c = new Zend_Config($application->getOptions());
//Create data directory and all his children
//Create data directory and all his children
$dirToCreate = array(
APPLICATION_PATH.'/../data',

View File

@ -0,0 +1,5 @@
# Envoi commande bilan
0 * * * * root php /home/vhosts/extranet/scripts/jobs/bilaninput.php --send >> /home/vhosts/data/log/bilaninput.log 2>&1
# Suppression fichier
0 10 1 * * root php /home/vhosts/extranet/scripts/jobs/bilaninput.php --delete >> /home/vhosts/data/log/bilaninput.log 2>&1

View File

@ -0,0 +1 @@
/home/vhosts/data/bilanclient IN_CLOSE_WRITE php /home/vhosts/extranet/scripts/jobs/bilaninput.php --save $# >> /home/vhosts/data/log/bilaninput.log 2>&1

172
scripts/jobs/bilaninput.php Normal file
View File

@ -0,0 +1,172 @@
<?php
/**
* @todo :
* Faire en sorte que chaque extranet récupére la liste des bilans à traiter, depuis le webservice
* pour envoyer sur le ftp
*/
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../application'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
//Use classmap autoloader - useful with opcode and realpath cache
require_once 'Zend/Loader/AutoloaderFactory.php';
require_once 'Zend/Loader/ClassMapAutoloader.php';
Zend_Loader_AutoloaderFactory::factory(array(
'Zend_Loader_ClassMapAutoloader' => array(
__DIR__ . '/../../library/Zend/autoload_classmap.php',
__DIR__ . '/../../library/Application/autoload_classmap.php',
__DIR__ . '/../../library/Scores/autoload_classmap.php',
__DIR__ . '/../../application/autoload_classmap.php',
),
'Zend_Loader_StandardAutoloader' => array(
'prefixes' => array(
'Zend' => __DIR__ . '/../../library/Zend',
'Application' => __DIR__ . '/../../library/Application',
'Scores' => __DIR__ . '/../../library/Scores',
'Metier' => __DIR__ . '/../../library/Metier',
),
'fallback_autoloader' => true
)
));
// Zend_Application - Use it if you don't have autoloaders
//require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
try {
$opts = new Zend_Console_Getopt(
//Options
array(
'help|?' => "Affiche l'aide.",
'send-s' => "Envoi tous les fichiers non traité par FTP (si nom du fichier fourni force l'envoi).",
'delete' => "Supprime les anciens fichiers et leurs références",
'save=s' => "Enregistre la présence d'un fichier"
));
$opts->parse();
} catch (Zend_Console_Getopt_Exception $e) {
echo $e->getUsageMessage();
exit;
}
//Usage
if(count($opts->getOptions())==0 || isset($opts->help))
{
echo "Bilan en commande saisi.";
echo "\n\n";
echo $opts->getUsageMessage();
echo "\n";
exit;
}
$test = false;
if ( isset($opts->list) ) {
$test = true;
}
$c = new Zend_Config($application->getOptions());
Zend_Registry::set('config', $c);
define ('PATH_DATA', $c->profil->path->data);
define('FTP_HOST', 'ftp.scores-decisions.com');
define('FTP_USER', 'bilansext');
define('FTP_PASS', 'j12azt78');
define('FTP_DIR', 'send');
// --- Functions
function sendToFtp($localFile, $remoteFile)
{
$conn_id = ftp_connect(FTP_HOST);
$login_result = ftp_login($conn_id, FTP_USER, FTP_PASS);
ftp_chdir($conn_id, FTP_DIR);
$return = false;
if (ftp_put($conn_id, $remoteFile, $localFile, FTP_BINARY)) {
$return = true;
}
ftp_close($conn_id);
return $return;
}
// --- Connexion à la base de données
$db = Zend_Db::factory($c->profil->db->sdv1);
Zend_Db_Table_Abstract::setDefaultAdapter($db);
$model = new Application_Model_BilanInput();
// --- Suppression des fichiers traités
if ( $opts->delete ) {
echo date('Y-m-d H:i:s')." - Suppression fichier.\n";
try {
$sql = $model->select()->where('sent=?', 1)->where('DATE_SUB(CURDATE(),INTERVAL 30 DAY) >= dateUpdate');
$result = $model->fetchAll($sql);
if (count($result) > 0) {
foreach ($result as $item) {
if( unlink(PATH_DATA . '/bilanclient/' . $item->file) ){
$model->delete("file='".$item->file."'");
}
}
}
} catch(Zend_Db_Exception $e) {
echo date('Y-m-d H:i:s')." - ".$e->getMessage().".\n";
}
echo date('Y-m-d H:i:s')." - Suppression fichier FIN.\n";
}
if ( $opts->save ) {
echo date('Y-m-d H:i:s')." - Enregistrement fichier.\n";
$model->insert(array('file' => $opts->save, 'sent' => 0));
echo date('Y-m-d H:i:s')." - Enregistrement fichier FIN.\n";
}
// --- Envoi
if ( $opts->send ) {
echo date('Y-m-d H:i:s')." - Envoi fichier.\n";
$tabFichier = array();
// --- Selection fichier
if ( $opts->send !== true ) {
$tabFichier[] = basename($opts->send);
} else {
$sql = $model->select()->where('sent=?', 0);
$result = $model->fetchAll($sql);
if (count($result) > 0) {
foreach($result as $item) {
$tabFichier[] = $item->file;
}
}
}
// --- Envoi sur le FTP
if (count($tabFichier) > 0) {
foreach ($tabFichier as $fichier) {
echo date('Y-m-d H:i:s')." - Envoi fichier ";
if ( sendToFtp(PATH_DATA.'/bilanclient/'.$fichier, $fichier) ) {
$model->setFlagSent($fichier);
echo $fichier." - OK";
} else {
echo $fichier." - Erreur";
}
echo "\n";
}
}
echo date('Y-m-d H:i:s')." - Envoi fichier FIN.\n";
}