[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: edara

On Tue, Jan 08, 2002 at 05:45:23PM -0800, Nadim Shaikli wrote:
> Here is a preliminary DB tables for the 'edara' (task/project manager).
> Let me know if I'm missing any major pieces or if something doesn't make
> sense (the calendar is the more difficult part, esp with its 'repeated'
> entry - please visualize that code in terms of any missing table parts).
> Look-n-Feel: the idea is to have something like epiware.com (note TABs),
> but with the calendar looking like webcalendar.sourceforge.net.  Each
> one of these things (admin, tasks, users, calendar) should be its own
> pluggable project into edara, so that in the future if someone wants
> to write a time-tracker (or whatever), no problem - write it and edara
> will create a TAB for it and it'll all play together.
>  - Nadim
> # task_approved   - valids (N, Y if self-entry)
> # cal_create_date - in the format YYYYMMDD
> # cal_day_alph	  - valid (MON, TUE, WED, THU, FRI, SAT, SUN)
> # cal_private	  - valid (N, Y) w/ Y others see blocked time no what's in it
> # cal_duration	  - is in minutes
> # cal_repeated	  - valid (NO, DAILY, WEEKLY, BI-WEEKLY, MONTHLY)
> CREATE TABLE edara_calendar
> (
>   cal_id		smallint	NOT NULL unsigned auto_increment,
>   cal_user_id		smallint	NOT NULL unsigned,
>   cal_approved		char	(1)	NOT NULL,
>   cal_create_date	int		NOT_NULL,
>   cal_year		int	(4)	NOT_NULL unsigned,
>   cal_month		int	(2)	NOT_NULL unsigned,
>   cal_day_num		int	(2)	NOT_NULL unsigned,
>   cal_day_alph		char	(3),
>   cal_subject		tinytext, 	NOT_NULL,
>   cal_desc		text,
>   cal_private		char	(1)	NOT_NULL default 'N',
>   cal_duration		smallint,
>   cal_repeated		tinytext	NOT_NULL default 'NO',
>   PRIMARY KEY (user_id)
> );

By adding a table edara_cal_repeat (
    cal_id INT DEFAULT '0' NOT NULL,
    cal_type VARCHAR(20),
    cal_end INT,
    cal_frequency INT DEFAULT '1',
    cal_days CHAR(7),
    PRIMARY KEY (cal_id)

and making cal_id another PRIMARY KEY on edara_calendar table.. then at run-time,
you view depending on daily/weekly/yearly

You will first read all the events, and store them in an array. Any of them with
'cal_repeated' as 'YES' you would read the edara_cal_repeat w/ the cal_id. verify that
the cal_end is not smaller or equal to the data you are displaying. Otherwise, you
check what type (ie. cal_repeated is a boolean yes/no, cal_type in edara_cal_repeat
would say, daily/weekly/yearly,etc.). If it's say, weekly,

you read in advance for at run-time you display it w/ calculating depending until
cal_end (or whatever the current view allows). 

The cal_frequcny is for how many times weekly/daily/monthly, etc. So for example 
if an event is repeated twice a month the frequency would be '2'. To specify whether
its by day or by date goes also into cal_type (edara_cal_repeat). 

That is, ripping off the webcalendar.sourceforge.net concept.

let me know if any of my ramblings make any sense ;)

cheers, its only Sunday ;)
| Mohammed Elzubeir    | Visit us at:                 |
|                      |  http://www.arabeyes.org/    |
| Arabeyes Project     | Homepage:                    |
| Unix the 'right' way |  http://fakkir.net/~elzubeir/|