#!/bin/csh
cd 
rm -f timestats/tmp.stat

#2002
foreach i (       03 04 05 06 07 08 09 10 11 12 )
  temps -p +z timestats/timechart_prefs timestats/temps.txt +h +d 00/{$i}/02 -d 32/{$i}/02 >> timestats/tmp.stat
end
#2003
foreach i ( 01 02 03 04 05 06 07 08 09 10 11 12 )
  temps -p +z timestats/timechart_prefs timestats/temps.txt +h +d 00/{$i}/03 -d 32/{$i}/03 >> timestats/tmp.stat
end
#2004
foreach i ( 01 02 03 04 05 06 07 08 09 10 11 12 )
  temps -p +z timestats/timechart_prefs timestats/temps.txt +h +d 00/{$i}/04 -d 32/{$i}/04 >> timestats/tmp.stat
end


cd timestats
rm -f tmp.tab
echo -n          "t, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, " >> tmp.tab
echo -n     "01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, " >> tmp.tab
echo -n     "01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, " >> tmp.tab

echo >> tmp.tab
echo -n "?, " >> tmp.tab
cat tmp.stat | grep inconnu | awk ' { printf $2 ", " }' >> tmp.tab
echo >> tmp.tab
echo -n "ADM, " >> tmp.tab
cat tmp.stat | grep ADM     | awk ' { printf $2 ", " }' >> tmp.tab
echo >> tmp.tab
echo -n "SYS, " >> tmp.tab
cat tmp.stat | grep SYS     | awk ' { printf $2 ", " }' >> tmp.tab
echo >> tmp.tab
echo -n "DISC, " >> tmp.tab
cat tmp.stat | grep DISC    | awk ' { printf $2 ", " }' >> tmp.tab
echo >> tmp.tab
echo -n "COLLAB, " >> tmp.tab
cat tmp.stat | grep COLLAB    | awk ' { printf $2 ", " }' >> tmp.tab
echo >> tmp.tab
echo -n "BIB, " >> tmp.tab
cat tmp.stat | grep BIB     | awk ' { printf $2 ", " }' >> tmp.tab
echo >> tmp.tab
echo -n "RECH, " >> tmp.tab
cat tmp.stat | grep RECH    | awk ' { printf $2 ", " }' >> tmp.tab
echo >> tmp.tab
echo -n "PUBLI, " >> tmp.tab
cat tmp.stat | grep PUBLI   | awk ' { printf $2 ", "}' >> tmp.tab
echo >> tmp.tab
echo -n "REVIEW, " >> tmp.tab
cat tmp.stat | grep REVIEW  | awk ' { printf $2 ", " }' >> tmp.tab
echo >> tmp.tab
echo -n "COMM, " >> tmp.tab
cat tmp.stat | grep COMM    | awk ' { printf $2 ", " }' >> tmp.tab
echo >> tmp.tab
echo -n "heures," >> tmp.tab
cat tmp.stat | grep "100%" | awk ' { printf $6 ", "}' >> tmp.tab
echo >> tmp.tab


echo "Lancer oocalc tmp.tab ."
echo "choisir sep = virgule    type = AnglaisUS (tout selectionner)"
#echo "Faire select all (^A), et  Table/convert/text2table [OLD: Tools/text2table] (sep=',')."
echo "Selectionner toute la table, sauf cols vides et derniere ligne (=heures),"
echo "puis cliquer Insert/Diagramme. style: zone additive saturee, org ligne, 1er ligne et 1er colonne comme etiquette"
echo "Redimensionner l'image. graduations = h/mois (133.3 = 1600h/an)"

#echo "Lancer ooffice tmp.tab ."
#echo "Faire select all (^A), et  Table/convert/text2table [OLD: Tools/text2table] (sep=',')."
#echo "Selectionner toute la table, sauf col vide et derniere ligne (=heures),"
#echo "puis cliquer Insert/object/Graph [OLD: icone CreerGraphe]: choisir Rows, style Area, sous-style 100%"
#echo "Redimensionner l'image."

