{
$this->assign('mail_part', $version);
$text = $this->fetch($this->tpl);
+ if ($version == 'text') {
+ return wordwrap($text, 78);
+ }
return $text;
}
/** used to remove the empty lines due to {from ...}, {to ...} ... functions */
static public function mail_format($output, &$smarty)
{
- return wordwrap("\n".trim($output)."\n",75);
+ return "\n".trim($output)."\n";
}
static protected function format_addr(&$params)
require_once("user.func.inc.php");
if (S::has('suid')) {
- $page->kill("déjà en SUID !!!");
+ $page->kill("Déjà en SUID !!!");
}
if (Env::has('user_id')) {
break;
}
+ $watch = 'SELECT naissance, deces, password, perms,
+ prenom, nom, flags, promo, comment
+ FROM auth_user_md5
+ WHERE user_id = ' . $mr['user_id'];
+ $res = XDB::query($watch);
+ $old_fields = $res->fetchOneAssoc();
$query = "UPDATE auth_user_md5 SET
naissance = '$naiss',
deces = '$deces',
if (XDB::execute($query)) {
user_reindex($mr['user_id']);
+ $res = XDB::query($watch);
+ $new_fields = $res->fetchOneAssoc();
+
$mailer = new PlMailer("admin/mail_intervention.tpl");
$mailer->assign("user", S::v('forlife'));
- $mailer->assign("query", $query);
+ $mailer->assign('old', $old_fields);
+ $mailer->assign('new', $new_fields);
$mailer->send();
$page->trig("updaté correctement.");
ORDER BY u.promo,u.nom,u.prenom');
$page->assign('diffs', $res->fetchAllAssoc());
- // gens à l'ax mais pas chez nous
+ // gens à l'ax mais pas chez nous
$res = XDB::query(
'SELECT ia.promo,ia.nom,ia.nom_patro,ia.prenom
FROM identification_ax as ia
WHERE u.nom IS NULL');
$page->assign('mank', $res->fetchAllAssoc());
- // gens chez nous et pas à l'ax
+ // gens chez nous et pas à l'ax
$res = XDB::query('SELECT promo,nom,prenom FROM auth_user_md5 WHERE matricule_ax IS NULL');
$page->assign('plus', $res->fetchAllAssoc());
}
{from full=#from#}
{to addr=#to#}
{subject text="INTERVENTION de $user"}
-{elseif $mail_part eq 'text'}
-{$query|regex_replace:"/[ \t]+/":" "}
+{elseif $mail_part eq 'wiki'}
+Le profil du camarade {$old.prenom} {$old.nom} ({$old.promo}) a été édité.\\
+Les champs suivants ont été changés :
+{foreach from=$old item=value key=field}
+{if $value neq $new[$field]}
+* '''{$field}''' : {$value} -> {$new[$field]}{/if}
+{/foreach}
+
+Valeur des différents champs :
+{foreach from=$old item=value key=field}
+* '''{$field}''' : {$value} -> {$new[$field]}
+{/foreach}
{/if}
+
{* vim:set et sw=2 sts=2 sws=2: *}