merge
This commit is contained in:
commit
cb1db1aa91
10 changed files with 219 additions and 70 deletions
|
@ -56,6 +56,7 @@ function gamumail_declarer_tables_objets_sql($tables) {
|
|||
'statut' => 'varchar(20) DEFAULT "0" NOT NULL',
|
||||
'public' => 'varchar(20) DEFAULT "oui" NOT NULL',
|
||||
'editable' => 'varchar(5) DEFAULT "oui" NOT NULL',
|
||||
'date' => 'datetime NOT NULL DEFAULT "0000-00-00 00:00:00"',
|
||||
'maj' => 'TIMESTAMP',
|
||||
'rang' => 'smallint(6) NOT NULL'
|
||||
),
|
||||
|
@ -63,10 +64,10 @@ function gamumail_declarer_tables_objets_sql($tables) {
|
|||
'PRIMARY KEY' => 'id_gamumail',
|
||||
'KEY statut' => 'statut',
|
||||
),
|
||||
'titre' => 'slug AS titre, "" AS lang',
|
||||
// 'titre' => 'slug AS titre, "" AS lang',
|
||||
#'date' => '',
|
||||
'champs_editables' => array('slug', 'sujet', 'texte','titre', 'editable'),
|
||||
'champs_versionnes' => array('slug', 'sujet', 'texte','titre', 'editable'),
|
||||
'champs_editables' => array('slug', 'sujet', 'texte','titre', 'editable', 'public', 'id_docs', 'rang', 'statut', 'date'),
|
||||
'champs_versionnes' => array('slug', 'sujet', 'texte','titre', 'editable', 'public', 'id_docs', 'rang', 'statut', 'date'),
|
||||
'rechercher_champs' => array("slug" => 8),
|
||||
'tables_jointures' => array(),
|
||||
'statut'=> array(
|
||||
|
|
|
@ -20,14 +20,17 @@
|
|||
overflow: hidden;
|
||||
margin: 3px 0;
|
||||
}
|
||||
|
||||
.tag-editor div {
|
||||
float: left;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.tag-editor .placeholder {
|
||||
padding: 0 8px;
|
||||
color: #bbb;
|
||||
}
|
||||
|
||||
.tag-editor .tag-editor-spacer {
|
||||
padding: 0;
|
||||
width: 8px;
|
||||
|
@ -35,6 +38,7 @@
|
|||
color: transparent;
|
||||
background: none;
|
||||
}
|
||||
|
||||
.tag-editor input {
|
||||
vertical-align: inherit;
|
||||
border: 0;
|
||||
|
@ -50,15 +54,18 @@
|
|||
background: none;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
/* hide original input field or textarea visually to allow tab navigation */
|
||||
.tag-editor-hidden-src {
|
||||
position: absolute !important;
|
||||
left: -99999px;
|
||||
}
|
||||
|
||||
/* hide IE10 "clear field" X */
|
||||
.tag-editor ::-ms-clear {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* tag style */
|
||||
.tag-editor .tag-editor-tag {
|
||||
/*padding-left: 5px; color: #46799b; background: #e0eaf1; white-space: nowrap;*/
|
||||
|
@ -71,6 +78,7 @@
|
|||
cursor: pointer;
|
||||
border-radius: 4px 0 0 4px;
|
||||
}
|
||||
|
||||
/* delete icon */
|
||||
/*.tag-editor .tag-editor-delete { background: #e0eaf1; cursor: pointer; border-radius: 0 2px 2px 0; padding-left: 3px; padding-right: 4px; }*/
|
||||
.tag-editor .tag-editor-delete {
|
||||
|
@ -80,10 +88,12 @@
|
|||
padding-left: 3px;
|
||||
padding-right: 4px;
|
||||
}
|
||||
|
||||
.tag-editor .tag-editor-delete i {
|
||||
line-height: 18px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/*.tag-editor .tag-editor-delete i:before { font-size: 16px; color: #8ba7ba; content: "×"; font-style: normal; }*/
|
||||
.tag-editor .tag-editor-delete i:before {
|
||||
font-size: 16px;
|
||||
|
@ -91,14 +101,17 @@
|
|||
content: '×';
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.tag-editor .tag-editor-delete:hover i:before {
|
||||
color: #d65454;
|
||||
}
|
||||
.tag-editor .tag-editor-tag.active + .tag-editor-delete,
|
||||
.tag-editor .tag-editor-tag.active + .tag-editor-delete i {
|
||||
|
||||
.tag-editor .tag-editor-tag.active+.tag-editor-delete,
|
||||
.tag-editor .tag-editor-tag.active+.tag-editor-delete i {
|
||||
visibility: hidden;
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
.tag-editor .tag-editor-tag.active {
|
||||
background: none !important;
|
||||
}
|
||||
|
@ -111,9 +124,11 @@
|
|||
cursor: default;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.ui-front {
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.ui-menu {
|
||||
list-style: none;
|
||||
padding: 1px;
|
||||
|
@ -121,21 +136,26 @@
|
|||
display: block;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.ui-menu .ui-menu-item a {
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
padding: 2px 0.4em;
|
||||
line-height: 1.4;
|
||||
min-height: 0; /* support: IE7 */
|
||||
min-height: 0;
|
||||
/* support: IE7 */
|
||||
}
|
||||
|
||||
.ui-widget-content {
|
||||
border: 1px solid #bbb;
|
||||
background: #fff;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.ui-widget-content a {
|
||||
color: #46799b;
|
||||
}
|
||||
|
||||
.ui-widget-content .ui-state-hover,
|
||||
.ui-widget-header .ui-state-hover,
|
||||
.ui-state-focus,
|
||||
|
@ -143,6 +163,7 @@
|
|||
.ui-widget-header .ui-state-focus {
|
||||
background: #e0eaf1;
|
||||
}
|
||||
|
||||
.ui-helper-hidden-accessible {
|
||||
display: none;
|
||||
}
|
||||
|
@ -151,47 +172,73 @@
|
|||
.formulaire_gamumail {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.formulaire_gamumail .editer {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.editer_pour {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.editer_pour label {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.editer_envoi_separe {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.editer_cc {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.editer_cc label {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.editer_cci {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.editer_cci label {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.editer_repondre_a {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.editer_repondre_a label {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.reponse_formulaire {
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
.reponse_formulaire_erreur, .editer .erreur_message {
|
||||
|
||||
.reponse_formulaire_erreur,
|
||||
.editer .erreur_message {
|
||||
background-color: #f7d1d1;
|
||||
border: solid 2px #f00;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.reponse_formulaire_ok {
|
||||
background-color: #c4ecd6;
|
||||
border: solid 2px #080;
|
||||
}
|
||||
|
||||
.remplacements_slugs {
|
||||
margin-top: 3rem;
|
||||
}
|
||||
|
||||
.formulaire_gamumail .boutons {
|
||||
margin-top: 3rem;
|
||||
}
|
||||
|
||||
.formulaire_gamumail .btn {
|
||||
font-size: 3rem;
|
||||
}
|
||||
|
|
|
@ -33,6 +33,25 @@
|
|||
<input required type="text" class="text tagEditor" name="#GET{name}" id="#GET{name}" value="#ENV{#GET{name}}" >
|
||||
</div>
|
||||
</div>
|
||||
<BOUCLE_testEnvoiSepare(CONDITION){si #ENV{envoi_separe}|oui}>
|
||||
<div class="editer_groupe">
|
||||
#SET{name,envoi_separe}
|
||||
#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
|
||||
#SET{obli,"obligatoire"}
|
||||
<div class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
|
||||
<label> Envoi séparé (1 mail par destinataire)</label>
|
||||
<div class="choix">
|
||||
<input type="radio" class="radio" name="#GET{name}" value="" id="#GET{name}_non"[ (#ENV{#GET{name}}|non|?{checked="checked"})] >
|
||||
<label for="#GET{name}_non">Non</label>
|
||||
</div>
|
||||
<div class="choix">
|
||||
<input type="radio" class="radio" name="#GET{name}" value="oui" id="#GET{name}_oui"[ (#ENV{#GET{name}}|=={oui}|?{checked="checked"})] >
|
||||
<label for="#GET{name}_oui">Oui</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</BOUCLE_testEnvoiSepare>
|
||||
|
||||
|
||||
<div class="editer_groupe">
|
||||
#SET{name,cc}
|
||||
|
@ -56,6 +75,19 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<BOUCLE_testRepondreA(CONDITION){si #ENV{repondre_a}}>
|
||||
<div class="editer_groupe">
|
||||
#SET{name,repondre_a}
|
||||
#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
|
||||
#SET{obli,"obligatoire"}
|
||||
<div class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
|
||||
<label for="#GET{name}">Répondre à</label>
|
||||
[<span class="erreur_message">(#GET{erreurs})</span>]
|
||||
<input type="text" class="text mail_repondre_a tagEditor" name="#GET{name}" id="#GET{name}" value="#ENV{#GET{name}}" >
|
||||
</div>
|
||||
</div>
|
||||
</BOUCLE_testRepondreA>
|
||||
|
||||
<div class="editer_groupe">
|
||||
#SET{name,sujet}
|
||||
#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
|
||||
|
@ -130,6 +162,13 @@
|
|||
</div>
|
||||
</B_doc>
|
||||
|
||||
#SET{fichier,all_fichiers}
|
||||
[(#CHEMIN{gamumail/#GET{fichier}.html}|oui)
|
||||
#SET{erreurs,#ENV**{erreurs}|table_valeur{Tid_doc}}
|
||||
[<span class="erreur_message">(#GET{erreurs})</span>]
|
||||
<INCLURE{fond=gamumail/#GET{fichier},env,slug=#SLUG,options=#ENV{options}}>
|
||||
]
|
||||
|
||||
#SET{fichier,#SLUG|concat{_fichiers}}
|
||||
[(#CHEMIN{gamumail/#GET{fichier}.html}|oui)
|
||||
#SET{erreurs,#ENV**{erreurs}|table_valeur{Tid_doc}}
|
||||
|
|
|
@ -27,6 +27,7 @@ function formulaires_gamumail_charger_dist($slug, $destinataires = 0, $Tclient =
|
|||
|
||||
$Tcc = lire_config('gamumail/mail_cc') !== '' ? explode(',', lire_config('gamumail/mail_cc', '')) : [];
|
||||
$Tcci = lire_config('gamumail/mail_cci') !== '' ? explode(',', lire_config('gamumail/mail_cci', '')) : [];
|
||||
$Trepondre_a = lire_config('gamumail/mail_repondre_a') !== '' ? explode(',', lire_config('gamumail/mail_repondre_a', '')) : [];
|
||||
|
||||
if (!empty($destinataires) and !is_array($destinataires)) {
|
||||
$destinataires = explode(',', $destinataires);
|
||||
|
@ -70,12 +71,10 @@ function formulaires_gamumail_charger_dist($slug, $destinataires = 0, $Tclient =
|
|||
$Tpdf = [$Tpdf];
|
||||
}
|
||||
foreach ($Tpdf as $id => $pdf) {
|
||||
//$TFichierPdf[] = $pdf['fichier'];
|
||||
$TFichierPdf[$id] = $pdf;
|
||||
//$options[$id] = $pdf;
|
||||
}
|
||||
}
|
||||
//var_dump($Tcc);
|
||||
|
||||
$gamuMail = sql_fetsel('sujet, texte, id_docs', 'spip_gamumails', 'slug='.sql_quote($slug));
|
||||
$texte = $gamuMail['texte'] ?? '';
|
||||
$sujet = $gamuMail['sujet'] ?? '';
|
||||
|
@ -91,11 +90,13 @@ function formulaires_gamumail_charger_dist($slug, $destinataires = 0, $Tclient =
|
|||
'pour' => implode(',', $Tmails),
|
||||
'cc' => implode(',', $Tcc),
|
||||
'cci' => implode(',', $Tcci),
|
||||
'repondre_a' => implode(',', $Trepondre_a),
|
||||
'TFichierpdfs' => $TFichierPdf,
|
||||
'Tpdfs_ok' => [],
|
||||
'docs_spip' => $gamuMail['id_docs'] ?? '',
|
||||
'Tid_fichiers' => [],
|
||||
'options' => $options
|
||||
'options' => $options,
|
||||
'envoi_separe' => $options['envoi_separe'] ?? ''
|
||||
);
|
||||
|
||||
// surcharges charger : d'abord les surcharges pour tous les slugs (tous_charge.php) puis les spécifiques par slug (nom_slug_charger.php)
|
||||
|
@ -209,21 +210,12 @@ function formulaires_gamumail_traiter_dist($slug, $destinataires = 0, $Tclient =
|
|||
include_spip('inc/texte');
|
||||
include_spip('classes/facteur');
|
||||
|
||||
$retour = array();
|
||||
$retour = [];
|
||||
|
||||
$envoi_separe = _request('envoi_separe') ?? '';
|
||||
|
||||
$pour = _request('pour');
|
||||
$cc = _request('cc');
|
||||
$cci = _request('cci');
|
||||
$sujet = _request('sujet');
|
||||
$html = propre(_request('texte'));
|
||||
$docs_spip = _request('docs_spip');
|
||||
$Tpdfs_ok = _request('Tpdfs_ok');
|
||||
$Tid_doc = _request('Tid_doc');
|
||||
$texte = facteur_mail_html2text($html);
|
||||
|
||||
$pour = explode(',', $pour);
|
||||
$cc = explode(',', $cc);
|
||||
$cci = explode(',', $cci);
|
||||
|
||||
$destinataires = [];
|
||||
foreach ($pour as $dest) {
|
||||
|
@ -231,12 +223,58 @@ function formulaires_gamumail_traiter_dist($slug, $destinataires = 0, $Tclient =
|
|||
if ($mail = sql_getfetsel('email', 'spip_auteurs', 'id_auteur='.$dest)) {
|
||||
$destinataires[] = $mail;
|
||||
}
|
||||
}
|
||||
elseif (email_valide($dest)) {
|
||||
} elseif (email_valide($dest)) {
|
||||
$destinataires[] = $dest;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($envoi_separe)) {
|
||||
gamuSend($slug, $options, $destinataires, $Tclient, $Tpdf, $redirect, $retour);
|
||||
} else {
|
||||
$ok = true;
|
||||
foreach ($destinataires as $d) {
|
||||
$r = gamuSend($slug, $options, [$d], $Tclient, $Tpdf, $redirect);
|
||||
if (!$r) {
|
||||
$ok = false;
|
||||
}
|
||||
}
|
||||
if (!$ok) {
|
||||
$retour['message_erreur'] = _T("gamumail:erreur_envoi_mail");
|
||||
}
|
||||
else {
|
||||
$retour['message_ok'] = _T('gamumail:mail_envoye');
|
||||
|
||||
// dans le retour message_ok ajouter que le gamumail est OK
|
||||
$retour['message_ok'] .= '@@gamumail_ok';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($redirect AND $redirect != '') {
|
||||
$retour['redirect'] = $redirect;
|
||||
}
|
||||
|
||||
return $retour;
|
||||
}
|
||||
|
||||
|
||||
function gamuSend($slug, $options, $destinataires, $Tclient, $Tpdf, $redirect, &$retour = []) {
|
||||
|
||||
$cc = _request('cc');
|
||||
$cci = _request('cci');
|
||||
$repondre_a = _request('repondre_a');
|
||||
|
||||
$cc = explode(',', $cc);
|
||||
$cci = explode(',', $cci);
|
||||
$repondre_a = explode(',', $repondre_a);
|
||||
|
||||
$sujet = _request('sujet');
|
||||
$html = propre(_request('texte'));
|
||||
$docs_spip = _request('docs_spip');
|
||||
$Tpdfs_ok = _request('Tpdfs_ok');
|
||||
$Tid_doc = _request('Tid_doc');
|
||||
$texte = facteur_mail_html2text($html);
|
||||
|
||||
$pieces_jointes = [];
|
||||
if ($f = charger_fonction('traiter_av_pdf', 'gamumail', true)) {
|
||||
$options = $f($options, $destinataires, $Tclient, $Tpdf);
|
||||
|
@ -323,6 +361,20 @@ function formulaires_gamumail_traiter_dist($slug, $destinataires = 0, $Tclient =
|
|||
];
|
||||
}
|
||||
}
|
||||
|
||||
if ($f = charger_fonction('traiter_pieces_jointes', 'gamumail', true)) {
|
||||
$pc = $f($slug, $options, $destinataires, $Tclient, $Tpdf);
|
||||
if (!empty($pc)) {
|
||||
$pieces_jointes[] = $pc;
|
||||
}
|
||||
}
|
||||
if ($f = charger_fonction($slug . '_traiter_pieces_jointes', 'gamumail', true)) {
|
||||
$pc = $f($options, $destinataires, $Tclient, $Tpdf);
|
||||
if (!empty($pc)) {
|
||||
$pieces_jointes[] = $pc;
|
||||
}
|
||||
}
|
||||
|
||||
$html_header = '';
|
||||
if (find_in_path('gamumail/'.$slug .'_html_header.html')) {
|
||||
$html_header = recuperer_fond('gamumail/'.$slug . '_html_header', $options);
|
||||
|
@ -360,6 +412,10 @@ function formulaires_gamumail_traiter_dist($slug, $destinataires = 0, $Tclient =
|
|||
'cci' => $cci,
|
||||
'pieces_jointes' => $pieces_jointes
|
||||
];
|
||||
if ($repondre_a) {
|
||||
$corps['repondre_a'] = $repondre_a;
|
||||
}
|
||||
|
||||
|
||||
// surcharges de traiter : d'abord les surcharges pour tous les slugs (tous_traiter.php) puis les spécifiques par slug (nom_slug_traiter.php)
|
||||
if ($f = charger_fonction('traiter', 'gamumail', true)) {
|
||||
|
@ -377,7 +433,8 @@ function formulaires_gamumail_traiter_dist($slug, $destinataires = 0, $Tclient =
|
|||
]);
|
||||
$sujet = $remplacement_generiques($args, $sujet);
|
||||
|
||||
//var_dump($corps);die;
|
||||
$args['corps'] = $corps;
|
||||
$args['sujet'] = $sujet;
|
||||
|
||||
// envoyer !
|
||||
$envoyer_mail = charger_fonction('envoyer_mail', 'inc/');
|
||||
|
@ -407,9 +464,5 @@ function formulaires_gamumail_traiter_dist($slug, $destinataires = 0, $Tclient =
|
|||
}
|
||||
}
|
||||
|
||||
if ($redirect AND $redirect != '') {
|
||||
$retour['redirect'] = $redirect;
|
||||
}
|
||||
|
||||
return $retour;
|
||||
return $ok;
|
||||
}
|
||||
|
|
|
@ -9,8 +9,11 @@
|
|||
<h3 class="spip"><:gamumail:remplacements_disponibles:></h3>
|
||||
<ul class="">
|
||||
<BOUCLE_remplace(DATA){source tableau, #VAL|afficher_remplacements}>
|
||||
<li><strong>[(#CLE)]</strong> : [(#VALEUR)]</li>
|
||||
<li><span class="toClip pointer" data-clipboard-text="#CLE"><strong>[(#CLE)]</strong> </span>: [(#VALEUR)]</li>
|
||||
</BOUCLE_remplace>
|
||||
</ul>
|
||||
<em><:gamumail:avertissement_remplacements:></em>
|
||||
</div>
|
||||
|
||||
<script src="[(#CHEMIN{javascript/spip_barre.js}|timestamp)]" type="text/javascript"></script>
|
||||
<script src="[(#CHEMIN{js/toClip.js}|timestamp)]" type="text/javascript"></script>
|
||||
|
|
|
@ -36,7 +36,7 @@ function gamumail_upgrade($nom_meta_base_version, $version_cible) {
|
|||
$maj['1.0.11'] = array( array('maj_tables', array('spip_gamumails')));
|
||||
$maj['1.0.12'] = array(array('creer_compte_curl'));
|
||||
$maj['1.0.14'] = array(array('maj_tables', array('spip_gamumails')));
|
||||
$maj['1.0.15'] = array(array('maj_tables', array('spip_gamumails')));
|
||||
$maj['1.0.16'] = array(array('maj_tables', array('spip_gamumails')));
|
||||
|
||||
|
||||
include_spip('base/upgrade');
|
||||
|
@ -55,7 +55,9 @@ function creer_compte_curl(){
|
|||
'statut' => '1comite'
|
||||
];
|
||||
|
||||
$id_auteur = sql_insertq('spip_auteurs', $set);
|
||||
include_spip('action/editer_auteur');
|
||||
$id_auteur = auteur_inserer(null, $set);
|
||||
|
||||
if ($id_auteur) {
|
||||
include_spip('inc/config');
|
||||
ecrire_config('curl_login', $set['login']);
|
||||
|
|
|
@ -7,19 +7,9 @@ function inc_charger_pdf_dist($fichier_pdf, $contexte = []){
|
|||
|
||||
$login = lire_config('curl_login');
|
||||
$password = lire_config('curl_mdp');
|
||||
$url = $GLOBALS['meta']['adresse_site'].'/spip.php?page=spipdf&spipdf='.$fichier_pdf;
|
||||
if (is_array($contexte) and count($contexte)) {
|
||||
foreach ($contexte as $champ => $val) {
|
||||
/* if (intval($val) === $val) {
|
||||
// if (intval($val)) {
|
||||
$val = intval($val);
|
||||
} else {
|
||||
$val = "$val";
|
||||
}
|
||||
*/
|
||||
$url .= "&$champ=$val";
|
||||
}
|
||||
}
|
||||
|
||||
$contexte['spipdf'] = $contexte['spipdf'] ?? $fichier_pdf ;
|
||||
$url = generer_url_public('spipdf', $contexte, true, false);
|
||||
|
||||
$CurlConnect = curl_init();
|
||||
// pour une connexion https locale avec certificat auto-signé
|
||||
|
|
|
@ -14,22 +14,21 @@ if (!defined('_ECRIRE_INC_VERSION')) {
|
|||
**/
|
||||
function inc_gamumail_remplacements_dist($args, $html) {
|
||||
/**
|
||||
* @@nom@@ => Prenom Nom | Nom (gère la présence/absence du champ prenom dans spip_auteurs)
|
||||
* @@nom@@ => $nom ou un espace pour vider le champ @@nom@@
|
||||
**/
|
||||
$nom = sql_getfetsel('nom', 'spip_auteurs', 'email='.sql_quote($args['destinataires'][0]));
|
||||
$prenom = $nom;
|
||||
$nom = sql_getfetsel('nom', 'spip_auteurs', 'email='.sql_quote($args['destinataires'][0])) ?? ' ';
|
||||
$html = gamumail_remplacer_modele('nom', ucwords($nom), $html);
|
||||
|
||||
/**
|
||||
* @@prenom@@ => $prenom ou un espace pour vider le champ @@prenom@@
|
||||
**/
|
||||
$prenom = ' ';
|
||||
$trouver_table = charger_fonction('trouver_table', 'base');
|
||||
$desc = $trouver_table('spip_auteurs');
|
||||
if (array_key_exists('prenom', $desc['field'])
|
||||
and $prenom = sql_getfetsel('prenom', 'spip_auteurs', 'email='.sql_quote($args['destinataires'][0]))) {
|
||||
$nom = $prenom.' '.$nom;
|
||||
if (array_key_exists('prenom', $desc['field'])) {
|
||||
$prenom = sql_getfetsel('prenom', 'spip_auteurs', 'email='.sql_quote($args['destinataires'][0])) ?? ' ';
|
||||
}
|
||||
if ($nom) {
|
||||
$html = gamumail_remplacer_modele('nom', ucwords($nom), $html);
|
||||
}
|
||||
if ($prenom) {
|
||||
$html = gamumail_remplacer_modele('prenom', ucwords($prenom), $html);
|
||||
}
|
||||
|
||||
/**
|
||||
* @@url_site@@ => URL du site
|
||||
|
|
15
js/toClip.js
Normal file
15
js/toClip.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
jQuery(function ($) {
|
||||
$('.toClip').on('mousedown', function (e) {
|
||||
e.preventDefault();
|
||||
const t = $(this).data('clipboard-text') ?? $(this).text();
|
||||
navigator.clipboard.writeText(t).then(() => {
|
||||
barre_inserer(t);
|
||||
const html = `<span class="copierOk verte"><strong>✔ copié</strong></span>`;
|
||||
$(this).append(html);
|
||||
setTimeout(() => {
|
||||
$(this).children('.copierOk').remove();
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
<paquet
|
||||
prefix="gamumail"
|
||||
categorie="communication"
|
||||
version="1.1.0"
|
||||
version="1.2.0"
|
||||
etat="dev"
|
||||
compatibilite="[3.2.0;4.2.*]"
|
||||
logo="prive/themes/spip/images/gamumail-64.png"
|
||||
documentation=""
|
||||
schema="1.0.15"
|
||||
schema="1.0.16"
|
||||
>
|
||||
|
||||
<nom>GamuMail</nom>
|
||||
|
|
Loading…
Add table
Reference in a new issue