closes 215 : singular/plural in notifications
authorPascal Corpet <pascal.corpet@m4x.org>
Sat, 15 Jan 2005 14:04:57 +0000 (14:04 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:27:39 +0000 (23:27 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-342

ChangeLog
bin/cron/notifs.send.php
templates/carnet/panel.tpl
upgrade/0.9.4/60_watch.sql

index bfe4c2e..e355994 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -65,6 +65,7 @@ Bug/Wish :
 
        * Notifications :
                - #63: Birthdays are now in the notifications !                                         -MC
+               - #215: The notifications use singular or plural.                   -Car
                - #232: Add a link to the fiche.                                                                -MC/Car
        
        * Profile :
index 2c1abf4..bee2e03 100755 (executable)
@@ -47,8 +47,8 @@ foreach($all->_data as $u) {
 EOF;
 
     foreach($u['data'] as $cid=>$d) {
-        $text .= "  {$all->_cats[$cid]['mail']} :\n\n";
-        $html .= "<h1 style='font-size: 120%'>{$all->_cats[$cid]['mail']} :</h1>\n<ul>\n";
+        $text .= "  {$all->_cats[$cid][(count($d)==1)?'mail_sg':'mail']} :\n\n";
+        $html .= "<h1 style='font-size: 120%'>{$all->_cats[$cid][(count($d)?'mail_sg':'mail']} :</h1>\n<ul>\n";
 
         foreach($d as $promo=>$x) {
             require_once('../../plugins/modifier.date_format.php');
index c25da6d..49a3c9e 100644 (file)
@@ -37,7 +37,17 @@ Il faut pour cel
 
 
 {foreach from=$notifs->_data item=c key=cid}
-<h2>{$notifs->_cats[$cid].mail} :</h2>
+<h2>{if ($c|@count) > 1}
+{$notifs->_cats[$cid].mail} :
+{else}
+  {foreach from=$c item=promo}
+    {if ($promo|@count) > 1}
+      {$notifs->_cats[$cid].mail} :
+    {else}
+      {$notifs->_cats[$cid].mail_sg} :
+    {/if}
+  {/foreach}
+{/if}</h2>
 
 <br />
 
index dddfd6c..e8e4c99 100644 (file)
@@ -1,6 +1,12 @@
 alter table watch_cat add column type enum('basic', 'near', 'often') not null default 'basic';
 update watch_cat set type='often' where frequent=1;
 alter table watch_cat drop column frequent;
-insert into watch_cat (id, short, mail, type) values(4, 'Anniversaires', 'Ces camarades ont feté leur anniversaire cette semaine', 'near');
+insert into watch_cat (id, short, mail, type) values(4, 'Anniversaires', 'Ces camarades ont fêté leur anniversaire cette semaine', 'near');
 
 replace into watch_sub (uid, cid) select user_id, 4 from auth_user_md5 where perms in ('admin', 'user') and deces=0;
+alter table watch_cat add mail_sg varchar(80) default NULL after mail;
+update watch_cat set mail_sg = 'Ce camarade a mis sa fiche à jour' where id = 1;
+update watch_cat set mail_sg = 'Ce camarade s\'est inscrit' where id = 2;
+update watch_cat set mail_sg = 'Ce camarade nous a quitté' where id = 3;
+update watch_cat set mail_sg = 'Ce camarade a fêté son anniversaire la semaine dernère' where id = 4;
+