From 50b3e4818f6fd3a50d928a4112360e4f14d7b97d Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 21 Dec 2010 10:30:20 +0000 Subject: [PATCH 1/6] Correction chemin fichier xml --- www/pages/scorescf.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/www/pages/scorescf.php b/www/pages/scorescf.php index 4e818f4c0..6322c04de 100644 --- a/www/pages/scorescf.php +++ b/www/pages/scorescf.php @@ -49,7 +49,7 @@ $req=''. $date=date('Ymd'); $fichier=$siret.'-'.$date.'.xml'; - if ( !file_exists(PATH_SITE.'/creditsafe/'.$fichier) ) + if ( !file_exists(PATH_SITE.'/cache/creditsafe/'.$fichier) ) { $url='https://www.creditsafe.fr/getdata/service/CSFRServices.asmx/GetData?RequestXmlStr='.$req; $referer=$cookie=''; @@ -57,19 +57,19 @@ $req=''. $referer=$url; $xml = html_entity_decode($page['body'], ENT_QUOTES, 'UTF-8'); /** Enregistrement du fichier XML en provenance des greffes **/ - $fp=@fopen(PATH_SITE.'/creditsafe/'.$fichier, 'w'); + $fp=@fopen(PATH_SITE.'/cache/creditsafe/'.$fichier, 'w'); @fwrite($fp, $xml); @fclose($fp); $O = $client->setLog('scorecsf', $siret); } else { /** Lecture du fichier XML en provenance des greffes **/ - $xml = file_get_contents(PATH_SITE.'/creditsafe/'.$fichier); + $xml = file_get_contents(PATH_SITE.'/cache/creditsafe/'.$fichier); $O = $client->setLog('scorecsf', $siret, 0, 'local'); } $dom_object = new DomDocument2(); //TODO : Chemin !! - $dom_object->load(PATH_SITE.'/creditsafe/'.$fichier); + $dom_object->load(PATH_SITE.'/cache/creditsafe/'.$fichier); $companyname=$dom_object->getValueFromTag('companyname'); $rating=$dom_object->getValueFromTag('rating'); $ratingdesc1=str_replace('?',"'",$dom_object->getValueFromTag('ratingdesc1')); From f6ae93e0e93577f2807a5c52229839c2511a1845 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Thu, 23 Dec 2010 09:48:51 +0000 Subject: [PATCH 2/6] =?UTF-8?q?Ajout=20rapport=20par=20email=20de=20l'int?= =?UTF-8?q?=C3=A9gration=20des=20actes=20dans=20le=20syst=C3=A8me?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- batch/getActes.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/batch/getActes.php b/batch/getActes.php index b12ae34d7..a574842f8 100644 --- a/batch/getActes.php +++ b/batch/getActes.php @@ -29,6 +29,10 @@ define ('ACTES_IGNUM_FTP_URL', 'ftp2.scores-decisions.com'); define ('ACTES_IGNUM_FTP_USER', 'mpc2500'); define ('ACTES_IGNUM_FTP_PASS', 'passmpc78'); +$report_email = 'production@scores-decisions.com'; +$report_subject = 'Traitement des actes '.date('Y-m-d H:i:s'); +$report_txt = ''; + require_once realpath(dirname(__FILE__) . '/../framework/fwk.php'); require_once realpath(dirname(__FILE__) . '/../config/config.inc'); require_once realpath(dirname(__FILE__) . '/mysql.php'); @@ -201,6 +205,7 @@ foreach ($tabCommandes as $ref => $commande){ if ($testMail){ echo "Envoi fichier $nomCible ($ref) à ".$commande['emailCommande']; } else { + $report_txt.= "$ref intégré à l'extranet"; $isMailSent = false; if (trim($commande['emailCommande'])!=''){ $isMailSent = sendMail($commande, $nomCible); @@ -214,9 +219,12 @@ foreach ($tabCommandes as $ref => $commande){ array( 'dateReception' => date('YmdHis') ), 'idCommande='.$commande['idCommande'] ); + $report_txt.= ' - Email envoyé à '.$commande['emailCommande']; } else { + $report_txt.= ' - Email non envoyé !'; echo date ('Y/m/d - H:i:s')." ERREUR - Email non envoyé et commande $ref non mise à jour".EOL; } + $report_txt.= "\n"; } } @@ -227,4 +235,9 @@ foreach ($tabCommandes as $ref => $commande){ } ftp_close($conn_id); +//Envoi du mail de rapport +if (!test && !$testMail){ + mail($report_email, $report_subject, $report_txt); +} + ?> \ No newline at end of file From c0a03723c7bfcd57495f71d5ae5366d93ea55599 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Mon, 3 Jan 2011 10:06:27 +0000 Subject: [PATCH 3/6] Simplification affichage --- includes/identite/news.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/includes/identite/news.php b/includes/identite/news.php index 82b5c4337..ebc10a1f2 100644 --- a/includes/identite/news.php +++ b/includes/identite/news.php @@ -6,7 +6,7 @@ if ( hasPref('news') ){ require_once ('XML/RSS.php'); $url = 'http://news.google.fr/news?hl=fr&ned=fr&q='. urlencode('"'.$etab['Nom'].'"').'&output=rss'; - $firephp->log($url, 'url'); + FB::log($url, 'url'); $rss = new XML_RSS($url); $rss->parse(); $tabMonth = array('Jan' => 1, 'Feb' => 2, 'Mar' => 3, 'Apr' => 4, @@ -16,8 +16,8 @@ if ( hasPref('news') ){ foreach ($rss->getItems() as $i=>$item) { if ($i == 0) { ?> - Information presse (Source Google News ©)
- Date: Mon, 3 Jan 2011 10:10:11 +0000 Subject: [PATCH 4/6] Ajout webservice de secours --- config/sd-13408/config.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/sd-13408/config.inc b/config/sd-13408/config.inc index 16027d332..ccfce6818 100644 --- a/config/sd-13408/config.inc +++ b/config/sd-13408/config.inc @@ -57,6 +57,10 @@ if (in_array(ENVIRONNEMENT, array('REC', 'DEV'))) { } else { define ('WEBSERVICE_URL','http://78.31.45.206:8088/ws/'); define ('WEBSERVICE_URI','http://78.31.45.206:8088/'); + /* + define ('WEBSERVICE_URL','http://88.162.202.159:8080/ws/'); + define ('WEBSERVICE_URI','http://88.162.202.159:8080/ws'); + */ } //Webservice INFOGREFFE define ('INFOGREFFE_WS_URL','https://webservices.infogreffe.fr/WSContextInfogreffe/INFOGREFFE'); From 333a524adb904fd34dfa16f97cbc09216555a284 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 11 Jan 2011 09:21:37 +0000 Subject: [PATCH 5/6] Mode maintenance en commentaire --- config/update/update-sql-20110103.sql | 8 +++ includes/maintenance/maintenance.php | 93 +++++++++++++++++++++++++++ includes/soaperror.php | 2 + www/index.php | 1 + www/index_auth.php | 9 ++- www/ipconnect.php | 2 +- www/maintenance.php | 39 +++++++++++ 7 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 config/update/update-sql-20110103.sql create mode 100644 includes/maintenance/maintenance.php create mode 100644 www/maintenance.php diff --git a/config/update/update-sql-20110103.sql b/config/update/update-sql-20110103.sql new file mode 100644 index 000000000..54bda26f6 --- /dev/null +++ b/config/update/update-sql-20110103.sql @@ -0,0 +1,8 @@ +CREATE TABLE IF NOT EXISTS `maintenance` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `mode` int(11) NOT NULL, + `message` int(11) NOT NULL, + `countMaintenance` int(11) NOT NULL, + `dateEven` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 \ No newline at end of file diff --git a/includes/maintenance/maintenance.php b/includes/maintenance/maintenance.php new file mode 100644 index 000000000..e04010fda --- /dev/null +++ b/includes/maintenance/maintenance.php @@ -0,0 +1,93 @@ +=$countEventMax || $info[0]['mode']==1){ + if ($error && + $info[0]['countMaintenance']>=$countEventMax && $info[0]['mode']==0) + { + $sql = "UPDATE sdv1.maintenance SET mode=1, ". + "dateEven=".date('Y-m-d H:i:s'). + " WHERE ".$info[0]['id']; + if (mysql_query($sql, $link)){ + return true; + } + } + return true; + } + return false; +} + +function maintenanceIncrement() +{ + $link = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS); + if (!$link) { + return false; + } + $sql = 'SELECT id FROM sdv1.maintenance ORDER BY dateEven DESC, LIMIT 1'; + $result = mysql_query($sql, $link); + if (!$result) { + return false; + } + if (mysql_num_rows($result)==0){ + $sql = "INSERT INTO sdv1.maintenance (mode, countMaintenance, dateEven) ". + "VALUES (0, 0, '".date('Y-m-d H:i:s')."')"; + $result = mysql_query($sql, $link); + } + $info = mysql_fetch_assoc($result); + $sql = "UPDATE sdv1.maintenance SET countMaintenance=countMaintenance+1, ". + "dateEven=".date('Y-m-d H:i:s'); + " WHERE ".$info[0]['id']; + if (mysql_query($sql, $link)){ + return true; + } + return false; +} + + diff --git a/includes/soaperror.php b/includes/soaperror.php index 670e5efe9..af98cfde6 100644 --- a/includes/soaperror.php +++ b/includes/soaperror.php @@ -20,6 +20,8 @@ function processSoapFault($clientSoap, $fault, $tabInfo, $debug = FALSE){ global $firephp; + //maintenanceMode(true); + $message = 'Request : '. $clientSoap->__getLastRequest() . '\n\n' . 'Response : '.$clientSoap->__getLastResponse() . '\n\n'; diff --git a/www/index.php b/www/index.php index b02e94f0a..7f1f63426 100644 --- a/www/index.php +++ b/www/index.php @@ -7,6 +7,7 @@ require_once '../config/prepend.php'; require_once 'index.fct.php'; require_once 'fwk.php'; require_once 'default/_includes/mysql.php'; +require_once 'maintenance/maintenance.php'; require_once 'index_auth.php'; require_once 'user/user.php'; diff --git a/www/index_auth.php b/www/index_auth.php index 7ffdbf280..3e944ca4c 100644 --- a/www/index_auth.php +++ b/www/index_auth.php @@ -1,5 +1,10 @@ faultcode!='900') { require_once 'soaperror.php'; diff --git a/www/ipconnect.php b/www/ipconnect.php index 9297e5b85..29cf00aa2 100644 --- a/www/ipconnect.php +++ b/www/ipconnect.php @@ -1,3 +1,3 @@ \ No newline at end of file diff --git a/www/maintenance.php b/www/maintenance.php new file mode 100644 index 000000000..072f0c9c6 --- /dev/null +++ b/www/maintenance.php @@ -0,0 +1,39 @@ + + + + + +Extranet Scores & Décisions - <?=$title?> + + +
+
+
+
+
+ Maintenance en cours...
+ Le service est momentanément indisponible.
+
+ +
+
+
+ + \ No newline at end of file From 8d6069cc0df195a9524819f39283f71bb19ec5bc Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Wed, 12 Jan 2011 08:29:58 +0000 Subject: [PATCH 6/6] Ajout source ANTE pour edition annonce --- includes/saisie/saisie_annonces.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/saisie/saisie_annonces.php b/includes/saisie/saisie_annonces.php index 20d25662a..3a071b4bd 100644 --- a/includes/saisie/saisie_annonces.php +++ b/includes/saisie/saisie_annonces.php @@ -89,8 +89,10 @@ switch ( $subaction ) { FB::log($idanResult, 'result'); //Limitation des événements $eventLimits = array('5500'); - foreach ( $eventLimits as $eventLimit ) { - if ( in_array($eventLimit, $idanResult['even']) && $idanResult['source']=='JT' ) { + foreach ( $eventLimits as $eventLimit ) + { + if ( in_array($eventLimit, $idanResult['even']) && in_array($idanResult['source'], array('JT', 'ANTE'))) + { echo ''; echo ''; echo '
';