diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index bc0c2241e71050bfb5e295de7dbfd1601d1768f2..5c52983cf88186875058859d145783da8a100f51 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -1,5 +1,6 @@ <?PHP /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> + * Copyright (C) 2005 Laurent Destailleur <eldy@uers.sourceforge.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,20 +21,28 @@ * */ +/** \file htdocs/comm/mailing/cibles.php + \brief Page des cibles de mailing + \version $Revision$ +*/ + require("./pre.inc.php"); +$langs->load("mails"); + $mesg = ''; -llxHeader("","","Fiche mailing"); +llxHeader("","",$langs->trans("MailCard")); -if ($cancel == $langs->trans("Cancel")) +if ($_POST["cancel"] == $langs->trans("Cancel")) { $action = ''; } + /* - * Cr�ation + * Fiche mailing en mode cr�ation * */ @@ -46,20 +55,20 @@ if ($mil->fetch($_GET["id"]) == 0) $h=0; $head[$h][0] = DOL_URL_ROOT."/comm/mailing/fiche.php?id=".$mil->id; - $head[$h][1] = $langs->trans("Fiche"); + $head[$h][1] = $langs->trans("MailCard"); $h++; $head[$h][0] = DOL_URL_ROOT."/comm/mailing/cibles.php?id=".$mil->id; - $head[$h][1] = $langs->trans('Destinatires'); + $head[$h][1] = $langs->trans("MailTargets"); $hselected = $h; $h++; dolibarr_fiche_head($head, $hselected, substr($mil->titre,0,20)); - print_titre("Mailing"); + print_titre($langs->trans("Mailing")); - print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; + print '<table class="border" width="100%">'; print '<tr><td width="20%">Nom</td><td>'.$mil->titre.'</td></tr>'; print '</table>'; @@ -78,7 +87,7 @@ if ($mil->fetch($_GET["id"]) == 0) $num = $db->num_rows(); print '<br /><table class="noborder" width="100%">'; - print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Destinataires").'</td></tr>'; + print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("MailTargets").'</td></tr>'; $var = true; $i = 0; diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 6a170d9b9ad2a145c7996612e40cefdb73b205f0..67dc43790ef02edb67076e32d4b300e0b95af5d4 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -1,5 +1,6 @@ <?PHP /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> + * Copyright (C) 2005 Laurent Destailleur <eldy@uers.sourceforge.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,10 +21,18 @@ * */ +/** \file htdocs/comm/mailing/fiche.php + \brief Fiche mailing, onglet g�n�ral + \version $Revision$ +*/ + require("./pre.inc.php"); +$langs->load("mails"); + $mesg = ''; + if ($_POST["action"] == 'add') { $mil = new Mailing($db); @@ -39,6 +48,7 @@ if ($_POST["action"] == 'add') } } + if ($_POST["action"] == 'update') { $mil = new Mailing($db); @@ -55,6 +65,7 @@ if ($_POST["action"] == 'update') } } + if ($_POST["action"] == 'confirm_valide') { @@ -70,7 +81,7 @@ if ($_POST["action"] == 'confirm_valide') } else { - print "Erreur"; + dolibarr_print_error($db); } } else @@ -94,7 +105,7 @@ if ($_POST["action"] == 'confirm_approve') } else { - print "Erreur"; + dolibarr_print_error($db); } } else @@ -103,9 +114,13 @@ if ($_POST["action"] == 'confirm_approve') } } + + + + llxHeader("","","Fiche Mailing"); -if ($cancel == $langs->trans("Cancel")) +if ($_POST["cancel"] == $langs->trans("Cancel")) { $action = ''; } @@ -122,17 +137,17 @@ if ($_GET["action"] == 'create') print '<form action="fiche.php" method="post">'."\n"; print '<input type="hidden" name="action" value="add">'; - print_titre("Nouveau Mailing"); + print_titre($langs->trans("NewMailing")); - print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; + print '<table class="border" width="100%">'; - print '<tr><td width="20%">Titre</td><td><input name="titre" size="30" value=""></td></tr>'; + print '<tr><td width="20%">'.$langs->trans("MailTitle").'</td><td><input name="titre" size="30" value=""></td></tr>'; - print '<tr><td width="20%">Sujet</td><td><input name="sujet" size="40" value=""> (sujet du mail)</td></tr>'; + print '<tr><td width="20%">'.$langs->trans("MailTopic").'</td><td><input name="sujet" size="40" value=""></td></tr>'; - print '<tr><td width="20%" valign="top">Message</td><td><textarea cols="30" rows="8" name="body"></textarea></td></tr>'; + print '<tr><td width="20%" valign="top">'.$langs->trans("MailMessage").'</td><td><textarea cols="30" rows="8" name="body"></textarea></td></tr>'; - print '<tr><td colspan="2" align="center"><input type="submit" value="Cr�er"></td></tr>'; + print '<tr><td colspan="2" align="center"><input type="submit" value="'.$langs->trans("CreateMailing").'"></td></tr>'; print '</table>'; print '</form>'; } @@ -144,12 +159,12 @@ else $h=0; $head[$h][0] = DOL_URL_ROOT."/comm/mailing/fiche.php?id=".$mil->id; - $head[$h][1] = $langs->trans("Fiche"); + $head[$h][1] = $langs->trans("MailCard"); $hselected = $h; $h++; $head[$h][0] = DOL_URL_ROOT."/comm/mailing/cibles.php?id=".$mil->id; - $head[$h][1] = $langs->trans('Destinatires'); + $head[$h][1] = $langs->trans('MailTargets'); $h++; dolibarr_fiche_head($head, $hselected, substr($mil->titre,0,20)); @@ -166,6 +181,7 @@ else "Confirmez-vous la validation du mailing ?", "confirm_valide"); } + /* * Confirmation de l'approbation du mailing * @@ -180,17 +196,12 @@ else print_titre("Mailing"); - print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; - - print '<tr><td width="20%">Titre</td><td colspan="3">'.$mil->titre.'</td></tr>'; - - print '<tr><td width="20%">Emetteur</td><td>'.htmlentities($mil->email_from).'</td>'; - print '<td>Email</td><td>'.htmlentities($mil->email_from).'</td></tr>'; + print '<table class="border" width="100%">'; - print '<tr><td width="20%" valign="top">Message</td><td colspan="3">'; + print '<tr><td width="20%">'.$langs->trans("MailTitle").'</td><td colspan="3">'.$mil->titre.'</td></tr>'; - print 'Sujet : '.$mil->sujet.'<br/><br />'; - print nl2br($mil->body).'</td></tr>'; + print '<tr><td width="20%">'.$langs->trans("MailSender").'</td><td>'.htmlentities($mil->email_from).'</td>'; + print '<td>'.$langs->trans("EMail").'</td><td>'.htmlentities($mil->email_from).'</td></tr>'; //print '<tr><td width="20%">R�ponse</td><td>'.htmlentities($mil->email_replyto).'</td></tr>'; //print '<tr><td width="20%">Retour Erreur</td><td>'.htmlentities($mil->email_errorsto).'</td></tr>'; @@ -200,21 +211,20 @@ else print '<tr><td width="20%">Nb destinataires</td><td colspan="3">'.$mil->nbemail.'</td></tr>'; } - print '<tr><td width="20%">Statut</td><td colspan="3">'.$mil->statuts[$mil->statut].'</td></tr>'; + print '<tr><td width="20%">'.$langs->trans("Status").'</td><td colspan="3">'.$mil->statuts[$mil->statut].'</td></tr>'; $uc = new User($db, $mil->user_creat); $uc->fetch(); - print '<tr><td width="20%">Cr�� par</td><td>'.$uc->fullname.'</td>'; - print '<td>le</td>'; + print '<tr><td width="20%">'.$langs->trans("CreatedBy").'</td><td>'.$uc->fullname.'</td>'; + print '<td>'.$langs->trans("DateCreation").'</td>'; print '<td>'.strftime("%d %b %Y %H:%M", $mil->date_creat).'</td></tr>'; - if ($mil->statut > 0) { $uv = new User($db, $mil->user_valid); $uv->fetch(); - print '<tr><td width="20%">Valid� par</td><td>'.$uv->fullname.'</td>'; - print '<td>le</td>'; + print '<tr><td width="20%">'.$langs->trans("ValidatedBy").'</td><td>'.$uv->fullname.'</td>'; + print '<td>'.$langs->trans("Date").'</td>'; print '<td>'.strftime("%d %b %Y %H:%M", $mil->date_valid).'</td></tr>'; } @@ -222,28 +232,42 @@ else { $ua = new User($db, $mil->user_appro); $ua->fetch(); - print '<tr><td width="20%">Approuv� par</td><td>'.$ua->fullname.'</td>'; - print '<td>le</td>'; + print '<tr><td width="20%">'.$langs->trans("ApprovedBy").'</td><td>'.$ua->fullname.'</td>'; + print '<td>'.$langs->trans("Date").'</td>'; print '<td>'.strftime("%d %b %Y %H:%M", $mil->date_appro).'</td></tr>'; } - print '</table>'; + // Contenu du mail + print '<tr><td width="20%">'.$langs->trans("MailTopic").'</td><td colspan="3">'.$mil->sujet.'</td></tr>'; + + print '<tr><td width="20%" valign="top">'.$langs->trans("MailMessage").'</td><td colspan="3">'; + print nl2br($mil->body).'</td></tr>'; + + + print '</table><br>'; + + print "</div>"; + + + /* + * Boutons d'action + */ print "\n\n<div class=\"tabsAction\">\n"; if ($_GET["action"] == '') { - print '<a class="tabAction" href="fiche.php?action=test&id='.$mil->id.'">'.$langs->trans("Tester").'</a>'; + print '<a class="tabAction" href="fiche.php?action=test&id='.$mil->id.'">'.$langs->trans("TestMailing").'</a>'; if ($mil->statut == 0) { - print '<a class="tabAction" href="fiche.php?action=valide&id='.$mil->id.'">'.$langs->trans("Valider").'</a>'; + print '<a class="tabAction" href="fiche.php?action=valide&id='.$mil->id.'">'.$langs->trans("ValidMailing").'</a>'; } if ($mil->statut == 1 && $mil->nbemail > 0) { - print '<a class="tabAction" href="fiche.php?action=approve&id='.$mil->id.'">'.$langs->trans("Approuver").'</a>'; + print '<a class="tabAction" href="fiche.php?action=approve&id='.$mil->id.'">'.$langs->trans("ApproveMailing").'</a>'; } diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index f5ee8fd9323e0772fbd978e55c656a079ffd4cb1..799c2d118521b16d7a7d7c742032575b1cbc7872 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -40,6 +40,7 @@ TestConnection=Test connection Show=Show Search=Search Valid=Valid +Approve=Approve Upload=Send file CreatedBy=Created by ModifiedBy=Modified by @@ -158,4 +159,5 @@ New=New Discount=Discount Unknown=Inconnu General=General -Size=Size \ No newline at end of file +Size=Size +Topic=Sujet \ No newline at end of file diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 4e9b5d2a5688d13e8f64561cfc688b43c511a4df..03ccd75e40e44d4917b27dc19daafc8d7f717386 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -7,16 +7,5 @@ ErrorPasswordDiffers=Passwords differs, please type them again. ErrorForbidden=Access forbidden.<br>You try to access to a page, area or feature that is not allowed to your user. ErrorForbidden2=Permission for this login can be defined by your Dolibarr administrator from menu %s->%s. ErrorForbidden3=It seems that Dolibarr is not used through an authenticated session. Take a look at Dolibarr setup documentation to know how to manage authentications (htaccess, mod_auth or other...). -Mailing=Mailing -MailingDesc=This page allows you to send mailings to a group of people. -MailingResult=Sending mails result -MailFrom=Sender -MailReply=Reply to -MailTo=Receiver(s) -MailCC=Copy to -MailTopic=Subject -MailText=Message -MailFile=Attach a file AddTrip=Add trip -Tools=Tools -NewMailing=New mailing \ No newline at end of file +Tools=Tools \ No newline at end of file diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index e2d793507b71fced3f89ce55369fe1d00ac13c1f..ae5b14a170275f2a1045d2ddfb08f090e50035d9 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -40,6 +40,7 @@ TestConnection=Tester la connexion Show=Voir Search=Rechercher Valid=Valider +Approve=Approuver Upload=Envoyer fichier CreatedBy=Cr�� par ModifiedBy=Modifi� par @@ -159,4 +160,5 @@ Discount=Remise Unknown=Inconnu General=G�n�ral Size=Taille -Received=Re�u \ No newline at end of file +Received=Re�u +Topic=Sujet \ No newline at end of file diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index df2446cb9dc2ffd0f3d79f36bd05fcf7ba605f52..e91f60536efa7b211b4c550aa5933e64a685fc08 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -7,16 +7,5 @@ ErrorPasswordDiffers=Les mots de passe ne sont pas identiques, veuillez les sais ErrorForbidden=Acc�s non autoris�.<br>Vous essayez d'acc�der � une page, zone ou fonction qui n'est pas autoris�e pour votre compte utilisateur. ErrorForbidden2=Les permissions pour ce login peuvent �tre attribu�e par l'administrateur Dolibarr via le menu %s->%s. ErrorForbidden3=Dolibarr ne semble pas fonctionner au sein d'une session authentifi�e. Consulter la documentation d'installation de Dolibarr pour connaitre comment g�rer les autentifications (htaccess, mod_auth ou autre...). -Mailing=Mailing -MailingDesc=Cet �cran vous permet d'envoyer des mailing � un groupe de personne. -MailingResult=R�sultat de l'envoi du mailing -MailFrom=Emetteur -MailReply=R�pondre � -MailTo=Destinataire(s) -MailCC=Copie � -MailTopic=Sujet -MailText=Message -MailFile=Joindre un fichier AddTrip=Cr�er d�placement -Tools=Outils -NewMailing=Nouveau mailing \ No newline at end of file +Tools=Outils \ No newline at end of file