Browse Source

ajout d'un mode test pour passer l'archivage des lettres

svn/root/tags/v3.3.6
erational@erational.org 11 years ago
parent
commit
d52de55d32
  1. 4
      formulaires/envoi_malettre.html
  2. 61
      formulaires/envoi_malettre.php
  3. 2
      lang/malettre_fr.php
  4. 2
      malettre_fonctions.php
  5. 2
      paquet.xml
  6. 12
      public/malettre_txt.html

4
formulaires/envoi_malettre.html

@ -36,7 +36,9 @@
[(#SAISIE{checkbox,desti,label=<strong><:malettre:destinataires:></strong>,datas=#GET{desti}})]
[(#SAISIE{input,desti_more,size=25,maxlength=255,label=<:malettre:autre:><br /><i>(<:malettre:email_seulement:>)</i>})]
[(#SAISIE{checkbox,no_archive,label=<strong><:malettre:no_archive:></strong>,datas=#ARRAY{'on',<:malettre:no_archive_info:>}})]
</ul>
<p class="boutons"><input type="submit" class="submit" value="<:malettre:lettre_envoyer:>" /></p>

61
formulaires/envoi_malettre.php

@ -223,36 +223,39 @@ function formulaires_envoi_malettre_traiter_dist(){
$message.= "<div> $i / $j </div>";
// archivage de la lettre en dur
// FIXME: utiliser les methodes natives pour ecrire les fichiers
$message.= "<div style=\"margin:15px 0;\">"._T('malettre:archives_placer');
$lettre_archive = "$path_archive_full/lettre_".date("Ymd")."_".$lettre_hash."_"._request('lang_select').".html";
$f_archive=fopen($lettre_archive,"w");
fwrite($f_archive,$recup);
fclose($f_archive);
$message.= " <a href='$url_lettre_archive' target='_blank'>html</a> - ";
$lettre_archive = "$path_archive_full/lettre_".date("Ymd")."_".$lettre_hash."_"._request('lang_select').".txt";
$f_archive=fopen($lettre_archive,"w");
fwrite($f_archive,$recup_txt);
fclose($f_archive);
$message.= "<a href='$url_lettre_archive_txt' target='_blank'>txt</a></div>";
// stockage en base
include_spip('base/abstract_sql');
sql_insertq('spip_meslettres',array(
'titre' => $lettre_title,
'lang' => $lang,
'url_html' => "lettre/$url_lettre_archive_short",
'url_txt' => "lettre/$url_lettre_archive_txt_short",
'date' => date('Y-m-d H:i:s')
));
$message.= "<p><a href='".generer_url_ecrire("malettre_archive")."'>"._T('malettre:archives_gerer')."</a></p>\n";
// FIXME: utiliser les methodes natives pour ecrire les fichiers
$no_archive = _request('no_archive');
if (!is_array($no_archive)) {
$message.= "<div style=\"margin:15px 0;\">"._T('malettre:archives_placer');
$lettre_archive = "$path_archive_full/lettre_".date("Ymd")."_".$lettre_hash."_"._request('lang_select').".html";
$f_archive=fopen($lettre_archive,"w");
fwrite($f_archive,$recup);
fclose($f_archive);
$message.= " <a href='$url_lettre_archive' target='_blank'>html</a> - ";
$lettre_archive = "$path_archive_full/lettre_".date("Ymd")."_".$lettre_hash."_"._request('lang_select').".txt";
$f_archive=fopen($lettre_archive,"w");
fwrite($f_archive,$recup_txt);
fclose($f_archive);
$message.= "<a href='$url_lettre_archive_txt' target='_blank'>txt</a></div>";
// stockage en base
include_spip('base/abstract_sql');
sql_insertq('spip_meslettres',array(
'titre' => $lettre_title,
'lang' => $lang,
'url_html' => "lettre/$url_lettre_archive_short",
'url_txt' => "lettre/$url_lettre_archive_txt_short",
'date' => date('Y-m-d H:i:s')
));
$message.= "<p><a href='".generer_url_ecrire("malettre_archive")."'>"._T('malettre:archives_gerer')."</a></p>\n";
}
// --------------------------------

2
lang/malettre_fr.php

@ -78,6 +78,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
//N
'nom'=>'Nom',#NEW
'no_archive' => 'Mode test', #NEW
'no_archive_info' => 'Ne pas archiver cet envoi', #NEW
// 0
'obligatoire' => 'Champs obligatoire',

2
malettre_fonctions.php

@ -20,6 +20,4 @@ function malettre_get_contents($patron,$id_edito=0,$selection,$selection_eve,$la
return $texte_patron;
}
?>

2
paquet.xml

@ -1,7 +1,7 @@
<paquet
prefix="malettre"
categorie="communication"
version="3.0.0"
version="3.0.1"
schema="1.0.0"
etat="test"
compatibilite="[3.0.0-dev;3.0.*]"

12
public/malettre_txt.html

@ -6,11 +6,12 @@
- id_edito: id de l'article edito
- selection: id des articles selectionnes (separe par une virgule)
]#CACHE{0}[(#HTTP_HEADER{Content-Type: text/plain[; charset=(#CHARSET)}]})][(#REM)pour supprimer les boutons admin ]
]#CACHE{0}
#HTTP_HEADER{Content-Type: text/plain;}[(#REM)pour supprimer les boutons admin ]
Ceci est une message automatique - ne pas repondre
--------------------------------------------------------------------
LETTRE D'INFORMATION #NOM_SITE_SPIP
LETTRE D'INFORMATION #NOM_SITE_SPIP
--------------------------------------------------------------------
<B_edito>
@ -21,7 +22,7 @@ EDITO
[(#TITRE|textebrut)]
-------------------------------------------------
[(#TEXTE|liens_absolus|couper{300}|PtoBR|textebrut)]
[(#URL_ARTICLE|url_absolue)]
#URL_SITE_SPIP/[(#URL_ARTICLE|substr{3})]
</BOUCLE_edito>
#SET{selection,#ENV**{selection}|explode{","}}
@ -48,4 +49,7 @@ EDITO
--
#NOM_SITE_SPIP
#URL_SITE_SPIP
#URL_SITE_SPIP
se désabonner: #NOM_SITE_SPIP

Loading…
Cancel
Save