Scores_Mail

This commit is contained in:
Michael RICOIS 2013-10-25 06:45:25 +00:00
parent 2a4402a3fd
commit 26b9019f7a
11 changed files with 34 additions and 47 deletions

View File

@ -51,8 +51,7 @@ class ErrorController extends Zend_Controller_Action
$message.= "Referer : ".$_SERVER['HTTP_REFERER']."\n";
$c = Zend_Registry::get('config');
require_once 'Scores/Mail.php';
$mail = new Mail();
$mail = new Scores_Mail();
$mail->setSubject('[ERREUR APPLICATIVE] - '.$c->profil->server->name.' -'.date('Ymd'));
$mail->setBodyTexte($message);
$mail->setFrom('supportdev');

View File

@ -10,7 +10,6 @@ class EvaluationController extends Zend_Controller_Action
$this->siret = $request->getParam('siret');
$this->id = $request->getParam('id', 0);
require_once 'common/dates.php';
require_once 'Scores/WsScores.php';
require_once 'Scores/SessionEntreprise.php';
require_once 'Scores/IdentiteEntreprise.php';
@ -107,7 +106,6 @@ class EvaluationController extends Zend_Controller_Action
$this->view->headScript()->appendFile('/themes/default/scripts/finance.js', 'text/javascript');
$user = new Scores_Utilisateur();
$wdate = new WDate();
if(!$user->checkPerm('INDISCORE2') && !$user->checkPerm('INDISCORE2P'))
$this->_forward('perms', 'error');
@ -165,8 +163,9 @@ class EvaluationController extends Zend_Controller_Action
$dataTotal[$idRatio] = $ratiosData->dTotal($typeBilan, $annee, $idRatio, $valRatio['total']);
$dInfo[$idRatio] = $valRatio['total_info'];
}
$date = new Zend_Date($annee, 'yyyyMMdd');
$tabResult[] = array(
'dateCloture' => $wdate->dateT('Ymd','d/m/Y',$annee),
'dateCloture' => $date->toString('dd/MM/yyyy'),
'duree' => $infosAnnee[$annee]->duree.' Mois',
'ratio' => $data,
'total' => $dataTotal,
@ -217,9 +216,10 @@ class EvaluationController extends Zend_Controller_Action
$this->view->assign('dBlock', $dBlock);
$dateRadiation = '';
if(isset($indiscore->DateRadiation) && $indiscore->DateRadiation!='' && $indiscore->DateRadiation!='0000-00-00')
$this->view->assign('dateRadiation', $wdate->dateT('Ymd', 'd/m/Y', str_replace('-','',$indiscore->DateRadiation)));
if(isset($indiscore->DateRadiation) && $indiscore->DateRadiation!='' && $indiscore->DateRadiation!='0000-00-00') {
$date = new Zend_Date(str_replace('-','',$indiscore->DateRadiation), 'yyyyMMdd');
$this->view->assign('dateRadiation', $date->toString('dd/MM/yyyy'));
}
foreach($indiscore->scores as $name => $sc){
if($name == 'ConanH')
$score[$name] = array($sc, 'Score Conan Holder');
@ -658,8 +658,7 @@ class EvaluationController extends Zend_Controller_Action
$texte = "<pre>".print_r($InfoUser, 1)."</pre>".
"<pre>".print_r($InfoEnq, 1)."</pre>";
require_once 'Scores/Mail.php';
$mail = new Mail();
$mail = new Scores_Mail();
$mail->setFrom('production');
$mail->addToKey('support');
$mail->setSubject($sujet);
@ -814,8 +813,7 @@ class EvaluationController extends Zend_Controller_Action
if (preg_match('#^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,5}$#',$email)) {
$message = 'Entreprise mise sous surveillance scoring partenaire !';
require_once 'Scores/Mail.php';
$mail = new Mail();
$mail = new Scores_Mail();
$mail->setSubject("Demande de surveillance score CreditSafe pour $siren à ".$email);
$user = new Scores_Utilisateur();

View File

@ -638,8 +638,7 @@ class PiecesController extends Zend_Controller_Action
//Envoi mail de commande courrier
if($type=='C') {
require_once 'Scores/Mail.php';
$mail = new Mail();
$mail = new Scores_Mail();
$mail->setFrom('contact');
$mail->addToKey('support');
$mail->setSubject('[COMMANDE PIECES] - '.'COMMANDE DE '.strtoupper($vue));
@ -878,8 +877,7 @@ class PiecesController extends Zend_Controller_Action
$message = '<br/>Impossible de télécharger le fichier auprès de notre partenaire.';
//Envoi Mail avec reférence erreur
require_once 'Scores/Mail.php';
$mail = new Mail();
$mail = new Scores_Mail();
$mail->setFrom('supportdev');
$mail->addToKey('supportdev');
$sujet = "[ERREUR TELECHARGEMENT INFOGREFFE] - ".date('d')."/".date('m')."/".date('Y');
@ -1076,8 +1074,7 @@ class PiecesController extends Zend_Controller_Action
//Envoi Mail avec reférence erreur
require_once 'Scores/Mail.php';
$mail = new Mail();
$mail = new Scores_Mail();
$mail->setFrom('supportdev');
$mail->addToKey('supportdev');
$sujet = "[ERREUR TELECHARGEMENT INFOGREFFE] - ".date('d')."/".date('m')."/".date('Y');
@ -1155,8 +1152,7 @@ class PiecesController extends Zend_Controller_Action
//Vérification des champs
if (!empty($email)) {
//Envoi du mail
require_once 'Scores/Mail.php';
$mail = new Mail();
$mail = new Scores_Mail();
$mail->setFrom('contact');
$mail->addToKey('support');
$mail->setSubject('[COMMANDE PIECES] - KBIS par email');
@ -1210,8 +1206,7 @@ class PiecesController extends Zend_Controller_Action
}
if(!$error) {
//Envoi du mail
require_once 'Scores/Mail.php';
$mail = new Mail();
$mail = new Scores_Mail();
$mail->setFrom('contact');
$mail->addToKey('support');
$mail->setSubject('[COMMANDE PIECES] - KBIS par courrier');
@ -1289,8 +1284,7 @@ class PiecesController extends Zend_Controller_Action
$privilegesJ = join(', ', $privileges);
$privilegesLog = join('-', $privileges);
require_once 'Scores/Mail.php';
$mail = new Mail();
$mail = new Scores_Mail();
$mail->setFrom('contact');
$mail->addToKey('support');
$mail->setSubject('[COMMANDE PIECES] - PRIVILEGES par email');
@ -1541,8 +1535,7 @@ class PiecesController extends Zend_Controller_Action
{
if(!empty($params['email']))
{
require_once 'Scores/Mail.php';
$mail = new Mail();
$mail = new Scores_Mail();
$mail->setFrom('contact');
$mail->addToKey('support');
$mail->setSubject('[COMMANDE PIECES] - KBIS par email après essai(s) de téléchargement');

View File

@ -306,8 +306,7 @@ class RechercheController extends Zend_Controller_Action
$message.= "Prénom : ".$user->getPrenom()."<br/>";
$objet = "Demande d'investigation";
require_once 'Scores/Mail.php';
$mail = new Mail();
$mail = new Scores_Mail();
$mail->setFrom('contact');
$mail->addToKey('support');
$mail->setSubject($objet);
@ -723,8 +722,8 @@ class RechercheController extends Zend_Controller_Action
if ($etab->ActActif==0){
$preDate = ', avant le ';
}
require_once 'common/dates.php';
if ($etab->ActDateLien!='') $item['InfoActionnaire'].= $preDate.WDate::dateT('Y-m-d', 'd/m/Y',$etab->ActDateLien);
$date = new Zend_Date($etab->ActDateLien, 'yyyy-MM-dd');
if ($etab->ActDateLien!='') $item['InfoActionnaire'].= $preDate.$date->toString('dd/MM/yyyy');
if ($etab->ActPmin!='') {
if($etab->ActPmin<1){
$item['InfoActionnaire'].= ', minoritaire ';
@ -1037,9 +1036,14 @@ class RechercheController extends Zend_Controller_Action
$item['source'] = $etab->Infos->source;
$item['ref'] = $etab->Infos->ref;
require_once 'common/dates.php';
$item['dateAjout'] = WDate::dateT('Y-m-d','d/m/Y',$etab->Infos->dateAjout);
$item['dateEnvoi'] = ($etab->Infos->dateEnvoi!='0000-00-00') ? WDate::dateT('Y-m-d','d/m/Y',$etab->Infos->dateEnvoi) : '';
$date = new Zend_Date($etab->Infos->dateAjout, 'yyyy-MM-dd');
$item['dateAjout'] = $date->toString('dd/MM/yyyy');
if ( $etab->Infos->dateEnvoi!='0000-00-00' ) {
$date = new Zend_Date($etab->Infos->dateEnvoi, 'yyyy-MM-dd');
$item['dateEnvoi'] = $date->toString('dd/MM/yyyy');
} else {
$item['dateEnvoi'] = '';
}
$liste[] = $item;
}

View File

@ -621,8 +621,7 @@ class UserController extends Zend_Controller_Action
$mailbody .= "Aussi nous vous invitons à vous rapprocher de votre interlocuteur commercial habituel ";
$mailbody .= "ou de votre responsable suivi relations Scores & Décisions au sein de votre société.</p>";
require_once 'Scores/Mail.php';
$mail = new Mail();
$mail = new Scores_Mail();
$mail->setSubject("Demande d'envoi des identifiants");
$mail->setBodyHTML($mailbody);
$mail->setFrom('support');

View File

@ -94,8 +94,7 @@ class AvisSituation
'http://avis-situation-sirene.insee.fr'.EOL.
'pour login '.$user->getLogin().EOL;
require_once 'Scores/Mail.php';
$mail = new Mail();
$mail = new Scores_Mail();
$mail->setFrom('contact');
$mail->addToKey('support');
$mail->setSubject($objet);

View File

@ -1,5 +1,5 @@
<?php
class Mail
class Scores_Mail
{
protected $config;
protected $mail;

View File

@ -2886,8 +2886,7 @@ class WsScores
$message.= "Requete :\n ".$requete."\n";
$message.= "Reponse :\n ".$reponse."\n";
$c = Zend_Registry::get('config');
require_once 'Scores/Mail.php';
$mail = new Mail();
$mail = new Scores_Mail();
$mail->setSubject('[ERREUR SOAP] - '.$c->profil->server->name.' -'.date('Ymd'));
$mail->setBodyTexte($message);
$mail->setFrom('supportdev');

View File

@ -49,7 +49,6 @@ $c = new Zend_Config($application->getOptions());
Zend_Registry::set('config', $c);
require_once 'Scores/WsScores.php';
require_once 'Scores/Mail.php';
define('LOGIN', 'mricois');
define('PASSWORD', '');
@ -154,7 +153,7 @@ $emailTxt.= "<br/>";
$emailTxt.= listeCmd(1);
//Envoi mail
$mail = new Mail();
$mail = new Scores_Mail();
$mail->setFrom('production');
$mail->addTo('support@scores-decisions.com', 'Pieces');
$mail->setSubject("[COMMANDES PIECES COURRIER] - ".date('d')."/".date('m')."/".date('Y'));

View File

@ -57,8 +57,6 @@ Zend_Registry::set('config', $c);
$db = Zend_Db::factory($c->profil->db->sdv1);
Zend_Db_Table_Abstract::setDefaultAdapter($db);
require_once 'Scores/Mail.php';
function listCmdMois($statut, $date)
{
$commandes = new Application_Model_Commandes();
@ -119,7 +117,7 @@ if(count($listeCmd)>0){
$emailTxt.= '<br/>';
//Envoi mail
$mail = new Mail();
$mail = new Scores_Mail();
$mail->setSubject("[Commandes greffe non receptionné] - ".date('d')."/".date('m')."/".date('Y'));
$mail->setFrom('production');
$mail->addTo('support@scores-decisions.com', 'Support');

View File

@ -172,8 +172,7 @@ if ( isset($opts->rapport) || isset($opts->rapportcomplet) )
$emailTxt = utf8_encode($emailTxt);
}
//Envoi mail
require_once 'Scores/Mail.php';
$mail = new Mail();
$mail = new Scores_Mail();
$mail->setFrom('production');
$mail->addTo('support@scores-decisions.com', 'Support');
$mail->addTo('supportdev@scores-decisions.com', 'Support Dev');