From 8a8f2fe7cad96469c7460f706558457b37bd5aed Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 9 Mar 2015 09:55:18 +0000 Subject: [PATCH 01/20] Formattage --- application/views/default/scripts/identite/lienfiche.phtml | 4 ++-- application/views/default/scripts/identite/liens.phtml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/application/views/default/scripts/identite/lienfiche.phtml b/application/views/default/scripts/identite/lienfiche.phtml index f3ce25289..fe8803b5a 100644 --- a/application/views/default/scripts/identite/lienfiche.phtml +++ b/application/views/default/scripts/identite/lienfiche.phtml @@ -46,8 +46,8 @@ edition) { ?>
- -Editer la fiche +Editer la fiche + + + +
+ + +
+ Réel normal (Liasse 2050)
+ Simplifé (Liasse 2033)
+ Consolidé
+
(JJ/MM/AAAA)

- - Réel normal (Liasse 2050) - Simplifié (Liasse 2033) - Consolidé -




@@ -31,29 +67,33 @@ Ce bilan n'est pas confidentiel (saisie gratuite)
Ce bilan est confidentiel et ne doit être utilisé que pour les utilisateurs -de votre société (+5€ HT par bilan saisi) -

-
- -Instantané par le site : envoi du bilan au format numérique -
- -Par courrier +de votre société (+7€ HT par bilan saisi)

-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) -
+

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. -
+ \ No newline at end of file + + + diff --git a/application/views/default/scripts/finance/saisiebilanup.phtml b/application/views/default/scripts/finance/saisiebilanup.phtml new file mode 100644 index 000000000..b4af10a43 --- /dev/null +++ b/application/views/default/scripts/finance/saisiebilanup.phtml @@ -0,0 +1,19 @@ +upload) && $this->upload == true){?> + +Fichier envoyé + + +upload) && $this->upload == false) {?> + +
+

+ Alert: errMsg?>

+
+ + \ No newline at end of file diff --git a/library/Application/Model/BilanInput.php b/library/Application/Model/BilanInput.php new file mode 100644 index 000000000..4daa5df1d --- /dev/null +++ b/library/Application/Model/BilanInput.php @@ -0,0 +1,11 @@ + 1); + return $this->update($data, "file='$file'"); + } +} \ No newline at end of file diff --git a/library/Scores/Ws/Client/Order.php b/library/Scores/Ws/Client/Order.php new file mode 100644 index 000000000..d8447b639 --- /dev/null +++ b/library/Scores/Ws/Client/Order.php @@ -0,0 +1,9 @@ + array( + 'setBilanInput' => array( + 'debug' => true, + ), + 'setBilanInputFile' => null, + ) +); \ No newline at end of file diff --git a/public/themes/default/scripts/finance.js b/public/themes/default/scripts/finance.js index 0435a7cf6..f3d826819 100644 --- a/public/themes/default/scripts/finance.js +++ b/public/themes/default/scripts/finance.js @@ -62,7 +62,6 @@ $(document).ready(function() $(this).load(url); }, buttons: { - Valider: function() { formEnvoiBilanSubmit(); }, Annuler: function() { $(this).dialog('close'); } }, close: function() { $('#dialogbilanclient').remove(); } diff --git a/scripts/build/config/_sql/structure/bilaninput.sql b/scripts/build/config/_sql/structure/bilaninput.sql new file mode 100644 index 000000000..ad368ed38 --- /dev/null +++ b/scripts/build/config/_sql/structure/bilaninput.sql @@ -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` datetime 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 KEY `file` (`file`), ADD KEY `sent` (`sent`); \ No newline at end of file diff --git a/scripts/build/etc/cron.d/bilaninput b/scripts/build/etc/cron.d/bilaninput new file mode 100644 index 000000000..03e196b00 --- /dev/null +++ b/scripts/build/etc/cron.d/bilaninput @@ -0,0 +1,5 @@ +# Envoi commande bilan +0 * * * * root php /home/vhosts/extranet/scripts/jobs/bilaninput.php --send + +# Suppression fichier +0 10 1 * * root php /home/vhosts/extranet/scripts/jobs/bilaninput.php --delete diff --git a/scripts/build/etc/incron.d/bilaninput b/scripts/build/etc/incron.d/bilaninput new file mode 100644 index 000000000..bc2b40c93 --- /dev/null +++ b/scripts/build/etc/incron.d/bilaninput @@ -0,0 +1 @@ +/home/vhosts/data/bilanclient IN_CLOSE_WRITE php /home/vhosts/extranet/scripts/jobs/bilaninput.php --save $# \ No newline at end of file diff --git a/scripts/jobs/bilaninput.php b/scripts/jobs/bilaninput.php new file mode 100644 index 000000000..bc2fef9f7 --- /dev/null +++ b/scripts/jobs/bilaninput.php @@ -0,0 +1,172 @@ + 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"; +} From 8b13ecb5968b2ca3d311a46626532db3f905645d Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Wed, 18 Mar 2015 08:21:32 +0000 Subject: [PATCH 05/20] Double comment --- scripts/build/configure.php | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/build/configure.php b/scripts/build/configure.php index 7d52c727b..44872dd66 100644 --- a/scripts/build/configure.php +++ b/scripts/build/configure.php @@ -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', From 2c4a3c0c87bfc9cd94a78e429c57a9c608346adc Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 20 Mar 2015 08:32:27 +0000 Subject: [PATCH 06/20] =?UTF-8?q?Correction=20non=20prise=20en=20compte=20?= =?UTF-8?q?des=20bilans=20simplifi=C3=A9=20dans=20les=20grahiques=20du=20r?= =?UTF-8?q?apport?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/Scores/RapportComment.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/library/Scores/RapportComment.php b/library/Scores/RapportComment.php index 6b615fbcc..c13c0448f 100644 --- a/library/Scores/RapportComment.php +++ b/library/Scores/RapportComment.php @@ -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 { From 7516f12a578fbc462008ce982e47efcd25a84a6a Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 20 Mar 2015 09:46:52 +0000 Subject: [PATCH 07/20] =?UTF-8?q?Move=20cleanchar=20librairie=20avec=20com?= =?UTF-8?q?patibilit=C3=A9=20autoloading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/RechercheController.php | 17 ++-- library/Scores/Locale/String.php | 87 ++++++++++++++++++ .../Locale/String}/i18n-ascii.txt | 2 +- .../Locale/String}/special.txt | 0 library/i18n/cleanchar.php | 92 ------------------- 5 files changed, 94 insertions(+), 104 deletions(-) create mode 100644 library/Scores/Locale/String.php rename library/{i18n => Scores/Locale/String}/i18n-ascii.txt (99%) rename library/{i18n => Scores/Locale/String}/special.txt (100%) delete mode 100644 library/i18n/cleanchar.php diff --git a/application/controllers/RechercheController.php b/application/controllers/RechercheController.php index f6dfef109..38b792156 100644 --- a/application/controllers/RechercheController.php +++ b/application/controllers/RechercheController.php @@ -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]); diff --git a/library/Scores/Locale/String.php b/library/Scores/Locale/String.php new file mode 100644 index 000000000..6a9b815ba --- /dev/null +++ b/library/Scores/Locale/String.php @@ -0,0 +1,87 @@ + \ No newline at end of file From 3e44cb15cd7f222381e6ec5ab1869cc83892a6d0 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 20 Mar 2015 10:28:46 +0000 Subject: [PATCH 08/20] Mise a jour du fichier d'autloading --- library/Scores/autoload_classmap.php | 77 +++++++++++++--------------- 1 file changed, 36 insertions(+), 41 deletions(-) diff --git a/library/Scores/autoload_classmap.php b/library/Scores/autoload_classmap.php index 6506eec1b..f13ece175 100644 --- a/library/Scores/autoload_classmap.php +++ b/library/Scores/autoload_classmap.php @@ -1,45 +1,40 @@ 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', ); From eac7586f9d59659a0beda22904922682c7f082bb Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Wed, 25 Mar 2015 13:48:42 +0000 Subject: [PATCH 09/20] =?UTF-8?q?Saisie=20bilan=20:=20Message=20sur=20bila?= =?UTF-8?q?n=20consolid=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/default/scripts/finance/saisiebilan.phtml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/application/views/default/scripts/finance/saisiebilan.phtml b/application/views/default/scripts/finance/saisiebilan.phtml index 69a3116a4..681ae9ff3 100644 --- a/application/views/default/scripts/finance/saisiebilan.phtml +++ b/application/views/default/scripts/finance/saisiebilan.phtml @@ -11,10 +11,6 @@ Votre référence : BS-ref)?>

Saisie du bilan de la Société raisonSociale?> clôturé le bilanCloture?> au format type?>

-
@@ -23,7 +19,7 @@ Votre fichier :
- - -upload) && $this->upload == false) {?> - -errMsg?> - - - -Votre référence : BSref?> -

- -
- - - -Votre fichier : - -
-
-
- - - \ No newline at end of file From 65de830533d092c33b9ab01840d8215a24b68c96 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Wed, 25 Mar 2015 15:38:43 +0000 Subject: [PATCH 11/20] =?UTF-8?q?KBIS=20:=20Suppression=20interface=20et?= =?UTF-8?q?=20envoi=20mail,=20voir=20backoffice=20dor=C3=A9navant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/PiecesController.php | 83 -------------------- 1 file changed, 83 deletions(-) diff --git a/application/controllers/PiecesController.php b/application/controllers/PiecesController.php index db972974c..aa1c946fe 100644 --- a/application/controllers/PiecesController.php +++ b/application/controllers/PiecesController.php @@ -1085,44 +1085,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 :'. - ''. - $this->siret.''.PHP_EOL. - 'pour login '.$user->getLogin().'('.$email.')
'.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 +1127,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 : '. - ''. - $this->siret.'
'.PHP_EOL. - 'pour login '.$user->getLogin(). - '('.$email.')'.'
'.PHP_EOL. - 'Référence Client : '.$ref.PHP_EOL. - 'Référence Backoffice : '.strtoupper($response).PHP_EOL. - 'Societe :'.$params['societe'].'
'.PHP_EOL. - 'Nom : '.$params['nom'].'
'.PHP_EOL. - 'Prenom : '.$params['prenom'].'
'.PHP_EOL. - 'Adresse : '.$params['adresse'].'
'.PHP_EOL. - 'CP : '.$params['cp'].'
'.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',''.$this->view->translate('Erreur : Tous les champs doivent être renseigner.').''); From f3586e1100dcb4c9819bef289fe445acd6479d4f Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Wed, 25 Mar 2015 15:53:17 +0000 Subject: [PATCH 12/20] =?UTF-8?q?Saisie=20de=20bilan=20:=20Suppression=20l?= =?UTF-8?q?ors=20de=20la=20cr=C3=A9ation=20des=20dates=20pr=C3=A9vues=20po?= =?UTF-8?q?ur=20la=20modification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/SaisieController.php | 31 +++++++++++++------ .../views/default/scripts/saisie/liasse.phtml | 2 ++ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/application/controllers/SaisieController.php b/application/controllers/SaisieController.php index 37b69588f..cf2dfa082 100644 --- a/application/controllers/SaisieController.php +++ b/application/controllers/SaisieController.php @@ -534,7 +534,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 +1054,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 +1401,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 +1419,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 +1454,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'], diff --git a/application/views/default/scripts/saisie/liasse.phtml b/application/views/default/scripts/saisie/liasse.phtml index 616710c0a..6f45ebd63 100644 --- a/application/views/default/scripts/saisie/liasse.phtml +++ b/application/views/default/scripts/saisie/liasse.phtml @@ -52,8 +52,10 @@ span.poste input { width:50px; } ?>
+ infos == 'NEW' ) {?> +
From 5b8ae3de0733b8a258f7a693e2225acad79a2cfb Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Wed, 25 Mar 2015 19:32:32 +0000 Subject: [PATCH 13/20] =?UTF-8?q?Mise=20=C3=A0=20jour=20model,=20crontab,?= =?UTF-8?q?=20incron?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/_sql/structure/bilaninput.sql | 4 ++-- .../build/config/_sql/structure/commandes.sql | 20 ---------------- .../config/_sql/structure/commandes_kbis.sql | 24 ------------------- .../_sql/structure/commandes_pieces.sql | 19 --------------- scripts/build/etc/cron.d/bilaninput | 4 ++-- scripts/build/etc/incron.d/bilaninput | 2 +- 6 files changed, 5 insertions(+), 68 deletions(-) delete mode 100644 scripts/build/config/_sql/structure/commandes.sql delete mode 100644 scripts/build/config/_sql/structure/commandes_kbis.sql delete mode 100644 scripts/build/config/_sql/structure/commandes_pieces.sql diff --git a/scripts/build/config/_sql/structure/bilaninput.sql b/scripts/build/config/_sql/structure/bilaninput.sql index ad368ed38..8bcfc203b 100644 --- a/scripts/build/config/_sql/structure/bilaninput.sql +++ b/scripts/build/config/_sql/structure/bilaninput.sql @@ -5,7 +5,7 @@ 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` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP + `dateUpdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Liste des bilans à transférer pour la saisie'; -- @@ -16,4 +16,4 @@ CREATE TABLE IF NOT EXISTS `bilaninput` ( -- Index pour la table `bilaninput` -- ALTER TABLE `bilaninput` - ADD KEY `file` (`file`), ADD KEY `sent` (`sent`); \ No newline at end of file + ADD PRIMARY KEY (`file`), ADD KEY `sent` (`sent`); \ No newline at end of file diff --git a/scripts/build/config/_sql/structure/commandes.sql b/scripts/build/config/_sql/structure/commandes.sql deleted file mode 100644 index af822a400..000000000 --- a/scripts/build/config/_sql/structure/commandes.sql +++ /dev/null @@ -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; \ No newline at end of file diff --git a/scripts/build/config/_sql/structure/commandes_kbis.sql b/scripts/build/config/_sql/structure/commandes_kbis.sql deleted file mode 100644 index 82cfaec3c..000000000 --- a/scripts/build/config/_sql/structure/commandes_kbis.sql +++ /dev/null @@ -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'; \ No newline at end of file diff --git a/scripts/build/config/_sql/structure/commandes_pieces.sql b/scripts/build/config/_sql/structure/commandes_pieces.sql deleted file mode 100644 index 2cba92128..000000000 --- a/scripts/build/config/_sql/structure/commandes_pieces.sql +++ /dev/null @@ -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; \ No newline at end of file diff --git a/scripts/build/etc/cron.d/bilaninput b/scripts/build/etc/cron.d/bilaninput index 03e196b00..30ea8e844 100644 --- a/scripts/build/etc/cron.d/bilaninput +++ b/scripts/build/etc/cron.d/bilaninput @@ -1,5 +1,5 @@ # Envoi commande bilan -0 * * * * root php /home/vhosts/extranet/scripts/jobs/bilaninput.php --send +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 +0 10 1 * * root php /home/vhosts/extranet/scripts/jobs/bilaninput.php --delete >> /home/vhosts/data/log/bilaninput.log 2>&1 diff --git a/scripts/build/etc/incron.d/bilaninput b/scripts/build/etc/incron.d/bilaninput index bc2b40c93..00054bfd8 100644 --- a/scripts/build/etc/incron.d/bilaninput +++ b/scripts/build/etc/incron.d/bilaninput @@ -1 +1 @@ -/home/vhosts/data/bilanclient IN_CLOSE_WRITE php /home/vhosts/extranet/scripts/jobs/bilaninput.php --save $# \ No newline at end of file +/home/vhosts/data/bilanclient IN_CLOSE_WRITE php /home/vhosts/extranet/scripts/jobs/bilaninput.php --save $# >> /home/vhosts/data/log/bilaninput.log 2>&1 \ No newline at end of file From a68d1224cec3695b731d21bede14f8c4e1d29fb7 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Thu, 26 Mar 2015 07:10:56 +0000 Subject: [PATCH 14/20] =?UTF-8?q?Modification=20des=20libell=C3=A9s=20du?= =?UTF-8?q?=20Menu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/Scores/Menu.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/library/Scores/Menu.php b/library/Scores/Menu.php index 8d8c0d8a8..75531c5a8 100644 --- a/library/Scores/Menu.php +++ b/library/Scores/Menu.php @@ -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' => "Deconnexion", 'controller' => 'user', 'action' => 'logout', ), From 6616e7c86a7c55f750bac66be6b72d26a58862e5 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Sun, 29 Mar 2015 17:29:07 +0000 Subject: [PATCH 15/20] Suppression tableau static des cours d'appel --- application/controllers/SaisieController.php | 47 -------------------- 1 file changed, 47 deletions(-) diff --git a/application/controllers/SaisieController.php b/application/controllers/SaisieController.php index cf2dfa082..a0f881a4c 100644 --- a/application/controllers/SaisieController.php +++ b/application/controllers/SaisieController.php @@ -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 From 445a33f64f0927cb4be713979dea5ffad3916ab3 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 30 Mar 2015 09:24:26 +0000 Subject: [PATCH 16/20] Correction pour la carte --- .../default/scripts/identite/carte.phtml | 161 ++++++++++++------ 1 file changed, 108 insertions(+), 53 deletions(-) diff --git a/application/views/default/scripts/identite/carte.phtml b/application/views/default/scripts/identite/carte.phtml index 430258db4..959c327e8 100644 --- a/application/views/default/scripts/identite/carte.phtml +++ b/application/views/default/scripts/identite/carte.phtml @@ -1,68 +1,123 @@ -
+
Préparation de la carte ...
\ No newline at end of file From 0cb2febdf98c46d84bbb968cde1eedf18bd1f083 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Wed, 1 Apr 2015 13:34:43 +0000 Subject: [PATCH 17/20] Comment --- application/controllers/PiecesController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/PiecesController.php b/application/controllers/PiecesController.php index aa1c946fe..2e4667de9 100644 --- a/application/controllers/PiecesController.php +++ b/application/controllers/PiecesController.php @@ -790,8 +790,8 @@ class PiecesController extends Zend_Controller_Action } /** - * Affichage status association - */ + * Affichage status association + */ public function associationactesAction() { $user = new Scores_Utilisateur(); From ff7ef8d93013f9051765c9b7381b333135cbf18a Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 3 Apr 2015 12:57:04 +0000 Subject: [PATCH 18/20] Meilleur gestion des comandes associations, bilan en saisie, privileges --- application/controllers/PiecesController.php | 145 ++++++++++-------- .../scripts/pieces/associationactes.phtml | 73 ++++----- .../default/scripts/pieces/bilanenter.phtml | 81 +++++----- .../views/default/scripts/pieces/bilans.phtml | 6 +- .../scripts/pieces/cmdassociation.phtml | 65 +++++--- .../default/scripts/pieces/commande.phtml | 121 ++++++++------- .../default/scripts/pieces/privilege.phtml | 62 ++++++++ library/Scores/Ws/Client.php | 6 - library/Scores/Ws/Client/Pieces.php | 12 ++ 9 files changed, 330 insertions(+), 241 deletions(-) create mode 100644 application/views/default/scripts/pieces/privilege.phtml create mode 100644 library/Scores/Ws/Client/Pieces.php diff --git a/application/controllers/PiecesController.php b/application/controllers/PiecesController.php index 2e4667de9..cebad4a23 100644 --- a/application/controllers/PiecesController.php +++ b/application/controllers/PiecesController.php @@ -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 '.$ref.'.'; - } 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); } + } /** diff --git a/application/views/default/scripts/pieces/associationactes.phtml b/application/views/default/scripts/pieces/associationactes.phtml index 5d617e028..0c85de5c4 100644 --- a/application/views/default/scripts/pieces/associationactes.phtml +++ b/application/views/default/scripts/pieces/associationactes.phtml @@ -25,43 +25,34 @@

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élai approximatif de 15 jours)

- -
- - -
- -
- -
-
+ Commander les statuts de l'association... + -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- actes)!=0){?> @@ -73,13 +64,13 @@ + + + PDF + + + diff --git a/application/views/default/scripts/pieces/bilanenter.phtml b/application/views/default/scripts/pieces/bilanenter.phtml index a9d67eb0b..62be85606 100644 --- a/application/views/default/scripts/pieces/bilanenter.phtml +++ b/application/views/default/scripts/pieces/bilanenter.phtml @@ -1,53 +1,46 @@ form == 'display') {?> -

Commande de la saisie des chiffres du bilan date,8,2).'/'.substr($this->date,5,2).'/'. - substr($this->date,0,4)?> pour intégration et calcul dans les éléments financiers.

+

Commande de la saisie des chiffres du bilan date,8,2).'/'.substr($this->date,5,2).'/'. + substr($this->date,0,4)?> pour intégration et calcul dans les éléments financiers.

-isAuthorize ) {?> - -

-Des frais supplémentaires peuvent s'appliquer suivant vos accords contractuels. -
- - - -
- - - - - - - - - - - - - - err ) {?> - err?> + isAuthorize ) {?> + +
+ Des frais supplémentaires peuvent s'appliquer suivant vos accords contractuels. +
+ + + + +
+ + + - Commande enregistrée sous la référence msg?> + + + + + + + msg?> + -

Actes & Status

-
-message?> -
+ - \ No newline at end of file +

Voulez vous commandez les derniers statuts à jour de l'association ?

+

raisonSociale?>

+

(délai approximatif de 15 jours)

+

+

Votre email : UserEmail?>

+ + + + + + + diff --git a/application/views/default/scripts/pieces/commande.phtml b/application/views/default/scripts/pieces/commande.phtml index adf38bbf3..5e7719db2 100644 --- a/application/views/default/scripts/pieces/commande.phtml +++ b/application/views/default/scripts/pieces/commande.phtml @@ -69,72 +69,75 @@

PRIVILÉGES & NANTISSEMENTS

-
+ permPriv ) {?> -
- - - -
-KbisErreurCJ || $this->KbisErreurDEP){ - $disponible = false; -} -if ( $disponible ) { ?> - permSurvPriv ) { ?> - privileges) && in_array('SprivSurv',$this->privileges) ? 'checked' : ''?>/>Privilèges de la sécurité sociale et des régimes complémentaires et Trésor Public
(avec surveillance, retour sous 48 à 72h)

-
+ KbisErreurCJ || $this->KbisErreurDEP){ + $disponible = false; + } + ?> + permSurvPriv ) { ?> + Commander la mise en suivi des privilèges(surveillance des privilèges auprès du greffe, retour sous 48 à 72h) +
- 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)
- privileges) && in_array('privTres',$this->privileges) ? 'checked' : ''?>/>Privilèges du Trésor Public (mail sous 12h ouvrées)
-
- privileges) && in_array('nantFond',$this->privileges) ? 'checked' : ''?>/>Nantissements du fonds de commerce ou du fonds artisanal (conventionnels et judiciaires)
- privileges) && in_array('nantVend',$this->privileges) ? 'checked' : ''?>/>Privilèges du vendeur de fonds de commerce et d'action résolutoire
+ +
+ +

Privilèges de la sécurité sociale et des régimes complémentaires - Commander

+ +

Privilèges du Trésor Public - Commander

+ +

Nantissements du fonds de commerce ou du fonds artisanal (conventionnels et judiciaires) - Commander

+ +

Déclarations de créances - Commander

+ + + +

Les pièces demandées seront commandées par courrier auprès du greffe. Prévoir un délai de 2 à 3 semaines.

+ +

Les pièces demandées seront commandées auprès du greffe, et vous seront transmises dans un delai approximatif de 48h.

+ - privileges) && in_array('declCrea',$this->privileges) ? 'checked' : ''?>/>Déclarations de créances
- - privileges) && in_array('privSecu',$this->privileges) ? 'checked' : ''?>/>Privilèges de la sécurité sociale et des régimes complémentaires
- privileges) && in_array('privTres',$this->privileges) ? 'checked' : ''?>/>Privilèges du Trésor Public
- privileges) && in_array('nantCompl',$this->privileges) ? 'checked' : ''?>/>Etat complet des nantissements
- -
- -

Les pièces demandées seront commandées par courrier auprès du greffe. Prévoir un délai de 2 à 3 semaines.

- -
- -
- -
- -
- -Précisez votre e-mail pour recevoir la commande. -
-
- -
- -
- -Votre référence. -
-
-
- -
-
-
- - +
- +

translate("Vous n'avez pas les droits d'accès pour cette fonctionalité."); ?>

- -
+ + \ No newline at end of file diff --git a/application/views/default/scripts/pieces/privilege.phtml b/application/views/default/scripts/pieces/privilege.phtml new file mode 100644 index 000000000..16f4631c2 --- /dev/null +++ b/application/views/default/scripts/pieces/privilege.phtml @@ -0,0 +1,62 @@ +msg) {?> + +
+

+ Alert: msg?>

+
+ +ref) {?> + +Votre référence : ref)?> + + + + +

Voulez vous commandez les 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; +} +?> ?

+

raisonSociale?>

+

(délai approximatif de 48 h)

+

+

Votre email : UserEmail?>

+ + + + + + + + \ No newline at end of file diff --git a/library/Scores/Ws/Client.php b/library/Scores/Ws/Client.php index 652f3102a..aa9e39208 100644 --- a/library/Scores/Ws/Client.php +++ b/library/Scores/Ws/Client.php @@ -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); } } diff --git a/library/Scores/Ws/Client/Pieces.php b/library/Scores/Ws/Client/Pieces.php new file mode 100644 index 000000000..8eebcde77 --- /dev/null +++ b/library/Scores/Ws/Client/Pieces.php @@ -0,0 +1,12 @@ + array( + 'setAssoStatut' => array( + 'debug' => true, + ), + 'setPrivileges' => array( + 'debug' => true, + 'errorMsg' => array('0902'), + ), + ) +); \ No newline at end of file From 1ee1a7f6d72b65921b7ad399943feb1ff9baeb02 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 7 Apr 2015 09:50:54 +0000 Subject: [PATCH 19/20] Envoi geocodate et elevation au webservice --- application/controllers/SaisieController.php | 38 ++++++++++ .../default/scripts/identite/carte.phtml | 70 ++++++++++--------- .../default/scripts/saisie/geocode.phtml | 1 + library/Scores/Ws/Client/Saisie.php | 8 +++ 4 files changed, 84 insertions(+), 33 deletions(-) create mode 100644 application/views/default/scripts/saisie/geocode.phtml create mode 100644 library/Scores/Ws/Client/Saisie.php diff --git a/application/controllers/SaisieController.php b/application/controllers/SaisieController.php index a0f881a4c..b1d1a9a77 100644 --- a/application/controllers/SaisieController.php +++ b/application/controllers/SaisieController.php @@ -2940,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 = $siren; + $p->type = 'siren'; + $p->data = json_encode($data); + $p->override = false; + $ws->setGeoCode($p); + } + } } \ No newline at end of file diff --git a/application/views/default/scripts/identite/carte.phtml b/application/views/default/scripts/identite/carte.phtml index 959c327e8..b4d1317d8 100644 --- a/application/views/default/scripts/identite/carte.phtml +++ b/application/views/default/scripts/identite/carte.phtml @@ -40,6 +40,41 @@ function createMarker(m) { }); // --- 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', { + lat: m.locationLat, + lng: m.locationLng, + alt: alt, + address: m.locationAddress, + precis: m.locationType + }); + } + } + }); + } } // --- Load Google Map @@ -62,39 +97,6 @@ function loadGoogleMap() { } } -// --- Altitude -function getElevation(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]) { - return results[0].elevation; - } - } else { - return ''; - } - }); -} - -// --- Set GeoCode -function setGeocode() -{ - $.each(marks, function (i, item){ - if (item.gps.lat && item.gps.lon) { - // --- Do nothing - } else { - var alt = getElevation(item.location); - //$.get(); - } - }); -} - // --- Wait the document is ready $(document).ready(function(){ // --- Start timer @@ -110,6 +112,8 @@ $(document).ready(function(){ 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 } diff --git a/application/views/default/scripts/saisie/geocode.phtml b/application/views/default/scripts/saisie/geocode.phtml new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/application/views/default/scripts/saisie/geocode.phtml @@ -0,0 +1 @@ + diff --git a/library/Scores/Ws/Client/Saisie.php b/library/Scores/Ws/Client/Saisie.php new file mode 100644 index 000000000..f03df4258 --- /dev/null +++ b/library/Scores/Ws/Client/Saisie.php @@ -0,0 +1,8 @@ + array( + 'setGeoCode' => array( + 'debug' => true, + ), + ) +); \ No newline at end of file From 51bfe130d0c61443692c538eb303928b131e7553 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 7 Apr 2015 15:49:53 +0000 Subject: [PATCH 20/20] Geo localisation : Ajout du siret au marqueur et validation du fonctionnement --- application/controllers/IdentiteController.php | 13 +++++++------ application/controllers/SaisieController.php | 2 +- .../views/default/scripts/identite/carte.phtml | 3 ++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/application/controllers/IdentiteController.php b/application/controllers/IdentiteController.php index ca91ca578..efcc9f90a 100644 --- a/application/controllers/IdentiteController.php +++ b/application/controllers/IdentiteController.php @@ -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); diff --git a/application/controllers/SaisieController.php b/application/controllers/SaisieController.php index b1d1a9a77..1917d6478 100644 --- a/application/controllers/SaisieController.php +++ b/application/controllers/SaisieController.php @@ -2971,7 +2971,7 @@ class SaisieController extends Zend_Controller_Action // --- Execute $ws = new Scores_Ws_Client('saisie', '0.2'); $p = new stdClass(); - $p->companyId = $siren; + $p->companyId = $request->getParam('siret'); $p->type = 'siren'; $p->data = json_encode($data); $p->override = false; diff --git a/application/views/default/scripts/identite/carte.phtml b/application/views/default/scripts/identite/carte.phtml index b4d1317d8..c107baf61 100644 --- a/application/views/default/scripts/identite/carte.phtml +++ b/application/views/default/scripts/identite/carte.phtml @@ -4,7 +4,7 @@ marks.';'?> var timer; var timerSecondInterval = 5; -var timerSecondMax = 120; +var timerSecondMax = 300; var timeCount = 0; var marksNb = marks.length; var markDone = 1; @@ -65,6 +65,7 @@ function createMarker(m) { alt = 0; } $.post('/saisie/geocode', { + siret: m.siret, lat: m.locationLat, lng: m.locationLng, alt: alt,
- - - PDF - - -