Index: openacs-4/packages/calendar/sql/oracle/calendar-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/sql/oracle/calendar-create.sql,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/calendar/sql/oracle/calendar-create.sql 20 Jan 2004 14:37:51 -0000 1.7 +++ openacs-4/packages/calendar/sql/oracle/calendar-create.sql 21 Jan 2004 15:12:48 -0000 1.8 @@ -271,60 +271,6 @@ calendar_id in calendars.calendar_id%TYPE ); - -- returns 't' if calendar is viewable by the given party - -- this implies that the party has calendar_read permission - -- on this calendar - function readable_p ( - calendar_id in calendars.calendar_id%TYPE, - party_id in parties.party_id%TYPE - ) return char; - - -- returns 't' if party wants to be able to select - -- this calendar, and return 'f' otherwise. - function show_p ( - calendar_id in calendars.calendar_id%TYPE, - party_id in parties.party_id%TYPE - ) return char; - - - ---------------------------------------------------------------- - -- Helper functions for calendar generations: - -- - -- These functions are used for assist in calendar - -- generation. Putting them in the PL/SQL level ensures that - -- the date date will be the same, and allowing adoptation - -- to a different language much easier and faster. - -- - -- current month name - function month_name ( - current_date date - ) return char; - - -- next month - function next_month ( - current_date date - ) return date; - - -- prev month - function prev_month ( - current_date date - ) return date; - - -- number of days in the month - function num_day_in_month ( - current_date date - ) return integer; - - -- first day to be displayed in a month. - function first_displayed_date ( - current_date date - ) return date; - - -- last day to be displayed in a month. - function last_displayed_date ( - current_date date - ) return date; - end calendar; / show errors; @@ -421,132 +367,6 @@ - -- returns 't' if party wants to be able to select (calendar_show granted) - -- this calendar, and .return 'f' otherwise. - -- - -- this seems to be a problem with the problem that when - -- revoking the permissions using acs_permissions.revoke - -- data is not removed from table acs_object_party_privilege_map. - function show_p ( - calendar_id in calendars.calendar_id%TYPE, - party_id in parties.party_id%TYPE - ) - return char - - is - v_show_p char(1) := 't'; - begin - select decode(count(*), 1, 't', 'f') - into v_show_p - from acs_permissions - where grantee_id = calendar.show_p.party_id - and object_id = calendar.show_p.calendar_id - and privilege = 'calendar_show'; - - return v_show_p; - - end show_p; - - - -- Helper functions for calendar generations: - -- - -- These functions are used for assist in calendar - -- generation. Putting them in the PL/SQL level ensures that - -- the date date will be the same, and allowing adoptation - -- to a different language much easier and faster. - -- - -- current month name - function month_name ( - current_date date - ) return char - - is - name char; - begin - select to_char(to_date(calendar.month_name.current_date), 'fmMonth') - into name - from dual; - - return name; - end month_name; - - - -- next month - function next_month ( - current_date date - ) return date - - is - v_date date; - begin - select trunc(add_months(to_date(sysdate), -1)) - into v_date - from dual; - - return v_date; - end next_month; - - - -- prev month - function prev_month ( - current_date date - ) return date - - is - v_date date; - begin - select trunc(add_months(to_date(sysdate), -1)) - into v_date - from dual; - - return v_date; - end prev_month; - - -- number of days in the month - function num_day_in_month ( - current_date date - ) return integer - - is - v_num integer; - begin - select to_char(last_day(to_date(sysdate)), 'DD') - into v_num - from dual; - - return v_num; - end num_day_in_month; - - -- first day to be displayed in a month. - function first_displayed_date ( - current_date date - ) return date - - is - v_date date; - begin - select next_day(trunc(to_date(sysdate), 'Month') - 7, 'SUNDAY') - into v_date - from dual; - - return v_date; - end first_displayed_date; - - -- last day to be displayed in a month. - function last_displayed_date ( - current_date date - ) return date - - is - v_date date; - begin - select next_day(last_day(to_date(sysdate)), 'SATURDAY') - into v_date - from dual; - - return v_date; - end last_displayed_date; - end calendar; / show errors