root / plugins / moinmoin_numberofpeople @ 8f2bcef9
Historique | Voir | Annoter | Télécharger (2,07 ko)
| 1 |
#!/bin/sh |
|---|---|
| 2 |
|
| 3 |
# Présences aux réunions |
| 4 |
|
| 5 |
if [ "$1" = "autoconf" ]; then |
| 6 |
echo yes |
| 7 |
exit 0 |
| 8 |
fi |
| 9 |
|
| 10 |
if [ "$1" = "config" ]; then |
| 11 |
echo 'graph_title Koumbit - presences aux reunions' |
| 12 |
echo 'graph_vlabel personnes' |
| 13 |
echo 'graph_category wiki' |
| 14 |
# echo 'totalpresences.label total' |
| 15 |
echo 'reflexion.label reflexion' |
| 16 |
echo 'production.label production' |
| 17 |
echo 'sysadmin.label sysadmin' |
| 18 |
echo 'vieasso.label vie-asso' |
| 19 |
# echo 'embauche.label embauche' |
| 20 |
echo 'ca.label ca' |
| 21 |
echo 'graph_args --base 1000 -l 0' |
| 22 |
exit 0 |
| 23 |
fi |
| 24 |
|
| 25 |
NOW_YEAR=`date +"%Y"` |
| 26 |
NOW_MONTH=`date +"%m"` |
| 27 |
NOW_DAY=`date +"%d"` |
| 28 |
|
| 29 |
show_for_meeting () {
|
| 30 |
|
| 31 |
COMITE=$1 |
| 32 |
EXPRESSION=$2 |
| 33 |
|
| 34 |
# get 3 latest, since there may be future meetings, we will filter out later |
| 35 |
echo -n "$COMITE.value " |
| 36 |
FILES=`ls -1d /export/wiki/wikis/koumbitwiki/data/pages/$EXPRESSION* | sort -r | grep -v Template` |
| 37 |
|
| 38 |
for file in $FILES |
| 39 |
do |
| 40 |
FILE_YEAR=`echo $file | sed "s/.*(2f)\([0-9][0-9][0-9][0-9]\)(2d).*/\1/"` |
| 41 |
FILE_MONTH=`echo $file | sed "s/.*(2d)\([0-9][0-9]\)(2d).*/\1/"` |
| 42 |
FILE_DAY=`echo $file | sed "s/.*(2d)\([0-9][0-9]\)$/\1/"` |
| 43 |
|
| 44 |
# Make sure the document has a past date, not future |
| 45 |
DATE_PAST="no" |
| 46 |
|
| 47 |
if [ $FILE_YEAR -lt $NOW_YEAR ]; then |
| 48 |
DATE_PAST="yes" |
| 49 |
fi |
| 50 |
|
| 51 |
if [ $FILE_YEAR -le $NOW_YEAR ] && [ $FILE_MONTH -lt $NOW_MONTH ]; then |
| 52 |
DATE_PAST="yes" |
| 53 |
fi |
| 54 |
|
| 55 |
if [ $FILE_YEAR -le $NOW_YEAR ] && [ $FILE_MONTH -lt $NOW_MONTH ] && [ $FILE_DAY -lt $NOW_DAY ]; then |
| 56 |
DATE_PAST="yes" |
| 57 |
fi |
| 58 |
|
| 59 |
if [ "$DATE_PAST" = "yes" ]; then |
| 60 |
REVISION=`cat "$file/current"` |
| 61 |
LATEST_FILE="$file/revisions/$REVISION" |
| 62 |
|
| 63 |
# http://www.ilfilosofo.com/blog/2008/04/26/sed-multi-line-search-and-replace/ |
| 64 |
sed -n -e '1,/sences confir/d' -e "1h; 1!H; $ { g; s/\([^-']*\).*/\1/g; p; } " $LATEST_FILE | grep -c '\*'
|
| 65 |
return |
| 66 |
fi |
| 67 |
done |
| 68 |
|
| 69 |
echo 0 |
| 70 |
} |
| 71 |
|
| 72 |
show_for_meeting reflexion MeetingsDeR |
| 73 |
show_for_meeting sysadmin "Comit*SysAdmin" |
| 74 |
show_for_meeting production "MeetingsDeProduction(2f)20" |
| 75 |
show_for_meeting vieasso "Comit(c3a9)VieAssociative(2f)20" |
| 76 |
# show_for_meeting embauche "Comit(c3a9)Embauche(2f)20" |
| 77 |
show_for_meeting drupal "Comit(c3a9)Strat(c3a9)gieDrupal(2f)20" |
| 78 |
show_for_meeting ca "MeetingsCa(2f)20" |
