#include #include "agenda.h" /* Return true if there is some tasks for this day. A truncated summary is written in line. */ bool tasks_getshort ( int year, int month, int day, const char *team, char line[10]) { bool ret = false; SSTRING tbd[48]; tasks_getday (year,month,day,team,tbd); line[0] = '\0'; for (int i=0; i<48; i++){ const char *s = tbd[i].get(); if (s[0] != '\0'){ sprintf (line,"%-9.9s",s); ret = true; break; } } return ret; } void tasks_gettitles ( int year, int month, int day, const char *team, SSTRINGS &tb) { SSTRING tbd[48]; tasks_getday (year,month,day,team,tbd); for (int i=0; i<48; i++){ const char *s = tbd[i].get(); if (s[0] != '\0'){ char tmp[30]; sprintf (tmp,"%02d:%02d %-15.15s",i/2,i&1?30:0,s); tb.add (new SSTRING(tmp)); } } } void tasks_getday ( int year, int month, int day, const char *team, SSTRING tb[48]) { if (year == 2001 && month == 1 && day == 9){ tb[9*2+1].setfrom ("Rencontre thin"); tb[24].setfrom ("Poulet"); tb[27].setfrom ("Installation 1"); tb[30].setfrom ("Ftpweb"); } }